/* ============================================
   QURANI — Ultra-minimal Quran reader
   ============================================ */

@font-face {
  font-family: "Amiri Quran";
  src: url("fonts/AmiriQuran.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Amiri";
  src: url("fonts/Amiri-Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Amiri";
  src: url("fonts/Amiri-Bold.ttf") format("truetype");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "Aref Ruqaa";
  src: url("fonts/ArefRuqaa-Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Space Mono";
  src: url("fonts/SpaceMono-Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Space Mono";
  src: url("fonts/SpaceMono-Bold.ttf") format("truetype");
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "Scheherazade New";
  src: url("fonts/ScheherazadeNew-Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}

/* ---- THEME VARIABLES ---- */
:root {
  --bg: radial-gradient(ellipse 90% 55% at 15% 0%,  rgba(251,191,36,.07) 0%, transparent 65%),
        radial-gradient(ellipse 70% 45% at 85% 100%, rgba(249,115,22,.05) 0%, transparent 65%),
        #f9f9f9;
  --bg-solid: #f9f9f9;
  --text: #000000;
  --text-secondary: #222222;
  --text-muted: #888888;
  --text-faint: #bbbbbb;
  --border: #ececec;
  --track: #f0f0f0;
  --overlay-bg: #ffffff;
  --btn-border: #e0e0e0;
  --btn-active-border: #222222;
  --btn-active-text: #222222;
  --accent: #222222;
  /* Liquid Glass tokens */
  --glass-bg:        rgba(252, 252, 252, 0.68);
  --glass-border:    rgba(255, 255, 255, 0.60);
  --glass-overlay:   rgba(249, 249, 249, 0.86);
  --glass-shadow:    0 4px 28px rgba(0,0,0,.06), 0 1px 0 rgba(255,255,255,.85) inset;
  --glass-blur:      blur(28px) saturate(1.8);
}

body.sepia, html.sepia {
  --accent: #3d3425;
  --bg: radial-gradient(ellipse 90% 55% at 15% 0%,  rgba(251,191,36,.07) 0%, transparent 65%),
        radial-gradient(ellipse 70% 45% at 85% 100%, rgba(180,120,50,.06) 0%, transparent 65%),
        #fdf8f2;
  --bg-solid: #fdf8f2;
  --text: #2c2416;
  --text-secondary: #3d3425;
  --text-muted: #8a7e6e;
  --text-faint: #b8ad9e;
  --border: #ede6db;
  --track: #ede6db;
  --overlay-bg: #fdf9f4;
  --btn-border: #d6cdbf;
  --btn-active-border: #3d3425;
  --btn-active-text: #3d3425;
  --glass-bg:        rgba(253, 250, 245, 0.70);
  --glass-border:    rgba(255, 255, 255, 0.62);
  --glass-overlay:   rgba(252, 248, 242, 0.88);
  --glass-shadow:    0 4px 28px rgba(0,0,0,.05), 0 1px 0 rgba(255,255,255,.80) inset;
  --glass-blur:      blur(28px) saturate(1.6);
}

body.dark, html.dark {
  --accent: #e0e0e0;
  --bg: radial-gradient(ellipse 90% 55% at 15% 0%,  rgba(245,158,11,.06) 0%, transparent 65%),
        radial-gradient(ellipse 70% 45% at 85% 100%, rgba(249,115,22,.04) 0%, transparent 65%),
        #101010;
  --bg-solid: #101010;
  --text: #e8e8e8;
  --text-secondary: #dddddd;
  --text-muted: #888888;
  --text-faint: #555555;
  --border: #222222;
  --track: #1e1e1e;
  --overlay-bg: #111111;
  --btn-border: #333333;
  --btn-active-border: #e0e0e0;
  --btn-active-text: #e0e0e0;
  --glass-bg:        rgba(22, 22, 22, 0.70);
  --glass-border:    rgba(255, 255, 255, 0.07);
  --glass-overlay:   rgba(14, 14, 14, 0.88);
  --glass-shadow:    0 4px 32px rgba(0,0,0,.50), 0 1px 0 rgba(255,255,255,.05) inset;
  --glass-blur:      blur(28px) saturate(1.6);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  overscroll-behavior: none;
  background: #000;
  color: var(--text);
  font-family: system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  transition: color .3s ease;
  position: fixed;
  width: 100%;
}

/* ---- HIDE SCROLLBARS GLOBALLY ---- */
* {
  scrollbar-width: none;
}
*::-webkit-scrollbar {
  display: none;
}

/* ---- LAYOUT ---- */
#app {
  position: fixed;
  inset: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ---- HEADER ---- */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(12px + env(safe-area-inset-top, 0px)) 18px 10px 18px;
  flex-shrink: 0;
  position: relative;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  z-index: 10;
}
.menu-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-faint);
  padding: 4px;
  transition: color .2s;
  z-index: 1;
}
.menu-btn:hover { color: var(--text-muted); }
.back-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-faint);
  font-size: 12px;
  padding: 4px 0;
  transition: color .2s;
  z-index: 1;
  white-space: nowrap;
}
.back-btn:hover { color: var(--text-muted); }
.header-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  z-index: 1;
}
.action-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-faint);
  padding: 4px;
  transition: color .2s;
  display: flex;
  align-items: center;
}
.action-btn:hover { color: var(--text-muted); }
.action-btn:active { color: var(--text-secondary); }
.header-title {
  font-size: 11px;
  font-weight: 300;
  color: var(--text-muted);
  letter-spacing: 2.5px;
  text-align: center;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  white-space: nowrap;
  pointer-events: none;
  padding-top: env(safe-area-inset-top, 0px);
}

/* ---- AYAH VIEWER ---- */
.ayah-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 24px;
  user-select: none;
  -webkit-user-select: none;
  overflow: hidden;
  min-height: 0;
}
.ayah-ref {
  font-size: 12px;
  color: var(--text-faint);
  margin-top: 18px;
  margin-bottom: 6px;
  font-family: system-ui, sans-serif;
  text-align: center;
  flex-shrink: 0;
}
.ayah-scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  width: 100%;
  min-height: 0;
}
.ayah-scroll-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100%;
  padding: 8px 0;
}
.ayah-text {
  font-family: "Amiri Quran", "Amiri", "Noto Naskh Arabic", "Traditional Arabic", serif;
  color: var(--text);
  text-align: center;
  max-width: 700px;
  width: 100%;
  direction: rtl;
  transition: opacity 150ms ease;
  word-spacing: 4px;
}
.ayah-text.size-S { font-size: 24px; line-height: 1.8; }
.ayah-text.size-M { font-size: 30px; line-height: 2.0; }
.ayah-text.size-L { font-size: 38px; line-height: 2.2; }

@media (min-width: 640px) {
  .ayah-text.size-M { font-size: 36px; line-height: 2.1; }
  .ayah-text.size-L { font-size: 46px; line-height: 2.3; }
}

.ayah-text.fade-out { opacity: 0; }

/* ---- TRANSLATION DISPLAY ---- */
.ayah-arabic {
  display: block;
  font-family: "Amiri Quran", "Amiri", "Noto Naskh Arabic", "Traditional Arabic", serif;
  direction: rtl;
  text-align: center;
  word-spacing: 4px;
}
.ayah-french {
  display: block;
  font-family: system-ui, -apple-system, sans-serif;
  direction: ltr;
  text-align: center;
  color: var(--text-muted);
  line-height: 1.7;
}
.size-S .ayah-french { font-size: 14px; }
.size-M .ayah-french { font-size: 16px; }
.size-L .ayah-french { font-size: 19px; }
.ayah-separator {
  height: 16px;
}

/* ---- NAVIGATION BAR — floating glass pill ---- */
.nav-arrows {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 16px 12px;
  padding: 6px 4px;
  flex-shrink: 0;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  box-shadow: var(--glass-shadow);
  transition: opacity .35s ease, transform .35s ease;
}
.nav-arrows.dock-hidden {
  opacity: 0;
  transform: translateY(16px);
  pointer-events: none;
}
.nav-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-faint);
  padding: 10px 18px;
  transition: color .2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.nav-btn:hover { color: var(--text-muted); }
.nav-btn:active { color: var(--text-secondary); }
.nav-btn svg {
  width: 24px;
  height: 24px;
}
.nav-btn.bookmarked { color: #f59e0b; }
.nav-btn.bookmarked svg { fill: #f59e0b; }

/* ---- GOAL REACHED ---- */
.goal-reached {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
}
.goal-reached p {
  font-size: 13px;
  color: var(--text-muted);
}
.goal-reached button {
  font-size: 12px;
  color: var(--text-muted);
  background: none;
  border: 1px solid var(--btn-border);
  border-radius: 50px;
  padding: 7px 20px;
  cursor: pointer;
  transition: all .2s;
}
.goal-reached button:hover {
  color: var(--text-secondary);
  border-color: var(--text-faint);
}

/* ---- PROGRESS BARS ---- */
.progress-section {
  flex-shrink: 0;
  padding: 10px 24px 28px;
  max-width: 420px;
  margin: 0 auto;
  width: 100%;
}
.progress-row {
  margin-bottom: 10px;
}
.progress-row:last-child {
  margin-bottom: 0;
}
.progress-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.progress-track {
  width: 100%;
  height: 6px;
  background: var(--track);
  border-radius: 6px;
  overflow: hidden;
}
.progress-fill-today {
  height: 100%;
  border-radius: 6px;
  transition: width .5s ease;
  background: linear-gradient(90deg, #f59e0b, #f97316);
}
.progress-fill-khatma {
  height: 100%;
  border-radius: 6px;
  transition: width .5s ease;
  background: linear-gradient(90deg, #3b82f6, #6366f1);
}
.progress-fill-free {
  height: 100%;
  border-radius: 6px;
  transition: width .5s ease;
  background: linear-gradient(90deg, #facc15, #eab308);
}

/* ---- MENU NAV ---- */
.menu-overlay-header {
  justify-content: space-between;
}
.menu-overlay-title {
  font-size: 11px;
  font-weight: 300;
  color: var(--text-muted);
  letter-spacing: 2.5px;
}
.menu-nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.menu-item {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 15px;
  color: var(--text);
  text-decoration: none;
  padding: 11px 12px;
  border-radius: 14px;
  border-bottom: none;
  transition: background .15s ease;
}
.menu-item:hover { background: var(--track); }
.menu-item:active { background: var(--border); }
.menu-item-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  flex-shrink: 0;
}
.menu-item-label {
  flex: 1;
  font-size: 15px;
  font-weight: 400;
  color: var(--text);
}
.menu-item-chevron {
  color: var(--text-faint);
}

/* ---- OVERLAY — glass panel ---- */
.overlay {
  position: fixed;
  inset: 0;
  background: var(--glass-overlay);
  backdrop-filter: blur(40px) saturate(1.6);
  -webkit-backdrop-filter: blur(40px) saturate(1.6);
  z-index: 100;
  display: flex;
  flex-direction: column;
  padding-top: env(safe-area-inset-top, 0px);
}
.overlay-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--glass-border);
}
.overlay-header h2 {
  font-size: 13px;
  font-weight: 300;
  color: var(--text-muted);
  letter-spacing: 0.4px;
}
.close-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-faint);
  padding: 4px;
  transition: color .2s;
}
.close-btn:hover { color: var(--text-muted); }
.overlay-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}
.setting-group {
  margin-bottom: 32px;
}
.setting-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.setting-value {
  font-size: 18px;
  color: var(--text-secondary);
}
.setting-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.setting-btn {
  font-size: 12px;
  padding: 8px 16px;
  border-radius: 50px;
  border: 1px solid var(--btn-border);
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: all .2s;
}
.setting-btn:hover {
  border-color: var(--text-faint);
  color: var(--text-secondary);
}
.setting-btn.active {
  border-color: var(--btn-active-border);
  color: var(--btn-active-text);
}
/* ---- REMINDERS ---- */
.reminder-note {
  font-size: 10px;
  color: var(--text-faint);
  margin-bottom: 10px;
  line-height: 1.5;
}
.reminder-times {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.reminder-time-badge {
  font-size: 10px;
  color: var(--text-muted);
  background: var(--card-bg, #f5f5f5);
  border: 1px solid var(--btn-border);
  border-radius: 50px;
  padding: 4px 10px;
}
body.sepia .reminder-time-badge { background: #f0ebe2; }
body.dark .reminder-time-badge { background: #1e1e1e; }
.reminder-toggle-btn {
  font-size: 12px;
  color: var(--text-muted);
  background: none;
  border: 1px solid var(--btn-border);
  border-radius: 50px;
  padding: 8px 20px;
  cursor: pointer;
  transition: all .2s;
}
.reminder-toggle-btn:hover {
  border-color: var(--text-faint);
  color: var(--text-secondary);
}
.reminder-toggle-btn:disabled {
  opacity: .4;
  cursor: default;
}
.reminder-status {
  font-size: 12px;
  color: #10b981;
  display: flex;
  align-items: center;
  gap: 6px;
}
.reminder-status-dot {
  width: 8px;
  height: 8px;
  background: #10b981;
  border-radius: 50%;
  display: inline-block;
}
.reminder-confirm {
  font-size: 11px;
  color: #10b981;
  margin-top: 10px;
  line-height: 1.5;
}

.reset-btn {
  font-size: 12px;
  color: var(--text-faint);
  background: none;
  border: none;
  cursor: pointer;
  margin-top: 24px;
  padding: 0;
  transition: color .2s;
}
.reset-btn:hover { color: #e53e3e; }

/* ---- ABOUT PAGE ---- */
.about-page {
  min-height: 100dvh;
  background: var(--overlay-bg);
  padding: 48px 24px;
  max-width: 480px;
  margin: 0 auto;
}
.about-page p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.8;
  margin-bottom: 16px;
}
.about-page .divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 20px 0;
}
.about-page .sub-label {
  font-size: 10px;
  color: var(--text-faint);
  margin-bottom: 8px;
}
.about-page .highlight {
  color: var(--text-secondary);
}

/* ---- ARTICLE HORAIRES ---- */
.article-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 20px 18px;
  margin-bottom: 22px;
}
.article-tag {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 10px;
}
.article-title {
  font-size: 19px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
  letter-spacing: -0.3px;
  margin-bottom: 10px;
}
.article-lead {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.65;
}
.article-lead strong { color: var(--text-secondary); font-weight: 500; }

.article-section-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 10px;
  margin-top: 4px;
}

.article-block {
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 10px;
  border: 1px solid var(--border);
}
.article-block-highlight {
  background: var(--glass-bg);
  border-color: var(--glass-border);
}
.article-block-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 8px;
}
.article-text {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 8px;
}
.article-text:last-child { margin-bottom: 0; }
.article-text strong { color: var(--text-secondary); font-weight: 500; }

.article-cities-label {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.5px;
  color: var(--text-faint);
  margin-bottom: 8px;
  padding-left: 2px;
}
.article-cities {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}
.article-cities span {
  font-size: 12px;
  color: var(--text-secondary);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 6px;
  padding: 4px 9px;
}

.article-prayers-grid {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 4px;
}
.article-prayer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
}
.article-prayer-row:last-child { border-bottom: none; }
.apr-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  min-width: 90px;
}
.apr-rule {
  font-size: 12px;
  color: var(--text-faint);
  text-align: right;
}

.article-source {
  font-size: 11px;
  color: var(--text-faint);
  text-align: center;
  padding: 16px 0 4px;
}
.article-source-name {
  color: var(--text-secondary);
}

/* ---- FAVORIS INLINE DANS RÉGLAGES ---- */
.settings-bookmarks-list .bookmarks-empty {
  font-size: 13px; color: var(--text-faint);
  text-align: center; padding: 20px 0 8px; line-height: 1.6;
}
.settings-bookmarks-list .folder-section-header {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.6px;
  text-transform: uppercase; color: var(--text-faint);
  padding: 14px 0 6px;
}
.settings-bookmarks-list .bookmark-item {
  padding: 12px 0; border-bottom: 1px solid var(--border);
}
.settings-bookmarks-list .bookmark-item:last-child { border-bottom: none; }
.settings-bookmarks-list .bookmark-item-ref {
  font-size: 11px; color: var(--text-faint); margin-bottom: 4px;
}
.settings-bookmarks-list .bookmark-item-text {
  font-family: 'Amiri', serif; font-size: 17px;
  color: var(--text); line-height: 1.6; margin-bottom: 6px;
  direction: rtl; text-align: right;
}
.settings-bookmarks-list .bookmark-item-actions { text-align: left; }
.settings-bookmarks-list .bookmark-action-btn {
  font-size: 11px; color: var(--text-faint);
  background: none; border: 1px solid var(--border);
  border-radius: 6px; padding: 3px 9px; cursor: pointer;
}
.settings-bookmarks-list .bookmark-action-btn:hover {
  color: #ef4444; border-color: #ef4444;
}

/* ---- SURAH LIST ---- */
.ayah-ref-clickable {
  cursor: pointer;
  transition: color .2s;
}
.ayah-ref-clickable:hover {
  color: var(--text-muted);
}
.surah-overlay-note {
  font-size: 11px;
  color: var(--text-faint);
  padding: 12px 24px 0;
  line-height: 1.5;
}
.surah-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background .15s ease;
}
.surah-item:last-child {
  border-bottom: none;
}
.surah-item:hover {
  background: var(--track);
}
.surah-item:active {
  background: var(--border);
}
.surah-item-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.surah-num {
  font-size: 11px;
  color: var(--text-faint);
  min-width: 24px;
  text-align: right;
}
.surah-name-fr {
  font-size: 13px;
  color: var(--text-secondary);
}
.surah-name-ar {
  font-size: 14px;
  color: var(--text-faint);
  font-family: "Amiri", serif;
  direction: rtl;
}

/* ---- VERSE PICKER ---- */
.verse-picker {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 0 14px;
  flex-wrap: nowrap;
}
.verse-picker-label {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}
.verse-picker-input {
  width: 50px;
  font-size: 13px;
  padding: 5px 6px;
  border: 1px solid var(--btn-border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text-secondary);
  font-family: system-ui, sans-serif;
  text-align: center;
  -moz-appearance: textfield;
}
.verse-picker-input::-webkit-inner-spin-button,
.verse-picker-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.verse-picker-btn {
  font-size: 11px;
  color: var(--text-muted);
  background: none;
  border: 1px solid var(--btn-border);
  border-radius: 50px;
  padding: 6px 12px;
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap;
}
.verse-picker-btn:hover {
  border-color: var(--text-faint);
  color: var(--text-secondary);
}
.verse-picker-btn-jump {
  border-color: #f59e0b;
  color: #f59e0b;
}
.verse-picker-btn-jump:hover {
  background: #f59e0b;
  color: #fff;
  border-color: #f59e0b;
}

/* ---- LOADING ---- */
/* ---- SPLASH SCREEN ---- */
.splash {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  background: #f3efe4;
  transition: opacity .6s ease, visibility .6s ease;
}
.splash.splash-hide {
  opacity: 0; visibility: hidden; pointer-events: none;
}
.splash-top {
  position: absolute; top: 0;
  padding-top: max(env(safe-area-inset-top, 20px), 20px);
  padding-top: calc(max(env(safe-area-inset-top, 20px), 20px) + 16px);
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  opacity: 0;
  animation: splash-fadein .8s ease 0.2s forwards;
}
.splash-title {
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 18px; letter-spacing: 10px; font-weight: 400;
  padding-left: 10px;
  color: rgba(0,0,0,0.62);
}
.splash-subtitle {
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 8px; letter-spacing: 2.64px; font-weight: 300;
  padding-left: 2.64px;
  color: rgba(0,0,0,0.38);
}
/* Logo wrapper — holds ghost + fill layers */
.splash-logo-wrap {
  position: relative;
  width: 140px;
}
/* Ghost logo — always visible, very faint outline */
.splash-logo-ghost {
  display: block;
  width: 100%;
  height: auto;
  opacity: 0.06;
}
/* Fill logo — clips from bottom to top */
.splash-logo-fill {
  position: absolute;
  inset: 0;
  clip-path: inset(100% 0 0 0);
  animation: splash-fill 3.5s cubic-bezier(0.4, 0, 0.2, 1) 0.4s forwards;
}
.splash-logo-fill img {
  display: block;
  width: 100%;
  height: auto;
}
.splash-credit {
  position: absolute; bottom: 0;
  padding-bottom: max(env(safe-area-inset-bottom, 20px), 20px);
  padding-bottom: calc(max(env(safe-area-inset-bottom, 20px), 20px) + 16px);
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 9px; letter-spacing: 2px; font-weight: 300;
  color: rgba(0,0,0,0.35);
  opacity: 0;
  animation: splash-fadein .8s ease 0.6s forwards;
}
@keyframes splash-fill {
  0%   { clip-path: inset(100% 0 0 0); }
  100% { clip-path: inset(0% 0 0 0); }
}
@keyframes splash-fadein {
  to { opacity: 1; transform: translateY(0); }
}
@keyframes spin { to { transform: rotate(360deg); } }


/* ---- SURAH SEARCH ---- */
.surah-search-wrap {
  padding: 8px 24px 0;
}
.surah-search {
  width: 100%;
  font-size: 13px;
  padding: 10px 14px;
  border: 1px solid var(--btn-border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text-secondary);
  font-family: system-ui, sans-serif;
  outline: none;
  transition: border-color .2s;
}
.surah-search:focus {
  border-color: var(--text-muted);
}
.surah-search::placeholder {
  color: var(--text-faint);
}

/* ---- BOOKMARKS ---- */
.bookmarks-empty {
  font-size: 13px;
  color: var(--text-faint);
  text-align: center;
  padding: 40px 20px;
  line-height: 1.6;
}
.bookmark-item {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background .15s ease;
}
.bookmark-item:hover { background: var(--track); }
.bookmark-item-ref {
  font-size: 11px;
  color: var(--text-faint);
  margin-bottom: 6px;
}
.bookmark-item-text {
  font-family: "Amiri Quran", "Amiri", serif;
  font-size: 20px;
  color: var(--text);
  direction: rtl;
  text-align: right;
  line-height: 1.8;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.bookmark-item-actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}
.bookmark-action-btn {
  font-size: 11px;
  color: var(--text-faint);
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 0;
  transition: color .2s;
}
.bookmark-action-btn:hover { color: #e53e3e; }

/* ---- FOLDER SECTIONS IN BOOKMARKS ---- */
.folder-section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 20px 0 8px;
  margin-top: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.02em;
  border-bottom: 1.5px solid var(--border);
}
.folder-section-header:first-child { padding-top: 4px; margin-top: 0; }

/* ---- FOLDER PICKER SHEET ---- */
.folder-picker-wrap {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.folder-picker-wrap.hidden { display: none; }
.folder-picker-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}
.folder-picker-sheet {
  position: relative;
  width: 100%;
  max-width: 480px;
  background: var(--overlay-bg);
  border-radius: 20px 20px 0 0;
  padding-bottom: env(safe-area-inset-bottom, 8px);
  max-height: 70vh;
  overflow-y: auto;
  z-index: 1;
}
.folder-picker-handle {
  width: 36px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin: 12px auto 0;
}
.folder-picker-header {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
  padding: 12px 24px 6px;
}
.folder-picker-list { padding: 4px 0; }
.folder-option {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  background: none;
  border: none;
  padding: 13px 24px;
  font-size: 15px;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: background .15s;
}
.folder-option:hover, .folder-option:active { background: var(--track); }
.folder-option svg { flex-shrink: 0; color: var(--text-muted); }
.folder-picker-footer {
  border-top: 1px solid var(--border);
  padding: 4px 0 8px;
}
.folder-new-btn {
  color: var(--text-faint) !important;
  font-size: 14px !important;
}
.folder-new-row {
  display: flex;
  gap: 8px;
  padding: 12px 24px 8px;
}
.folder-new-row.hidden { display: none; }
.folder-new-input {
  flex: 1;
  background: var(--track);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 14px;
  color: var(--text);
  outline: none;
  font-family: inherit;
}
.folder-new-input:focus { border-color: var(--text-muted); }
.folder-new-confirm {
  background: var(--text-secondary);
  color: var(--bg-solid);
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
}

/* ---- STATS ---- */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 8px 0;
}
.stat-card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: 18px;
  padding: 28px 12px 22px;
  text-align: center;
}
.stat-value {
  font-size: 32px;
  font-weight: 200;
  color: var(--text-secondary);
  margin-bottom: 8px;
  letter-spacing: -1px;
  line-height: 1;
}
.stat-label {
  font-size: 11px;
  color: var(--text-faint);
  letter-spacing: 0.2px;
}
/* Hassanates card */
.stats-prefs {
  margin-top: 32px;
  border-top: 1px solid rgba(255,255,255,0.07);
  padding-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.stats-pref-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.stats-pref-label {
  font-size: 11px;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.35);
  text-transform: uppercase;
}
.stats-pref-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
}
.stats-pref-opt {
  background: none;
  border: none;
  padding: 0;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.2);
  cursor: pointer;
  font-family: inherit;
  transition: color 0.15s;
}
.stats-pref-opt.active {
  color: rgba(255,255,255,0.85);
}
.stats-pref-sep {
  color: rgba(255,255,255,0.15);
  font-size: 11px;
  pointer-events: none;
}
.stat-hassanates-card {
  margin-top: 24px;
  background: rgba(255,255,255,0.06);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 22px;
  padding: 32px 20px 28px;
  text-align: center;
}
.stat-hassanates-value {
  font-size: 44px;
  font-weight: 200;
  color: #fff;
  letter-spacing: -1.5px;
  line-height: 1;
  margin-bottom: 6px;
  text-shadow: 0 2px 12px rgba(0,0,0,0.3);
}
.stat-hassanates-label {
  font-size: 13px;
  color: rgba(255,255,255,0.5);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 24px;
}
.stat-hassanates-hadith {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 20px;
}
.stat-hadith-ar {
  font-size: 18px;
  color: rgba(255,255,255,0.85);
  line-height: 2;
  margin: 0 0 14px;
  direction: rtl;
  font-family: 'KFGQPC Uthmanic Script HAFS', 'Scheherazade New', serif;
}
.stat-hadith-fr {
  font-size: 13px;
  color: rgba(255,255,255,0.5);
  line-height: 1.6;
  margin: 0 0 8px;
  font-style: italic;
  font-weight: 300;
}
.stat-hadith-source {
  font-size: 11px;
  color: rgba(255,255,255,0.3);
  margin: 0;
  letter-spacing: 0.5px;
}
/* about overlay */
.about-body p { margin: 0 0 12px; font-size: 14px; color: var(--text-secondary); line-height: 1.6; }
.about-body .sub-label { font-size: 10px; letter-spacing: 1px; text-transform: uppercase; color: var(--text-faint); margin-bottom: 6px; }
.about-body .highlight { color: var(--text-primary); font-weight: 500; }
.about-body .divider { border: none; border-top: 1px solid var(--glass-border); margin: 20px 0; }
.stats-links {
  margin-top: 24px;
  text-align: center;
}
.stats-link {
  font-size: 12px;
  color: var(--text-faint);
  text-decoration: none;
  transition: color .2s;
}
.stats-link:hover { color: var(--text-muted); }

/* ---- SEARCH OVERLAY LAYOUT ---- */
#search-overlay {
  background: #0a0a0a !important;
  display: flex;
  flex-direction: column;
}
.qs-top {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px 12px;
  flex-shrink: 0;
}
.qs-input {
  flex: 1;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 15px;
  color: #fff;
  font-family: system-ui, sans-serif;
  outline: none;
}
.qs-input::placeholder {
  color: rgba(255,255,255,0.35);
}
.qs-input:focus {
  border-color: rgba(255,255,255,0.25);
}
.qs-close {
  background: none;
  border: none;
  color: rgba(255,255,255,0.5);
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  letter-spacing: 1px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  padding: 8px 0;
  flex-shrink: 0;
}
.qs-filters {
  display: flex;
  gap: 8px;
  padding: 4px 20px 16px;
  flex-shrink: 0;
}
.qs-pill {
  background: none;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 20px;
  padding: 6px 16px;
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  letter-spacing: 1px;
  color: rgba(255,255,255,0.55);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.qs-pill.active {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.35);
  color: #fff;
}
.qs-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0 20px 40px;
}
.qs-suggest-title {
  font-size: 1.3rem;
  font-weight: 600;
  color: #fff;
  margin: 8px 0 16px;
}
.qs-suggest-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-top: 1px solid rgba(255,255,255,0.06);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.qs-suggest-thumb {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
}
.qs-suggest-info {
  flex: 1;
  min-width: 0;
}
.qs-suggest-cat {
  font-family: 'Space Mono', monospace;
  font-size: 9px;
  letter-spacing: 1.2px;
  color: rgba(255,255,255,0.35);
  text-transform: uppercase;
  margin-bottom: 3px;
}
.qs-suggest-name {
  font-size: 15px;
  font-weight: 400;
  color: rgba(255,255,255,0.9);
}
.qs-suggest-arrow {
  flex-shrink: 0;
  color: rgba(255,255,255,0.25);
}
.search-hint {
  font-size: 11px;
  color: rgba(255,255,255,0.3);
  padding: 7px 0 0;
  line-height: 1.5;
  display: none;
}
#search-overlay.has-results .qs-suggest { display: none; }
#search-overlay.has-results .qs-filters { display: none; }
#search-overlay.has-results .search-hint { display: none; }
#search-overlay .overlay-body { padding-left: 0 !important; padding-right: 0 !important; }
#search-overlay.has-results .qs-body { padding-left: 0; padding-right: 0; }
/* Search result cards — same style as kh-surah-item */
.qs-result-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 20px;
  border-bottom: 1px solid rgba(0,0,0,0.3);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  background-size: cover;
  background-position: center;
  min-height: 78px;
  overflow: hidden;
}
.qs-result-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, rgba(0,0,0,0.90) 35%, rgba(0,0,0,0.45) 70%, rgba(0,0,0,0.15) 100%);
  pointer-events: none;
}
.qs-result-card > * { position: relative; z-index: 1; }
.qs-result-card:active::before { background: rgba(0,0,0,0.65); }
.qs-result-num {
  font-family: 'Space Mono', monospace;
  font-size: 0.62rem;
  color: rgba(255,255,255,0.38);
  flex-shrink: 0;
  width: 22px;
  text-align: right;
  line-height: 1;
}
.qs-result-info { flex: 1; min-width: 0; }
.qs-result-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  display: block;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.qs-result-meta {
  font-family: 'Space Mono', monospace;
  font-size: 0.6rem;
  letter-spacing: 0.07em;
  color: rgba(255,255,255,0.4);
  margin-bottom: 6px;
}
.qs-result-fr {
  font-size: 13px;
  color: rgba(255,255,255,0.72);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.qs-result-chevron { color: rgba(255,255,255,0.25); flex-shrink: 0; }
.search-no-results {
  font-size: 13px;
  color: rgba(255,255,255,0.35);
  text-align: center;
  padding: 40px 20px;
}
.search-result-count {
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.5px;
  color: rgba(255,255,255,0.35);
  padding: 4px 20px 12px;
}

/* ---- HELP OVERLAY ---- */
.help-section {
  margin-bottom: 24px;
}
.help-section:last-child { margin-bottom: 0; }
.help-section-highlight {
  background: var(--track); border-radius: 12px; padding: 16px;
  border: 1px solid var(--border);
}
.help-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.help-text {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.7;
}

/* ---- TOAST ---- */
.toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text-secondary);
  color: var(--bg-solid);
  font-size: 12px;
  padding: 10px 20px;
  border-radius: 50px;
  z-index: 200;
  opacity: 0;
  transition: opacity .3s;
  pointer-events: none;
}
.toast.show { opacity: 1; }

/* ---- TAJWID COLORS ---- */
/* Standard tajwid color conventions (light mode) */
.tajwid-ghunnah  { color: #C62828; }   /* Red    — nasalisation */
.tajwid-idgham   { color: #2E7D32; }   /* Green  — assimilation */
.tajwid-ikhfaa   { color: #E65100; }   /* Orange — dissimulation */
.tajwid-qalqalah { color: #6A1B9A; }   /* Purple — écho */
.tajwid-madd     { color: #1565C0; }   /* Blue   — prolongation */
.tajwid-iqlab    { color: #00695C; }   /* Teal   — conversion */
.tajwid-izhar    { color: #37474F; }   /* Gris   — articulation claire */

/* Dark mode — softer/lighter tones on dark background */
body.dark .tajwid-ghunnah  { color: #EF9A9A; }
body.dark .tajwid-idgham   { color: #A5D6A7; }
body.dark .tajwid-ikhfaa   { color: #FFCC80; }
body.dark .tajwid-qalqalah { color: #CE93D8; }
body.dark .tajwid-madd     { color: #90CAF9; }
body.dark .tajwid-iqlab    { color: #80CBC4; }
body.dark .tajwid-izhar    { color: #B0BEC5; }

/* Sepia mode */
body.sepia .tajwid-ghunnah  { color: #b71c1c; }
body.sepia .tajwid-idgham   { color: #1b5e20; }
body.sepia .tajwid-ikhfaa   { color: #bf360c; }
body.sepia .tajwid-qalqalah { color: #4a148c; }
body.sepia .tajwid-madd     { color: #0d47a1; }
body.sepia .tajwid-iqlab    { color: #004d40; }
body.sepia .tajwid-izhar    { color: #37474F; }

/* Minimal mode without colors — silence all tajwid colors via CSS cascade */
body.minimal-no-colors [class^="tajwid-"] { color: inherit; }

/* Tajwid mode without colors — same cascade trick */
body.tajwid-no-colors [class^="tajwid-"] { color: inherit; }

/* Khatm reader: always dark bg → use dark-theme colors, override body class suppression */
#khatm-reader .tajwid-ghunnah  { color: #EF9A9A !important; }
#khatm-reader .tajwid-idgham   { color: #A5D6A7 !important; }
#khatm-reader .tajwid-ikhfaa   { color: #FFCC80 !important; }
#khatm-reader .tajwid-qalqalah { color: #CE93D8 !important; }
#khatm-reader .tajwid-madd     { color: #90CAF9 !important; }
#khatm-reader .tajwid-iqlab    { color: #80CBC4 !important; }
#khatm-reader .tajwid-izhar    { color: #B0BEC5 !important; }

/* Surah player (Lecteur Libre): always dark bg → same overrides */
#surah-player .tajwid-ghunnah  { color: #EF9A9A !important; }
#surah-player .tajwid-idgham   { color: #A5D6A7 !important; }
#surah-player .tajwid-ikhfaa   { color: #FFCC80 !important; }
#surah-player .tajwid-qalqalah { color: #CE93D8 !important; }
#surah-player .tajwid-madd     { color: #90CAF9 !important; }
#surah-player .tajwid-iqlab    { color: #80CBC4 !important; }
#surah-player .tajwid-izhar    { color: #B0BEC5 !important; }

/* ---- TAJWID COLOR SUB-GROUP (shown only when tajwid mode is active) ---- */
.setting-sub-group {
  margin-top: 10px;
  padding: 12px;
  background: var(--track);
  border-radius: 10px;
}
.setting-sub-label {
  font-size: 10px;
  color: var(--text-faint);
  letter-spacing: 0.3px;
  margin-bottom: 8px;
}

/* ---- SETTING HINT (below setting buttons) ---- */
.setting-hint {
  font-size: 10px;
  color: var(--text-faint);
  margin-top: 8px;
  line-height: 1.5;
}

/* ---- SETTINGS PANEL SECTIONS (stats, about, help) ---- */
.settings-section-divider {
  height: 1px;
  background: var(--border);
  margin: 28px 0 22px;
}
.settings-section-title {
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 14px;
}

/* ---- QIBLA ---- */
#qibla-overlay.moi-cat-overlay {
  background: linear-gradient(180deg, #0a0e1a 0%, #0f1528 40%, #141e38 100%) !important;
}
.qibla-stars {
  position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(1px 1px at 8% 12%, rgba(255,255,255,0.7) 0%, transparent 100%),
    radial-gradient(1.2px 1.2px at 22% 38%, rgba(255,255,255,0.5) 0%, transparent 100%),
    radial-gradient(0.8px 0.8px at 37% 7%, rgba(255,255,255,0.6) 0%, transparent 100%),
    radial-gradient(1px 1px at 52% 55%, rgba(255,255,255,0.4) 0%, transparent 100%),
    radial-gradient(1.3px 1.3px at 68% 18%, rgba(255,255,255,0.55) 0%, transparent 100%),
    radial-gradient(0.8px 0.8px at 82% 42%, rgba(255,255,255,0.45) 0%, transparent 100%),
    radial-gradient(1px 1px at 12% 68%, rgba(255,255,255,0.35) 0%, transparent 100%),
    radial-gradient(1.1px 1.1px at 30% 82%, rgba(255,255,255,0.4) 0%, transparent 100%),
    radial-gradient(0.7px 0.7px at 58% 72%, rgba(255,255,255,0.3) 0%, transparent 100%),
    radial-gradient(1.2px 1.2px at 78% 88%, rgba(255,255,255,0.35) 0%, transparent 100%),
    radial-gradient(0.9px 0.9px at 3% 45%, rgba(255,255,255,0.5) 0%, transparent 100%),
    radial-gradient(1px 1px at 45% 28%, rgba(255,255,255,0.3) 0%, transparent 100%),
    radial-gradient(0.6px 0.6px at 90% 10%, rgba(255,255,255,0.6) 0%, transparent 100%),
    radial-gradient(1.1px 1.1px at 28% 95%, rgba(255,255,255,0.25) 0%, transparent 100%),
    radial-gradient(0.8px 0.8px at 73% 62%, rgba(255,255,255,0.3) 0%, transparent 100%),
    radial-gradient(1.3px 1.3px at 15% 90%, rgba(255,255,255,0.2) 0%, transparent 100%),
    radial-gradient(0.7px 0.7px at 60% 92%, rgba(255,255,255,0.3) 0%, transparent 100%),
    radial-gradient(1px 1px at 93% 75%, rgba(255,255,255,0.25) 0%, transparent 100%),
    radial-gradient(0.9px 0.9px at 40% 50%, rgba(255,255,255,0.2) 0%, transparent 100%),
    radial-gradient(1.2px 1.2px at 6% 25%, rgba(255,255,255,0.45) 0%, transparent 100%),
    radial-gradient(0.6px 0.6px at 50% 15%, rgba(255,255,255,0.5) 0%, transparent 100%),
    radial-gradient(0.8px 0.8px at 85% 30%, rgba(255,255,255,0.35) 0%, transparent 100%),
    radial-gradient(1px 1px at 18% 52%, rgba(255,255,255,0.25) 0%, transparent 100%),
    radial-gradient(0.7px 0.7px at 65% 40%, rgba(255,255,255,0.3) 0%, transparent 100%);
  opacity: 0.6;
  animation: qibla-twinkle 5s ease-in-out infinite alternate;
}
@keyframes qibla-twinkle {
  0% { opacity: 0.45; }
  100% { opacity: 0.7; }
}
.qibla-topbar {
  position: absolute;
  top: 0; left: 0; right: 0;
  padding: calc(16px + env(safe-area-inset-top)) 24px 12px;
  z-index: 10;
}
.qibla-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 0 24px;
  position: relative;
  overflow: hidden;
  height: 100%;
}
.qibla-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 40px 20px;
  text-align: center;
}
.qibla-state-text {
  font-size: 13px;
  color: rgba(255,255,255,0.45);
  line-height: 1.7;
  max-width: 260px;
}
.qibla-action-btn {
  font-size: 12px;
  color: rgba(255,255,255,0.5);
  background: none;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 50px;
  padding: 9px 22px;
  cursor: pointer;
  transition: all .2s;
}
.qibla-compass-view {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 100%;
  padding: calc(70px + env(safe-area-inset-top)) 0 0;
}

/* Direction text */
.qibla-direction {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
}
.qibla-dir-arrow {
  color: rgba(255,255,255,0.65);
  transition: transform 0.3s ease, opacity 0.3s ease;
  flex-shrink: 0;
}
.qibla-dir-arrow.flip {
  transform: scaleX(-1);
}
.qibla-dir-arrow.aligned {
  opacity: 0;
  width: 0;
  overflow: hidden;
}
.qibla-dir-text {
  font-size: 16px;
  font-weight: 400;
  color: rgba(255,255,255,0.55);
  letter-spacing: 0.2px;
  font-family: -apple-system, 'Helvetica Neue', sans-serif;
}
.qibla-direction.aligned .qibla-dir-text {
  color: rgba(255,255,255,0.85);
}

/* SVG Arc */
.qibla-arc-wrap {
  width: 100%;
  max-width: 340px;
  flex-shrink: 0;
}
.qibla-arc-svg {
  width: 100%;
  height: auto;
}
#qibla-pointer {
  transition: transform 0.15s ease-out;
}
#qibla-pointer.live {
  transition: none;
}

/* Info section */
.qibla-info {
  text-align: center;
  padding: 0 0 8px;
}
.qibla-bearing-row {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 1px;
  margin-bottom: 4px;
}
.qibla-bearing-val {
  font-size: 40px;
  font-weight: 200;
  color: rgba(255,255,255,0.65);
  letter-spacing: -1.5px;
  line-height: 1;
}
.qibla-bearing-deg {
  font-size: 20px;
  font-weight: 200;
  color: rgba(255,255,255,0.35);
}
.qibla-info-label {
  font-size: 10px;
  color: rgba(255,255,255,0.25);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.qibla-distance {
  font-size: 13px;
  color: rgba(255,255,255,0.35);
  font-weight: 300;
}

/* Bottom bar */
.qibla-bottom-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0 calc(20px + env(safe-area-inset-bottom));
  width: 100%;
}
.qibla-bottom-label {
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  font-weight: 700;
  color: rgba(255,255,255,0.3);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  background: none;
  border: none;
  padding: 8px 4px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.qibla-bottom-label:active {
  color: rgba(255,255,255,0.6);
}
.qibla-bottom-location {
  font-size: 13px;
  color: rgba(255,255,255,0.4);
  font-weight: 300;
  letter-spacing: 0.2px;
}

/* Orient prompt */
.qibla-orient-prompt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  padding: 16px 0;
}
.qibla-orient-note {
  font-size: 10px;
  color: rgba(255,255,255,0.25);
  line-height: 1.5;
  max-width: 220px;
}

/* ---- TAFSIR ---- */
.tafsir-body {
  padding: 24px;
}
.tafsir-state {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
}
.tafsir-error-text {
  font-size: 13px;
  color: var(--text-muted);
}
.tafsir-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.tafsir-ayah-ref {
  font-size: 11px;
  color: var(--text-faint);
  letter-spacing: 0.4px;
  text-transform: uppercase;
  margin: 0;
}
.tafsir-text {
  font-size: 14px;
  font-weight: 300;
  color: var(--text-secondary);
  line-height: 1.8;
}
.tafsir-text p {
  margin: 0 0 12px;
}
.tafsir-text p:last-child {
  margin-bottom: 0;
}
.tafsir-translation {
  font-size: 15px;
  font-weight: 400;
  color: var(--text);
  line-height: 1.85;
  margin: 0 0 16px !important;
}
sup.tafsir-ref {
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 600;
  vertical-align: super;
  line-height: 0;
  margin-left: 1px;
}
.tafsir-notes-header {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 4px 0 10px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
p.tafsir-note {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin: 0 0 10px !important;
}
p.tafsir-note:last-child { margin-bottom: 0 !important; }
.tafsir-note-num {
  font-weight: 700;
  color: var(--text-muted);
  font-size: 12px;
}
.tafsir-source {
  font-size: 10px;
  color: var(--text-faint);
  letter-spacing: 0.3px;
  margin: 8px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--glass-border);
}

/* ---- AUDIO PLAYER ---- */
.nav-btn.audio-playing { color: #f59e0b; }
.nav-btn.audio-playing svg { fill: #f59e0b; stroke: none; }

/* ---- AUDIO GLOW EFFECT ---- */
.audio-glow {
  text-shadow: 0 0 8px rgba(245,158,11,0.5), 0 0 20px rgba(245,158,11,0.25);
  transition: text-shadow 0.4s ease;
}
.dark .audio-glow,
body[data-theme="nuit"] .audio-glow {
  text-shadow: 0 0 10px rgba(245,158,11,0.65), 0 0 28px rgba(245,158,11,0.35);
}
body[data-theme="sepia"] .audio-glow {
  text-shadow: 0 0 8px rgba(180,120,50,0.5), 0 0 20px rgba(180,120,50,0.25);
}
/* Surah player glow (dark bg) */
.sp-verse-ar.audio-glow {
  text-shadow: 0 0 10px rgba(255,255,255,0.55), 0 0 25px rgba(255,255,255,0.3);
}

/* ---- SUIVI RÉCITATION (FOLLOW MODE) ---- */
#kr-follow-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: rgba(255,255,255,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  transition: all 0.3s ease;
}
#kr-follow-btn.follow-active {
  background: rgba(52, 211, 153, 0.25);
  border-color: #34d399;
  color: #34d399;
  animation: follow-pulse 2s ease-in-out infinite;
}

.follow-fab {
  position: absolute;
  bottom: 70px;
  right: 20px;
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(30,30,32,0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: rgba(255,255,255,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  transition: all 0.3s ease;
  box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}
.follow-fab.follow-active {
  background: rgba(52, 211, 153, 0.25);
  border-color: #34d399;
  color: #34d399;
  animation: follow-pulse 2s ease-in-out infinite;
}

@keyframes follow-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.4); }
  50% { box-shadow: 0 0 0 8px rgba(52, 211, 153, 0); }
}

.kr-verse-follow-active {
  background: rgba(52, 211, 153, 0.08) !important;
  border-left: 3px solid #34d399 !important;
  transition: background 0.4s ease, border 0.4s ease;
}
/* Surah Player: Suivi Vocal highlight */
.sp-verse-follow-active {
  background: rgba(52, 211, 153, 0.08) !important;
  border-left: 3px solid #34d399 !important;
  transition: background 0.4s ease, border 0.4s ease;
}

/* Follow mode: model download progress */
#follow-progress-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10001;
}
#follow-progress-overlay.hidden { display: none; }
.follow-progress-content {
  text-align: center;
  color: #fff;
  padding: 30px;
}
.follow-progress-content svg { margin-bottom: 15px; }
#follow-progress-status {
  font-size: 15px;
  margin-bottom: 10px;
  opacity: 0.9;
}
.follow-progress-bar-wrap {
  width: 200px;
  height: 4px;
  background: rgba(255,255,255,0.15);
  border-radius: 2px;
  margin: 0 auto 10px;
  overflow: hidden;
}
#follow-progress-bar {
  width: 0%;
  height: 100%;
  background: #34d399;
  border-radius: 2px;
  transition: width 0.3s;
}
#follow-progress-text {
  font-size: 13px;
  opacity: 0.6;
}

/* ---- KHATM AUDIO BUTTONS ---- */
#kr-audio-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,0.7);
  padding: 8px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
#kr-audio-btn.kr-playing { color: #f59e0b; }
#kr-audio-btn.kr-playing svg { fill: #f59e0b; stroke: none; }
#kr-audio-auto-btn {
  background: none;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 50%;
  color: rgba(255,255,255,0.45);
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
#kr-audio-auto-btn.kr-auto-active {
  border-color: #f59e0b;
  color: #f59e0b;
}
.reciter-list { display: flex; flex-direction: column; gap: 2px; }
.reciter-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 14px; border-radius: 12px; cursor: pointer; transition: background .15s;
}
.reciter-item:active { background: var(--track); }
.reciter-item.active { background: var(--glass-bg); border: 1px solid var(--glass-border); }
.reciter-item-name { font-size: 14px; color: var(--text); }
.reciter-item-name-ar { font-size: 13px; color: var(--text-faint); font-family: "Amiri", serif; direction: rtl; }
.reciter-item-check { color: #f59e0b; font-size: 16px; display: none; }
.reciter-item.active .reciter-item-check { display: block; }

/* ---- PRAYER TIMES (Behold-style full-screen) ---- */

/* Full-screen background image on the overlay itself */
.prayer-overlay-bg {
  background-color: #1a1a1a !important;
  background-size: cover !important;
  background-position: center center !important;
  background-repeat: no-repeat !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
/* Dark overlay for text readability — covers only the background, NOT the text */
.prayer-overlay-bg::before {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  transition: background 1s ease;
}
/* Day mode: gentle gradient at top/bottom */
.prayer-overlay-bg.prayer-day::before {
  background:
    linear-gradient(to bottom, rgba(0,0,0,0.5) 0%, rgba(0,0,0,0.15) 25%, transparent 45%),
    linear-gradient(to top, rgba(0,0,0,0.45) 0%, transparent 30%);
}
/* Night mode: strong dark overlay — only darkens background, text stays bright */
.prayer-overlay-bg.prayer-night::before {
  background: rgba(0,0,0,0.65);
}

/* ---- Sunlight sweep effect on prayer overlay ---- */
.prayer-overlay-bg::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(
    105deg,
    transparent 0%,
    transparent 35%,
    rgba(255, 230, 160, 0.12) 42%,
    rgba(255, 240, 190, 0.18) 50%,
    rgba(255, 230, 160, 0.12) 58%,
    transparent 65%,
    transparent 100%
  );
  background-size: 300% 100%;
  background-position: 100% 0;
  opacity: 0;
}
.prayer-overlay-bg.prayer-halo::after {
  animation: prayer-sun-sweep 7s ease-in-out 0.3s infinite;
}
/* Night: cooler moonlight sweep */
.prayer-overlay-bg.prayer-night::after {
  background: linear-gradient(
    105deg,
    transparent 0%,
    transparent 35%,
    rgba(160, 190, 255, 0.08) 42%,
    rgba(180, 210, 255, 0.12) 50%,
    rgba(160, 190, 255, 0.08) 58%,
    transparent 65%,
    transparent 100%
  );
  background-size: 300% 100%;
  background-position: 100% 0;
}
@keyframes prayer-sun-sweep {
  0%   { opacity: 0; background-position: 100% 0; }
  8%   { opacity: 1; }
  38%  { opacity: 1; background-position: 0% 0; }
  48%  { opacity: 0; background-position: 0% 0; }
  100% { opacity: 0; background-position: 100% 0; }
}

/* Sun rays container — no longer used */
.prayer-sun-rays { display: none; }
}

.prayer-top-bar {
  display: flex; justify-content: flex-end;
  padding: calc(14px + env(safe-area-inset-top, 0px)) 20px 0;
  position: relative; z-index: 2;
}
.prayer-state {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 12px; padding: 60px 20px;
  position: relative; z-index: 2;
}
.prayer-state-text { font-size: 13px; color: rgba(255,255,255,0.7); }
#prayer-overlay .qibla-action-btn {
  color: #fff; border-color: rgba(255,255,255,0.4);
}
#prayer-overlay .qibla-action-btn:hover { color: #fff; border-color: rgba(255,255,255,0.7); }

/* Date navigation — arrows aligned with timeline extremities */
.prayer-date-nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 20px 6px; position: relative; z-index: 2;
}
.prayer-date-arrow {
  background: none; border: none; color: rgba(255,255,255,0.5);
  cursor: pointer; padding: 8px 4px; border-radius: 50%;
  transition: color 0.2s, background 0.2s;
  outline: none; -webkit-tap-highlight-color: transparent;
}
.prayer-date-arrow:hover { color: #fff; background: rgba(255,255,255,0.08); }
.prayer-date-arrow.disabled { opacity: 0.2; pointer-events: none; }
.prayer-date-center { text-align: center; flex: 1; }
.prayer-date-gregorian {
  font-size: 16px; font-weight: 300; color: #fff; letter-spacing: 0.3px;
}
.prayer-date-hijri {
  font-size: 10px; color: rgba(255,255,255,0.45); text-transform: uppercase;
  letter-spacing: 1.5px; margin-top: 3px; font-weight: 400;
}

/* Horizontal timeline + prayer names (combined layout) */
.prayer-timeline-section {
  position: relative; z-index: 2; padding: 0 20px;
}
.prayer-timeline {
  position: relative; height: 28px;
  display: flex; align-items: center;
}
.prayer-timeline-line {
  position: absolute; top: 50%; left: 0; right: 0;
  height: 1.5px; background: rgba(255,255,255,0.15);
  transform: translateY(-50%);
}
.prayer-timeline-progress {
  position: absolute; top: 50%; left: 0;
  height: 1.5px; background: rgba(255,255,255,0.5);
  transform: translateY(-50%); transition: width 0.8s ease;
}
/* Round markers instead of triangles */
.prayer-timeline-marker {
  position: absolute; top: 50%; transform: translate(-50%, -50%);
  width: 6px; height: 6px; border-radius: 50%;
  background: rgba(255,255,255,0.25);
}
.prayer-timeline-marker.active { background: #fff; box-shadow: 0 0 6px rgba(255,255,255,0.5); }
.prayer-timeline-marker.past { background: rgba(255,255,255,0.12); }
/* Current position dot (larger) */
.prayer-timeline-dot {
  position: absolute; top: 50%; transform: translate(-50%, -50%);
  width: 10px; height: 10px; border-radius: 50%;
  background: #fff; box-shadow: 0 0 10px rgba(255,255,255,0.5);
  transition: left 0.8s ease;
}

/* Horizontal prayer times row */
.prayer-times-row {
  display: flex; justify-content: space-between;
  padding: 6px 0 16px; position: relative; z-index: 2;
}
/* Horizontal line running through all dots */
.prayer-times-row::before {
  content: ''; position: absolute;
  top: 10px; left: 0; right: 0;
  height: 1.5px; background: rgba(255,255,255,0.15);
  z-index: 0;
}
.prayer-time-col {
  flex: 1; text-align: center; display: flex;
  flex-direction: column; align-items: center; gap: 6px;
  opacity: 0.9; transition: opacity 0.3s;
  position: relative; z-index: 1;
}
.prayer-time-col.prayer-active { opacity: 1; }
.prayer-time-col.prayer-past { opacity: 0.7; }
.prayer-time-col.prayer-future-day { opacity: 0.95; }
/* Dot centered above prayer name */
.prayer-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: rgba(255,255,255,0.25); flex-shrink: 0;
}
.prayer-time-col.prayer-active .prayer-dot {
  background: #fff;
  box-shadow: 0 0 8px rgba(255,255,255,0.6), 0 0 2px rgba(255,255,255,0.9);
}
.prayer-time-col.prayer-past .prayer-dot {
  background: rgba(255,255,255,0.1);
}
/* Moving cursor dot that travels toward next prayer */
.prayer-cursor-dot {
  position: absolute;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 10px rgba(255,255,255,0.5);
  transform: translate(-50%, -50%);
  z-index: 3;
  pointer-events: none;
}
.prayer-time-col-name {
  font-family: "Space Mono", monospace;
  font-size: 11px; color: #fff;
  letter-spacing: 0.2px; font-weight: 400;
  text-shadow: 0 1px 4px rgba(0,0,0,0.4);
}
.prayer-time-col.prayer-active .prayer-time-col-name {
  color: #fff; font-weight: 700;
}
.prayer-time-col-time {
  font-family: "Space Mono", monospace;
  font-size: 13px; color: rgba(255,255,255,0.95);
  font-variant-numeric: tabular-nums; font-weight: 400;
  text-shadow: 0 1px 4px rgba(0,0,0,0.4);
}
.prayer-time-col.prayer-active .prayer-time-col-time {
  color: #fff; font-weight: 700;
}

/* Spacer pushes countdown to bottom */
.prayer-spacer { flex: 1; position: relative; z-index: 1; }

/* Countdown — clean, elegant like Behold */
.prayer-countdown-overlay {
  text-align: center; z-index: 2; pointer-events: none;
  padding: 0 20px 24px; position: relative;
}
.prayer-countdown-label {
  font-family: "Space Mono", monospace;
  font-size: 10px; text-transform: uppercase; letter-spacing: 2.5px;
  color: rgba(255,255,255,0.5); font-weight: 400;
}
.prayer-countdown-name {
  font-family: "Space Mono", monospace;
  font-size: 30px; font-weight: 400; color: #ffffff;
  letter-spacing: -0.5px; margin-top: 6px;
  text-shadow: 0 2px 20px rgba(0,0,0,0.4);
}
.prayer-countdown-time {
  font-family: "Space Mono", monospace;
  font-size: 14px; color: rgba(255,255,255,0.6); margin-top: 4px;
  font-weight: 400; letter-spacing: 0.2px;
  text-shadow: 0 1px 10px rgba(0,0,0,0.4);
}

/* Bottom action bar — Behold style */
.prayer-bottom-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 24px 12px; position: relative; z-index: 2;
  /* safe-area géré par prayer-bottom-location juste en dessous */
}
.prayer-bottom-btn {
  font-family: "Space Mono", monospace;
  background: none; border: none; cursor: pointer;
  font-size: 11px; text-transform: uppercase; letter-spacing: 2px;
  color: rgba(255,255,255,0.6); font-weight: 700; padding: 8px 0;
  min-width: 70px;
}
.prayer-bottom-btn:hover { color: #fff; }
.prayer-bottom-close {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 50%;
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.7);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.2s, color 0.2s;
  flex-shrink: 0;
}
.prayer-bottom-close:active {
  background: rgba(255,255,255,0.15);
  color: #fff;
}
.prayer-bottom-location {
  font-family: "Space Mono", monospace;
  font-size: 10px; color: rgba(255,255,255,0.6); text-align: center;
  flex-shrink: 0; padding: 0 20px;
  padding-bottom: max(14px, env(safe-area-inset-bottom, 14px));
  min-height: max(14px, env(safe-area-inset-bottom, 14px));
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-weight: 700; letter-spacing: 2px; text-transform: uppercase;
}

/* Settings sub-panel (slide-up) — dark theme to match prayer overlay */
.prayer-settings-panel {
  position: absolute; bottom: 0; left: 0; right: 0; z-index: 10;
  background: rgba(20,20,20,0.92); backdrop-filter: blur(40px) saturate(1.6);
  -webkit-backdrop-filter: blur(40px) saturate(1.6);
  border-top: 1px solid rgba(255,255,255,0.12);
  border-radius: 20px 20px 0 0; max-height: 70vh; overflow: visible;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
}
.prayer-settings-panel.visible { transform: translateY(0); }
.prayer-settings-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid rgba(255,255,255,0.1);
}
.prayer-settings-header .close-btn { color: rgba(255,255,255,0.5); }
.prayer-settings-title {
  font-family: "Space Mono", monospace;
  font-size: 11px; font-weight: 700; color: rgba(255,255,255,0.7);
  letter-spacing: 2px; text-transform: uppercase;
}
.prayer-settings-body { padding: 20px; max-height: 55vh; overflow-y: auto; }
.prayer-settings-body .setting-label {
  font-family: "Space Mono", monospace;
  font-size: 10px; color: rgba(255,255,255,0.45);
  letter-spacing: 1.5px; text-transform: uppercase;
}
.prayer-settings-body .setting-btn {
  font-family: "Space Mono", monospace;
  background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.7); font-size: 11px; letter-spacing: 0.5px;
}
.prayer-settings-body .setting-btn.active {
  background: rgba(255,255,255,0.18); border-color: rgba(255,255,255,0.3);
  color: #fff;
}

/* Night info in settings */
.prayer-night-info {
  margin-top: 20px; padding: 14px;
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
}
.prayer-night-item {
  display: flex; justify-content: space-between; align-items: center; padding: 8px 0;
}
.prayer-night-item + .prayer-night-item { border-top: 1px solid rgba(255,255,255,0.08); }
.prayer-night-label {
  font-family: "Space Mono", monospace;
  font-size: 11px; color: rgba(255,255,255,0.5); letter-spacing: 0.3px;
}
.prayer-night-value {
  font-family: "Space Mono", monospace;
  font-size: 12px; color: rgba(255,255,255,0.85);
  font-variant-numeric: tabular-nums;
}
.prayer-mosque-row { font-family: "Space Mono", monospace; color: rgba(255,255,255,0.6); font-size: 11px; }
.prayer-mosque-name { color: rgba(255,255,255,0.85); }
.prayer-mosque-change { font-family: "Space Mono", monospace; color: rgba(255,255,255,0.5); border-color: rgba(255,255,255,0.2); font-size: 10px; }

/* ---- PRAYER NOTIFICATIONS TOGGLE ---- */
.prayer-notif-section {
  margin-top: 20px; padding: 14px;
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
}
.prayer-notif-section .prayer-setting-label {
  font-family: "Space Mono", monospace;
  font-size: 9px; letter-spacing: 2px; color: rgba(255,255,255,0.35);
  margin-bottom: 12px;
}
.prayer-notif-row {
  display: flex; justify-content: space-between; align-items: center;
}
.prayer-notif-text {
  font-family: "Space Mono", monospace;
  font-size: 11px; color: rgba(255,255,255,0.75); letter-spacing: 0.3px;
}
.prayer-notif-toggle {
  position: relative; width: 44px; height: 26px; border-radius: 13px;
  background: rgba(255,255,255,0.15); border: none; cursor: pointer;
  transition: background 0.25s; padding: 0;
  -webkit-tap-highlight-color: transparent;
}
.prayer-notif-toggle.active { background: #10b981; }
.prayer-notif-toggle-knob {
  position: absolute; top: 2px; left: 2px;
  width: 22px; height: 22px; border-radius: 50%;
  background: #fff; transition: transform 0.25s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.prayer-notif-toggle.active .prayer-notif-toggle-knob { transform: translateX(18px); }
.prayer-notif-hint {
  font-family: "Space Mono", monospace;
  font-size: 10px; color: rgba(255,255,255,0.3);
  margin-top: 8px; letter-spacing: 0.2px;
}

/* ---- PRAYER CITY SEARCH ---- */
.prayer-location-bar { margin-bottom: 16px; position: relative; z-index: 20; }
.prayer-search-wrap { position: relative; display: flex; align-items: center; gap: 8px; }
.prayer-search-input {
  font-family: "Space Mono", monospace;
  flex: 1; background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.15);
  border-radius: 12px; padding: 10px 14px; font-size: 12px; color: #fff;
  outline: none; min-width: 0; letter-spacing: 0.3px;
}
.prayer-search-input::placeholder { color: rgba(255,255,255,0.35); }
.prayer-search-input:focus { border-color: rgba(255,255,255,0.3); }
.prayer-search-reset {
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.5); border-radius: 8px; width: 34px; height: 34px;
  font-size: 18px; line-height: 1; cursor: pointer; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.prayer-search-dropdown {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 100;
  background: rgba(30,30,30,0.95); border: 1px solid rgba(255,255,255,0.15);
  border-radius: 12px; overflow: hidden;
  box-shadow: 0 8px 24px rgba(0,0,0,0.6);
}
.prayer-search-item {
  font-family: "Space Mono", monospace;
  padding: 12px 16px; font-size: 12px; color: rgba(255,255,255,0.85); cursor: pointer;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.prayer-search-item:last-child { border-bottom: none; }
.prayer-search-item:hover { background: rgba(255,255,255,0.1); }
.prayer-search-empty { color: rgba(255,255,255,0.35); cursor: default; }
.prayer-search-empty:hover { background: transparent; }

/* ---- MAWAQIT MOSQUE SELECTOR ---- */
.mosque-selector {
  background: rgba(20,20,20,0.85); backdrop-filter: blur(40px) saturate(1.6);
  -webkit-backdrop-filter: blur(40px) saturate(1.6);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 16px; padding: 16px; margin-bottom: 16px;
}
.mosque-selector-title {
  font-size: 12px; color: rgba(255,255,255,0.7); text-transform: uppercase;
  letter-spacing: 0.5px; margin-bottom: 12px;
}
.mosque-selector-item {
  display: block; width: 100%; text-align: left;
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px; padding: 12px 14px; margin-bottom: 8px;
  font-size: 14px; color: #fff; cursor: pointer;
}
.mosque-selector-item:last-child { margin-bottom: 0; }
.mosque-selector-item:hover { background: rgba(255,255,255,0.12); }

/* ---- MAWAQIT MOSQUE NAME ROW ---- */
.prayer-mosque-row {
  display: flex; align-items: center; gap: 8px; margin-top: 12px;
  padding: 10px 14px; background: rgba(255,255,255,0.04);
  border-radius: 10px; border: 1px solid var(--glass-border);
}
.prayer-mosque-label { font-size: 12px; color: rgba(255,255,255,0.6); flex-shrink: 0; }
.prayer-mosque-name { font-size: 13px; color: #fff; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prayer-mosque-change {
  background: transparent; border: 1px solid rgba(255,255,255,0.2);
  color: #fff; border-radius: 8px; padding: 4px 10px;
  font-size: 12px; cursor: pointer; flex-shrink: 0;
}
.prayer-mosque-change:hover { color: #fff; border-color: rgba(255,255,255,0.4); }

/* ---- HIFZ (MEMORIZATION) — Reader-style ---- */
#hifz-overlay {
  position: fixed; inset: 0; z-index: 9998;
  background: #0d0d0d;
  display: flex; flex-direction: column;
}
#hifz-topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 56px 20px 0; flex-shrink: 0;
}
#hifz-close, #hifz-menu-btn {
  background: none; border: none; color: rgba(255,255,255,0.7);
  padding: 8px; cursor: pointer; -webkit-tap-highlight-color: transparent;
  width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
#hifz-close:active, #hifz-menu-btn:active { opacity: 0.5; }
#hifz-surah-header {
  text-align: center; flex: 1; min-width: 0;
}
#hifz-surah-header h1 {
  font-size: 20px; font-weight: 600; color: #fff; margin: 0;
  font-family: system-ui, -apple-system, sans-serif;
}
#hifz-surah-header p {
  font-size: 10px; font-weight: 500; color: rgba(255,255,255,0.3);
  letter-spacing: 0.1em; margin: 2px 0 0;
  font-family: system-ui, -apple-system, sans-serif;
}
#hifz-content {
  flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch;
  display: flex; flex-direction: column;
  padding: 20px 28px;
}
#hifz-words {
  font-family: "Scheherazade New", "Amiri Quran", "Amiri", serif;
  font-size: 32px; line-height: 2.4;
  text-align: center; color: #fff;
  max-width: 600px; width: 100%; word-spacing: 10px;
  margin: auto;
}
.hifz-word { display: inline; transition: color .3s, text-shadow .3s; cursor: pointer; }
.hifz-hidden {
  color: transparent;
  text-shadow: 0 0 12px rgba(255,255,255,0.3);
  user-select: none; transition: color .3s, text-shadow .3s;
}
.hifz-revealed { color: #10b981; text-shadow: none; }

/* Footer */
#hifz-footer {
  flex-shrink: 0; padding: 12px 20px 32px;
  border-top: 1px solid rgba(255,255,255,0.06);
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
#hifz-level-display {
  font-size: 12px; color: rgba(255,255,255,0.35);
  font-family: 'Space Mono', monospace;
}
#hifz-verse-nav {
  display: flex; align-items: center; gap: 20px;
}
.hifz-nav-btn {
  background: none; border: none; color: rgba(255,255,255,0.4);
  padding: 8px; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.hifz-nav-btn:active { opacity: 0.5; }
#hifz-nav-ref {
  font-size: 12px; font-weight: 300; color: rgba(255,255,255,0.4);
  text-align: center; min-width: 120px;
  font-family: system-ui, -apple-system, sans-serif;
  letter-spacing: 0.02em;
}
#hifz-play-btn {
  background: rgba(255,255,255,0.08); border: none;
  color: #fff; width: 48px; height: 48px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: background .2s;
}
#hifz-play-btn:active { background: rgba(255,255,255,0.16); }

/* ··· Menu dropdown */
#hifz-menu {
  position: fixed; right: 16px; top: 100px;
  width: calc(100vw - 32px); max-width: 300px;
  background: rgba(28,28,30,0.96); -webkit-backdrop-filter: blur(40px); backdrop-filter: blur(40px);
  border-radius: 14px; padding: 8px 0;
  z-index: 10000; box-shadow: 0 8px 40px rgba(0,0,0,0.5);
  overflow: hidden;
}
.hifz-menu-label {
  font-size: 10px; font-weight: 400; color: rgba(255,255,255,0.3);
  letter-spacing: 0.1em; padding: 10px 16px 4px;
  text-transform: uppercase;
  font-family: system-ui, -apple-system, sans-serif;
}
.hifz-menu-item {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; padding: 9px 16px; background: none; border: none;
  color: rgba(255,255,255,0.85); font-size: 13px; font-weight: 300;
  text-transform: uppercase; letter-spacing: 0.04em;
  cursor: pointer; font-family: system-ui, -apple-system, sans-serif;
  -webkit-tap-highlight-color: transparent;
}
.hifz-menu-item:active { background: rgba(255,255,255,0.06); }
.hifz-menu-check { font-size: 12px; color: #10b981; }
.hifz-menu-check::after { content: ""; }
.hifz-menu-check.active::after { content: "✓"; }
.hifz-menu-arrow { color: rgba(255,255,255,0.3); font-size: 16px; }
.hifz-menu-sep {
  height: 1px; background: rgba(255,255,255,0.08); margin: 4px 0;
}
.hifz-menu-selects {
  display: flex; gap: 8px; padding: 6px 16px 8px;
}
.hifz-select {
  flex: 1; font-size: 11px; font-weight: 300; color: rgba(255,255,255,0.85);
  background: rgba(255,255,255,0.08); border: none; border-radius: 8px;
  padding: 8px 10px; appearance: none; -webkit-appearance: none;
  text-transform: uppercase; letter-spacing: 0.03em;
  font-family: system-ui, -apple-system, sans-serif;
  min-width: 0; overflow: hidden; text-overflow: ellipsis;
}
.hifz-menu-stepper {
  display: flex; align-items: center; justify-content: center;
  gap: 20px; padding: 8px 16px;
}
.hifz-stepper-btn {
  width: 32px; height: 32px; border-radius: 50%; border: 1px solid rgba(255,255,255,0.2);
  background: none; color: #fff; font-size: 16px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  -webkit-tap-highlight-color: transparent;
}
.hifz-stepper-btn:active { background: rgba(255,255,255,0.1); }
#hifz-hide-count {
  font-size: 14px; font-weight: 300; color: rgba(255,255,255,0.85); min-width: 40px; text-align: center;
  font-family: system-ui, -apple-system, sans-serif; letter-spacing: 0.02em;
}
.hifz-menu-actions {
  display: flex; padding: 0 0 4px;
}
.hifz-menu-actions .hifz-menu-item { flex: 1; justify-content: center; }

/* Reciter sheet */
#hifz-reciter-sheet {
  position: fixed; inset: 0; z-index: 10001;
  background: rgba(0,0,0,0.5); display: flex; align-items: flex-end;
}
#hifz-reciter-sheet.hidden { display: none; }
#hifz-reciter-panel {
  width: 100%; max-height: 70vh; background: #1c1c1e;
  border-radius: 16px 16px 0 0; overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: env(safe-area-inset-bottom);
}
.hifz-reciter-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid rgba(255,255,255,0.08);
  position: sticky; top: 0; background: #1c1c1e; z-index: 1;
}
.hifz-reciter-header h3 {
  font-size: 17px; font-weight: 600; color: #fff; margin: 0;
}
#hifz-reciter-close {
  background: none; border: none; color: rgba(255,255,255,0.5);
  padding: 4px; cursor: pointer;
}
.hifz-reciter-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; cursor: pointer; border: none; background: none;
  width: 100%; -webkit-tap-highlight-color: transparent;
}
.hifz-reciter-item:active { background: rgba(255,255,255,0.04); }
.hifz-reciter-item .name {
  font-size: 15px; color: #fff;
  font-family: system-ui, -apple-system, sans-serif;
}
.hifz-reciter-item .nameAr {
  font-size: 14px; color: rgba(255,255,255,0.5); margin-top: 2px;
}
.hifz-reciter-item .check {
  font-size: 14px; color: #10b981;
}

/* ---- RECITATION VERIFICATION ---- */
.recit-body { padding: 0; display: flex; flex-direction: column; height: 100%; overflow: hidden; }
.recit-nav {
  padding: 12px 16px; border-bottom: 1px solid var(--border);
  display: flex; flex-direction: column; align-items: center; gap: 10px; flex-shrink: 0;
}
.recit-select {
  width: 100%; max-width: 400px; padding: 10px 14px; border-radius: 12px;
  border: 1px solid var(--glass-border); background: var(--glass-bg);
  color: var(--text); font-size: 14px; font-family: inherit;
  appearance: none; -webkit-appearance: none; cursor: pointer;
  text-align: center; text-align-last: center;
}
.recit-verse-nav { display: flex; align-items: center; gap: 16px; }
.recit-nav-btn {
  background: none; border: 1px solid var(--btn-border); border-radius: 50%;
  width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); cursor: pointer; transition: all .2s;
}
.recit-nav-btn:active { border-color: var(--text-faint); color: var(--text-secondary); }
.recit-verse-label { font-size: 12px; color: var(--text-muted); min-width: 80px; text-align: center; letter-spacing: 0.3px; }
.recit-scroll-area {
  flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding: 16px 20px;
}
.recit-verse-area {
  font-family: "Amiri Quran", "Amiri", serif; font-size: 28px; line-height: 2.4;
  text-align: center; color: var(--text); max-width: 600px; width: 100%; word-spacing: 8px;
}
.recit-verse-area.size-S { font-size: 22px; line-height: 2.0; }
.recit-verse-area.size-M { font-size: 28px; line-height: 2.4; }
.recit-verse-area.size-L { font-size: 36px; line-height: 2.6; }
.recit-word { display: inline; transition: color .3s; color: var(--text-muted); }
.recit-word-active { color: var(--text); text-decoration: underline; text-underline-offset: 8px; text-decoration-color: var(--btn-border); }
.recit-word-correct { color: #10b981; }
.recit-word-error { color: #ef4444; text-decoration-line: underline; text-decoration-style: wavy; text-underline-offset: 6px; text-decoration-color: #ef4444; }
.recit-word-skipped { color: #f59e0b; opacity: 0.7; }
.recit-transcript {
  font-size: 14px; color: var(--text-muted); text-align: center; min-height: 20px;
  padding: 4px 16px; font-style: italic; opacity: 0.75; flex-shrink: 0;
  letter-spacing: 0.3px; word-break: break-word;
}
.recit-status { font-size: 12px; color: var(--text-faint); text-align: center; min-height: 18px; letter-spacing: 0.2px; flex-shrink: 0; }
.recit-score-card {
  background: var(--glass-bg); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border); box-shadow: var(--glass-shadow);
  border-radius: 16px; padding: 16px 24px; text-align: center; width: 100%; max-width: 260px; flex-shrink: 0;
}
.recit-score { font-size: 36px; font-weight: 200; color: var(--text); letter-spacing: -1px; }
.recit-score-detail { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.recit-controls {
  border-top: 1px solid var(--border); padding: 12px 16px 16px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  flex-shrink: 0; background: var(--bg);
}
.recit-mic-btn {
  width: 72px; height: 72px; border-radius: 50%; border: 2px solid var(--btn-border);
  background: none; color: var(--text-muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: all .3s;
}
.recit-mic-btn.recording { border-color: #ef4444; color: #ef4444; animation: pulse-record 1.5s ease-in-out infinite; }
@keyframes pulse-record {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,.35); }
  50% { box-shadow: 0 0 0 14px rgba(239,68,68,0); }
}
.recit-mic-label { font-size: 11px; color: var(--text-faint); letter-spacing: 0.3px; }
.recit-fallback { text-align: center; padding: 40px 20px; flex-shrink: 0; }
.recit-fallback p { font-size: 14px; color: var(--text-muted); line-height: 1.6; }

/* ---- ÉCOUTER LE CORAN (Apple Music style) ---- */
.listen-body {
  display: flex; flex-direction: column; height: 100%; overflow: hidden; padding: 0;
}

/* Reciter dropdown */
.listen-reciter-wrap {
  padding: 12px 16px 8px; flex-shrink: 0;
}
.listen-reciter-select {
  width: 100%; padding: 10px 14px; border-radius: 12px;
  border: 1px solid var(--btn-border); background: var(--glass-bg);
  backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
  color: var(--text); font-size: 15px; font-family: inherit;
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
  cursor: pointer; transition: border-color .15s;
}
.listen-reciter-select:focus {
  outline: none; border-color: var(--accent);
}

/* Surah list */
.listen-surah-list {
  flex: 1; overflow-y: auto; padding: 0;
  -webkit-overflow-scrolling: touch;
}
.listen-surah-item {
  display: flex; align-items: center; gap: 12px; padding: 13px 16px;
  cursor: pointer; transition: background .12s;
  border-bottom: 1px solid color-mix(in srgb, var(--divider) 50%, transparent);
}
.listen-surah-item:active { background: var(--hover-bg); }
.listen-surah-item.active {
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}
.listen-surah-item.active .listen-surah-fr { color: var(--accent); }
.listen-surah-item.active .listen-surah-num-badge { background: var(--accent); color: #fff; }
.listen-surah-num-badge {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 600;
  background: var(--track);
  border: 1px solid var(--border);
  color: var(--text);
}
.listen-surah-fr {
  flex: 1; font-size: 15px; font-weight: 500; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.listen-surah-ar {
  font-size: 14px; color: var(--text-muted); direction: rtl; flex-shrink: 0;
}

/* Apple Music-style player bar */
.listen-player-bar {
  flex-shrink: 0; padding: 16px 20px calc(16px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--divider);
  background: var(--glass-bg); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
}
.listen-player-info { text-align: center; margin-bottom: 14px; }
.listen-player-surah-ar {
  font-size: 20px; color: var(--text); direction: rtl; font-weight: 500;
  line-height: 1.3;
}
.listen-player-surah-fr {
  font-size: 14px; color: var(--text-muted); margin-top: 2px;
}
.listen-player-reciter {
  font-size: 12px; color: var(--text-faint); margin-top: 2px;
}

/* Progress bar */
.listen-progress-wrap {
  display: flex; align-items: center; gap: 10px; margin-bottom: 16px;
}
.listen-time {
  font-size: 11px; color: var(--text-faint); font-variant-numeric: tabular-nums;
  min-width: 32px; user-select: none;
}
.listen-time:first-child { text-align: right; }
.listen-time:last-child { text-align: left; }
.listen-progress-bar {
  flex: 1; height: 4px; background: var(--btn-border); border-radius: 2px;
  position: relative; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.listen-progress-fill {
  height: 100%; width: 0%; background: var(--accent); border-radius: 2px;
  pointer-events: none;
}
.listen-progress-knob {
  position: absolute; top: 50%; width: 14px; height: 14px;
  border-radius: 50%; background: var(--accent);
  box-shadow: 0 1px 4px rgba(0,0,0,.18);
  transform: translate(-50%, -50%); left: 0%;
  pointer-events: none; opacity: 0; transition: opacity .15s;
}
.listen-progress-bar:hover .listen-progress-knob,
.listen-progress-bar:active .listen-progress-knob,
.listen-progress-bar.seeking .listen-progress-knob { opacity: 1; }

/* Controls */
.listen-player-controls {
  display: flex; align-items: center; justify-content: center; gap: 32px;
}
.listen-ctrl-btn {
  background: none; border: none; cursor: pointer; color: var(--text);
  display: flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 50%;
  transition: background .12s, transform .1s;
  -webkit-tap-highlight-color: transparent;
}
.listen-ctrl-btn:active { transform: scale(0.9); }
.listen-ctrl-play {
  width: 56px; height: 56px;
  background: var(--accent) !important; color: var(--overlay-bg) !important;
  border-radius: 50% !important;
  box-shadow: 0 2px 10px rgba(0,0,0,.12);
}
.listen-ctrl-play:active { transform: scale(0.92); opacity: 0.9; }

/* ---- SHAZAM ---- */
/* ---- SHAZAM / IDENTIFIER UN VERSET ---- */
.shazam-topbar {
  position: absolute;
  top: 0; left: 0; right: 0;
  padding: calc(16px + env(safe-area-inset-top)) 24px 12px;
  z-index: 10;
}
.shazam-body {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: calc(50px + env(safe-area-inset-top)) 20px calc(50px + env(safe-area-inset-bottom)); gap: 16px; min-height: 100%;
  position: relative; overflow: hidden; box-sizing: border-box;
}

/* ---- Scrolling Arabic verses background ---- */
.shazam-scroll-bg {
  position: absolute; inset: -20px -40px; overflow: hidden;
  pointer-events: none; z-index: 0;
  display: flex; flex-direction: column; justify-content: space-around;
  padding: 0;
  mask-image: radial-gradient(ellipse 100% 80% at center, black 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 100% 80% at center, black 30%, transparent 75%);
  transition: opacity .5s;
}
.shazam-scroll-row {
  white-space: nowrap;
  font-family: "Amiri Quran", "Amiri", serif;
  font-size: 32px; line-height: 2.2;
  color: var(--text); opacity: 0.055;
  direction: rtl;
  animation: shazam-scroll var(--dur, 28s) linear infinite;
  animation-delay: var(--delay, 0s);
}
.shazam-scroll-row:nth-child(even) {
  animation-direction: reverse;
  font-size: 28px;
}
@keyframes shazam-scroll {
  0% { transform: translateX(80%); }
  100% { transform: translateX(-80%); }
}

.shazam-status {
  font-size: 14px; color: var(--text-muted); text-align: center;
  margin: 0; font-weight: 300; line-height: 1.7;
  position: relative; z-index: 1;
}


/* ---- Microphone button ---- */
.shazam-btn-wrap {
  position: relative; width: 100px; height: 100px;
  display: flex; align-items: center; justify-content: center;
  z-index: 1;
}
.shazam-rings {
  position: absolute; inset: 0; pointer-events: none; opacity: 0;
  transition: opacity .4s;
}
.shazam-rings.active { opacity: 1; }
.shazam-ring {
  position: absolute; inset: 0; border-radius: 50%;
  border: 1px solid var(--accent);
  opacity: 0;
}
.shazam-rings.active .shazam-ring {
  animation: shazam-pulse 2.4s ease-out infinite;
}
.shazam-rings.active .shazam-ring:nth-child(2) { animation-delay: 1.2s; }
@keyframes shazam-pulse {
  0% { transform: scale(0.75); opacity: 0.5; }
  100% { transform: scale(1.4); opacity: 0; }
}
.shazam-btn {
  width: 68px; height: 68px; border-radius: 50%;
  border: 1px solid var(--btn-border);
  background: var(--overlay-bg);
  color: var(--text); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all .3s ease; position: relative; z-index: 1;
}
.shazam-btn:active { transform: scale(0.93); }
.shazam-btn.listening {
  border-color: var(--accent); color: var(--accent);
  box-shadow: 0 0 0 4px rgba(0,0,0,.06);
}
.shazam-btn.analyzing {
  border-color: var(--accent); color: var(--accent);
  animation: shazam-breathe 1.6s ease-in-out infinite;
}
@keyframes shazam-breathe {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0,0,0,.06); transform: scale(1); }
  50% { box-shadow: 0 0 0 8px rgba(0,0,0,.03); transform: scale(1.04); }
}

/* ---- Timer ---- */
.shazam-timer {
  font-size: 32px; font-weight: 200; color: var(--text);
  margin: 0; font-variant-numeric: tabular-nums;
  letter-spacing: 2px;
  position: relative; z-index: 1;
}

/* ---- Transcription preview ---- */
.shazam-transcript {
  text-align: center; font-size: 14px; color: var(--text-muted);
  margin: 4px 16px 0; padding: 10px 16px;
  background: var(--track); border-radius: 12px;
  line-height: 1.8; font-family: "Scheherazade New", serif;
  max-height: 70px; overflow-y: auto;
  max-width: 340px; width: 100%;
}

/* ---- Found animation (checkmark) ---- */
.shazam-found {
  display: flex; flex-direction: column; align-items: center;
  gap: 16px; position: relative; z-index: 1;
}
.shazam-found-circle {
  width: 72px; height: 72px;
}
.shazam-found-check {
  width: 72px; height: 72px; color: var(--accent);
}
/* Animations only play when .playing class is added via JS */
.shazam-found-check circle {
  stroke-dasharray: 152; stroke-dashoffset: 152;
}
.shazam-found-check-path {
  stroke-dasharray: 50; stroke-dashoffset: 50;
}
.shazam-found-text {
  font-size: 17px; font-weight: 600; color: var(--text);
  margin: 0; letter-spacing: 0.2px; opacity: 0;
}
.shazam-found.playing {
  animation: shazam-fadein .4s ease both;
}
.shazam-found.playing .shazam-found-check circle {
  animation: shazam-circle-draw .6s cubic-bezier(.65,0,.45,1) forwards;
}
.shazam-found.playing .shazam-found-check-path {
  animation: shazam-check-draw .4s cubic-bezier(.65,0,.45,1) .45s forwards;
}
.shazam-found.playing .shazam-found-text {
  animation: shazam-text-up .5s ease .7s both;
}
@keyframes shazam-circle-draw { to { stroke-dashoffset: 0; } }
@keyframes shazam-check-draw { to { stroke-dashoffset: 0; } }
@keyframes shazam-text-up {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---- Result card ---- */
.shazam-result {
  width: 100%; max-width: 360px;
  text-align: center; position: relative; z-index: 1;
  animation: shazam-card-in .6s cubic-bezier(.16,1,.3,1);
}
@keyframes shazam-fadein {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes shazam-card-in {
  from { opacity: 0; transform: translateY(30px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.shazam-result-surah-fr {
  font-size: 20px; font-weight: 700; color: var(--text);
  margin: 0 0 2px; line-height: 1.3;
}
.shazam-result-surah-ar {
  font-size: 15px; color: var(--text-muted);
  font-family: "Amiri Quran", "Amiri", serif;
  margin: 0 0 8px; line-height: 1.4;
  direction: rtl;
}
.shazam-result-meta {
  display: flex; align-items: center; justify-content: center;
  gap: 6px; margin-bottom: 16px;
}
.shazam-result-num {
  font-size: 12px; color: var(--text-faint);
  letter-spacing: 0.4px; font-weight: 500;
}
.shazam-result-dot { color: var(--text-faint); font-size: 10px; }
.shazam-result-pct {
  font-size: 12px; color: var(--text-faint); font-weight: 500;
  font-variant-numeric: tabular-nums;
}

/* ---- Verse navigation row ---- */
.shazam-result-verse-row {
  display: flex; align-items: center; justify-content: center;
  gap: 12px; margin-bottom: 16px;
}
.shazam-nav-btn {
  width: 32px; height: 32px; border-radius: 50%;
  border: 1px solid var(--btn-border); background: var(--track);
  color: var(--text-muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: border-color .2s, color .2s, transform .15s;
}
.shazam-nav-btn:active {
  border-color: var(--accent); color: var(--text);
  transform: scale(0.9);
}
.shazam-result-verse-num {
  font-size: 13px; color: var(--text-secondary); font-weight: 600;
  margin: 0; letter-spacing: 0.3px;
  min-width: 80px; text-align: center;
}

/* ---- Verse text (hero) ---- */
.shazam-result-verse-wrap {
  background: var(--track); border-radius: 20px;
  padding: 20px 16px 24px; margin-bottom: 16px;
  position: relative;
}
.shazam-result-text {
  font-size: 26px; line-height: 2.1; color: var(--text);
  font-family: "Amiri Quran", "Amiri", "Noto Naskh Arabic", "Traditional Arabic", serif;
  text-align: center; margin: 0;
  direction: rtl; word-spacing: 5px;
  max-height: 180px; overflow-y: auto;
  transition: opacity .15s ease, transform .15s ease;
}

/* ---- Action button (liquid glass) ---- */
.shazam-goto {
  width: 100%; padding: 15px 20px;
  border: 1px solid var(--btn-border);
  border-radius: 16px;
  background: var(--track);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  color: var(--text); font-size: 15px; font-weight: 600;
  cursor: pointer; transition: all .25s ease;
  letter-spacing: 0.2px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,.04), inset 0 1px 0 rgba(255,255,255,.06);
}
.shazam-goto svg { opacity: 0.4; transition: transform .25s ease, opacity .25s; }
.shazam-goto:active {
  transform: scale(0.97);
  box-shadow: 0 0 4px rgba(0,0,0,.06);
}
.shazam-goto:active svg { transform: translateX(3px); opacity: 0.7; }

.shazam-new {
  width: 100%; padding: 12px 20px;
  border: none; border-radius: 16px;
  background: transparent;
  color: var(--text-muted); font-size: 13px; font-weight: 500;
  cursor: pointer; transition: all .25s ease;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.shazam-new svg { opacity: 0.4; }
.shazam-new:active { transform: scale(0.97); color: var(--text); }

/* ---- Error state ---- */
.shazam-error {
  text-align: center; animation: shazam-fadein .4s ease;
}
.shazam-error p {
  font-size: 14px; color: var(--text-muted); margin: 0 0 16px;
}
.shazam-retry {
  padding: 12px 32px; border: 1.5px solid var(--btn-border);
  border-radius: 12px; background: none;
  color: var(--text); font-size: 14px; cursor: pointer;
  transition: border-color .2s, transform .15s; font-weight: 500;
}
.shazam-retry:active { border-color: var(--accent); transform: scale(0.97); }

/* Shazam within gradient overlay */
#shazam-overlay.moi-cat-overlay .shazam-status {
  color: rgba(255,255,255,0.35);
}
#shazam-overlay.moi-cat-overlay .shazam-btn {
  border-color: rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
  color: rgba(255,255,255,0.6);
}
#shazam-overlay.moi-cat-overlay .shazam-btn.listening,
#shazam-overlay.moi-cat-overlay .shazam-btn.analyzing {
  border-color: rgba(255,255,255,0.5);
  color: rgba(255,255,255,0.9);
  box-shadow: 0 0 24px rgba(255,255,255,0.12);
}
#shazam-overlay.moi-cat-overlay .shazam-ring {
  border-color: rgba(255,255,255,0.3);
}
#shazam-overlay.moi-cat-overlay .shazam-timer {
  color: rgba(255,255,255,0.8);
}
#shazam-overlay.moi-cat-overlay .shazam-scroll-row {
  color: rgba(255,255,255,1);
  opacity: 0.04;
}
#shazam-overlay.moi-cat-overlay .shazam-transcript {
  color: rgba(255,255,255,0.35);
}
#shazam-overlay.moi-cat-overlay .shazam-result-surah-fr {
  color: rgba(255,255,255,0.6);
  font-weight: 400;
}
#shazam-overlay.moi-cat-overlay .shazam-result-surah-ar {
  color: rgba(255,255,255,0.85);
}
#shazam-overlay.moi-cat-overlay .shazam-result-num,
#shazam-overlay.moi-cat-overlay .shazam-result-dot,
#shazam-overlay.moi-cat-overlay .shazam-result-pct {
  color: rgba(255,255,255,0.35);
}
#shazam-overlay.moi-cat-overlay .shazam-result-text {
  color: rgba(255,255,255,0.9);
}
#shazam-overlay.moi-cat-overlay .shazam-result-verse-wrap {
  background: rgba(255,255,255,0.06);
}
#shazam-overlay.moi-cat-overlay .shazam-result-verse-num {
  color: rgba(255,255,255,0.5);
}
#shazam-overlay.moi-cat-overlay .shazam-goto {
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.8);
  border-color: rgba(255,255,255,0.08);
}
#shazam-overlay.moi-cat-overlay .shazam-new {
  color: rgba(255,255,255,0.45);
}
#shazam-overlay.moi-cat-overlay .shazam-nav-btn {
  color: rgba(255,255,255,0.35);
  border-color: rgba(255,255,255,0.06);
  background: transparent;
}
#shazam-overlay.moi-cat-overlay .shazam-error p {
  color: rgba(255,255,255,0.5);
}
#shazam-overlay.moi-cat-overlay .shazam-retry {
  color: rgba(255,255,255,0.7);
  border-color: rgba(255,255,255,0.15);
}
#shazam-overlay.moi-cat-overlay .shazam-found-text {
  color: rgba(255,255,255,0.8);
}
#shazam-overlay.moi-cat-overlay .shazam-found-check {
  color: rgba(255,255,255,0.8);
}

/* ============================================
   TAB SYSTEM + DASHBOARD (Behold-style)
   ============================================ */

/* Tab panels */
.tab-panel { display: flex; flex-direction: column; min-height: 100%; }
.tab-panel.hidden { display: none !important; }

/* Dashboard — Behold gradient (slate blue-grey top → black bottom) */
.dashboard {
  flex: 1;
  background: transparent;
  color: #fff;
  padding: 0 28px;
  padding-top: env(safe-area-inset-top, 20px);
  font-family: -apple-system, 'Helvetica Neue', Helvetica, Arial, sans-serif;
  overflow-y: scroll;
  overflow-x: clip; /* prevent horizontal clipping of emotion wheel without creating scroll axis */
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
  position: absolute;
  inset: 0;
  padding-bottom: calc(70px + env(safe-area-inset-bottom, 0px) + 20px);
  touch-action: pan-y;
}

/* ---- Dashboard background: black with subtle glow ---- */
#dash-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: #000;
  pointer-events: none;
}
#dash-bg::after {
  content: '';
  position: absolute;
  top: -20%;
  left: 50%;
  transform: translateX(-50%);
  width: 120%;
  height: 60%;
  background: radial-gradient(ellipse at center, rgba(255,255,255,0.04) 0%, transparent 70%);
  pointer-events: none;
}

/* ---- Dynamic Ambient Glow (sun/moon) ---- */
.dash-ambient-glow {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  z-index: 0;
  transition: background 120s linear;
}

/* ---- Compact Prayer Bar ---- */
.dash-prayer-bar {
  padding-top: 28px;
  padding-bottom: 24px;
}

.dash-prayer-timeline {
  position: relative;
  height: 10px;
  margin-bottom: 18px;
}

/* The line behind dots — spans from first to last dot */
.dash-prayer-timeline::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0; right: 0;
  height: 1px;
  background: rgba(255,255,255,0.25);
  transform: translateY(-50%);
}

/* Right-half circle for ALL prayer positions */
.dash-timeline-dot {
  width: 5px; height: 10px;
  border-radius: 0 5px 5px 0;
  background: rgba(255,255,255,0.25);
  position: absolute;
  top: 0;
  z-index: 1;
}
/* Next upcoming prayer: brighter */
.dash-timeline-dot.next {
  background: rgba(255,255,255,0.55);
}
/* Past prayers: slightly brighter */
.dash-timeline-dot.past {
  background: rgba(255,255,255,0.45);
}
/* Left-half circle cursor */
.dash-timeline-cursor {
  position: absolute;
  width: 5px; height: 10px;
  border-radius: 5px 0 0 5px;
  background: #fff;
  top: 0;
  z-index: 2;
}

.dash-prayer-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dash-prayer-left { flex: 1; }

.dash-day-name {
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 1px;
  margin-bottom: 5px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.65);
}

.dash-prayer-countdown {
  font-size: 12px;
  font-weight: 500;
  color: rgba(255,255,255,0.9);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.dash-prayer-expand {
  background: none; border: none;
  color: rgba(255,255,255,0.5);
  padding: 8px;
  margin-left: auto;
  cursor: pointer;
  transition: color 0.2s;
}
.dash-prayer-expand:active { color: #fff; }
.dash-prayer-hint {
  font-size: 9px;
  font-weight: 400;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.85);
  text-transform: uppercase;
  font-family: system-ui, -apple-system, sans-serif;
  position: relative;
  top: -4px;
}
.dash-prayer-hint.hidden { display: none; }

/* ---- Dashboard Cards ---- */
.dash-card {
  padding: 0;
  margin-top: 40px;
}

.dash-card-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.dash-card-label {
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
}

.dash-card-label-chevron {
  color: rgba(255,255,255,0.25);
}

.dash-card-prompt {
  font-family: -apple-system, 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -1px;
  margin-bottom: 28px;
  color: #fff;
}

.dash-card-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.25);
  background: none;
  padding: 8px 16px;
  border-radius: 50px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.dash-card-btn:active {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.45);
}
.dash-btn-arrow {
  font-size: 16px;
  margin-left: 2px;
}

/* ---- 10 Dernières Nuits de Ramadan — card accent ---- */
.dash-ramadan-label {
  color: #C8962D !important;
}
.dash-ramadan-btn-row {
  display: flex;
  align-items: center;
  gap: 16px;
}
.dash-ramadan-countdown {
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  letter-spacing: 1px;
  color: #C8962D;
  white-space: nowrap;
  opacity: 0.7;
}

/* ---- Ramadan overlay background ---- */
#ramadan-overlay {
  background: linear-gradient(165deg, #100c1a 0%, #0c0914 30%, #090711 60%, #07050e 100%);
}
.ramadan-hero {
  background: radial-gradient(ellipse 100% 60% at 50% 0%, rgba(200,150,45,0.08) 0%, transparent 70%);
}
#ramadan-overlay .emotion-entry-badge {
  color: rgba(212, 160, 48, 0.9);
  background: rgba(212, 160, 48, 0.1);
}
.ramadan-scholar-note {
  margin: 2px 0 0;
  padding: 24px 20px 32px;
  background: rgba(200, 150, 45, 0.06);
  border-top: 1px solid rgba(200, 150, 45, 0.15);
}
.ramadan-scholar-label {
  display: block;
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  letter-spacing: 1.5px;
  color: rgba(200, 150, 45, 0.7);
  margin-bottom: 12px;
}
.ramadan-scholar-text {
  font-size: 14px;
  line-height: 1.75;
  color: rgba(255,255,255,0.72);
  margin: 0;
}
.ramadan-scholar-text strong {
  color: rgba(212, 160, 48, 0.9);
  font-weight: 600;
}

/* ---- Sourate du jour: button row + remaining count ---- */
.dash-surat-btn-row {
  display: flex;
  align-items: center;
  gap: 16px;
}
.dash-surat-remaining {
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  letter-spacing: 1px;
  color: rgba(255,255,255,0.45);
  text-transform: uppercase;
  white-space: nowrap;
}
/* Sourate du jour: progress bar (thin line) */
.dash-surat-progress-line {
  height: 1px;
  background: rgba(255,255,255,0.08);
  margin: 40px 0;
  position: relative;
  border-radius: 1px;
  overflow: hidden;
}
.dash-surat-progress-fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  background: linear-gradient(90deg, #34d399, #6ee7b7);
  border-radius: 1px;
  width: 0%;
  transition: width 1.2s ease;
}

/* ---- Thin Separator ---- */
.dash-thin-line {
  height: 1px;
  background: rgba(255,255,255,0.1);
  margin: 40px 0;
}
.dash-khatm-progress-line {
  height: 1px;
  background: rgba(255,255,255,0.08);
  margin: 40px 0;
  position: relative;
  border-radius: 1px;
  overflow: hidden;
}
.dash-khatm-progress-fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  background: linear-gradient(90deg, #c9a84c, #e8c96a);
  border-radius: 1px;
  width: 0%;
  transition: width 1.2s ease;
}

/* ---- Dashboard Stats Section ---- */
.dash-stats-section {
  cursor: pointer;
}
.dash-stats-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.dash-stats-title {
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
}
.dash-stats-header > svg {
  color: rgba(255,255,255,0.3);
  flex-shrink: 0;
}
.dash-stats-row {
  display: flex;
  align-items: flex-start;
  gap: 0;
}
.dash-stat-block {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}
.dash-stat-value {
  font-family: 'Space Mono', monospace;
  font-size: 32px;
  font-weight: 400;
  color: #fff;
  letter-spacing: -1px;
}
.dash-stat-value--gold {
  color: #fff;
}
.dash-stat-label {
  font-family: 'Space Mono', monospace;
  font-size: 9px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
}
.dash-stat-divider {
  width: 1px;
  height: 36px;
  background: rgba(255,255,255,0.1);
  flex-shrink: 0;
  margin: 4px 20px 0;
}
.dash-stats-progress-fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  background: linear-gradient(90deg, #c9a84c, #e8c96a);
  border-radius: 1px;
  width: 0%;
  transition: width 1.2s ease;
}

/* ---- Reading / Khatm card ---- */
.dash-verse-section {
  cursor: pointer;
}
.dash-khatm-label {
  display: block;
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
  margin-bottom: 10px;
}
.dash-verse-row {
  display: flex;
  align-items: center;
  gap: 14px;
}
.dash-khatm-thumb {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
  background-color: rgba(255,255,255,0.08);
  overflow: hidden;
}
.dash-verse-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.dash-verse-title {
  font-family: -apple-system, 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 20px;
  font-weight: 400;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dash-verse-section > svg {
  display: none;
}
.dash-verse-row > svg {
  color: rgba(255,255,255,0.3);
  flex-shrink: 0;
}
.dash-verse-subtitle {
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---- Emotion Wheel ---- */
.dash-emotion {
  margin-top: 10px;
  text-align: center;
  padding-bottom: 0;
}
.dash-emotion-question {
  font-family: -apple-system, 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 17px;
  font-weight: 300;
  color: rgba(255,255,255,0.45);
  margin-bottom: 16px;
}
.dash-emotion-selected {
  font-family: -apple-system, 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 42px;
  font-weight: 700;
  color: #fff;
  margin-bottom: -40px;
}
/* Radial container — full viewport width, hub at 280px from top */
.dash-emotion-radial {
  position: relative;
  height: 340px;
  width: 100vw;
  margin-left: calc(-50vw + 50%);
}

/* Wheel: full-size touch layer, words rendered inside */
.dash-emotion-wheel {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  touch-action: pan-x;
}

/* Each word radiates from the hub (280px, 50%) */
.dash-emotion-word {
  position: absolute;
  top: 273px; /* hub(280) - half line-height(~7) */
  left: 50%;
  transform-origin: 0% 50%;
  font-family: -apple-system, 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 14px;
  font-weight: 300;
  color: #fff;
  letter-spacing: 0.5px;
  white-space: nowrap;
  pointer-events: auto;
  cursor: pointer;
  line-height: 1;
  will-change: transform, opacity;
}
/* Spoke line before each word */
.dash-emotion-word::before {
  content: '';
  display: inline-block;
  width: 35px;
  height: 1px;
  background: currentColor;
  vertical-align: middle;
  margin-right: 8px;
}
/* + button: centered exactly at the hub point */
.dash-emotion-plus {
  position: absolute;
  top: 258px; /* hub(280) - half-btn(22) */
  left: 50%;
  transform: translateX(-50%);
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.25);
  background: transparent;
  color: #fff;
  font-size: 22px;
  font-weight: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 3;
  transition: border-color 0.2s, background 0.2s;
}
.dash-emotion-plus:active {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.5);
}

/* Stem: short line going DOWN from the + button */
.dash-emotion-stem {
  position: absolute;
  top: 302px; /* hub(280) + half-btn(22) */
  left: 50%;
  transform: translateX(-50%);
  width: 1px;
  height: 25px;
  background: rgba(255,255,255,0.25);
  z-index: 2;
}

/* ============================================
   TAB BAR (text only, Behold-style)
   ============================================ */
.tab-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 50;
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 16px 0 12px;
  padding-bottom: max(12px, env(safe-area-inset-bottom));
  background: rgba(18,18,20,0.95);
  backdrop-filter: blur(30px) saturate(1.5);
  -webkit-backdrop-filter: blur(30px) saturate(1.5);
  border-top: 1px solid rgba(255,255,255,0.06);
  font-family: 'Space Mono', monospace;
}

.tab-bar-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  position: relative;
}

.tab-bar-label {
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  letter-spacing: 1.5px;
  color: rgba(255,255,255,0.35);
  transition: color 0.2s;
}

/* Active state */
.tab-bar-btn.active .tab-bar-label {
  color: #fff;
}

/* Active dot */
.tab-bar-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: transparent;
  transition: background 0.2s;
}
.tab-bar-btn.active .tab-bar-dot {
  background: #fff;
}

/* Center triangle button */
.tab-bar-center {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.7);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  margin: -10px 0;
  flex-shrink: 0;
}
.tab-bar-center:active { opacity: 0.5; }
.tab-bar-center.min-pulse {
  animation: minPulse 2.4s ease-in-out infinite;
}

/* Placeholder tab */
.tab-placeholder {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-bottom: 80px;
  color: var(--text-secondary);
  font-family: 'Space Mono', monospace;
}
.tab-placeholder-icon { font-size: 48px; margin-bottom: 12px; }
.tab-placeholder-text { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.tab-placeholder-sub { font-size: 12px; opacity: 0.5; letter-spacing: 1px; }

/* Hide tab bar when overlays are open */
.tab-bar.tab-bar-hidden { display: none; }

/* Night theme: tab bar stays dark regardless */
body[data-theme="nuit"] .tab-bar { background: rgba(18,18,20,0.95); }

/* Adjust bottom padding for Coran tab when tab bar is present */
#tab-coran .progress-section {
  padding-bottom: calc(16px + 70px);
}

/* ---- IPAD / TABLET RESPONSIVE ---- */
@media (min-width: 768px) {
  /* Header */
  .header {
    padding-left: 32px; padding-right: 32px;
  }
  .header-title {
    font-size: 13px; letter-spacing: 4px;
  }

  /* Verse viewer */
  .ayah-container {
    padding: 0 48px;
  }
  .ayah-ref {
    font-size: 14px;
  }
  .ayah-text.size-S { font-size: 32px; line-height: 2.0; }
  .ayah-text.size-M { font-size: 42px; line-height: 2.2; }
  .ayah-text.size-L { font-size: 54px; line-height: 2.4; }
  .size-S .ayah-french { font-size: 17px; }
  .size-M .ayah-french { font-size: 19px; }
  .size-L .ayah-french { font-size: 22px; }

  /* Navigation bar */
  .nav-arrows {
    max-width: 500px;
    margin: 0 auto 16px;
  }
  .nav-btn {
    padding: 12px 24px;
  }
  .nav-btn svg {
    width: 28px; height: 28px;
  }

  /* Progress */
  .progress-section {
    max-width: 500px;
    padding-bottom: 32px;
  }
  .progress-labels {
    font-size: 12px;
  }

  /* Overlays */
  .overlay-body {
    padding: 32px 48px;
    max-width: 700px;
    margin: 0 auto;
    width: 100%;
  }
  .overlay-header {
    padding: 20px 48px;
  }
  .overlay-header h2 {
    font-size: 14px;
  }

  /* Settings */
  .setting-label {
    font-size: 12px;
  }

  /* Surah list */
  .surah-list-item {
    padding: 14px 8px;
  }

  /* Listen */
  .listen-surah-item {
    padding: 14px 8px;
  }

  /* Prayer times */
  .prayer-card {
    max-width: 500px;
    margin-left: auto; margin-right: auto;
  }

  /* Hifz */
  #hifz-content { padding: 20px 40px; }
  #hifz-words { font-size: 38px; }

  /* Shazam */
  .shazam-content {
    max-width: 500px;
    margin: 0 auto;
  }

  /* Qibla */
  .qibla-compass {
    max-width: 350px;
    margin: 0 auto;
  }

  /* Splash */
  .splash-content {
    max-width: 600px;
  }
  .splash-verse {
    font-size: 42px;
    white-space: nowrap;
  }
  .splash-translation {
    font-size: 17px; margin-top: 28px;
  }
  .splash-ref {
    font-size: 12px;
  }
  .splash-logo {
    font-size: 15px; letter-spacing: 8px;
  }
  .splash-bar-wrap {
    width: 160px;
  }

  /* Help / About */
  .help-section, .about-section {
    max-width: 600px;
    margin-left: auto; margin-right: auto;
  }

  /* Bookmarks */
  .folder-section {
    max-width: 600px;
    margin-left: auto; margin-right: auto;
  }

  /* Stats */
  .stats-section {
    max-width: 600px;
    margin-left: auto; margin-right: auto;
  }

  /* Menu */
  .menu-items {
    max-width: 500px;
    margin: 0 auto;
  }
  .menu-item {
    font-size: 17px;
    padding: 13px 14px;
    gap: 16px;
  }
  .menu-item-label {
    font-size: 17px;
  }
  .menu-item-icon {
    width: 38px;
    height: 38px;
  }

  /* ---- SETTINGS (iPad) ---- */
  .setting-label {
    font-size: 14px;
    margin-bottom: 12px;
  }
  .setting-value {
    font-size: 22px;
  }
  .setting-btn {
    font-size: 14px;
    padding: 10px 20px;
  }
  .setting-buttons {
    gap: 10px;
  }
  .reminder-note {
    font-size: 12px;
  }
  .settings-section-title {
    font-size: 12px;
  }

  /* ---- PRAYER TIMES (iPad) ---- */
  .prayer-date-gregorian { font-size: 17px; }
  .prayer-date-hijri { font-size: 12px; }
  .prayer-time-col-name { font-size: 13px; }
  .prayer-time-col-time { font-size: 15px; }
  .prayer-countdown-name { font-size: 34px; }
  .prayer-countdown-time { font-size: 16px; }
  .prayer-bottom-btn { font-size: 12px; }
  .prayer-bottom-location { font-size: 14px; }
  .prayer-date-gregorian { font-size: 18px; }
  .prayer-countdown-name { font-size: 36px; }
  .prayer-search-input { font-size: 16px; padding: 12px 16px; }
  .prayer-search-item { font-size: 16px; padding: 14px 18px; }

  /* ---- HIFZ / MEMORISATION (iPad) ---- */
  .hifz-surah-select {
    font-size: 16px;
    padding: 12px 18px;
  }
  .hifz-words {
    font-size: 34px;
  }
  .hifz-words.size-S { font-size: 26px; }
  .hifz-words.size-M { font-size: 34px; }
  .hifz-words.size-L { font-size: 42px; }

  /* ---- AUDIO / LISTEN (iPad) ---- */
  .listen-reciter-select {
    font-size: 17px;
    padding: 12px 16px;
  }
  .listen-surah-item {
    padding: 16px 20px;
    gap: 14px;
  }
  .listen-surah-fr {
    font-size: 17px;
  }
  .listen-surah-ar {
    font-size: 16px;
  }
  .listen-player-surah-ar {
    font-size: 24px;
  }

  /* ---- STATS (iPad) ---- */
  .stats-grid {
    gap: 16px;
  }
  .stat-card {
    padding: 32px 16px 26px;
    border-radius: 20px;
  }
  .stat-value {
    font-size: 36px;
  }
  .stat-label {
    font-size: 13px;
  }

  /* ---- BOOKMARKS (iPad) ---- */
  .bookmark-item {
    padding: 16px 0;
  }
  .bookmark-item-text {
    font-size: 24px;
  }
  .folder-section-header {
    font-size: 14px;
  }
  .bookmarks-empty {
    font-size: 15px;
  }

  /* ---- HELP / ABOUT (iPad) ---- */
  .help-title {
    font-size: 16px;
  }
  .help-text {
    font-size: 15px;
  }
  .about-body p {
    font-size: 16px;
  }
  .about-body .sub-label {
    font-size: 12px;
  }

  /* ---- DASHBOARD (iPad) ---- */
  .dashboard {
    padding-left: 10%;
    padding-right: 10%;
  }
  .dash-prayer-bar { padding-top: 36px; padding-bottom: 32px; }
  .dash-day-name { font-size: 12px; letter-spacing: 1.5px; }
  .dash-prayer-countdown { font-size: 14px; letter-spacing: 1.2px; }
  .dash-card { margin-top: 48px; }
  .dash-card-label { font-size: 12px; letter-spacing: 3px; }
  .dash-card-prompt { font-size: 34px; margin-bottom: 32px; }
  .dash-card-btn { font-size: 12px; padding: 16px 36px; letter-spacing: 2px; }
  .dash-thin-line { margin: 48px 0; }
  .dash-surat-progress-line { margin: 48px 0; }
  .dash-khatm-label { font-size: 12px; letter-spacing: 2.5px; }
  .dash-khatm-thumb { width: 64px; height: 64px; border-radius: 10px; }
  .dash-verse-title { font-size: 24px; }
  .dash-verse-subtitle { font-size: 11px; letter-spacing: 2px; }
  .dash-stat-value { font-size: 40px; }
  .dash-stat-label { font-size: 10px; letter-spacing: 2.5px; }
  .dash-stats-title { font-size: 12px; letter-spacing: 2.5px; }
  .dash-verse-row { gap: 18px; }
  .dash-emotion-question { font-size: 20px; }
  .dash-emotion-selected { font-size: 52px; }
  .dash-emotion-word { font-size: 16px; }

  /* ---- TAB BAR (iPad) ---- */
  .tab-bar {
    padding: 18px 0 14px;
  }
  .tab-bar-label { font-size: 12px; letter-spacing: 2px; }

  /* ---- KHATM LANDING (iPad) ---- */
  #khatm-hero { height: 400px; }
  #khatm-hero-content { padding-left: 48px; padding-right: 48px; }
  #khatm-hero-content h1 { font-size: 2.6rem; }
  .kh-hero-title { font-size: 30px !important; }
  #khatm-hero-content p { font-size: 1rem; }
  #khatm-hero-btn { font-size: 12px; padding: 16px 36px; letter-spacing: 2px; }
}

/* ============================================
   EMOTION DETAIL OVERLAY (Behold-style)
   ============================================ */

/* Override default glass overlay — uses solid gradient background set via JS */
.emotion-overlay-bg {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  overflow: hidden !important;
  padding-top: 0 !important;
}

/* Floating back button (emotion + dua overlays) */
.float-back-fab {
  position: fixed;
  bottom: 28px; left: 50%;
  transform: translateX(-50%) translateY(16px);
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(16px) saturate(1.5);
  -webkit-backdrop-filter: blur(16px) saturate(1.5);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 50px;
  padding: 10px 18px;
  color: rgba(255,255,255,0.9);
  cursor: pointer; z-index: 9999;
  display: flex; align-items: center; gap: 6px;
}
.float-back-fab.visible {
  opacity: 1; pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

/* Scrollable container */
.emotion-overlay-scroll {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

/* HERO — full viewport, centered content */
.emotion-hero {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 32px;
  position: relative;
}

/* Top bar — pinned in hero */
.emotion-top-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: calc(16px + env(safe-area-inset-top, 0px)) 20px 12px;
  z-index: 10;
}
.emotion-back-btn,
.emotion-share-btn {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  padding: 10px;
  cursor: pointer;
  transition: color 0.2s;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.emotion-back-btn:active,
.emotion-share-btn:active {
  color: #fff;
  background: rgba(255,255,255,0.08);
}

/* Big emotion title */
.emotion-title {
  font-family: -apple-system, 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 46px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.5px;
  margin: 0 0 40px;
  text-align: center;
}

/* Quote below title */
.emotion-quote {
  font-family: -apple-system, 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 16px;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.50);
  text-align: center;
  max-width: 300px;
  line-height: 1.65;
  margin: 0;
}

/* ACTIONS SECTIONS */
.emotion-actions {
  padding: 48px 28px 24px;
}
.emotion-section {
  margin-bottom: 32px;
}
.emotion-section-divider {
  height: 1px;
  background: rgba(255,255,255,0.10);
  margin-bottom: 20px;
}
.emotion-section-label {
  font-family: "Space Mono", monospace;
  font-size: 11px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.35);
  letter-spacing: 3px;
  text-transform: uppercase;
  margin: 0 0 16px;
}
.emotion-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.emotion-list li {
  font-family: -apple-system, 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 15px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.75);
  line-height: 1.5;
  padding: 14px 0;
}

/* ARTICLE SECTION — darker background */
.emotion-article {
  padding: 48px 28px calc(48px + env(safe-area-inset-bottom, 0px));
}
.emotion-article-title {
  font-family: -apple-system, 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 28px;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 36px;
}
/* Each entry block (verset or hadith) */
.emotion-entry {
  margin-bottom: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.emotion-entry:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}
.emotion-entry-badge {
  font-family: "Space Mono", monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 4px;
  display: inline-block;
  margin-bottom: 20px;
}
.emotion-entry-badge.verset {
  color: rgba(180,210,255,0.8);
  background: rgba(180,210,255,0.08);
}
.emotion-entry-badge.hadith {
  color: rgba(255,210,150,0.8);
  background: rgba(255,210,150,0.08);
}
.emotion-entry-badge.dua {
  color: rgba(150,220,180,0.8);
  background: rgba(150,220,180,0.08);
}
.emotion-entry-ar {
  font-family: "Amiri Quran", "Amiri", serif;
  font-size: 24px;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.8;
  text-align: right;
  margin: 0 0 14px;
}
.emotion-entry-ph {
  font-family: -apple-system, 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 13px;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.35);
  line-height: 1.6;
  margin: 0 0 14px;
  font-style: italic;
  letter-spacing: 0.2px;
}
.emotion-entry-fr {
  font-family: -apple-system, 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 15px;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.55);
  line-height: 1.65;
  margin: 0 0 10px;
  font-style: italic;
}
.emotion-entry-ref {
  font-family: "Space Mono", monospace;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.28);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  display: block;
  margin-bottom: 16px;
}
.emotion-entry-commentary {
  font-family: -apple-system, 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 14px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.55);
  line-height: 1.7;
  margin: 0;
}

/* iPad responsive — emotion / invocation overlays */
@media (min-width: 768px) {
  .emotion-title { font-size: 64px; }
  .emotion-quote { font-size: 18px; max-width: 440px; }
  .emotion-actions {
    padding: 60px 10% 40px;
  }
  .emotion-article {
    padding: 60px 10%;
  }
  .emotion-section-label { font-size: 12px; letter-spacing: 3.5px; }
  .emotion-list li { font-size: 17px; padding: 16px 0; }
  .emotion-article-title { font-size: 32px; }
  .emotion-entry-ar { font-size: 30px; }
  .emotion-entry-fr { font-size: 16px; }
  .emotion-entry-ph { font-size: 14px; }
  .emotion-entry-commentary { font-size: 15px; }
  .emotion-entry-ref { font-size: 11px; }
  .emotion-entry { margin-bottom: 48px; padding-bottom: 48px; }
}
@media (min-width: 1024px) {
  .emotion-actions { padding: 60px 12% 40px; }
  .emotion-article { padding: 60px 12%; }
}

/* ---- DU'A ENTRY HEADER + PLAY BUTTON ---- */
.dua-entry-header {
  display: flex; align-items: center;
  justify-content: space-between; margin-bottom: 20px;
}
.dua-entry-header .emotion-entry-badge { margin-bottom: 0; }
.dua-play-btn {
  width: 40px; height: 40px; border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.85);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: border-color .2s, background .2s;
  flex-shrink: 0; padding: 0;
  -webkit-tap-highlight-color: transparent;
}
.dua-play-btn:active {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.4);
}
.dua-play-btn.dua-playing {
  border-color: rgba(255,255,255,0.45);
  background: rgba(255,255,255,0.1);
}
.dua-play-btn svg { width: 20px; height: 20px; }

/* ---- DU'A TAB ---- */
#tab-invocation {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.dua-tab-scroll {
  padding: 0 0 200px;
  min-height: 100%;
}

/* DU'A HERO */
#dua-hero {
  position: relative;
  height: 260px;
  flex-shrink: 0;
  overflow: hidden;
}
#dua-hero-bg {
  position: absolute;
  inset: 0;
  background-image: url('img/prayer/22.jpg');
  background-size: cover;
  background-position: center 30%;
  filter: brightness(0.62);
  transform: scale(1.04);
  transition: background-image 0.4s ease;
}
#dua-hero-fade {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 160px;
  background: linear-gradient(to bottom, transparent, #000);
}
#dua-hero-content {
  position: relative;
  z-index: 2;
  padding: calc(52px + env(safe-area-inset-top)) 24px 28px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  height: 100%;
}
.dua-tab-title {
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 32px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.95);
  margin: 0 0 6px;
}
.dua-tab-subtitle {
  font-family: "Space Mono", monospace;
  font-size: 11px;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.5);
  margin: 0;
}
.dua-grid {
  display: flex;
  flex-direction: column;
  padding: 8px 20px 100px;
}
.dua-card {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px 0;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: opacity 0.15s;
}
.dua-card:first-child {
  border-top: 1px solid rgba(255,255,255,0.07);
}
.dua-card:active {
  opacity: 0.5;
}
.dua-card-num {
  font-family: "Space Mono", monospace;
  font-size: 20px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.22);
  width: 44px;
  flex-shrink: 0;
  text-align: left;
  letter-spacing: 0px;
  display: block;
  margin-bottom: 0;
}
.dua-card-body {
  flex: 1;
  min-width: 0;
}
.dua-card-name {
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  margin: 0 0 4px;
  line-height: 1.2;
}
.dua-card-count {
  font-family: "Space Mono", monospace;
  font-size: 10px;
  letter-spacing: 1.5px;
  color: rgba(255, 255, 255, 0.38);
  margin: 0;
}
.dua-card-arrow {
  color: rgba(255, 255, 255, 0.18);
  flex-shrink: 0;
  display: flex;
  align-items: center;
}
/* ---- DU'A iPad override (must come after base styles) ---- */
@media (min-width: 768px) {
  .dua-grid {
    max-width: 640px;
    margin: 0 auto;
    padding: 16px 32px 100px;
  }
  .dua-card { padding: 24px 0; gap: 24px; }
  .dua-card-num { font-size: 22px; width: 50px; }
  .dua-card-name { font-size: 18px; }
  .dua-card-count { font-size: 11px; }
  #dua-hero { height: 320px; }
  #dua-hero-content { padding-left: 48px; padding-right: 48px; }
  .dua-tab-title { font-size: 42px; }
  .dua-tab-subtitle { font-size: 12px; letter-spacing: 1.5px; }
}
@media (min-width: 1024px) {
  .dua-grid { max-width: 720px; padding: 16px 40px 100px; }
  #dua-hero { height: 360px; }
  #dua-hero-content { padding-left: 60px; padding-right: 60px; }
  .dua-tab-title { font-size: 48px; }
}
/* Du'a overlay — reuses emotion overlay classes */
.dua-overlay-scroll {
  scroll-behavior: smooth;
}
/* ---- Scroll hint arrow ---- */
.dua-scroll-hint {
  position: fixed;
  bottom: calc(28px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: none;
  border: none;
  color: rgba(255,255,255,0.6);
  cursor: pointer;
  padding: 8px;
  -webkit-tap-highlight-color: transparent;
  animation: dua-hint-bounce 1.6s ease-in-out infinite,
             dua-hint-in 0.5s ease 0.9s both;
  transition: opacity 0.3s ease;
}
.dua-scroll-hint.hidden {
  opacity: 0;
  pointer-events: none;
  animation: none;
}
@keyframes dua-hint-bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%       { transform: translateX(-50%) translateY(7px); }
}
@keyframes dua-hint-in {
  from { opacity: 0; transform: translateX(-50%) translateY(12px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ===== DUA CONTACT OVERLAY ===== */
#dua-contact-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: #0a0812;
  overflow: hidden;
}
.dua-contact-bg {
  position: absolute;
  inset: -24px;
  background-size: cover;
  background-position: center;
  filter: brightness(0.38) blur(14px);
  z-index: 0;
}
.dua-contact-scroll {
  position: relative;
  z-index: 1;
  height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 40px);
}
.dua-contact-hero {
  position: relative;
  background: linear-gradient(to bottom, rgba(0,0,0,0.15) 0%, transparent 100%);
  padding: calc(54px + env(safe-area-inset-top, 0px)) 28px 40px;
}
.dua-contact-title {
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 34px;
  font-weight: 700;
  color: rgba(255,255,255,0.95);
  margin: 16px 0 10px;
  letter-spacing: -0.5px;
  line-height: 1.1;
}
.dua-contact-subtitle {
  font-family: "Space Mono", monospace;
  font-size: 11px;
  letter-spacing: 2px;
  color: rgba(255,255,255,0.38);
  margin: 0;
  text-transform: uppercase;
}
.dua-contact-form-wrap {
  padding: 32px 24px 48px;
}
.dua-contact-field {
  margin-bottom: 24px;
}
.dua-contact-label {
  display: block;
  font-family: "Space Mono", monospace;
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
  margin-bottom: 10px;
}
.dua-contact-input,
.dua-contact-textarea,
.dua-contact-select {
  width: 100%;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 14px 16px;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 15px;
  color: rgba(255,255,255,0.9);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  box-sizing: border-box;
  transition: border-color 0.2s, background 0.2s;
}
.dua-contact-input::placeholder,
.dua-contact-textarea::placeholder {
  color: rgba(255,255,255,0.2);
}
.dua-contact-input:focus,
.dua-contact-textarea:focus,
.dua-contact-select:focus {
  border-color: rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.07);
}
.dua-contact-textarea {
  resize: none;
  min-height: 120px;
  line-height: 1.6;
}
.dua-contact-select-wrap {
  position: relative;
}
.dua-contact-select {
  padding-right: 40px;
  cursor: pointer;
}
.dua-contact-select option {
  background: #1a1428;
  color: rgba(255,255,255,0.9);
}
.dua-contact-select-arrow {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255,255,255,0.35);
  pointer-events: none;
}
.dua-contact-error {
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 13px;
  color: rgba(255,100,100,0.9);
  margin-bottom: 16px;
  padding: 10px 14px;
  background: rgba(255,60,60,0.08);
  border: 1px solid rgba(255,60,60,0.15);
  border-radius: 10px;
}
.dua-contact-chips {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  margin-bottom: 12px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 2px;
}
.dua-contact-chips::-webkit-scrollbar { display: none; }
.dc-chip {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 20px;
  padding: 6px 13px;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 12px;
  color: rgba(255,255,255,0.65);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
}
.dc-chip:active,
.dc-chip.active {
  background: rgba(255,255,255,0.16);
  border-color: rgba(255,255,255,0.35);
  color: rgba(255,255,255,0.95);
}
.dua-contact-submit {
  width: 100%;
  padding: 16px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 14px;
  font-family: "Space Mono", monospace;
  font-size: 12px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.88);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, opacity 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.dua-contact-submit:active:not(:disabled) {
  background: rgba(255,255,255,0.14);
}
.dua-contact-submit:disabled {
  opacity: 0.45;
  cursor: default;
}
.dua-contact-success {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 24px 20px 12px;
  text-align: center;
}
.dua-contact-success-main {
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 18px;
  font-weight: 600;
  color: rgba(255,255,255,0.9);
  margin: 0;
}
.dua-contact-success-sub {
  font-family: "Space Mono", monospace;
  font-size: 10px;
  letter-spacing: 1px;
  color: rgba(255,255,255,0.35);
  margin: 0;
  line-height: 1.7;
}
@media (min-width: 768px) {
  .dua-contact-title { font-size: 42px; }
  .dua-contact-hero { padding-left: 48px; padding-right: 48px; }
  .dua-contact-form-wrap { max-width: 540px; margin: 0 auto; }
  .dua-contact-submit { max-width: 540px; margin: 0 auto; display: block; }
}

/* ===== MINI PLAYER ===== */
#sp-mini {
  position: fixed;
  bottom: 68px; /* above tab bar */
  left: 12px;
  right: 12px;
  height: 62px;
  background: rgba(28,28,30,0.96);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 14px;
  display: flex;
  align-items: center;
  gap: 0;
  z-index: 850;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0,0,0,0.5);
  cursor: pointer;
}
#sp-mini.hidden { display: none !important; }
#sp-mini-bg {
  width: 54px;
  height: 62px;
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
  filter: brightness(0.7);
}
#sp-mini-info {
  flex: 1;
  padding: 0 12px;
  min-width: 0;
}
#sp-mini-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}
#sp-mini-sub {
  font-family: 'Space Mono', monospace;
  font-size: 0.58rem;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.4);
}
#sp-mini-pp, #sp-mini-close-btn {
  background: none;
  border: none;
  color: #fff;
  padding: 14px 14px;
  cursor: pointer;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}
#sp-mini-close-btn { color: rgba(255,255,255,0.45); }

/* ============================================================
   KHATM LANDING
   ============================================================ */
#khatm-landing {
  display: flex;
  flex-direction: column;
  position: absolute;
  inset: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: #000;
  z-index: 1;
}
#coran-classic-wrap { display: none; }
#khatm-hero {
  position: relative;
  height: 340px;
  flex-shrink: 0;
  overflow: hidden;
}
#khatm-hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: brightness(0.65);
  transform: scale(1.04);
}
#khatm-hero-fade {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 180px;
  background: linear-gradient(to bottom, transparent, #000);
}

#khatm-hero-line {
  height: 1px;
  background: rgba(255,255,255,0.1);
  margin: 0;
}
/* ---- Séparateur Lecture libre ---- */
.khatm-section-divider {
  position: relative;
  padding: 20px 24px 16px;
  background: linear-gradient(180deg, #0f0d08 0%, #0a0a0a 100%);
  flex-shrink: 0;
}
.khatm-section-divider::before {
  content: '';
  position: absolute;
  left: 50%; top: -20px;
  transform: translateX(-50%);
  width: 280px; height: 100px;
  background: radial-gradient(ellipse, rgba(201,168,76,0.12) 0%, transparent 70%);
  pointer-events: none;
}
.khatm-section-line {
  position: relative;
  height: 1px;
  background: linear-gradient(90deg, transparent, #c9a84c, #e8c96a, #c9a84c, transparent);
  margin-bottom: 20px;
  opacity: 0.8;
}
.khatm-section-header {
  padding-bottom: 4px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.khatm-section-chevron { flex-shrink: 0; }
.khatm-section-title {
  display: block;
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  letter-spacing: 2.5px;
  color: rgba(255,255,255,0.9);
  margin-bottom: 8px;
}
.khatm-section-desc {
  font-family: 'Space Mono', monospace;
  font-size: 9px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
  margin: 0 0 4px;
  line-height: 1.6;
}
#khatm-hero-content {
  position: relative;
  z-index: 2;
  padding: 52px 24px 28px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  height: 100%;
}
#khatm-hero-content h1 {
  font-size: 2.1rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.15;
  margin: 0 0 10px;
}
.kh-hero-title {
  font-size: 26px !important;
  font-weight: 700 !important;
  color: rgba(255, 255, 255, 0.95);
  letter-spacing: -0.3px;
  white-space: nowrap;
}
#kh-search-btn {
  position: absolute;
  top: 52px;
  right: 24px;
  z-index: 3;
  background: rgba(255,255,255,0.12);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
#khatm-hero-content p {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.65);
  margin: 0 0 22px;
  line-height: 1.45;
}
#khatm-hero-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
#khatm-hero-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: none;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 50px;
  padding: 14px 30px;
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  letter-spacing: 1.5px;
  cursor: pointer;
  font-weight: 400;
  text-transform: uppercase;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.2s, background 0.2s;
}
#khatm-hero-btn:active {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.45);
}
/* ---- Active khatm header (title + ··· inline) ---- */
#kh-active-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
#kh-active-header #kh-days-title {
  font-family: system-ui, -apple-system, sans-serif;
  color: rgba(255,255,255,0.95);
  margin: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
#kh-active-header #kh-days-title .kh-days-num {
  font-size: 52px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -2px;
}
#kh-active-header #kh-days-title .kh-days-label {
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 2px;
  color: rgba(255,255,255,0.55);
  font-family: 'Space Mono', monospace;
}
#khatm-hero-menu {
  display: none;
  background: none;
  color: rgba(255,255,255,0.75);
  border: none;
  padding: 4px 0 4px 8px;
  font-size: 1.4rem;
  cursor: pointer;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
  letter-spacing: 0.12em;
  line-height: 1;
}
#khatm-hero-menu.visible { display: block; }

/* ---- iOS-style dropdown (fixed to avoid overflow:hidden clip from hero) ---- */
#khatm-hero-dropdown {
  display: none;
  position: fixed;
  top: 220px; /* overridden by JS */
  left: 20px;
  min-width: 190px;
  background: rgba(30,30,32,0.95);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 16px;
  overflow: hidden;
  z-index: 200;
  box-shadow: 0 8px 32px rgba(0,0,0,0.55);
}
#khatm-hero-dropdown.visible { display: block; }
#kh-history-btn, #khatm-reset-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  background: none;
  border: none;
  color: #fff;
  font-size: 1rem;
  padding: 16px 18px;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
#kh-history-btn svg { opacity: 0.85; }
#khatm-reset-btn span { color: #fff; }
#khatm-reset-btn svg { flex-shrink: 0; stroke: #fff; }
.kh-menu-sep {
  height: 1px;
  background: rgba(255,255,255,0.1);
  margin: 0;
}

/* ---- Delete confirmation sheet ---- */
#khatm-delete-sheet {
  position: fixed;
  inset: 0;
  z-index: 9999;
}
#khatm-delete-sheet.hidden { display: none; }
#kds-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
}
#kds-panel {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: #111;
  border-radius: 24px 24px 0 0;
  padding: 32px 28px max(28px, env(safe-area-inset-bottom, 28px));
  transform: translateY(0);
  transition: transform 0.38s cubic-bezier(0.22,1,0.36,1);
}
#khatm-delete-sheet.hidden #kds-panel {
  transform: translateY(100%);
}
#kds-panel h2 {
  font-size: 1.7rem;
  font-weight: 700;
  color: #fff;
  margin: 0 0 16px;
  line-height: 1.2;
}
#kds-subtitle {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.6);
  margin: 0 0 18px;
  line-height: 1.5;
}
#kds-list {
  list-style: none;
  padding: 0;
  margin: 0 0 28px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
#kds-list li {
  font-size: 0.88rem;
  color: rgba(255,255,255,0.55);
  padding-left: 18px;
  position: relative;
  line-height: 1.45;
}
#kds-list li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: rgba(255,255,255,0.35);
}
#kds-btns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
#kds-cancel {
  background: rgba(255,255,255,0.1);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 50px;
  padding: 18px;
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  letter-spacing: 1.5px;
  font-weight: 400;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
#kds-confirm {
  background: #fff;
  color: #111;
  border: none;
  border-radius: 50px;
  padding: 18px;
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  letter-spacing: 1.5px;
  font-weight: 400;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

/* ---- Stats reset button ---- */
.stats-reset-btn {
  background: none;
  border: none;
  padding: 0;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(220,100,80,0.55);
  cursor: pointer;
  font-family: inherit;
  transition: color 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.stats-reset-btn:active { color: rgba(220,100,80,0.9); }

/* ---- Stats reset sheet (same pattern as khatm-delete-sheet) ---- */
#stats-reset-sheet {
  position: fixed;
  inset: 0;
  z-index: 9999;
}
#stats-reset-sheet.hidden { display: none; }
#srs-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
}
#srs-panel {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: #111;
  border-radius: 24px 24px 0 0;
  padding: 32px 28px max(28px, env(safe-area-inset-bottom, 28px));
  transform: translateY(0);
  transition: transform 0.38s cubic-bezier(0.22,1,0.36,1);
}
#stats-reset-sheet.hidden #srs-panel { transform: translateY(100%); }
#srs-panel h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  margin: 0 0 12px;
  line-height: 1.2;
}
#srs-panel p {
  font-size: 0.88rem;
  color: rgba(255,255,255,0.55);
  margin: 0 0 28px;
  line-height: 1.5;
}
#srs-btns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
#srs-cancel {
  background: rgba(255,255,255,0.1);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 50px;
  padding: 18px;
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  letter-spacing: 1.5px;
  font-weight: 400;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
#srs-confirm {
  background: #fff;
  color: #111;
  border: none;
  border-radius: 50px;
  padding: 18px;
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  letter-spacing: 1.5px;
  font-weight: 400;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

/* ---- History overlay ---- */
#khatm-history-overlay {
  background: #000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#khatm-history-overlay.hidden { display: none !important; }
#kh-hist-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: max(56px, env(safe-area-inset-top, 56px)) 24px 24px;
  flex-shrink: 0;
}
#kh-hist-back {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.08);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}
#kh-hist-header h1 {
  font-size: 2rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
}
#kh-hist-list {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.kh-hist-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.kh-hist-date {
  font-family: 'Space Mono', monospace;
  font-size: 0.62rem;
  color: rgba(255,255,255,0.4);
  line-height: 1.5;
  letter-spacing: 0.04em;
  flex-shrink: 0;
  min-width: 60px;
}
.kh-hist-info {
  flex: 1;
  min-width: 0;
}
.kh-hist-from {
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  display: block;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.kh-hist-to {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.4);
  display: block;
}
.kh-hist-chev svg { opacity: 0.3; }
/* ---- KHATM PROGRESS CARD ---- */
#khatm-progress-card {
  background: rgba(255,255,255,0.05);
  border-bottom: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
#khatm-progress-card:active { opacity: 0.65; }
#kp-inner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
}
#kp-svg { flex-shrink: 0; }
.kp-track {
  fill: none;
  stroke: rgba(255,255,255,0.12);
  stroke-width: 3;
}
.kp-arc {
  fill: none;
  stroke: #fff;
  stroke-width: 3;
  stroke-linecap: round;
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
  transition: stroke-dashoffset 0.7s ease;
}
#kp-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}
#kp-pct-label {
  font-family: 'Space Mono', monospace;
  font-size: 0.88rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.02em;
}
#kp-loc-label {
  font-family: 'Space Mono', monospace;
  font-size: 0.6rem;
  color: rgba(255,255,255,0.4);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#kp-days-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}
#kp-days-num {
  font-family: 'Space Mono', monospace;
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  line-height: 1;
}
#kp-days-lbl {
  font-family: 'Space Mono', monospace;
  font-size: 0.48rem;
  color: rgba(255,255,255,0.38);
  letter-spacing: 0.07em;
  text-align: center;
}
.kp-chev { flex-shrink: 0; }

#khatm-surah-wrap {
  flex: 1;
  background: #000;
  padding-bottom: 90px;
}
.kh-surah-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 20px;
  border-bottom: 1px solid rgba(0,0,0,0.3);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  background-size: cover;
  background-position: center;
  min-height: 78px;
  overflow: hidden;
}
/* Gradient: dark on left (text readable) → image reveals on right */
.kh-surah-item::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, rgba(0,0,0,0.90) 35%, rgba(0,0,0,0.45) 70%, rgba(0,0,0,0.15) 100%);
  pointer-events: none;
}
.kh-surah-item > * { position: relative; z-index: 1; }
.kh-surah-item:active::before { background: rgba(0,0,0,0.65); }
/* Small number replaces thumbnail */
.kh-surah-num {
  font-family: 'Space Mono', monospace;
  font-size: 0.62rem;
  color: rgba(255,255,255,0.38);
  flex-shrink: 0;
  width: 22px;
  text-align: right;
  line-height: 1;
}
.kh-surah-thumb { display: none; } /* hidden — image is now the item background */
.kh-surah-info { flex: 1; min-width: 0; }
.kh-surah-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  display: block;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.kh-surah-meta {
  font-family: 'Space Mono', monospace;
  font-size: 0.6rem;
  letter-spacing: 0.07em;
  color: rgba(255,255,255,0.4);
}
.kh-surah-chevron { color: rgba(255,255,255,0.25); flex-shrink: 0; }

/* ============================================================
   KHATM WIZARD
   ============================================================ */
#khatm-wizard {
  background: #000;
  z-index: 200;
  overflow: hidden;
}
.kw-step {
  padding: env(safe-area-inset-top, 0) 0 0;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding-top: max(56px, env(safe-area-inset-top, 0));
  padding-left: 0;
  padding-right: 0;
}
.kw-close-btn, .kw-back-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.07);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin: 0 0 36px 24px;
  padding: 0;
  flex-shrink: 0;
  align-self: flex-start;
  -webkit-tap-highlight-color: transparent;
}
.kw-title {
  font-size: 1.95rem;
  font-weight: 700;
  color: #fff;
  margin: 0 24px 36px;
  line-height: 1.2;
}
.kw-opts { display: flex; flex-direction: column; }
.kw-opt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.09);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.kw-opt:first-child { border-top: 1px solid rgba(255,255,255,0.09); }
.kw-opt:active { opacity: 0.6; }
.kw-opt-inner { display: flex; flex-direction: column; gap: 4px; }
.kw-opt-name { font-size: 0.95rem; color: #fff; font-weight: 500; }
.kw-opt-desc { font-size: 0.78rem; color: rgba(255,255,255,0.4); }
/* Step 1b */
.kw-manual { padding: 0 24px; margin-bottom: 120px; }
.kw-section-head {
  font-size: 0.9rem;
  color: #fff;
  font-weight: 500;
  margin: 0 0 16px;
}
.kw-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  border-bottom: 1px solid rgba(255,255,255,0.09);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.kw-field:first-of-type { border-top: 1px solid rgba(255,255,255,0.09); }
.kw-field-label {
  font-family: 'Space Mono', monospace;
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  color: rgba(255,255,255,0.38);
}
.kw-field-right { display: flex; align-items: center; gap: 8px; }
.kw-field-val { font-size: 0.88rem; color: rgba(255,255,255,0.55); }
.kw-field-val.selected { color: #fff; }
.kw-num-input {
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(255,255,255,0.3);
  color: #fff;
  font-size: 1.1rem;
  width: 72px;
  text-align: right;
  padding: 4px 0;
  outline: none;
}
.khatm-cta {
  background: #fff;
  color: #000;
  border: none;
  border-radius: 50px;
  padding: 16px;
  font-family: 'Space Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  font-weight: 700;
  cursor: pointer;
  position: fixed;
  bottom: max(28px, env(safe-area-inset-bottom, 28px));
  left: 24px;
  right: 24px;
  -webkit-tap-highlight-color: transparent;
}
/* Step 2: goal */
.kw-goal-sub {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.45);
  margin: -24px 24px 28px;
}
.kw-goal-list { display: flex; flex-direction: column; }
.kw-goal-opt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.09);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.kw-goal-opt:first-child { border-top: 1px solid rgba(255,255,255,0.09); }
.kw-goal-opt:active { opacity: 0.6; }
.kw-goal-inner { display: flex; flex-direction: column; gap: 4px; }
.kw-goal-name { font-size: 0.95rem; color: #fff; font-weight: 500; }
.kw-goal-info {
  font-family: 'Space Mono', monospace;
  font-size: 0.6rem;
  letter-spacing: 0.06em;
  color: rgba(255,255,255,0.38);
}
/* Surah picker bottom sheet */
#kw-surah-picker {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.97);
  z-index: 300;
  display: flex;
  flex-direction: column;
  padding-top: env(safe-area-inset-top, 0);
}
#kw-surah-picker.hidden { display: none; }
#kw-picker-handle {
  width: 36px; height: 4px;
  background: rgba(255,255,255,0.25);
  border-radius: 2px;
  margin: 14px auto 16px;
  flex-shrink: 0;
}
#kw-picker-list {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.kw-picker-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.kw-picker-item:active { opacity: 0.6; }
.kw-picker-name { font-size: 0.95rem; color: #fff; font-weight: 500; display: block; }
.kw-picker-sub { font-size: 0.78rem; color: rgba(255,255,255,0.4); }

/* ============================================================
   KHATM READER
   ============================================================ */
#khatm-reader {
  background: #000;
  z-index: 200;
  overflow: hidden;
  flex-direction: column;
  padding-top: 0 !important;
}
#khatm-reader:not(.hidden) { display: flex; }
/* ---- Reader progress bar ---- */
#kr-progress-bar-wrap {
  position: relative;
  z-index: 10;
  height: 2px;
  background: rgba(255,255,255,0.10);
  pointer-events: none;
  flex-shrink: 0;
}
#kr-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #facc15, #eab308);
  transition: width 0.8s ease;
  border-radius: 0 2px 2px 0;
}
#kr-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: blur(18px) brightness(0.45) saturate(1.3);
  transform: scale(1.08);
  z-index: 0;
  transition: background-image 1s ease;
}
#kr-bg-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,0.72) 0%,
    rgba(0,0,0,0.50) 30%,
    rgba(0,0,0,0.65) 68%,
    rgba(0,0,0,0.92) 100%
  );
  z-index: 1;
}
#kr-header {
  position: relative;
  z-index: 10;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: max(52px, env(safe-area-inset-top, 52px)) 18px 14px;
  background: linear-gradient(to bottom, rgba(0,0,0,0.7) 60%, transparent);
}
#kr-back, #kr-menu-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}
#kr-header-title {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
#kr-surah-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
}
#kr-surah-sub {
  font-family: 'Space Mono', monospace;
  font-size: 0.58rem;
  letter-spacing: 0.12em;
  color: rgba(255,255,255,0.5);
  text-transform: uppercase;
}
/* Settings panel — slide-down animation */
#kr-panel {
  position: fixed;
  top: 0; left: 0; right: 0;
  background: rgba(8,8,8,0.97);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  z-index: 15;
  padding-top: max(0px, env(safe-area-inset-top, 0));
  border-bottom: 1px solid rgba(255,255,255,0.09);
  transform: translateY(-110%);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.42s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.28s ease;
}
#kr-panel:not(.hidden) {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}
/* Override global .hidden for panel — uses transform animation instead */
#kr-panel.hidden { display: block !important; }
#kr-panel-top {
  padding: 22px 24px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
#kr-panel-title {
  display: block;
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
}
#kr-panel-days {
  display: block;
  font-size: 0.82rem;
  color: rgba(255,255,255,0.45);
  margin-top: 3px;
}
.kr-panel-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.kr-panel-name { display: block; font-size: 0.95rem; color: #fff; margin-bottom: 2px; }
.kr-panel-val {
  font-family: 'Space Mono', monospace;
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.38);
  white-space: nowrap;
}
.kr-size-btns { display: flex; gap: 8px; }
.kr-size-btns button {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.1);
  color: #fff;
  font-size: 1.15rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}
#kr-lang-picker {
  background: rgba(22,22,22,0.98);
  border-radius: 12px;
  margin: 6px 20px 14px;
  overflow: hidden;
}
#kr-lang-picker.hidden { display: none; }
/* Mode de lecture picker */
#kr-mode-picker {
  background: rgba(22,22,22,0.98);
  border-radius: 12px;
  margin: 6px 20px 14px;
  overflow: hidden;
}
#kr-mode-picker.hidden { display: none; }
.kr-mode-opt {
  padding: 12px 18px;
  color: rgba(255,255,255,0.55);
  cursor: pointer;
  font-size: 0.88rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  -webkit-tap-highlight-color: transparent;
}
.kr-mode-opt:last-child { border-bottom: none; }
.kr-mode-opt.active { color: #fff; }
.kr-mode-opt.active::after { content: '✓'; font-size: 0.85rem; flex-shrink: 0; }
.kr-mode-label { display: block; font-size: 0.9rem; margin-bottom: 3px; }
.kr-mode-desc { display: block; font-size: 0.72rem; color: rgba(255,255,255,0.3); }
.kr-mode-opt.active .kr-mode-desc { color: rgba(255,255,255,0.45); }
.kr-mode-opt-text { flex: 1; }
.kr-lang-opt {
  padding: 13px 18px;
  color: rgba(255,255,255,0.6);
  cursor: pointer;
  font-size: 0.92rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  -webkit-tap-highlight-color: transparent;
}
.kr-lang-opt:last-child { border-bottom: none; }
.kr-lang-opt.active { color: #fff; }
.kr-lang-opt.active::after { content: '✓'; font-size: 0.85rem; }
/* Scroll container */
#kr-scroll {
  position: relative;
  z-index: 5;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1;
  padding-top: 0;
  padding-bottom: 60px;
}
.kr-surah-section {}
.kr-surah-banner {
  padding: 52px 28px 20px;
  text-align: center;
  margin-top: 20px;
}
.kr-surah-banner:first-child { margin-top: 0; padding-top: 20px; }
.kr-surah-banner-name {
  font-size: 1.9rem;
  font-weight: 700;
  color: #fff;
  display: block;
}
.kr-surah-banner-sub {
  font-family: 'Space Mono', monospace;
  font-size: 0.64rem;
  letter-spacing: 0.12em;
  color: rgba(255,255,255,0.38);
  text-transform: uppercase;
  display: block;
  margin-top: 6px;
}
.kr-separator {
  height: 1px;
  background: rgba(255,255,255,0.1);
  margin: 0 28px 20px;
}
.kr-verse {
  padding: 36px 28px;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
.kr-verse-ref {
  text-align: center;
  font-family: 'Space Mono', monospace;
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  color: rgba(255,255,255,0.28);
  margin-bottom: 12px;
}
.kr-verse-ar {
  font-size: 1.7rem;
  line-height: 2.1;
  text-align: center;
  color: #fff;
  direction: rtl;
  font-family: "Amiri Quran", "Amiri", "Noto Naskh Arabic", "Traditional Arabic", serif;
  margin-bottom: 14px;
  word-spacing: 4px;
}
.kr-verse-en {
  font-size: 0.88rem;
  line-height: 1.65;
  text-align: center;
  color: rgba(255,255,255,0.55);
  margin-top: 14px;
}
.kr-verse-fr {
  font-size: 0.88rem;
  line-height: 1.65;
  text-align: center;
  color: rgba(255,255,255,0.55);
  margin-top: 14px;
}
.kr-verse-bright { color: #fff !important; }
.kr-verse-ph {
  font-size: 0.88rem;
  line-height: 1.65;
  text-align: center;
  color: rgba(255,255,255,0.62);
  font-style: italic;
  letter-spacing: 0.01em;
  margin-top: 14px;
}

/* ---- KHATM COMPLETE BUTTON ---- */
.kr-complete-wrap {
  padding: 28px 28px 48px;
  display: flex;
  justify-content: center;
}
.kr-complete-btn {
  background: rgba(255,255,255,0.12);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.28);
  border-radius: 50px;
  padding: 16px 48px;
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  letter-spacing: 1.5px;
  font-weight: 400;
  text-transform: uppercase;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  min-width: 220px;
  white-space: nowrap;
  text-align: center;
  transition: opacity 0.2s;
}
.kr-complete-btn:active { opacity: 0.6; }
.kr-complete-btn:disabled { cursor: default; }
/* Spinner inside complete button */
@keyframes kr-dot-bounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.3; }
  40% { transform: scale(1); opacity: 1; }
}
.kr-complete-loading {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}
.kr-complete-loading span {
  width: 6px; height: 6px;
  background: #fff;
  border-radius: 50%;
  display: inline-block;
  animation: kr-dot-bounce 1.2s infinite ease-in-out;
}
.kr-complete-loading span:nth-child(2) { animation-delay: 0.2s; }
.kr-complete-loading span:nth-child(3) { animation-delay: 0.4s; }

/* ---- HIDDEN ---- */
.hidden { display: none !important; }

/* ===================== SURAH PLAYER (Lecteur Libre + Audio) ===================== */
#surah-player {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 900;
  display: flex;
  flex-direction: column;
  background: #000;
  overflow: hidden;
  height: 100%;
  height: 100dvh;
}
#surah-player.hidden { display: none !important; }

#sp-bg {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background-size: cover;
  background-position: center;
  transform: scale(1.08);
  transition: background-image 0.35s ease, filter 0.4s ease;
  filter: blur(0px);
  pointer-events: none;
}
/* Blur the bg in reader mode for better readability */
#surah-player.sp-reader-mode #sp-bg {
  filter: blur(18px);
}
#sp-bg-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,0.58) 0%,
    rgba(0,0,0,0.28) 30%,
    rgba(0,0,0,0.55) 68%,
    rgba(0,0,0,0.92) 100%
  );
  pointer-events: none;
}
/* Slightly darker overlay in reader mode too */
#surah-player.sp-reader-mode #sp-bg-overlay {
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,0.72) 0%,
    rgba(0,0,0,0.55) 30%,
    rgba(0,0,0,0.70) 68%,
    rgba(0,0,0,0.94) 100%
  );
}

/* Header */
#sp-header {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: max(env(safe-area-inset-top, 44px), 44px) 20px 0;
}
#sp-close, #sp-menu-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.22);
  background: rgba(0,0,0,0.32);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
}
#sp-menu-btn {
  font-size: 1rem;
  padding: 0;
}
#sp-play-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,0.7);
  padding: 8px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
#sp-play-btn.sp-playing { color: #f59e0b; }
#sp-play-btn.sp-playing svg { fill: #f59e0b; stroke: none; }
#sp-follow-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,0.45);
  padding: 6px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.3s ease;
}
#sp-follow-btn.follow-active {
  color: #34d399;
  animation: follow-pulse 2s ease-in-out infinite;
}
#sp-auto-btn {
  background: none;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 50%;
  color: rgba(255,255,255,0.45);
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
#sp-auto-btn.sp-auto-active {
  border-color: #f59e0b;
  color: #f59e0b;
}
#sp-page-dots {
  display: flex;
  gap: 7px;
  align-items: center;
}
.sp-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.28);
  transition: background 0.2s;
}
.sp-dot.sp-dot-active { background: #fff; }

/* Tab labels */
#sp-tab-labels {
  position: relative;
  z-index: 10;
  display: flex;
  gap: 36px;
  padding: 10px 0 0;
  justify-content: center;
}
#sp-tab-labels span {
  font-size: 0.95rem;
  color: rgba(255,255,255,0.32);
  cursor: pointer;
  padding-bottom: 10px;
  letter-spacing: 0.015em;
  transition: color 0.2s;
  -webkit-tap-highlight-color: transparent;
}
#sp-tab-labels span.sp-tab-active {
  color: #fff;
  font-weight: 500;
  border-bottom: 1.5px solid rgba(255,255,255,0.6);
}
#sp-tab-sep {
  position: relative;
  z-index: 10;
  height: 1px;
  background: rgba(255,255,255,0.1);
}

/* === READER PAGE === */
#sp-reader-page {
  position: relative;
  z-index: 10;
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}
#sp-reader-intro {
  padding: 22px 24px 12px;
  text-align: center;
  flex-shrink: 0;
}
#sp-reader-name {
  font-size: 1.85rem;
  font-weight: 600;
  color: #fff;
  margin: 0;
  line-height: 1.15;
}
#sp-reader-meaning {
  font-size: 0.63rem;
  color: rgba(255,255,255,0.42);
  letter-spacing: 0.13em;
  margin: 5px 0 0;
  font-weight: 400;
}
#sp-reader-scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  min-height: 0;
  scroll-behavior: smooth;
  overscroll-behavior: contain;
}
#sp-reader-content {
  padding: 12px 20px calc(140px + env(safe-area-inset-bottom));
}
.sp-verse {
  margin-bottom: 44px;
  text-align: center;
  padding: 0 4px;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
/* Pas d'effet visuel sur le verset actif, juste auto-scroll */
.sp-verse-ref {
  font-family: 'Space Mono', monospace;
  font-size: 0.57rem;
  color: rgba(255,255,255,0.26);
  letter-spacing: 0.1em;
  margin: 0 0 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
/* No separator lines between verses */
.sp-verse-ar {
  font-family: "Amiri Quran", "Amiri", serif;
  font-size: 1.75rem;
  line-height: 2.15;
  color: #fff;
  margin: 0 0 14px;
  direction: rtl;
}
.sp-verse-en {
  font-size: 0.86rem;
  line-height: 1.72;
  color: rgba(255,255,255,0.52);
  margin: 14px 0 0;
}
.sp-verse-fr {
  font-size: 0.86rem;
  line-height: 1.72;
  color: rgba(255,255,255,0.52);
  margin: 14px 0 0;
  font-style: italic;
}
.sp-verse-bright { color: #fff !important; }
.sp-verse-ph {
  font-size: 0.86rem;
  line-height: 1.72;
  color: rgba(255,255,255,0.62);
  margin: 14px 0 0;
  font-style: italic;
  letter-spacing: 0.01em;
}

/* === AUDIO PAGE === */
#sp-audio-page {
  position: relative;
  z-index: 10;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding-bottom: max(env(safe-area-inset-bottom, 24px), 36px);
}
#sp-audio-top { flex: 1; }
#sp-audio-center {
  text-align: center;
  padding: 0 28px 28px;
}
#sp-audio-name {
  font-size: 2rem;
  font-weight: 600;
  color: #fff;
  margin: 0 0 8px;
  line-height: 1.15;
}
#sp-audio-reciter {
  font-size: 0.6rem;
  color: rgba(255,255,255,0.38);
  letter-spacing: 0.15em;
  margin: 0;
}
#sp-seek-wrap { padding: 0 28px; }
#sp-seek {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 3px;
  background: rgba(255,255,255,0.18);
  outline: none;
  border-radius: 2px;
  cursor: pointer;
}
#sp-seek::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
}
#sp-times {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  padding: 0 2px;
}
#sp-times span {
  font-family: 'Space Mono', monospace;
  font-size: 0.67rem;
  color: rgba(255,255,255,0.38);
}
#sp-btns {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-top: 20px;
  padding: 0 20px;
}
#sp-btns button {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  -webkit-tap-highlight-color: transparent;
}
#sp-prev-surah, #sp-next-surah { opacity: 0.45; }
#sp-rew, #sp-fwd { opacity: 0.75; }
#sp-playpause {
  width: 66px;
  height: 66px;
  border-radius: 50%;
  background: rgba(255,255,255,0.14);
  border: 1.5px solid rgba(255,255,255,0.28);
  padding: 0;
}

/* === SURAH PLAYER MENU (position:fixed) === */
#surah-player-menu {
  position: fixed;
  min-width: 200px;
  background: rgba(30,30,32,0.95);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 16px;
  overflow: hidden;
  z-index: 2000;
  box-shadow: 0 8px 32px rgba(0,0,0,0.55);
}
#surah-player-menu.hidden { display: none !important; }
.spm-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 18px;
  color: #fff;
  font-size: 0.91rem;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.spm-btn:active { background: rgba(255,255,255,0.06); }
.spm-btn svg { flex-shrink: 0; opacity: 0.7; }
.spm-btn > span { flex: 1; }
#spm-lang-row #spm-lang-chev {
  margin-left: auto;
  opacity: 0.45;
  transition: transform 0.2s;
}
#spm-lang-row.spm-open #spm-lang-chev { transform: rotate(90deg); }
#spm-lang-opts { background: rgba(0,0,0,0.18); }
#spm-lang-opts.hidden { display: none !important; }
.spm-lang-opt {
  padding: 11px 18px 11px 50px;
  color: rgba(255,255,255,0.5);
  font-size: 0.88rem;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  position: relative;
}
.spm-lang-opt:active { background: rgba(255,255,255,0.06); }
.spm-lang-opt.spm-lang-active { color: #fff; }
.spm-lang-opt.spm-lang-active::before {
  content: '✓';
  position: absolute;
  left: 22px;
  color: #fff;
}
.spm-sep { height: 1px; background: rgba(255,255,255,0.08); }
.spm-close { color: rgba(255,255,255,0.48); }

/* SP Mode picker */
#spm-mode-opts { background: rgba(0,0,0,0.18); }
#spm-mode-opts.hidden { display: none !important; }
#spm-mode-chev { margin-left: 4px; opacity: 0.45; transition: transform 0.2s; }
.spm-mode-opt {
  padding: 11px 18px 11px 50px;
  color: rgba(255,255,255,0.5);
  font-size: 0.88rem;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  position: relative;
}
.spm-mode-opt:active { background: rgba(255,255,255,0.06); }
.spm-mode-opt.spm-mode-active { color: #fff; }
.spm-mode-opt.spm-mode-active::before {
  content: '\2713';
  position: absolute;
  left: 22px;
  color: #fff;
}

/* SP Text size */
.spm-size-row { cursor: default; }
.spm-size-btns {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}
.spm-size-btns button {
  background: rgba(255,255,255,0.15);
  border: none;
  color: #fff;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}
.spm-size-btns button:active { background: rgba(255,255,255,0.25); }
#spm-size-val {
  font-family: "Space Mono", monospace;
  font-size: 0.75rem;
  color: rgba(255,255,255,0.6);
  min-width: 40px;
  text-align: center;
}

/* === SP RECITER SHEET === */
#sp-reciter-sheet {
  position: fixed;
  inset: 0;
  z-index: 2100;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
#sp-reciter-sheet.hidden { display: none !important; }
#sp-reciter-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.55);
}
#sp-reciter-panel {
  position: relative;
  background: rgba(22,22,24,0.98);
  backdrop-filter: blur(32px);
  -webkit-backdrop-filter: blur(32px);
  border-radius: 20px 20px 0 0;
  max-height: 78vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-bottom: max(env(safe-area-inset-bottom, 16px), 16px);
}
#sp-reciter-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}
#sp-reciter-header h2 {
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  margin: 0;
  letter-spacing: 0.02em;
}
#sp-reciter-close {
  background: none;
  border: none;
  color: rgba(255,255,255,0.45);
  font-size: 0.82rem;
  cursor: pointer;
  padding: 4px 0;
  letter-spacing: 0.04em;
}
#sp-reciter-list {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1;
}
.spr-section-label {
  font-family: 'Space Mono', monospace;
  font-size: 0.58rem;
  color: rgba(255,255,255,0.3);
  letter-spacing: 0.13em;
  padding: 14px 20px 6px;
  text-transform: uppercase;
}
.spr-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.spr-item:active { background: rgba(255,255,255,0.06); }
.spr-item-info { flex: 1; }
.spr-item-name {
  font-size: 0.92rem;
  color: #fff;
  display: block;
  margin-bottom: 2px;
}
.spr-item-lang {
  font-size: 0.68rem;
  color: rgba(255,255,255,0.35);
  letter-spacing: 0.07em;
  display: block;
}
.spr-item-check {
  color: rgba(255,255,255,0.7);
  font-size: 1rem;
  width: 20px;
  text-align: center;
}
.spr-item.spr-active .spr-item-name { color: #90CAF9; }
.spr-item.spr-active .spr-item-check { color: #90CAF9; }

/* ============================================
   MOI TAB (Profile) — Behold-style
   ============================================ */
#tab-ayati {
  min-height: 0;
  max-height: calc(100vh - 56px);
  max-height: calc(100vh - 56px - env(safe-area-inset-bottom, 0px));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: #000;
}
.moi-scroll {
  padding: 0 0 calc(80px + env(safe-area-inset-bottom));
}
.moi-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: calc(20px + env(safe-area-inset-top)) 24px 40px;
}
.moi-header-content { display: flex; flex-direction: column; }
.moi-logo {
  font-size: 18px;
  font-weight: 400;
  color: rgba(255,255,255,0.85);
  letter-spacing: 12px;
  margin: 0;
  line-height: 1.1;
  font-family: system-ui, -apple-system, sans-serif;
}
.moi-subtitle {
  font-size: 8px;
  color: rgba(255,255,255,0.35);
  margin: 5px 0 0;
  font-weight: 300;
  letter-spacing: 3.36px;
  text-transform: uppercase;
}
.moi-settings-btn {
  background: rgba(255,255,255,0.08);
  border: none;
  color: rgba(255,255,255,0.5);
  padding: 5px;
  border-radius: 50%;
  cursor: pointer;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}
.moi-section { padding: 0 24px; }

/* ---- AUTH / COMPTE ---- */

/* Auth Overlay */
.auth-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  width: 100%; height: 100%;
  z-index: 10000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 1;
  transition: opacity 0.3s ease;
}
.auth-overlay.hidden {
  display: none;
}
.auth-overlay.fade-out {
  opacity: 0;
}
.auth-overlay-backdrop {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
}
.auth-overlay-content {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  margin: 0;
  padding: 32px 28px calc(env(safe-area-inset-bottom, 24px) + 44px);
  background: rgba(18, 18, 18, 0.92);
  backdrop-filter: blur(40px) saturate(1.6);
  -webkit-backdrop-filter: blur(40px) saturate(1.6);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px 24px 0 0;
  box-shadow: 0 -8px 40px rgba(0,0,0,0.4), 0 1px 0 rgba(255,255,255,0.04) inset;
  text-align: center;
  animation: authSheetUp 0.38s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes authSheetUp {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
.auth-overlay-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.2s;
}
.auth-overlay-close:active { background: rgba(255, 255, 255, 0.15); }
.auth-overlay-icon {
  margin: 0 auto 18px;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(251,191,36,0.15), rgba(251,191,36,0.05));
  border: 1px solid rgba(251,191,36,0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.9);
}
.auth-overlay-title {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
  color: rgba(255, 255, 255, 0.95);
  margin: 0 0 10px;
  letter-spacing: -0.02em;
}
.auth-overlay-desc {
  font-size: 0.82rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.45);
  margin: 0 auto 24px;
  max-width: 300px;
}
.auth-overlay-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}
.auth-overlay-footer {
  font-family: "Space Mono", monospace;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.25);
  margin: 0;
}

.auth-buttons {
  padding: 4px 0 12px;
}
.auth-buttons.hidden { display: none; }
.auth-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 13px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.15);
  background: transparent;
  color: rgba(255,255,255,0.92);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  margin-bottom: 8px;
  -webkit-tap-highlight-color: transparent;
}
.auth-btn:active { opacity: 0.7; }
.auth-google { background: transparent; color: rgba(255,255,255,0.92); border-color: rgba(255,255,255,0.15); }
.auth-apple { background: transparent; color: rgba(255,255,255,0.92); border-color: rgba(255,255,255,0.15); }
.auth-user-row {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px 0;
}
.auth-avatar-wrap {
  flex-shrink: 0;
  width: 46px;
  height: 46px;
}
.auth-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  object-fit: cover;
}
.auth-initials {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.02em;
}
.auth-user-info { flex: 1; min-width: 0; }
.auth-name-row {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 5px;
}
.auth-name {
  font-weight: 600;
  font-size: 0.93rem;
  color: rgba(255,255,255,0.9);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.auth-provider-badge {
  flex-shrink: 0;
  font-size: 0.58rem;
  font-family: "Space Mono", monospace;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255,255,255,0.07);
  color: var(--text-faint);
  border: 1px solid rgba(255,255,255,0.08);
}
.auth-name-edit-btn {
  background: none;
  border: none;
  padding: 3px 4px;
  cursor: pointer;
  color: rgba(255,255,255,0.28);
  border-radius: 4px;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.2s;
}
.auth-name-edit-btn:active { color: rgba(255,255,255,0.75); }
.auth-name-input {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 6px;
  color: rgba(255,255,255,0.9);
  font-size: 0.93rem;
  font-weight: 600;
  padding: 2px 8px;
  width: 130px;
  outline: none;
}
.auth-email {
  font-size: 0.77rem;
  color: var(--text-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.auth-meta-row {
  display: flex;
  align-items: center;
  gap: 5px;
}
.auth-meta-sep {
  font-size: 0.63rem;
  color: var(--text-faint);
  opacity: 0.35;
}
.auth-sync-time {
  font-size: 0.68rem;
  font-family: "Space Mono", monospace;
  color: var(--text-faint);
  opacity: 0.6;
}
.auth-sync-status {
  font-family: "Space Mono", monospace;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  transition: color 0.3s;
}
.auth-sync-status--ok { color: #4ade80; }
.auth-sync-status--err { color: #ef4444; }
.auth-sync-bar {
  width: 36px;
  height: 2px;
  background: rgba(255,255,255,0.08);
  border-radius: 1px;
  overflow: hidden;
}
.auth-sync-bar--hidden { display: none; }
.auth-sync-bar-fill {
  height: 100%;
  width: 40%;
  background: var(--accent, #A0C8A8);
  border-radius: 1px;
  animation: syncSlide 1.0s ease-in-out infinite;
}
@keyframes syncSlide {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(250%); }
}
.auth-logout-btn {
  background: none;
  border: none;
  padding: 0;
  color: rgba(239,68,68,0.5);
  font-size: 0.63rem;
  font-family: "Space Mono", monospace;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
}
.auth-logout-btn:active { opacity: 0.4; }

.moi-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.moi-item:active { opacity: 0.7; }
.moi-item-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
}
.moi-item-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.moi-item-thumb {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  background-size: cover;
  background-position: center;
  background-color: rgba(255,255,255,0.06);
  flex-shrink: 0;
}
.moi-item-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  opacity: 0.8;
}
.moi-item-label {
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: rgba(255,255,255,0.9);
  line-height: 1.2;
}
.moi-item-count {
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  color: rgba(255,255,255,0.38);
  letter-spacing: 1.5px;
  text-transform: uppercase;
}
.moi-item-arrow {
  color: rgba(255,255,255,0.25);
  flex-shrink: 0;
}
.moi-sep {
  height: 1px;
  background: rgba(255,255,255,0.06);
}

/* MOI Settings overlay — now uses moi-cat-overlay system */
#moi-settings-overlay {
  z-index: 300;
}
/* Reuse moi-cat-title style for settings title */
.moi-settings-list { padding: 0; }
.moi-settings-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.moi-settings-item:active { opacity: 0.7; }
.moi-settings-item-label {
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: rgba(255,255,255,0.9);
  line-height: 1.2;
  flex: 1;
}

/* ============================================
   MOI CATEGORY OVERLAYS — Du'a-style gradients
   ============================================ */
.moi-cat-overlay {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  overflow: hidden !important;
  padding-top: 0 !important;
}
.moi-cat-scroll {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: calc(16px + env(safe-area-inset-top)) 24px 120px;
}
.moi-cat-topbar {
  margin-bottom: 12px;
}
.moi-cat-back {
  background: rgba(255,255,255,0.08);
  border: none;
  color: rgba(255,255,255,0.6);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.2s, color 0.2s;
}
.moi-cat-back:active {
  background: rgba(255,255,255,0.14);
  color: #fff;
}
.moi-cat-title {
  font-family: -apple-system, 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 26px;
  font-weight: 300;
  color: #fff;
  margin: 0 0 32px;
  line-height: 1.15;
  letter-spacing: -0.3px;
}
/* ---- MOI overlays iPad override (must come after base) ---- */
@media (min-width: 768px) {
  .moi-cat-scroll { padding-left: 48px; padding-right: 48px; }
  .moi-cat-title { font-size: 30px; }
}
@media (min-width: 1024px) {
  .moi-cat-scroll { padding-left: 60px; padding-right: 60px; }
  .moi-cat-title { font-size: 34px; }
}

/* Per-overlay gradient backgrounds */
#bookmarks-overlay.moi-cat-overlay {
  background: linear-gradient(165deg, #3a1828 0%, #301420 30%, #25101a 60%, #1a0c12 100%) !important;
}
#notes-overlay.moi-cat-overlay {
  background: linear-gradient(165deg, #352a12 0%, #2e2410 30%, #241c0c 60%, #1a1508 100%) !important;
}
#moi-khatms-overlay.moi-cat-overlay {
  background: #0a0a0a !important;
}
.moi-khatms-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: blur(55px) brightness(0.35) saturate(1.3);
  transform: scale(1.15);
  z-index: 0;
  transition: background-image 1s ease;
}
#moi-khatms-overlay .moi-cat-scroll {
  position: relative;
  z-index: 1;
}
#moi-settings-overlay.moi-cat-overlay {
  background: #0a0810 !important;
}
#moi-settings-overlay .moi-cat-scroll {
  padding-top: 0;
}
.moi-settings-hero {
  position: relative;
  height: 220px;
  overflow: hidden;
  margin: 0 -24px 8px;
}
.moi-settings-hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center 30%;
  filter: brightness(0.65);
  transform: scale(1.04);
  transition: background-image 0.4s ease;
}
.moi-settings-hero-fade {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 140px;
  background: linear-gradient(to bottom, transparent, #0a0810);
}
.moi-settings-hero-inner {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: calc(16px + env(safe-area-inset-top)) 24px 20px;
}
#moi-settings-overlay .moi-cat-title {
  margin-bottom: 0;
}
#about-overlay.moi-cat-overlay {
  background: linear-gradient(165deg, #142540 0%, #102038 30%, #0c1a2e 60%, #0a1422 100%) !important;
  z-index: 310;
}
#help-overlay.moi-cat-overlay {
  background: linear-gradient(165deg, #103030 0%, #0c2828 30%, #0a2222 60%, #081a1a 100%) !important;
  z-index: 310;
}
#method-overlay.moi-cat-overlay {
  background: linear-gradient(165deg, #302818 0%, #282214 30%, #201a0e 60%, #18140a 100%) !important;
  z-index: 310;
}
#videos-overlay.moi-cat-overlay {
  background: #000 !important;
}
#podcast-overlay.moi-cat-overlay {
  background: #000 !important;
  display: flex; flex-direction: column;
  padding-top: env(safe-area-inset-top, 0px) !important;
  bottom: calc(52px + max(12px, env(safe-area-inset-bottom)));
}
#islamsounnah-overlay.moi-cat-overlay {
  background: #000 !important;
}
.is-bg {
  position: absolute; inset: 0; z-index: 0;
  background-size: cover; background-position: center;
  filter: blur(20px); -webkit-filter: blur(20px);
  transform: scale(1.15);
}
.is-bg-dim {
  position: absolute; inset: 0; z-index: 1;
  background: rgba(0,0,0,0.55);
}
#islamsounnah-overlay .moi-cat-scroll { position: relative; z-index: 2; }
#islamsounnah-overlay .moi-cat-title { margin-bottom: 6px; }
.is-subtitle { margin-top: 0 !important; }

/* ---- Video Overlay ---- */
#videos-overlay.moi-cat-overlay {
  display: flex; flex-direction: column;
  padding-top: env(safe-area-inset-top, 0px) !important;
  bottom: calc(52px + max(12px, env(safe-area-inset-bottom)));
}
/* Back button overlay in player */
.vid-top-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 16px 6px 4px;
  background: #000;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.vid-top-bar-back {
  width: 42px; height: 42px;
  display: flex; align-items: center; justify-content: center;
  border: none; background: none;
  color: rgba(255,255,255,0.85);
  cursor: pointer; flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
  border-radius: 50%;
}
.vid-top-bar-back:active { background: rgba(255,255,255,0.1); }
.vid-top-bar-label {
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  color: rgba(255,255,255,0.38);
  letter-spacing: 1.5px;
  text-transform: uppercase;
}
.video-sticky-player { position: relative; z-index: 10; background: #000; flex-shrink: 0; }
.video-back-center {
  position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%);
  z-index: 100; padding: 0;
  opacity: 0; pointer-events: none;
  transition: opacity .3s ease;
}
.video-back-center.visible {
  opacity: 1; pointer-events: auto;
}
.video-back-center .moi-cat-back {
  background: rgba(30,30,30,0.85); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-radius: 50%; width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}
/* Back button overlaying the video player top-left */
.video-top-back {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 20;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border: none;
  border-radius: 50%;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.85);
  cursor: pointer;
}
.video-top-back:active { background: rgba(0,0,0,0.6); }
.video-player-wrap {
  position: relative; width: 100%; aspect-ratio: 16/9;
  background: #000; overflow: hidden;
}
.video-thumb-state {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
}
.video-thumb-img {
  width: 100%; height: 100%; object-fit: cover;
}
.video-play-btn {
  position: absolute; background: none; border: none;
  cursor: pointer; z-index: 2;
  -webkit-tap-highlight-color: transparent;
  transition: transform .15s;
}
.video-play-btn:active { transform: scale(0.92); }
.video-iframe-state { position: absolute; inset: 0; }
.video-iframe-state iframe { width: 100%; height: 100%; border: none; }

.videos-scroll {
  flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 0 0 100px;
}

.video-info { padding: 24px 24px 0; }
.video-label {
  font-family: 'Space Mono', monospace;
  font-size: 11px; color: rgba(255,255,255,0.3);
  letter-spacing: 1.2px; text-transform: uppercase;
  margin: 0 0 12px;
}
.video-title {
  font-size: 24px; font-weight: 300;
  color: rgba(255,255,255,0.92);
  margin: 0 0 8px; line-height: 1.3;
}
.video-meta {
  font-family: 'Space Mono', monospace;
  font-size: 11px; color: rgba(255,255,255,0.3);
  letter-spacing: 0.5px; text-transform: uppercase;
  margin: 0;
}

.video-upnext-section { padding: 0 24px; margin-top: 32px; }
.video-upnext-sep {
  height: 1px; background: rgba(255,255,255,0.06);
  margin-bottom: 20px;
}
.video-upnext-label {
  font-size: 17px; font-weight: 300;
  color: rgba(255,255,255,0.88);
  margin: 0 0 16px;
}
.video-upnext-list { display: flex; flex-direction: column; gap: 18px; }
.video-upnext-card {
  display: flex; gap: 14px; align-items: center;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.video-upnext-card:active { opacity: 0.7; }
.video-upnext-thumb {
  width: 130px; height: 74px; border-radius: 8px;
  background-size: cover; background-position: center;
  background-color: rgba(255,255,255,0.06); flex-shrink: 0;
}
.video-upnext-info { flex: 1; min-width: 0; }
.video-upnext-title {
  font-size: 14px; font-weight: 400;
  color: rgba(255,255,255,0.88);
  margin: 0 0 5px; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}
.video-upnext-meta {
  font-family: 'Space Mono', monospace;
  font-size: 10px; color: rgba(255,255,255,0.3);
  letter-spacing: 0.5px; text-transform: uppercase;
  margin: 0;
}
/* ---- Video/Podcast iPad override (must come after base) ---- */
@media (min-width: 768px) {
  .video-info { padding: 28px 48px 0; }
  .video-title { font-size: 28px; }
  .video-upnext-section { padding: 0 48px; }
  .video-upnext-thumb { width: 160px; height: 90px; border-radius: 10px; }
  .video-upnext-title { font-size: 16px; }
}
@media (min-width: 1024px) {
  .video-info { padding: 32px 60px 0; }
  .video-upnext-section { padding: 0 60px; }
}

/* IslamSounnah overlay */
.is-subtitle {
  font-size: 14px; color: rgba(255,255,255,0.4);
  margin: 0 0 32px; font-weight: 300;
}
.is-store-row {
  display: flex; align-items: center; gap: 16px;
  padding: 18px 0; color: rgba(255,255,255,0.88);
  text-decoration: none; font-size: 17px; font-weight: 300;
  -webkit-tap-highlight-color: transparent;
}
.is-store-row:active { opacity: 0.7; }
.is-store-row svg { color: rgba(255,255,255,0.5); flex-shrink: 0; }
.is-store-row .is-store-label { flex: 1; }
.is-store-row .is-store-arrow { color: rgba(255,255,255,0.2); }

.moi-privacy-note {
  font-size: 11px !important;
  color: rgba(255,255,255,0.22) !important;
  margin: -8px 0 20px;
  line-height: 1.5;
  font-style: italic;
}

/* ============================================================
   HERITAGE OVERLAY
   ============================================================ */
#heritage-overlay.moi-cat-overlay {
  background: linear-gradient(165deg, rgba(10,16,36,0.92) 0%, rgba(8,12,28,0.92) 50%, rgba(5,8,18,0.92) 100%) !important;
  backdrop-filter: blur(32px) !important;
  -webkit-backdrop-filter: blur(32px) !important;
}
#heritage-overlay .moi-cat-title { margin-bottom: 4px; }
.heritage-intro {
  font-size: 12px !important; color: rgba(255,255,255,0.35) !important;
  font-weight: 300 !important; margin: 0 0 36px !important;
  line-height: 1.65; letter-spacing: 0.1px;
}
.heritage-section { margin-bottom: 36px; }
.heritage-section-title {
  display: flex; align-items: center; gap: 12px;
  font-family: 'Space Mono', monospace;
  font-size: 9px; letter-spacing: 3px; text-transform: uppercase;
  color: rgba(255,255,255,0.28); margin: 0 0 18px; font-weight: 400;
}
.heritage-section-title::after {
  content: ''; flex: 1; height: 1px;
  background: linear-gradient(90deg, rgba(255,255,255,0.07) 0%, transparent 100%);
}
.heritage-gender-row { display: flex; gap: 8px; margin-bottom: 20px; }
.heritage-gender-btn {
  flex: 1; padding: 12px 0;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px; color: rgba(255,255,255,0.3);
  font-family: 'Space Mono', monospace; font-size: 10px;
  letter-spacing: 2.5px; cursor: pointer;
  transition: all .2s ease;
  -webkit-tap-highlight-color: transparent;
}
.heritage-gender-btn.active {
  background: rgba(255,255,255,0.09);
  border-color: rgba(255,255,255,0.28);
  color: #fff;
}
.heritage-field { margin-bottom: 0; }
.heritage-label {
  display: block; font-family: 'Space Mono', monospace;
  font-size: 9px; letter-spacing: 2px; text-transform: uppercase;
  color: rgba(255,255,255,0.28); margin-bottom: 8px;
}
.heritage-opt { color: rgba(255,255,255,0.15); }
.heritage-amount-row { display: flex; align-items: center; gap: 10px; }
.heritage-amount-input {
  flex: 1; background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px; padding: 12px 16px;
  color: #fff; font-size: 18px; font-weight: 300;
  font-family: 'Space Mono', monospace;
  outline: none; -webkit-appearance: none;
}
.heritage-amount-input::placeholder { color: rgba(255,255,255,0.12); }
.heritage-amount-input:focus {
  border-color: rgba(255,255,255,0.22);
  background: rgba(255,255,255,0.07);
}
.heritage-currency {
  font-family: 'Space Mono', monospace;
  font-size: 14px; color: rgba(255,255,255,0.28); font-weight: 400;
}
.heritage-amount-hint {
  font-size: 10px !important; color: rgba(255,255,255,0.2) !important;
  margin: 10px 0 0 !important; line-height: 1.55; font-style: italic;
}
.heritage-heir-row {
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 13px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.heritage-heir-label {
  font-size: 11px; font-weight: 400;
  text-transform: uppercase; letter-spacing: 1.2px;
  color: rgba(255,255,255,0.65); flex: 1;
}
.heritage-heir-counter { display: flex; align-items: center; gap: 2px; }
.heritage-counter-btn {
  width: 28px; height: 28px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 50%;
  color: rgba(255,255,255,0.45); font-size: 17px; line-height: 1;
  cursor: pointer; display: flex;
  align-items: center; justify-content: center;
  -webkit-tap-highlight-color: transparent;
  transition: all .15s ease;
}
.heritage-counter-btn:active {
  background: rgba(255,255,255,0.18);
  border-color: rgba(255,255,255,0.3); color: #fff;
}
.heritage-counter-val {
  min-width: 34px; text-align: center;
  font-family: 'Space Mono', monospace;
  font-size: 14px; color: rgba(255,255,255,0.85);
}
/* Legend */
.heritage-legend {
  display: flex; gap: 16px; margin-bottom: 18px; flex-wrap: wrap;
}
.heritage-legend-item {
  display: flex; align-items: center; gap: 7px;
  font-family: 'Space Mono', monospace;
  font-size: 8px; color: rgba(255,255,255,0.3);
  letter-spacing: 1px; text-transform: uppercase;
}
.heritage-legend-dot { width: 12px; height: 3px; border-radius: 2px; flex-shrink: 0; }
.heritage-legend-fard-dot { background: rgba(90, 200, 110, 0.8); }
.heritage-legend-asaba-dot { background: rgba(210, 170, 60, 0.8); }
/* Result rows */
.heritage-result-row {
  display: block;
  padding: 14px 0 4px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.heritage-result-main {
  display: flex; justify-content: space-between; align-items: baseline;
}
.heritage-result-bar-track {
  height: 3px; background: rgba(255,255,255,0.06);
  border-radius: 3px; margin: 8px 0 5px; overflow: hidden;
}
.heritage-result-bar-fill {
  height: 100%; border-radius: 3px;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.heritage-bar-fard { background: rgba(90, 200, 110, 0.75); }
.heritage-bar-asaba { background: rgba(210, 170, 60, 0.75); }
.heritage-result-explanation {
  font-size: 10px !important; color: rgba(255,255,255,0.22) !important;
  font-style: italic; margin: 0 0 10px !important; line-height: 1.5;
}
.heritage-result-label {
  font-size: 11px; font-weight: 400;
  text-transform: uppercase; letter-spacing: 1px;
  color: rgba(255,255,255,0.7);
}
.heritage-result-share {
  font-family: 'Space Mono', monospace;
  font-size: 12px; color: rgba(255,255,255,0.85); text-align: right;
}
.heritage-result-share strong { font-size: 15px; color: #fff; }
.heritage-result-pct {
  font-size: 10px; color: rgba(255,255,255,0.32); margin-left: 4px;
}
.heritage-result-amount { color: rgba(201,168,76,0.85); font-size: 11px; }
.heritage-result-total {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 0 0; margin-top: 6px;
  border-top: 1px solid rgba(255,255,255,0.08);
  font-family: 'Space Mono', monospace;
  font-size: 9px; letter-spacing: 2.5px; text-transform: uppercase;
  color: rgba(255,255,255,0.35);
}
.heritage-result-total span:last-child {
  font-size: 14px; color: rgba(255,255,255,0.7); letter-spacing: 0;
}
.heritage-blocked { opacity: 0.22; }
.heritage-result-blocked-reason {
  font-size: 10px; color: rgba(255,255,255,0.3);
  text-align: right; font-style: italic;
}
.heritage-madhab-note {
  font-size: 10px !important; color: rgba(255,255,255,0.2) !important;
  margin: 28px 0 0 !important; line-height: 1.6; font-style: italic;
}

/* ============================================================
   TESTAMENT OVERLAY
   ============================================================ */
#testament-overlay.moi-cat-overlay {
  background: linear-gradient(165deg, rgba(16,26,14,0.92) 0%, rgba(10,18,8,0.96) 50%, rgba(6,12,4,0.98) 100%) !important;
  backdrop-filter: blur(32px) !important;
  -webkit-backdrop-filter: blur(32px) !important;
}
#testament-overlay .moi-cat-title { margin-bottom: 4px; }
.testament-intro {
  font-size: 12px !important;
  color: rgba(255,255,255,0.35) !important;
  font-weight: 300 !important;
  margin: 0 0 36px !important;
  line-height: 1.65;
}
.testament-section {
  margin-bottom: 32px;
}
.testament-section-title {
  display: flex; align-items: center; gap: 12px;
  font-family: 'Space Mono', monospace;
  font-size: 9px; letter-spacing: 3px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.28);
  margin: 0 0 16px; font-weight: 400;
}
.testament-section-title::after {
  content: ''; flex: 1; height: 1px;
  background: linear-gradient(90deg, rgba(255,255,255,0.07) 0%, transparent 100%);
}
.testament-opt {
  color: rgba(255,255,255,0.18); font-size: 8px;
  letter-spacing: 0; text-transform: none;
  font-family: -apple-system, 'Helvetica Neue', sans-serif;
  font-style: italic;
}
.testament-hint {
  font-size: 11px !important;
  color: rgba(255,255,255,0.25) !important;
  margin: -8px 0 16px !important;
  line-height: 1.55; font-style: italic;
}
.testament-field { margin-bottom: 14px; }
.testament-field-row { display: flex; gap: 10px; }
.testament-field-row .testament-field { flex: 1; }
.testament-label {
  display: block; font-family: 'Space Mono', monospace;
  font-size: 8px; letter-spacing: 2.5px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.3); margin-bottom: 7px;
}
.testament-input, .testament-textarea {
  width: 100%; box-sizing: border-box;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px; padding: 12px 14px;
  color: rgba(255,255,255,0.85); font-size: 14px; font-weight: 300;
  font-family: -apple-system, 'Helvetica Neue', sans-serif;
  outline: none; -webkit-appearance: none;
  transition: border-color 0.2s, background 0.2s;
}
.testament-input:focus, .testament-textarea:focus {
  border-color: rgba(255,255,255,0.22);
  background: rgba(255,255,255,0.07);
}
.testament-textarea {
  resize: vertical; min-height: 90px; line-height: 1.55;
}
.testament-generate-btn {
  display: block; width: 100%;
  margin-top: 36px; padding: 17px;
  background: rgba(201,168,76,0.12);
  border: 1px solid rgba(201,168,76,0.35);
  border-radius: 14px;
  color: rgba(201,168,76,0.9);
  font-family: 'Space Mono', monospace;
  font-size: 11px; letter-spacing: 2.5px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.testament-generate-btn:active {
  background: rgba(201,168,76,0.22);
  border-color: rgba(201,168,76,0.55);
}

/* ============================================================
   HERITAGE SHARE BUTTON
   ============================================================ */
.heritage-share-btn {
  display: block;
  width: 100%;
  margin: 18px 0 0;
  padding: 14px 0;
  background: rgba(255,230,158,0.12);
  border: 1px solid rgba(255,230,158,0.25);
  color: rgba(255,230,158,0.85);
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  border-radius: 12px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.heritage-share-btn:active {
  background: rgba(255,230,158,0.2);
}

/* ============================================================
   HERITAGE + TESTAMENT PRINT DOCUMENTS
   ============================================================ */
#heritage-print-doc,
#testament-print-doc,
#zakat-print-doc {
  display: none;
}
@media print {
  body * { visibility: hidden !important; }
  #testament-print-doc, #testament-print-doc *,
  #heritage-print-doc, #heritage-print-doc * {
    visibility: visible !important;
  }
  #heritage-print-doc,
  #testament-print-doc {
    display: block !important;
    position: fixed; inset: 0;
    padding: 2.2cm 2.8cm;
    font-family: Georgia, 'Times New Roman', serif;
    color: #111; background: #fff;
    font-size: 11.5pt; line-height: 1.75;
    box-sizing: border-box;
  }
  .tpd-bismillah {
    text-align: center; font-size: 24pt;
    direction: rtl; unicode-bidi: bidi-override;
    margin-bottom: 14pt; color: #1a1a1a;
    font-family: 'Arial', 'Amiri', sans-serif;
  }
  .tpd-title {
    text-align: center; font-size: 15pt;
    font-weight: bold; letter-spacing: 4px;
    margin: 0 0 3pt; text-transform: uppercase;
    color: #000;
  }
  .tpd-subtitle {
    text-align: center; font-size: 10.5pt;
    color: #444; margin: 0 0 6pt;
    font-style: italic;
  }
  .tpd-shahada {
    text-align: center; font-size: 16pt;
    direction: rtl; unicode-bidi: bidi-override;
    margin: 10pt 0 3pt;
    font-family: 'Arial', 'Amiri', sans-serif;
    color: #1a1a1a;
  }
  .tpd-shahada-fr {
    text-align: center; font-size: 9.5pt;
    font-style: italic; color: #555;
    margin: 0 0 20pt;
    border-bottom: 0.5pt solid #ccc;
    padding-bottom: 14pt;
  }
  .tpd-section { margin-bottom: 13pt; }
  .tpd-section-title {
    font-size: 9pt; font-weight: bold;
    text-transform: uppercase; letter-spacing: 2px;
    color: #222;
    border-bottom: 0.5pt solid #bbb;
    padding-bottom: 2.5pt; margin: 0 0 5pt;
  }
  .tpd-body-text { margin: 3pt 0; color: #222; }
  .tpd-signature-block {
    margin-top: 28pt;
    border-top: 0.5pt solid #bbb;
    padding-top: 10pt;
  }
  .tpd-sig-lieu { margin: 0 0 18pt; font-size: 10.5pt; }
  .tpd-sig-line { font-size: 10.5pt; margin-top: 20pt; color: #333; }
  /* Heritage table print styles */
  .hpd-table {
    width: 100%; border-collapse: collapse;
    margin: 16pt 0; font-size: 10.5pt;
  }
  .hpd-table th {
    text-align: left; font-size: 8.5pt; font-weight: bold;
    text-transform: uppercase; letter-spacing: 1.5px; color: #333;
    border-bottom: 1pt solid #222; padding: 4pt 8pt 4pt 0;
  }
  .hpd-table td {
    padding: 5pt 8pt 5pt 0;
    border-bottom: 0.5pt solid #ddd;
    vertical-align: top;
  }
  .hpd-table th:last-child, .hpd-table td:last-child { text-align: right; padding-right: 0; }
  .hpd-table th:nth-child(2), .hpd-table td:nth-child(2),
  .hpd-table th:nth-child(3), .hpd-table td:nth-child(3) { text-align: center; }
  .hpd-blocked td { color: #999; font-style: italic; text-decoration: line-through; }
  .hpd-total td { border-top: 1pt solid #222; border-bottom: none; font-weight: bold; }
  .hpd-type { font-size: 9pt; color: #777; }
  .hpd-footer {
    margin-top: 24pt; border-top: 0.5pt solid #bbb;
    padding-top: 8pt; font-size: 9pt; color: #777;
    text-align: center;
  }
  .hpd-footer p { margin: 2pt 0; }
}

/* ============================================================
   TESTAMENT DOCUMENT VIEWER (in-app)
   ============================================================ */
#testament-doc-viewer {
  background: #f0ede8;
  z-index: 8500;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.tdv-topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px 12px;
  background: #fff;
  border-bottom: 1px solid rgba(0,0,0,0.1);
  flex-shrink: 0;
}
.tdv-close-btn {
  background: none; border: none;
  color: #555; cursor: pointer; padding: 4px;
  display: flex; align-items: center;
  -webkit-tap-highlight-color: transparent;
}
.tdv-label {
  font-family: 'Space Mono', monospace;
  font-size: 9px; letter-spacing: 2.5px; color: #888;
}
.tdv-print-btn {
  background: #1a1a1a; color: #fff; border: none;
  padding: 9px 14px; border-radius: 8px;
  font-family: 'Space Mono', monospace;
  font-size: 9px; letter-spacing: 1.5px;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.tdv-scroll {
  flex: 1; overflow-y: auto;
  padding: 28px 16px 56px;
}
.tdv-doc {
  background: #fff;
  padding: 32px 24px;
  max-width: 560px;
  margin: 0 auto;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 11pt; line-height: 1.75; color: #111;
  box-shadow: 0 2px 24px rgba(0,0,0,0.12);
  border-radius: 4px;
}
/* Screen styles for tpd-* elements inside viewer */
#testament-doc-viewer .tpd-bismillah {
  text-align: center; font-size: 20pt;
  direction: rtl; unicode-bidi: bidi-override;
  margin-bottom: 10pt; color: #1a1a1a;
  font-family: 'Arial', sans-serif;
}
#testament-doc-viewer .tpd-title {
  text-align: center; font-size: 13pt;
  font-weight: bold; letter-spacing: 4px;
  text-transform: uppercase; margin: 0 0 3pt; color: #000;
}
#testament-doc-viewer .tpd-subtitle {
  text-align: center; font-size: 10pt;
  color: #555; margin: 0 0 6pt; font-style: italic;
}
#testament-doc-viewer .tpd-shahada {
  text-align: center; font-size: 14pt;
  direction: rtl; unicode-bidi: bidi-override;
  margin: 8pt 0 3pt; color: #1a1a1a;
  font-family: 'Arial', sans-serif;
}
#testament-doc-viewer .tpd-shahada-fr {
  text-align: center; font-size: 9pt;
  font-style: italic; color: #666;
  margin: 0 0 18pt;
  border-bottom: 0.5pt solid #ccc;
  padding-bottom: 12pt;
}
#testament-doc-viewer .tpd-section { margin-bottom: 12pt; }
#testament-doc-viewer .tpd-section-title {
  font-size: 8.5pt; font-weight: bold;
  text-transform: uppercase; letter-spacing: 2px;
  color: #333;
  border-bottom: 0.5pt solid #ccc;
  padding-bottom: 2pt; margin: 0 0 5pt;
}
#testament-doc-viewer .tpd-body-text { margin: 3pt 0; color: #333; }
#testament-doc-viewer .tpd-signature-block {
  margin-top: 24pt; border-top: 0.5pt solid #bbb; padding-top: 8pt;
}
#testament-doc-viewer .tpd-sig-lieu { margin: 0 0 16pt; }
#testament-doc-viewer .tpd-sig-line { margin-top: 18pt; color: #444; }
/* Heritage doc viewer screen styles */
#testament-doc-viewer .hpd-table {
  width: 100%; border-collapse: collapse;
  margin: 14pt 0; font-size: 10pt;
}
#testament-doc-viewer .hpd-table th {
  text-align: left; font-size: 8pt; font-weight: bold;
  text-transform: uppercase; letter-spacing: 1.5px; color: #444;
  border-bottom: 1pt solid #333; padding: 3pt 6pt 3pt 0;
}
#testament-doc-viewer .hpd-table td {
  padding: 4pt 6pt 4pt 0;
  border-bottom: 0.5pt solid #ddd;
  vertical-align: top;
}
#testament-doc-viewer .hpd-table th:last-child,
#testament-doc-viewer .hpd-table td:last-child { text-align: right; padding-right: 0; }
#testament-doc-viewer .hpd-table th:nth-child(2),
#testament-doc-viewer .hpd-table td:nth-child(2),
#testament-doc-viewer .hpd-table th:nth-child(3),
#testament-doc-viewer .hpd-table td:nth-child(3) { text-align: center; }
#testament-doc-viewer .hpd-blocked td { color: #aaa; font-style: italic; text-decoration: line-through; }
#testament-doc-viewer .hpd-total td { border-top: 1pt solid #333; border-bottom: none; font-weight: bold; }
#testament-doc-viewer .hpd-type { font-size: 8.5pt; color: #888; }
#testament-doc-viewer .hpd-footer {
  margin-top: 20pt; border-top: 0.5pt solid #ccc;
  padding-top: 8pt; font-size: 8.5pt; color: #888;
  text-align: center;
}
#testament-doc-viewer .hpd-footer p { margin: 2pt 0; }
.tdv-tip {
  margin: 24px auto 0; max-width: 560px;
  font-size: 11px; color: #999;
  text-align: center; font-style: italic; line-height: 1.5;
}

/* ============================================================
   ZAKAT CALCULATOR
   ============================================================ */
#zakat-overlay.moi-cat-overlay {
  background: linear-gradient(165deg, rgb(10,22,16) 0%, rgb(6,16,10) 50%, rgb(4,12,8) 100%) !important;
}
.zakat-intro {
  font-size: 14px; color: rgba(255,255,255,0.5); line-height: 1.6;
  margin: 0 0 28px;
}
.zakat-section {
  margin-bottom: 32px;
}
.zakat-section-title {
  font-family: 'Space Mono', 'SF Mono', monospace;
  font-size: 10px; letter-spacing: 2.5px; color: rgba(255,255,255,0.35);
  margin: 0 0 16px; padding-bottom: 8px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
/* ---- Zakat Save Button ---- */
.zakat-save-btn {
  display: block; width: 100%; margin: 18px 0 0;
  padding: 14px 0;
  background: rgba(16,185,129,0.1);
  border: 1px solid rgba(16,185,129,0.25);
  color: rgba(16,185,129,0.85);
  font-family: 'Space Mono', monospace;
  font-size: 10px; letter-spacing: 2px; text-transform: uppercase;
  border-radius: 12px; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.zakat-save-btn:active { background: rgba(16,185,129,0.2); }
/* ---- Zakat History ---- */
.zakat-history-section { margin-top: 28px; }
.zakat-fiche {
  background: rgba(16,185,129,0.07);
  border: 1px solid rgba(16,185,129,0.15);
  border-radius: 12px; padding: 14px 16px; margin-bottom: 10px;
}
.zakat-fiche-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 12px;
}
.zakat-fiche-title {
  font-size: 13px; font-weight: 600; color: rgba(255,255,255,0.9);
  margin-bottom: 4px;
}
.zakat-fiche-meta {
  font-family: 'Space Mono', monospace;
  font-size: 9px; color: rgba(255,255,255,0.35); letter-spacing: 0.3px;
  line-height: 1.5;
}
.zakat-fiche-amount {
  font-size: 17px; font-weight: 700; color: #10b981;
  white-space: nowrap; margin-left: 12px;
}
.zakat-fiche-actions { display: flex; gap: 8px; }
.zakat-fiche-pdf-btn {
  flex: 1; padding: 8px 0;
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.6); border-radius: 8px; cursor: pointer;
  font-family: 'Space Mono', monospace; font-size: 9px; letter-spacing: 1.5px;
  -webkit-tap-highlight-color: transparent;
}
.zakat-fiche-pdf-btn:active { background: rgba(255,255,255,0.12); }
.zakat-fiche-del-btn {
  width: 36px; height: 36px;
  background: rgba(239,68,68,0.08); border: 1px solid rgba(239,68,68,0.2);
  color: rgba(239,68,68,0.7); border-radius: 8px; cursor: pointer;
  font-size: 18px; line-height: 1; display: flex; align-items: center; justify-content: center;
  -webkit-tap-highlight-color: transparent;
}
.zakat-fiche-del-btn:active { background: rgba(239,68,68,0.2); }
/* ---- Zakat Print Doc viewer styles ---- */
#testament-doc-viewer .zpd-summary {
  margin-top: 14pt; border-top: 0.5pt solid #ddd; padding-top: 10pt;
}
#testament-doc-viewer .zpd-summary-row {
  display: flex; justify-content: space-between;
  padding: 4pt 0; font-size: 10pt; color: #333;
  border-bottom: 0.5pt solid #eee;
}
#testament-doc-viewer .zpd-badge {
  font-size: 9pt; font-weight: bold; padding: 1pt 6pt; border-radius: 3pt;
}
#testament-doc-viewer .zpd-badge-ok { background: #d1fae5; color: #059669; }
#testament-doc-viewer .zpd-badge-no { background: #fee2e2; color: #dc2626; }
#testament-doc-viewer .zpd-zakat-due {
  font-weight: bold; color: #111; border-bottom: none; padding-top: 8pt;
}
/* Zakat print styles */
@media print {
  #zakat-print-doc, #zakat-print-doc * { visibility: visible !important; }
  #zakat-print-doc {
    display: block !important; position: fixed; inset: 0;
    padding: 2.2cm 2.8cm;
    font-family: Georgia, 'Times New Roman', serif;
    color: #111; background: #fff; font-size: 11pt; line-height: 1.75;
    box-sizing: border-box;
  }
  .zpd-summary { margin-top: 14pt; border-top: 0.5pt solid #ccc; padding-top: 10pt; }
  .zpd-summary-row {
    display: flex; justify-content: space-between;
    padding: 4pt 0; font-size: 10pt; color: #333;
    border-bottom: 0.5pt solid #eee;
  }
  .zpd-badge { font-size: 9pt; font-weight: bold; }
  .zpd-zakat-due { font-weight: bold; color: #111; padding-top: 8pt; }
}
.zakat-hint {
  font-size: 12px; color: rgba(255,255,255,0.3); line-height: 1.5;
  margin: -8px 0 16px;
}
.zakat-field {
  margin-bottom: 18px;
}
.zakat-label {
  display: block; font-family: 'Space Mono', 'SF Mono', monospace;
  font-size: 11px; letter-spacing: 1px; color: rgba(255,255,255,0.5);
  margin-bottom: 6px; text-transform: uppercase;
}
.zakat-field-hint {
  display: block; font-size: 11px; color: rgba(255,255,255,0.25);
  margin: -2px 0 8px;
}
.zakat-opt {
  font-size: 9px; color: rgba(255,255,255,0.25); text-transform: none;
  letter-spacing: 0;
}
.zakat-amount-row {
  display: flex; align-items: center; gap: 8px;
}
.zakat-amount-input {
  flex: 1; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px; color: #fff; font-size: 16px; padding: 12px 14px;
  outline: none; -webkit-appearance: none;
}
.zakat-amount-input:focus {
  border-color: rgba(139,201,154,0.4);
}
.zakat-currency {
  font-family: 'Space Mono', 'SF Mono', monospace;
  font-size: 13px; color: rgba(255,255,255,0.3); min-width: 28px;
}
.zakat-input {
  width: 100%; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px; color: #fff; font-size: 15px; padding: 12px 14px;
  outline: none; -webkit-appearance: none; box-sizing: border-box;
}
.zakat-input:focus { border-color: rgba(139,201,154,0.4); }

/* Hijri display */
.zakat-hijri-display {
  text-align: center; margin: 0 0 20px; padding: 16px;
  background: rgba(139,201,154,0.06); border-radius: 12px;
  border: 1px solid rgba(139,201,154,0.1);
}
.zakat-hijri-date {
  font-size: 22px; color: #8BC99A; direction: rtl;
  font-weight: 600; margin-bottom: 4px;
}
.zakat-hijri-label {
  font-size: 12px; color: rgba(255,255,255,0.35);
}

/* Nisab toggle */
.zakat-nisab-toggle {
  display: flex; gap: 8px; margin-bottom: 18px;
}
.zakat-nisab-btn {
  flex: 1; padding: 10px 0; border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.1); background: transparent;
  color: rgba(255,255,255,0.4); font-family: 'Space Mono', 'SF Mono', monospace;
  font-size: 11px; letter-spacing: 1px; cursor: pointer;
  transition: all 0.2s;
}
.zakat-nisab-btn.active {
  background: rgba(139,201,154,0.12); border-color: rgba(139,201,154,0.3);
  color: #8BC99A;
}
.zakat-nisab-result {
  padding: 12px 14px; background: rgba(255,255,255,0.04);
  border-radius: 10px; margin-top: 12px;
}
.zakat-nisab-label {
  display: block; font-size: 10px; color: rgba(255,255,255,0.3);
  font-family: 'Space Mono', 'SF Mono', monospace; letter-spacing: 1.5px;
  text-transform: uppercase; margin-bottom: 4px;
}
.zakat-nisab-value {
  font-size: 13px; color: rgba(255,255,255,0.6);
}
.zakat-nisab-value strong { color: #8BC99A; }

/* Hawl status */
.zakat-hawl-status {
  margin-top: 14px; padding: 14px; background: rgba(255,255,255,0.04);
  border-radius: 10px;
}
.zakat-hawl-complete {
  display: block; font-family: 'Space Mono', 'SF Mono', monospace;
  font-size: 12px; letter-spacing: 1.5px; color: #8BC99A; font-weight: 600;
}
.zakat-hawl-pending {
  display: block; font-family: 'Space Mono', 'SF Mono', monospace;
  font-size: 14px; color: rgba(255,225,160,0.85); font-weight: 600;
}
.zakat-hawl-detail {
  display: block; font-size: 11px; color: rgba(255,255,255,0.3); margin-top: 4px;
}
.zakat-hawl-bar-track {
  height: 4px; background: rgba(255,255,255,0.06); border-radius: 2px;
  margin-top: 10px; overflow: hidden;
}
.zakat-hawl-bar-fill {
  height: 100%; background: linear-gradient(90deg, rgba(139,201,154,0.6), #8BC99A);
  border-radius: 2px; transition: width 0.3s;
}

/* Results */
.zakat-breakdown {
  margin-bottom: 20px;
}
.zakat-breakdown-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,0.04);
}
.zakat-breakdown-label {
  font-size: 13px; color: rgba(255,255,255,0.5);
}
.zakat-breakdown-value {
  font-family: 'Space Mono', 'SF Mono', monospace;
  font-size: 13px; color: rgba(255,255,255,0.7);
}
.zakat-breakdown-deduct .zakat-breakdown-label,
.zakat-breakdown-deduct .zakat-breakdown-value {
  color: rgba(220,120,120,0.7);
}
.zakat-breakdown-total {
  border-bottom: none; padding-top: 12px; margin-top: 4px;
  border-top: 1px solid rgba(255,255,255,0.1);
}
.zakat-breakdown-total .zakat-breakdown-label {
  font-weight: 600; color: rgba(255,255,255,0.7);
}
.zakat-breakdown-total .zakat-breakdown-value {
  font-weight: 700; color: #fff;
}

/* Nisab comparison */
.zakat-comparison { margin-bottom: 20px; text-align: center; }
.zakat-comparison-badge {
  display: inline-block; padding: 8px 20px; border-radius: 20px;
  font-family: 'Space Mono', 'SF Mono', monospace;
  font-size: 10px; letter-spacing: 1.5px;
}
.zakat-above-nisab {
  background: rgba(139,201,154,0.12); color: #8BC99A;
  border: 1px solid rgba(139,201,154,0.25);
}
.zakat-below-nisab {
  background: rgba(255,255,255,0.04); color: rgba(255,255,255,0.35);
  border: 1px solid rgba(255,255,255,0.08);
}
.zakat-no-zakat {
  font-size: 13px; color: rgba(255,255,255,0.35); margin-top: 12px;
}

/* Final amount */
.zakat-final {
  text-align: center; padding: 24px 0; margin-bottom: 16px;
}
.zakat-final-label {
  font-family: 'Space Mono', 'SF Mono', monospace;
  font-size: 10px; letter-spacing: 2.5px; color: rgba(139,201,154,0.6);
  margin-bottom: 8px;
}
.zakat-final-amount {
  font-size: 42px; font-weight: 700; color: #8BC99A;
  font-family: 'Space Mono', 'SF Mono', monospace;
}
.zakat-hawl-note {
  font-size: 11px; color: rgba(255,225,160,0.6); margin-top: 8px;
  font-style: italic;
}

/* Bar */
.zakat-bar-container { margin-bottom: 24px; }
.zakat-bar-track {
  height: 6px; background: rgba(255,255,255,0.06); border-radius: 3px;
  overflow: hidden;
}
.zakat-bar-fill {
  height: 100%; background: linear-gradient(90deg, rgba(139,201,154,0.5), #8BC99A);
  border-radius: 3px; transition: width 0.3s;
}
.zakat-bar-labels {
  display: flex; justify-content: space-between;
  font-size: 10px; color: rgba(255,255,255,0.2); margin-top: 4px;
}

/* Quranic reference */
.zakat-reference {
  text-align: center; margin: 28px 0 0; padding: 20px;
  background: rgba(139,201,154,0.04); border-radius: 12px;
  border: 1px solid rgba(139,201,154,0.08);
  font-size: 18px; color: rgba(255,255,255,0.7);
  direction: rtl; line-height: 1.8;
}
.zakat-ref-fr {
  display: block; direction: ltr; font-size: 11px;
  color: rgba(255,255,255,0.3); margin-top: 8px;
  font-style: italic; line-height: 1.5;
}

/* ============================================================
   SHOOTING STARS — Dashboard
   ============================================================ */
#dash-shooting-stars {
  position: fixed; inset: 0;
  pointer-events: none; overflow: hidden;
  z-index: 1;
}
.shooting-star {
  position: absolute;
  height: 1.5px;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.75) 55%, rgba(255,255,255,0.15) 100%);
  border-radius: 0 2px 2px 0;
  pointer-events: none;
  animation: shoot-star 0.85s ease-out forwards;
}
@keyframes shoot-star {
  0%   { opacity: 0; transform: translate(0, 0) rotate(-35deg); }
  18%  { opacity: 0.9; }
  80%  { opacity: 0.3; }
  100% { opacity: 0; transform: translate(-220px, 110px) rotate(-35deg); }
}

#shazam-overlay.moi-cat-overlay {
  background: #000 !important;
}
#shazam-overlay .shazam-topbar { position: absolute; z-index: 3; }
#shazam-overlay .shazam-body { position: relative; z-index: 2; }
#stats-overlay.moi-cat-overlay {
  background: #000 !important;
  overflow: hidden;
  z-index: 310;
}
#stats-bg {
  position: absolute;
  inset: -15%;
  background-size: cover;
  background-position: center;
  filter: blur(28px) brightness(0.35) saturate(0.8);
  z-index: 0;
  pointer-events: none;
}
#stats-overlay.moi-cat-overlay::before {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: rgba(0,0,0,0.35);
}
#stats-overlay.moi-cat-overlay::after {
  content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: linear-gradient(
    105deg, transparent 0%, transparent 35%,
    rgba(255,230,160,0.12) 42%, rgba(255,230,160,0.18) 50%,
    rgba(255,230,160,0.08) 58%, transparent 65%, transparent 100%
  );
  background-size: 300% 100%;
  background-position: 100% 0;
  animation: prayer-sun-sweep 7s ease-in-out 0.3s infinite;
}
#stats-overlay .moi-cat-scroll { position: relative; z-index: 3; }
#stats-overlay .moi-cat-title { text-shadow: 0 1px 8px rgba(0,0,0,0.4); }

/* Content typography within gradient overlays */
.moi-cat-body p {
  font-size: 15px;
  color: rgba(255,255,255,0.6);
  line-height: 1.7;
  margin: 0 0 14px;
  font-weight: 300;
}
.moi-cat-body .sub-label {
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.3);
  margin-bottom: 8px;
  font-weight: 400;
}
.moi-cat-body .highlight {
  color: rgba(255,255,255,0.9);
  font-weight: 400;
}
.moi-cat-body .divider {
  border: none;
  border-top: 1px solid rgba(255,255,255,0.06);
  margin: 24px 0;
}

/* Help sections within gradient overlay */
.moi-cat-body .help-section {
  margin-bottom: 28px;
}
.moi-cat-body .help-section:last-child {
  margin-bottom: 0;
}
.moi-cat-body .help-title {
  font-size: 15px;
  font-weight: 400;
  color: rgba(255,255,255,0.85);
  margin-bottom: 8px;
}
.moi-cat-body .help-text {
  font-size: 14px;
  color: rgba(255,255,255,0.5);
  line-height: 1.7;
  font-weight: 300;
}
.moi-cat-body .help-section-highlight {
  background: rgba(255,255,255,0.04);
  border-radius: 14px;
  padding: 20px;
  border: 1px solid rgba(255,255,255,0.06);
}

/* Empty states within gradient overlay */
.moi-cat-body .bookmarks-empty {
  font-size: 14px;
  color: rgba(255,255,255,0.35);
  text-align: center;
  padding: 60px 20px;
  line-height: 1.7;
  font-weight: 300;
}

/* Settings widgets within gradient overlay */
.moi-cat-body .setting-group {
  margin-bottom: 32px;
}
.moi-cat-body .setting-label {
  font-size: 11px;
  color: rgba(255,255,255,0.35);
  margin-bottom: 10px;
  letter-spacing: 0.5px;
}
.moi-cat-body .setting-value {
  color: rgba(255,255,255,0.8);
  font-size: 14px;
}
.moi-cat-body .setting-btn {
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.5);
  border-color: rgba(255,255,255,0.08);
}
.moi-cat-body .setting-btn.active {
  background: rgba(255,255,255,0.12);
  color: #fff;
  border-color: rgba(255,255,255,0.2);
}
.moi-cat-body .setting-btn:hover {
  color: rgba(255,255,255,0.7);
  border-color: rgba(255,255,255,0.12);
}

/* Favorites list — new design */
.fav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.fav-item:last-child { border-bottom: none; }
.fav-item:active { background: rgba(255,255,255,0.04); }
.fav-thumb {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}
.fav-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.fav-title {
  font-size: 15px;
  font-weight: 500;
  color: rgba(255,255,255,0.88);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fav-sub {
  font-size: 11px;
  font-family: 'Space Mono', monospace;
  color: rgba(255,255,255,0.32);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.fav-menu {
  background: none;
  border: none;
  color: rgba(255,255,255,0.25);
  font-size: 22px;
  padding: 8px;
  cursor: pointer;
  flex-shrink: 0;
  letter-spacing: 2px;
}
.fav-menu:active { color: rgba(255,255,255,0.5); }

/* Note list items within gradient overlay */
.moi-cat-body .note-list-item {
  border-color: rgba(255,255,255,0.05);
}

/* Khatm items within gradient overlay */
.moi-cat-body .moi-khatm-active-card {
  background: rgba(255,255,255,0.04);
}
.moi-cat-body .moi-khatm-section-header {
  color: rgba(255,255,255,0.3);
}

/* Reminder note within settings gradient */
.moi-cat-body .reminder-note {
  color: rgba(255,255,255,0.35);
}

/* Stat cards within gradient overlay */
.moi-cat-body .stat-card {
  background: rgba(255,255,255,0.08);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-color: rgba(255,255,255,0.12);
}
.moi-cat-body .stat-value {
  color: #fff;
  text-shadow: 0 1px 6px rgba(0,0,0,0.3);
}
.moi-cat-body .stat-label {
  color: rgba(255,255,255,0.55);
}

/* Reciter select within gradient overlay */
.moi-cat-body .recit-select {
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.8);
  border-color: rgba(255,255,255,0.1);
}

/* Reminder elements within gradient overlay */
.moi-cat-body .reminder-time-badge {
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.6);
}
.moi-cat-body .reminder-toggle-btn {
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.8);
  border-color: rgba(255,255,255,0.1);
}
.moi-cat-body .reminder-confirm {
  color: rgba(255,255,255,0.5);
}
.moi-cat-body .reminder-status {
  color: rgba(255,255,255,0.6);
}
.moi-cat-body .setting-hint {
  color: rgba(255,255,255,0.3);
}
.moi-cat-body .setting-sub-label {
  color: rgba(255,255,255,0.3);
}

/* ============================================
   SURAH PLAYER ACTION BAR
   ============================================ */
#sp-action-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 14px 24px calc(18px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, rgba(0,0,0,0.92) 0%, rgba(0,0,0,0.6) 60%, transparent 100%);
  transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}
#sp-action-bar.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(16px) scale(0.95);
}
.sp-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.1);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.8);
  cursor: pointer;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.15s ease, background 0.15s ease;
}
.sp-action-btn:active {
  transform: scale(0.9);
  background: rgba(255,255,255,0.16);
}
/* ---- KHATM ACTION BAR ---- */
#kr-action-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10000;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 14px 24px calc(18px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, rgba(0,0,0,0.92) 0%, rgba(0,0,0,0.6) 60%, transparent 100%);
  transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}
#kr-action-bar.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(16px) scale(0.95);
}
.kr-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.1);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.8);
  cursor: pointer;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.15s ease, background 0.15s ease;
}
.kr-action-btn:active {
  transform: scale(0.9);
  background: rgba(255,255,255,0.16);
}
#kr-action-heart.kr-heart-active svg {
  fill: #ef4444;
  stroke: #ef4444;
}
#sp-action-heart.sp-heart-active svg {
  fill: #ef4444;
  stroke: #ef4444;
}
#sp-action-heart.sp-heart-active {
  background: rgba(239,68,68,0.15);
  border-color: rgba(239,68,68,0.2);
}
.sp-verse-heart {
  color: #ef4444;
  font-size: 0.65rem;
  margin-left: 6px;
  vertical-align: middle;
}

/* ============================================
   NOTE EDITOR SHEET
   ============================================ */
.note-editor-wrap {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.note-editor-wrap.hidden { display: none; }
.note-editor-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
}
.note-editor-sheet {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 500px;
  background: #1a1a1a;
  border-radius: 20px 20px 0 0;
  padding: 16px 20px calc(20px + env(safe-area-inset-bottom));
}
.note-editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.note-editor-cancel,
.note-editor-save {
  background: none;
  border: none;
  color: rgba(255,255,255,0.6);
  padding: 4px;
  cursor: pointer;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
}
.note-editor-save { color: #fff; background: rgba(255,255,255,0.12); }
.note-editor-ref {
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.8px;
  color: rgba(255,255,255,0.4);
}
.note-editor-input {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.88);
  font-size: 15px;
  line-height: 1.6;
  padding: 14px 0;
  resize: none;
  outline: none;
  font-family: system-ui, -apple-system, sans-serif;
}
.note-editor-input::placeholder {
  color: rgba(255,255,255,0.2);
}

/* ============================================
   NOTES LIST
   ============================================ */
.note-list-item {
  display: flex;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.note-list-item:active { opacity: 0.7; }
.note-list-thumb {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
  background-color: rgba(255,255,255,0.06);
}
.note-list-info { flex: 1; min-width: 0; }
.note-list-ref {
  font-size: 14px;
  font-weight: 500;
  color: rgba(255,255,255,0.9);
  margin-bottom: 4px;
}
.note-list-text {
  font-size: 13px;
  color: rgba(255,255,255,0.45);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.note-list-date {
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  color: rgba(255,255,255,0.2);
  margin-top: 6px;
}

/* ============================================
   MOI KHATMS LIST
   ============================================ */
.moi-khatm-active-card {
  background: rgba(255,255,255,0.04);
  border-radius: 14px;
  padding: 16px 18px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.moi-khatm-active-info {
  flex: 1;
  min-width: 0;
}
.moi-khatm-arrow {
  flex-shrink: 0;
  color: rgba(255,255,255,0.35);
}
.moi-khatm-status {
  font-family: 'Space Mono', monospace;
  font-size: 9px;
  letter-spacing: 1.2px;
  color: #FF8C00;
  margin-bottom: 6px;
}
.moi-khatm-title {
  font-size: 16px;
  font-weight: 400;
  color: rgba(255,255,255,0.9);
  margin-bottom: 4px;
}
.moi-khatm-progress {
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  color: rgba(255,255,255,0.35);
}
.moi-khatm-section-header {
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  letter-spacing: 1px;
  color: rgba(255,255,255,0.25);
  padding: 12px 0 8px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.moi-khatm-session {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.moi-khatm-session-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.moi-khatm-session-range {
  font-size: 13px;
  color: rgba(255,255,255,0.7);
}
.moi-khatm-session-date {
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  color: rgba(255,255,255,0.25);
}

/* ---- IPAD PRO / LANDSCAPE (1024px+) ---- */
@media (min-width: 1024px) {
  .dashboard {
    padding-left: 12%;
    padding-right: 12%;
  }
  .dash-card-prompt { font-size: 38px; }
  .dash-verse-title { font-size: 28px; }
  .dash-emotion-selected { font-size: 58px; }
  .dash-emotion-question { font-size: 22px; }

  .overlay-body { max-width: 800px; }

  #khatm-hero { height: 440px; }
  #khatm-hero-content { padding-left: 60px; padding-right: 60px; }

  /* Surah player — wider reader content */
  #sp-reader-content { padding-left: 48px; padding-right: 48px; }
  #sp-reader-name { font-size: 2.2rem; }

  /* Tab bar — more spacing */
  .tab-bar-label { font-size: 13px; letter-spacing: 2.5px; }

  /* Mini player — centered on iPad */
  #sp-mini { left: 20%; right: 20%; max-width: 500px; margin: 0 auto; }
}

/* ============================================================
   MIN MODE — Triangle button + Hub + Reader
   ============================================================ */

/* Triangle button in QURAN hero */
#min-mode-btn {
  position: absolute;
  top: 52px;
  left: 24px;
  z-index: 20;
  background: rgba(255,255,255,0.12);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
#min-mode-btn:active { opacity: 0.5; }
#min-mode-btn.min-pulse {
  animation: minPulse 2.4s ease-in-out infinite;
}
@keyframes minPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,255,255,0); }
  50% { box-shadow: 0 0 12px 4px rgba(255,255,255,0.35); }
}

/* ---- Hub overlay ---- */
#min-hub-overlay {
  background: #0c0c0c; /* défaut = dark, overridé par min-t-* */
  z-index: 400;
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0;
}
.min-back-btn {
  position: absolute;
  top: max(20px, env(safe-area-inset-top, 20px));
  left: 12px;
  z-index: 10;
  background: none;
  border: none;
  color: rgba(255,255,255,0.38);
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}
#min-hub-inner {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 72px 32px 48px;
  gap: 36px;
  overflow-y: auto;
}
#min-hub-title {
  font-size: 10px;
  letter-spacing: 0.22em;
  color: rgba(255,255,255,0.22);
  text-transform: uppercase;
}
#min-hub-items { display: flex; flex-direction: column; }
.min-hub-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.min-hub-item:active { opacity: 0.6; }
.min-hub-item-meta {
  font-size: 10px;
  letter-spacing: 0.13em;
  color: rgba(255,255,255,0.28);
  text-transform: uppercase;
  flex-shrink: 0;
  width: 90px;
}
.min-hub-item-name {
  flex: 1;
  font-size: 17px;
  color: rgba(255,255,255,0.82);
  font-weight: 300;
}
.min-hub-sep { height: 1px; background: rgba(255,255,255,0.06); }
.min-hub-arrow { color: rgba(255,255,255,0.18); flex-shrink: 0; }
#min-hub-prefs {
  display: flex;
  flex-direction: column;
  gap: 15px;
  border-top: 1px solid rgba(255,255,255,0.06);
  padding-top: 24px;
}
.min-hub-pref-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.min-pref-label {
  font-size: 10px;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.28);
  text-transform: uppercase;
  flex-shrink: 0;
}
.min-pref-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
}
.min-pref-opt {
  background: none;
  border: none;
  padding: 0;
  font-size: 11px;
  letter-spacing: 0.05em;
  color: rgba(255,255,255,0.18);
  cursor: pointer;
  font-family: inherit;
  transition: color 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.min-pref-opt.active { color: rgba(255,255,255,0.88); }
.min-pref-sep { color: rgba(255,255,255,0.12); font-size: 10px; pointer-events: none; }
.min-reset-khatm-btn {
  background: none;
  border: none;
  padding: 0;
  font-size: 11px;
  letter-spacing: 0.05em;
  color: rgba(220,100,80,0.55);
  cursor: pointer;
  font-family: inherit;
  text-transform: uppercase;
  transition: color 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.min-reset-khatm-btn:active { color: rgba(220,100,80,0.9); }
#min-hub-overlay.min-t-light .min-reset-khatm-btn,
#min-hub-overlay.min-t-sepia .min-reset-khatm-btn { color: rgba(190,60,40,0.45); }

/* ---- Hub overlay themes ---- */
#min-hub-overlay.min-t-light { background: #F8F5F0; }
#min-hub-overlay.min-t-sepia { background: #F4ECD8; }
#min-hub-overlay.min-t-dark  { background: #0c0c0c; }

#min-hub-overlay.min-t-light .min-back-btn,
#min-hub-overlay.min-t-sepia .min-back-btn { color: rgba(0,0,0,0.35); }

#min-hub-overlay.min-t-light #min-hub-title,
#min-hub-overlay.min-t-sepia #min-hub-title { color: rgba(0,0,0,0.22); }

#min-hub-overlay.min-t-light .min-hub-item-meta,
#min-hub-overlay.min-t-sepia .min-hub-item-meta { color: rgba(0,0,0,0.28); }

#min-hub-overlay.min-t-light .min-hub-item-name,
#min-hub-overlay.min-t-sepia .min-hub-item-name { color: rgba(0,0,0,0.82); }

#min-hub-overlay.min-t-light .min-hub-sep,
#min-hub-overlay.min-t-sepia .min-hub-sep { background: rgba(0,0,0,0.08); }

#min-hub-overlay.min-t-light .min-hub-arrow,
#min-hub-overlay.min-t-sepia .min-hub-arrow { color: rgba(0,0,0,0.18); }

#min-hub-overlay.min-t-light #min-hub-prefs,
#min-hub-overlay.min-t-sepia #min-hub-prefs { border-top-color: rgba(0,0,0,0.08); }

#min-hub-overlay.min-t-light .min-pref-label,
#min-hub-overlay.min-t-sepia .min-pref-label { color: rgba(0,0,0,0.28); }

#min-hub-overlay.min-t-light .min-pref-opt,
#min-hub-overlay.min-t-sepia .min-pref-opt { color: rgba(0,0,0,0.22); }

#min-hub-overlay.min-t-light .min-pref-opt.active,
#min-hub-overlay.min-t-sepia .min-pref-opt.active { color: rgba(0,0,0,0.85); }

#min-hub-overlay.min-t-light .min-pref-sep,
#min-hub-overlay.min-t-sepia .min-pref-sep { color: rgba(0,0,0,0.12); }

/* ---- Surah & Verse pickers — light/sepia themes ---- */
#min-hub-overlay.min-t-light #min-surah-picker,
#min-hub-overlay.min-t-sepia #min-surah-picker,
#min-hub-overlay.min-t-light #min-verse-picker,
#min-hub-overlay.min-t-sepia #min-verse-picker { background: inherit; }

#min-hub-overlay.min-t-light #min-picker-header,
#min-hub-overlay.min-t-sepia #min-picker-header { border-bottom-color: rgba(0,0,0,0.08); }

#min-hub-overlay.min-t-light #min-picker-label,
#min-hub-overlay.min-t-sepia #min-picker-label { color: rgba(0,0,0,0.35); }

#min-hub-overlay.min-t-light .min-picker-surah,
#min-hub-overlay.min-t-sepia .min-picker-surah { border-bottom-color: rgba(0,0,0,0.06); }

#min-hub-overlay.min-t-light .min-picker-surah:active,
#min-hub-overlay.min-t-sepia .min-picker-surah:active { background: rgba(0,0,0,0.05); }

#min-hub-overlay.min-t-light .min-picker-num,
#min-hub-overlay.min-t-sepia .min-picker-num { color: rgba(0,0,0,0.22); }

#min-hub-overlay.min-t-light .min-picker-name,
#min-hub-overlay.min-t-sepia .min-picker-name { color: rgba(0,0,0,0.82); }

#min-hub-overlay.min-t-light .min-picker-ar,
#min-hub-overlay.min-t-sepia .min-picker-ar { color: rgba(0,0,0,0.45); }

#min-hub-overlay.min-t-light .min-picker-count,
#min-hub-overlay.min-t-sepia .min-picker-count { color: rgba(0,0,0,0.22); }

#min-hub-overlay.min-t-light #min-vpicker-header,
#min-hub-overlay.min-t-sepia #min-vpicker-header { border-bottom-color: rgba(0,0,0,0.08); }

#min-hub-overlay.min-t-light #min-vpicker-label,
#min-hub-overlay.min-t-sepia #min-vpicker-label { color: rgba(0,0,0,0.35); }

#min-hub-overlay.min-t-light #min-vpicker-surah-name,
#min-hub-overlay.min-t-sepia #min-vpicker-surah-name { color: rgba(0,0,0,0.35); }

#min-hub-overlay.min-t-light .min-vpicker-cell,
#min-hub-overlay.min-t-sepia .min-vpicker-cell { color: rgba(0,0,0,0.70); }

#min-hub-overlay.min-t-light .min-vpicker-cell:active,
#min-hub-overlay.min-t-sepia .min-vpicker-cell:active { background: rgba(0,0,0,0.07); }

/* ---- Reader overlay ---- */
#min-reader-overlay {
  position: fixed;
  inset: 0;
  z-index: 450;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: pan-y;
}
/* Themes */
#min-reader-overlay.min-t-light { background: #F8F5F0; color: #1a1a1a; }
#min-reader-overlay.min-t-sepia { background: #F4ECD8; color: #2c1a0a; }
#min-reader-overlay.min-t-dark  { background: #0c0c0c; color: #e8e4dc; }

#min-verse-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 80px 28px 80px;
  gap: 18px;
  width: 100%;
  max-height: 100vh;
  overflow-y: auto;
  transition: opacity 0.18s ease;
}
#min-verse-ar {
  font-family: 'Scheherazade New', 'KFGQPC Uthmanic Script HAFS', 'me_quran', 'Traditional Arabic', serif;
  text-align: center;
  line-height: 2.1;
  direction: rtl;
  width: 100%;
}
#min-verse-fr {
  text-align: center;
  line-height: 1.65;
  opacity: 0.52;
  width: 100%;
  font-style: italic;
}
#min-bottom-area {
  position: absolute;
  bottom: max(24px, env(safe-area-inset-bottom, 24px));
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}
#min-reader-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0.28;
  white-space: nowrap;
}
.min-info-dot { opacity: 0.5; }
#min-reader-back {
  position: absolute;
  top: max(14px, env(safe-area-inset-top, 14px));
  left: 10px;
  z-index: 10;
  padding: 8px;
}
#min-reader-overlay.min-t-light #min-reader-back,
#min-reader-overlay.min-t-sepia #min-reader-back { color: #1a1a1a; opacity: 0.3; }
#min-reader-overlay.min-t-dark  #min-reader-back { color: #e8e4dc; opacity: 0.3; }
/* Min reader — couleurs tajwid thème noir */
#min-reader-overlay.min-t-dark .tajwid-ghunnah  { color: #EF9A9A !important; }
#min-reader-overlay.min-t-dark .tajwid-idgham   { color: #A5D6A7 !important; }
#min-reader-overlay.min-t-dark .tajwid-ikhfaa   { color: #FFCC80 !important; }
#min-reader-overlay.min-t-dark .tajwid-qalqalah { color: #CE93D8 !important; }
#min-reader-overlay.min-t-dark .tajwid-madd     { color: #90CAF9 !important; }
#min-reader-overlay.min-t-dark .tajwid-iqlab    { color: #80CBC4 !important; }
#min-reader-overlay.min-t-dark .tajwid-izhar    { color: #B0BEC5 !important; }
/* Min reader — couleurs tajwid thème blanc et sépia */
#min-reader-overlay.min-t-light .tajwid-ghunnah,
#min-reader-overlay.min-t-sepia .tajwid-ghunnah  { color: #c0392b !important; }
#min-reader-overlay.min-t-light .tajwid-idgham,
#min-reader-overlay.min-t-sepia .tajwid-idgham   { color: #1b5e20 !important; }
#min-reader-overlay.min-t-light .tajwid-ikhfaa,
#min-reader-overlay.min-t-sepia .tajwid-ikhfaa   { color: #bf360c !important; }
#min-reader-overlay.min-t-light .tajwid-qalqalah,
#min-reader-overlay.min-t-sepia .tajwid-qalqalah { color: #4a148c !important; }
#min-reader-overlay.min-t-light .tajwid-madd,
#min-reader-overlay.min-t-sepia .tajwid-madd     { color: #0d47a1 !important; }
#min-reader-overlay.min-t-light .tajwid-iqlab,
#min-reader-overlay.min-t-sepia .tajwid-iqlab    { color: #004d40 !important; }
#min-reader-overlay.min-t-light .tajwid-izhar,
#min-reader-overlay.min-t-sepia .tajwid-izhar    { color: #37474F !important; }

/* ---- Surah picker ---- */
#min-surah-picker {
  position: absolute;
  inset: 0;
  background: #0c0c0c;
  display: flex;
  flex-direction: column;
  z-index: 5;
  overflow: hidden;
}
#min-picker-header {
  display: flex;
  align-items: center;
  padding: max(52px, calc(env(safe-area-inset-top, 0px) + 16px)) 12px 12px;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
#min-picker-label {
  flex: 1;
  text-align: center;
  font-size: 10px;
  letter-spacing: 0.20em;
  color: rgba(255,255,255,0.35);
  font-weight: 500;
  margin-right: 44px;
}
#min-picker-list {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.min-picker-surah {
  display: flex;
  align-items: center;
  padding: 13px 24px;
  gap: 14px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.min-picker-surah:active { background: rgba(255,255,255,0.05); }
.min-picker-num {
  font-size: 11px;
  color: rgba(255,255,255,0.22);
  width: 22px;
  text-align: right;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}
.min-picker-name {
  flex: 1;
  font-size: 13px;
  color: rgba(255,255,255,0.82);
  letter-spacing: 0.01em;
}
.min-picker-ar {
  font-family: 'AmiriQuran', 'Amiri', serif;
  font-size: 16px;
  color: rgba(255,255,255,0.45);
  direction: rtl;
  flex-shrink: 0;
}
.min-picker-count {
  font-size: 10px;
  color: rgba(255,255,255,0.18);
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

/* ---- Verse picker ---- */
#min-verse-picker {
  position: absolute;
  inset: 0;
  background: #0c0c0c;
  display: flex;
  flex-direction: column;
  z-index: 6;
  overflow: hidden;
}
#min-vpicker-header {
  display: flex;
  align-items: center;
  padding: max(52px, calc(env(safe-area-inset-top, 0px) + 16px)) 12px 12px;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
#min-vpicker-label {
  flex: 1;
  text-align: center;
  font-size: 10px;
  letter-spacing: 0.20em;
  color: rgba(255,255,255,0.35);
  font-weight: 500;
  margin-right: 44px;
}
#min-vpicker-surah-name {
  font-size: 12px;
  text-align: center;
  color: rgba(255,255,255,0.35);
  padding: 10px 24px 4px;
  letter-spacing: 0.06em;
  flex-shrink: 0;
}
#min-vpicker-grid {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
  padding: 10px 16px 32px;
  align-content: start;
}
.min-vpicker-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 46px;
  font-size: 13px;
  color: rgba(255,255,255,0.70);
  border-radius: 8px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  font-variant-numeric: tabular-nums;
}
.min-vpicker-cell:active { background: rgba(255,255,255,0.09); }

/* ---- Khatm progress bar in min reader ---- */
/* ---- Khatm top progress strip ---- */
#min-khatm-top {
  position: absolute;
  top: max(20px, env(safe-area-inset-top, 20px));
  right: 16px;
  display: flex;
  align-items: center;
  gap: 6px;
  pointer-events: none;
}
#min-khatm-top.hidden { display: none; }
#min-khatm-day-lbl {
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.32);
}
#min-khatm-count-lbl {
  font-size: 9px;
  letter-spacing: 0.12em;
  color: rgba(255,255,255,0.20);
}
#min-reader-overlay.min-t-light #min-khatm-day-lbl,
#min-reader-overlay.min-t-sepia #min-khatm-day-lbl { color: rgba(0,0,0,0.30); }
#min-reader-overlay.min-t-light #min-khatm-count-lbl,
#min-reader-overlay.min-t-sepia #min-khatm-count-lbl { color: rgba(0,0,0,0.20); }

/* ---- Khatm complete button ---- */
#min-complete-btn {
  margin-top: 14px;
  background: none;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 20px;
  color: rgba(255,255,255,0.55);
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 7px 18px;
  cursor: pointer;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
  transition: opacity 0.15s;
}
#min-complete-btn:active { opacity: 0.6; }
#min-complete-btn.hidden { display: none; }
#min-reader-overlay.min-t-light #min-complete-btn,
#min-reader-overlay.min-t-sepia #min-complete-btn {
  border-color: rgba(0,0,0,0.18);
  color: rgba(0,0,0,0.50);
}

#min-khatm-bar {
  width: 0%;
  height: 2px;
  align-self: stretch;
  background: rgba(255,255,255,0.35);
  border-radius: 1px;
  transition: width 0.4s ease;
  display: none;
}
#min-reader-overlay.min-t-light #min-khatm-bar,
#min-reader-overlay.min-t-sepia #min-khatm-bar { background: rgba(0,0,0,0.22); }

