/* =========================================
   NOUR AL-ISLAM — Main Stylesheet
   Design: Sacred Islamic luxury · Dark emerald
   ========================================= */

:root {
  --bg:        #07120d;
  --bg2:       #0c1c13;
  --bg3:       #112219;
  --card:      #0f2318;
  --card2:     #152d1f;
  --emerald:   #10b981;
  --emerald2:  #34d399;
  --teal:      #14b8a6;
  --gold:      #c9962a;
  --gold2:     #e8c060;
  --gold3:     #f5d98a;
  --text:      #e2e8e4;
  --text2:     #9ab5a4;
  --text3:     #5a7a65;
  --arabic:    #f0e2b8;
  --border:    rgba(201,150,42,0.18);
  --border2:   rgba(201,150,42,0.42);
  --shadow:    0 8px 40px rgba(0,0,0,0.55);
  --radius:    14px;
  --radius-sm: 8px;
  --font-ar:   'Amiri', serif;
  --font-head: 'Playfair Display', Georgia, serif;
  --font-ui:   'Lato', sans-serif;
  --nav-h:     68px;
  --transition: 0.28s cubic-bezier(0.4,0,0.2,1);
}

/* ──── Light Theme ──── */
html.light {
  --bg:        #f4f1eb;
  --bg2:       #eae6dd;
  --bg3:       #e0dbd0;
  --card:      #ffffff;
  --card2:     #f9f7f3;
  --emerald:   #0d9668;
  --emerald2:  #0b7d56;
  --teal:      #0f9b8e;
  --gold:      #b8860b;
  --gold2:     #a07608;
  --gold3:     #8b6508;
  --text:      #1a2e22;
  --text2:     #3d5a47;
  --text3:     #7a9484;
  --arabic:    #2c1a00;
  --border:    rgba(13,80,45,0.15);
  --border2:   rgba(13,80,45,0.30);
  --shadow:    0 8px 40px rgba(0,0,0,0.10);
}
html.light body::before {
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80'%3E%3Cg fill='none' stroke='rgba(13,80,45,0.08)' stroke-width='0.6'%3E%3Cpolygon points='40,4 50,30 76,30 55,47 63,73 40,57 17,73 25,47 4,30 30,30'/%3E%3Ccircle cx='40' cy='40' r='18'/%3E%3C/g%3E%3C/svg%3E");
}
html.light .navbar {
  background: rgba(244,241,235,0.92);
  border-bottom-color: rgba(13,80,45,0.12);
}
html.light .navbar.scrolled { box-shadow: 0 2px 24px rgba(0,0,0,0.08); }
html.light .surah-card,
html.light .ayah-card,
html.light .hadith-card,
html.light .dua-card { box-shadow: 0 2px 12px rgba(0,0,0,0.06); }
html.light .toast { background: #1a2e22; color: #f4f1eb; }

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.65;
}

/* ──── Islamic Geometric Background ──── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80'%3E%3Cg fill='none' stroke='rgba(201,150,42,0.055)' stroke-width='0.6'%3E%3Cpolygon points='40,4 50,30 76,30 55,47 63,73 40,57 17,73 25,47 4,30 30,30'/%3E%3Ccircle cx='40' cy='40' r='18'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 80px 80px;
}

#app, nav, footer { position: relative; z-index: 1; }

/* ──── Typography ──── */
.ar { font-family: var(--font-ar); }

h1, h2, h3 { font-family: var(--font-head); }

/* ──── Scrollbar ──── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--gold); border-radius: 3px; }

/* =========================================
   NAVBAR
   ========================================= */
.navbar {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: rgba(7,18,13,0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  transition: box-shadow var(--transition);
}
.navbar.scrolled { box-shadow: 0 2px 24px rgba(0,0,0,0.7); }

.nav-container {
  max-width: 1400px; margin: 0 auto;
  height: 100%;
  display: flex; align-items: center; gap: 24px;
  padding: 0 24px;
}

/* On desktop the dropdown wrapper is transparent to layout —
   .nav-menu and .nav-controls behave as direct flex children. */
.nav-dropdown { display: contents; }

.nav-brand {
  text-decoration: none;
  display: flex; align-items: center; gap: 10px;
  flex-shrink: 0;
}
.brand-ar {
  font-family: var(--font-ar);
  font-size: 1.5rem;
  color: var(--gold2);
  line-height: 1;
}
.brand-sep { color: var(--text3); font-size: 1.2rem; }
.brand-fr {
  font-family: var(--font-head);
  font-size: 1rem;
  color: var(--text2);
  letter-spacing: 0.5px;
}

.nav-menu {
  display: flex; align-items: center; gap: 4px;
  flex: 1;
  justify-content: center;
}
.nav-item {
  text-decoration: none;
  color: var(--text2);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 400;
  letter-spacing: 0.3px;
  transition: all var(--transition);
  white-space: nowrap;
}
.nav-item:hover { color: var(--emerald2); background: rgba(16,185,129,0.08); }
.nav-item.active {
  color: var(--emerald2);
  background: rgba(16,185,129,0.12);
  font-weight: 700;
}

.nav-controls {
  display: flex; align-items: center; gap: 8px;
  flex-shrink: 0;
}
.ctrl-btn {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  color: var(--text2);
  padding: 7px 13px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font-ui);
  white-space: nowrap;
}
.ctrl-btn:hover { border-color: var(--emerald); color: var(--emerald2); }
.ctrl-btn.active { border-color: var(--teal); color: var(--teal); background: rgba(20,184,166,0.1); }
.admin-btn { border-color: var(--border2); color: var(--gold2); }
.admin-btn:hover { background: rgba(201,150,42,0.12); border-color: var(--gold); color: var(--gold3); }

.hamburger {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: none; cursor: pointer; padding: 4px;
}
.hamburger span {
  display: block; width: 24px; height: 2px;
  background: var(--text2); border-radius: 2px;
  transition: all var(--transition);
}

/* =========================================
   PAGE SECTIONS
   ========================================= */
.page {
  min-height: 100vh;
  padding-top: var(--nav-h);
  animation: fadeInPage 0.4s ease;
}
.page.hidden { display: none; }

@keyframes fadeInPage {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.page-header {
  text-align: center;
  padding: 56px 24px 36px;
  position: relative;
}
.page-header::after {
  content: '';
  display: block;
  width: 80px; height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  margin: 20px auto 0;
}
.page-header h2 { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.page-header h2 .ar {
  font-family: var(--font-ar); font-size: 2.4rem; color: var(--arabic);
  line-height: 1.3;
}
.fr-sub { font-size: 1.1rem; color: var(--text2); font-family: var(--font-head); font-style: italic; }
.page-desc { color: var(--text2); font-size: 0.95rem; margin-top: 10px; }

/* =========================================
   HERO / ACCUEIL
   ========================================= */
#page-accueil {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh;
  padding: 0;
}
.hero { position: relative; width: 100%; min-height: 100vh; display: flex; align-items: center; justify-content: center; }

.hero-pattern {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(16,185,129,0.13) 0%, transparent 70%),
    radial-gradient(ellipse 60% 50% at 80% 100%, rgba(20,184,166,0.09) 0%, transparent 60%),
    radial-gradient(ellipse 40% 40% at 10% 60%, rgba(201,150,42,0.07) 0%, transparent 50%);
  pointer-events: none;
}

.hero-inner {
  position: relative; z-index: 2;
  max-width: 1100px; width: 100%;
  padding: calc(var(--nav-h) + 40px) 24px 60px;
  text-align: center;
}

.bismillah-hero {
  font-family: var(--font-ar);
  font-size: clamp(1.6rem, 4vw, 2.6rem);
  color: var(--gold2);
  letter-spacing: 2px;
  margin-bottom: 28px;
  text-shadow: 0 0 40px rgba(232,192,96,0.3);
  animation: fadeDown 0.8s ease both;
}

.hero-title {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  margin-bottom: 20px;
  animation: fadeDown 0.9s ease 0.1s both;
}
.ht-ar {
  font-family: var(--font-ar);
  font-size: clamp(2.8rem, 7vw, 5rem);
  color: var(--arabic);
  line-height: 1.1;
}
.ht-fr {
  font-family: var(--font-head);
  font-size: clamp(1.2rem, 3vw, 1.8rem);
  color: var(--text2);
  font-style: italic;
  letter-spacing: 1px;
}

.hero-tagline {
  font-size: clamp(0.9rem, 2vw, 1.05rem);
  color: var(--text2); max-width: 560px;
  margin: 0 auto 50px;
  animation: fadeDown 1s ease 0.2s both;
}

.hero-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px; max-width: 960px; margin: 0 auto 50px;
  animation: fadeDown 1.1s ease 0.3s both;
}

.hcard {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px 20px;
  cursor: pointer;
  transition: all var(--transition);
  position: relative; overflow: hidden;
}
.hcard::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: 0; transition: opacity var(--transition);
}
.hcard:hover {
  border-color: var(--border2);
  background: var(--card2);
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}
.hcard:hover::before { opacity: 1; }
.hcard-icon { font-size: 2.4rem; margin-bottom: 14px; }
.hcard h3 { font-family: var(--font-head); font-size: 1.15rem; color: var(--gold2); margin-bottom: 8px; }
.hcard p  { font-size: 0.85rem; color: var(--text2); line-height: 1.5; }

.hero-stats {
  display: flex; justify-content: center; gap: 40px; flex-wrap: wrap;
  animation: fadeDown 1.2s ease 0.4s both;
}
.hstat { text-align: center; }
.hstat-n {
  display: block; font-family: var(--font-head); font-size: 2rem;
  color: var(--emerald2); font-weight: 700;
}
.hstat-l { font-size: 0.82rem; color: var(--text3); text-transform: uppercase; letter-spacing: 1px; }

@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* =========================================
   CORAN
   ========================================= */
.quran-toolbar {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  max-width: 1200px; margin: 0 auto 28px; padding: 0 24px;
}
.filter-group { display: flex; gap: 8px; }
.filter-btn {
  background: var(--card); border: 1px solid var(--border);
  color: var(--text2); padding: 8px 16px; border-radius: 100px;
  font-size: 0.84rem; cursor: pointer;
  transition: all var(--transition); font-family: var(--font-ui);
}
.filter-btn:hover { border-color: var(--emerald); color: var(--emerald2); }
.filter-btn.active { background: rgba(16,185,129,0.15); border-color: var(--emerald); color: var(--emerald2); font-weight: 700; }

.surah-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px; max-width: 1200px; margin: 0 auto; padding: 0 24px 60px;
}

.surah-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
  cursor: pointer; transition: all var(--transition);
  display: flex; align-items: center; gap: 16px;
}
.surah-card:hover {
  border-color: var(--border2); background: var(--card2);
  transform: translateY(-2px); box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}
.surah-num {
  width: 44px; height: 44px; flex-shrink: 0;
  background: linear-gradient(135deg, rgba(201,150,42,0.15), rgba(16,185,129,0.12));
  border: 1px solid var(--border);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-ar); font-size: 1rem; color: var(--gold2);
  line-height: 1;
}
.surah-names { flex: 1; }
.surah-name-ar {
  font-family: var(--font-ar); font-size: 1.2rem; color: var(--arabic);
  display: block; line-height: 1.3;
}
.surah-name-fr { font-size: 0.82rem; color: var(--text2); display: block; }
.surah-meta { font-size: 0.75rem; color: var(--text3); margin-top: 3px; display: block; }
.surah-badge {
  font-size: 0.7rem; padding: 3px 8px; border-radius: 100px;
  border: 1px solid;
}
.surah-badge.mec { border-color: rgba(16,185,129,0.4); color: var(--emerald); }
.surah-badge.med { border-color: rgba(20,184,166,0.4); color: var(--teal); }

/* Reader */
.reader-bar {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  max-width: 1000px; margin: 0 auto 24px; padding: 0 24px;
}
.btn-back {
  background: var(--card); border: 1px solid var(--border);
  color: var(--text2); padding: 9px 16px; border-radius: var(--radius-sm);
  cursor: pointer; font-size: 0.88rem; transition: all var(--transition);
  font-family: var(--font-ui); white-space: nowrap;
}
.btn-back:hover { border-color: var(--emerald); color: var(--emerald2); }
.reader-meta { flex: 1; text-align: center; }
.reader-name-ar { font-family: var(--font-ar); font-size: 1.5rem; color: var(--arabic); }
.reader-name-fr { font-size: 0.9rem; color: var(--text2); font-style: italic; margin-left: 8px; }
.reader-info { font-size: 0.78rem; color: var(--text3); display: block; }
.reader-opts { display: flex; gap: 8px; flex-wrap: wrap; }

.sel {
  background: var(--card); border: 1px solid var(--border);
  color: var(--text2); padding: 8px 12px; border-radius: var(--radius-sm);
  font-size: 0.82rem; cursor: pointer; font-family: var(--font-ui);
  transition: border-color var(--transition);
}
.sel:hover, .sel:focus { border-color: var(--emerald); outline: none; }

.bismillah-reader {
  font-family: var(--font-ar); font-size: clamp(1.6rem, 4vw, 2.2rem);
  color: var(--gold2); text-align: center;
  padding: 24px; margin: 0 auto 16px; max-width: 700px;
  border-bottom: 1px solid var(--border);
  letter-spacing: 2px;
}

.ayah-list { max-width: 900px; margin: 0 auto; padding: 0 24px 60px; }

.ayah-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px;
  margin-bottom: 16px; transition: all var(--transition);
  animation: fadeInCard 0.3s ease both;
}
.ayah-card:hover { border-color: var(--border2); }
.ayah-card.playing {
  border-color: var(--emerald);
  background: linear-gradient(135deg, rgba(16,185,129,0.10), rgba(20,184,166,0.06));
  box-shadow: 0 0 0 1px var(--emerald), 0 4px 24px rgba(16,185,129,0.15);
}

@keyframes fadeInCard {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.ayah-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.ayah-num {
  width: 36px; height: 36px; background: rgba(201,150,42,0.12);
  border: 1px solid var(--border); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; color: var(--gold2);
}
.btn-play-ayah {
  background: none; border: 1px solid var(--border);
  color: var(--emerald); padding: 6px 12px; border-radius: var(--radius-sm);
  cursor: pointer; font-size: 0.8rem; transition: all var(--transition);
  font-family: var(--font-ui);
}
.btn-play-ayah:hover { background: rgba(16,185,129,0.12); border-color: var(--emerald); }
.btn-play-ayah.playing { background: rgba(16,185,129,0.18); color: var(--emerald2); }

.ayah-arabic {
  font-family: var(--font-ar); font-size: clamp(1.5rem, 3.5vw, 2rem);
  color: var(--arabic); line-height: 2; text-align: right;
  direction: rtl; margin-bottom: 14px;
}
.ayah-phonetic {
  font-style: italic; color: var(--teal); font-size: 0.92rem;
  margin-bottom: 10px; line-height: 1.7;
}
.ayah-translation { color: var(--text2); font-size: 0.93rem; line-height: 1.7; }
.ayah-phonetic.hidden, .ayah-card .ayah-phonetic.hidden { display: none; }

/* Ayah actions (play + bookmark) */
.ayah-actions { display: flex; align-items: center; gap: 8px; }

/* Bookmark button */
.btn-bookmark {
  background: none; border: 1px solid var(--border);
  color: var(--text3); padding: 6px 10px; border-radius: var(--radius-sm);
  cursor: pointer; font-size: 1rem; transition: all var(--transition);
  opacity: 0.5;
}
.btn-bookmark:hover { opacity: 1; border-color: var(--gold); background: rgba(201,150,42,0.08); }
.btn-bookmark.active {
  opacity: 1; color: var(--gold2); border-color: var(--gold);
  background: rgba(201,150,42,0.15);
  box-shadow: 0 0 0 1px var(--gold), 0 2px 8px rgba(201,150,42,0.2);
}

/* Bookmark banner */
#bookmarkBanner { margin-bottom: 20px; }
.bookmark-resume {
  display: flex; align-items: center; gap: 16px;
  background: linear-gradient(135deg, rgba(201,150,42,0.12), rgba(16,185,129,0.08));
  border: 1px solid var(--gold); border-radius: var(--radius);
  padding: 16px 20px;
  animation: fadeInCard 0.4s ease both;
}
.bookmark-icon { font-size: 2rem; }
.bookmark-text { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.bookmark-text strong { color: var(--gold2); font-size: 0.95rem; }
.bookmark-text span { color: var(--text2); font-size: 0.88rem; }
.bookmark-ago { color: var(--text3); font-size: 0.78rem; }
.bookmark-go {
  background: var(--emerald); color: #fff; border: none;
  padding: 10px 20px; border-radius: var(--radius-sm);
  cursor: pointer; font-family: var(--font-ui); font-size: 0.88rem;
  font-weight: 600; transition: all var(--transition);
  white-space: nowrap;
}
.bookmark-go:hover { background: var(--emerald2); transform: translateY(-1px); }
.bookmark-clear {
  background: none; border: none; color: var(--text3);
  cursor: pointer; font-size: 1.1rem; padding: 6px;
  opacity: 0.5; transition: opacity var(--transition);
}
.bookmark-clear:hover { opacity: 1; color: var(--danger, #ef4444); }

@media (max-width: 600px) {
  .bookmark-resume { flex-wrap: wrap; gap: 10px; padding: 12px 14px; }
  .bookmark-icon { font-size: 1.5rem; }
  .bookmark-go { width: 100%; text-align: center; }
}

.audio-player {
  position: sticky; bottom: 24px; left: 0; right: 0;
  max-width: 700px; margin: 0 auto;
  background: var(--card2); border: 1px solid var(--border2);
  border-radius: var(--radius); padding: 16px 20px;
  box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
.audio-player.hidden { display: none; }
.ap-info { font-size: 0.85rem; color: var(--text2); white-space: nowrap; }
.audio-player audio { flex: 1; min-width: 200px; height: 36px; }
.btn-stop-audio {
  background: none; border: 1px solid var(--border);
  color: var(--text3); padding: 6px 12px; border-radius: var(--radius-sm);
  cursor: pointer; font-size: 0.8rem; font-family: var(--font-ui);
  transition: all var(--transition);
}
.btn-stop-audio:hover { border-color: #ef4444; color: #ef4444; }

.btn-play-surah {
  display: block; margin: 0 auto 16px;
  background: linear-gradient(135deg, var(--emerald), var(--teal));
  border: none; color: #fff; padding: 13px 32px;
  border-radius: var(--radius-sm); font-size: 1rem; font-weight: 700;
  cursor: pointer; font-family: var(--font-ui);
  transition: opacity var(--transition);
}
.btn-play-surah:hover { opacity: 0.85; }

/* =========================================
   HADITHS
   ========================================= */
.hadith-layout {
  display: flex; gap: 24px;
  max-width: 1300px; margin: 0 auto; padding: 0 24px 60px;
}
.hadith-sidebar {
  width: 240px; flex-shrink: 0;
  position: sticky; top: calc(var(--nav-h) + 20px);
  height: max-content;
}
.hadith-main { flex: 1; min-width: 0; }

.side-title {
  font-size: 0.75rem; text-transform: uppercase;
  letter-spacing: 1px; color: var(--text3);
  margin: 20px 0 8px;
}
.coll-list { display: flex; flex-direction: column; gap: 4px; }
.coll-btn {
  background: var(--card); border: 1px solid var(--border);
  color: var(--text2); padding: 9px 12px; border-radius: var(--radius-sm);
  cursor: pointer; text-align: left; font-size: 0.84rem;
  transition: all var(--transition); font-family: var(--font-ui);
}
.coll-btn:hover { border-color: var(--emerald); color: var(--emerald2); }
.coll-btn.active { background: rgba(16,185,129,0.12); border-color: var(--emerald); color: var(--emerald2); }

.auth-group { display: flex; flex-direction: column; gap: 8px; }
.auth-group label {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.85rem; color: var(--text2); cursor: pointer;
}
.auth-group input[type=checkbox] {
  accent-color: var(--emerald); width: 14px; height: 14px; cursor: pointer;
}
.badge {
  padding: 2px 7px; border-radius: 100px; font-size: 0.72rem;
  font-weight: 700; letter-spacing: 0.5px;
}
.badge.sahih { background: rgba(16,185,129,0.15); color: var(--emerald2); border: 1px solid rgba(16,185,129,0.3); }
.badge.hasan { background: rgba(20,184,166,0.15); color: var(--teal); border: 1px solid rgba(20,184,166,0.3); }
.badge.daif  { background: rgba(239,68,68,0.12); color: #f87171; border: 1px solid rgba(239,68,68,0.25); }

.results-info { font-size: 0.85rem; color: var(--text3); margin-bottom: 18px; }

.hadith-list { display: flex; flex-direction: column; gap: 18px; }

.hadith-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px;
  transition: all var(--transition);
  animation: fadeInCard 0.25s ease both;
}
.hadith-card:hover { border-color: var(--border2); background: var(--card2); }
.hadith-top {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-bottom: 16px;
}
.hadith-coll {
  font-size: 0.75rem; color: var(--gold2); font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.5px;
}
.hadith-num { font-size: 0.78rem; color: var(--text3); }
.hadith-topic {
  font-size: 0.76rem; color: var(--teal); background: rgba(20,184,166,0.1);
  border: 1px solid rgba(20,184,166,0.25); padding: 2px 8px; border-radius: 100px;
}
.hadith-arabic {
  font-family: var(--font-ar); font-size: 1.25rem; color: var(--arabic);
  line-height: 2; text-align: right; direction: rtl;
  border-bottom: 1px solid var(--border); padding-bottom: 14px; margin-bottom: 14px;
}
.hadith-phonetic { font-style: italic; color: var(--teal); font-size: 0.88rem; margin-bottom: 10px; line-height: 1.7; }
.hadith-translation { color: var(--text); font-size: 0.92rem; line-height: 1.7; margin-bottom: 12px; }
.hadith-bottom {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  font-size: 0.8rem;
}
.hadith-narrator { color: var(--text3); }
.hadith-narrator strong { color: var(--text2); }
.hadith-source { color: var(--text3); font-style: italic; }

/* =========================================
   INVOCATIONS
   ========================================= */
.dua-layout {
  max-width: 1200px; margin: 0 auto; padding: 0 24px 60px;
}
.dua-cats {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px; margin-bottom: 36px;
}
.dua-cat-btn {
  background: var(--card); border: 2px solid var(--border);
  border-radius: var(--radius); padding: 18px 14px;
  cursor: pointer; text-align: center;
  transition: all var(--transition); font-family: var(--font-ui);
}
.dua-cat-btn:hover {
  border-color: var(--border2); background: var(--card2);
  transform: translateY(-2px); box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}
.dua-cat-btn.active {
  border-color: var(--gold); background: rgba(201,150,42,0.1);
}
.dcat-icon { font-size: 2rem; margin-bottom: 8px; }
.dcat-name { font-size: 0.88rem; color: var(--text2); font-weight: 700; display: block; }
.dcat-count { font-size: 0.75rem; color: var(--text3); }

.dua-placeholder { text-align: center; padding: 80px 24px; }
.dp-icon { font-size: 4rem; margin-bottom: 16px; opacity: 0.4; }
.dua-placeholder p { color: var(--text3); font-size: 1rem; }

.dua-list { display: flex; flex-direction: column; gap: 20px; }

.dua-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 26px;
  transition: border-color var(--transition);
  animation: fadeInCard 0.25s ease both;
}
.dua-card:hover { border-color: var(--border2); }
.dua-card-title {
  font-family: var(--font-head); font-size: 1rem; color: var(--gold2);
  margin-bottom: 16px; display: flex; align-items: center; gap: 8px;
}
.dua-num {
  width: 26px; height: 26px; background: rgba(201,150,42,0.12);
  border: 1px solid var(--border); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; color: var(--gold2); flex-shrink: 0;
}
.dua-arabic {
  font-family: var(--font-ar); font-size: clamp(1.4rem, 3vw, 1.8rem);
  color: var(--arabic); line-height: 2.2; text-align: right;
  direction: rtl; margin-bottom: 14px;
}
.dua-phonetic { font-style: italic; color: var(--teal); font-size: 0.9rem; line-height: 1.8; margin-bottom: 10px; }
.dua-translation { color: var(--text); font-size: 0.92rem; line-height: 1.7; margin-bottom: 12px; }
.dua-translation.en { color: var(--text2); font-style: italic; margin-top: 6px; }
.dua-source { font-size: 0.78rem; color: var(--text3); border-top: 1px solid var(--border); padding-top: 10px; margin-top: 10px; }
.dua-source strong { color: var(--gold); }

/* =========================================
   PRIÈRE
   ========================================= */
.prayer-guide {
  max-width: 820px; margin: 0 auto; padding: 0 24px 80px;
}

.prayer-progress-wrap { margin-bottom: 36px; }
.prayer-progress-bar {
  height: 4px; background: rgba(255,255,255,0.08);
  border-radius: 2px; margin-bottom: 16px; overflow: hidden;
}
.prayer-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--emerald), var(--teal));
  border-radius: 2px; transition: width 0.5s ease;
}
.prayer-steps-dots {
  display: flex; gap: 8px; justify-content: center; flex-wrap: wrap;
}
.pdot {
  width: 10px; height: 10px; border-radius: 50%;
  background: rgba(255,255,255,0.12); border: none; cursor: pointer;
  transition: all var(--transition); padding: 0;
}
.pdot.active { background: var(--emerald); transform: scale(1.3); }
.pdot.done { background: rgba(16,185,129,0.45); }

.prayer-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 36px;
  margin-bottom: 28px; min-height: 400px;
  animation: fadeInPage 0.35s ease;
}
.prayer-step-num {
  font-size: 0.78rem; text-transform: uppercase; letter-spacing: 1.5px;
  color: var(--emerald); margin-bottom: 4px;
}
.prayer-step-name {
  font-family: var(--font-head); font-size: 1.6rem; color: var(--text);
  margin-bottom: 4px;
}
.prayer-step-ar {
  font-family: var(--font-ar); font-size: 1.3rem; color: var(--arabic);
  margin-bottom: 18px;
}
.prayer-position {
  background: rgba(16,185,129,0.07); border-left: 3px solid var(--emerald);
  padding: 12px 16px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.88rem; color: var(--text2); margin-bottom: 20px;
}
.prayer-illustration {
  font-size: 6rem; text-align: center; margin: 20px 0;
  filter: drop-shadow(0 0 20px rgba(16,185,129,0.3));
}

.prayer-invocation {
  margin-top: 24px; border-top: 1px solid var(--border); padding-top: 20px;
}
.inv-label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 1px; color: var(--text3); margin-bottom: 10px; }
.inv-arabic {
  font-family: var(--font-ar); font-size: clamp(1.3rem, 3vw, 1.7rem);
  color: var(--arabic); line-height: 2.1; text-align: right;
  direction: rtl; margin-bottom: 10px;
}
.inv-phonetic { font-style: italic; color: var(--teal); font-size: 0.88rem; line-height: 1.7; margin-bottom: 8px; }
.inv-translation { color: var(--text2); font-size: 0.9rem; line-height: 1.65; }

.prayer-substeps { margin-top: 20px; }
.prayer-substeps h4 { font-size: 0.85rem; color: var(--text3); margin-bottom: 10px; text-transform: uppercase; letter-spacing: 0.5px; }
.prayer-substeps ol { padding-left: 18px; }
.prayer-substeps li { font-size: 0.9rem; color: var(--text2); line-height: 1.8; }

.prayer-nav {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.pnav-btn {
  background: var(--card); border: 1px solid var(--border);
  color: var(--text2); padding: 12px 24px; border-radius: var(--radius-sm);
  cursor: pointer; font-size: 0.9rem; transition: all var(--transition);
  font-family: var(--font-ui); font-weight: 700;
}
.pnav-btn:hover:not(:disabled) { border-color: var(--emerald); color: var(--emerald2); }
.pnav-btn:disabled { opacity: 0.35; cursor: default; }
.pnav-btn.primary {
  background: linear-gradient(135deg, var(--emerald), var(--teal));
  border-color: transparent; color: #fff;
}
.pnav-btn.primary:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--emerald2), var(--teal));
  box-shadow: 0 4px 20px rgba(16,185,129,0.35);
}
.step-counter { font-size: 0.88rem; color: var(--text3); }

/* =========================================
   SHARED COMPONENTS
   ========================================= */
.search-input {
  background: var(--card); border: 1px solid var(--border);
  color: var(--text); padding: 10px 16px; border-radius: var(--radius-sm);
  font-size: 0.9rem; width: 100%; max-width: 360px;
  transition: border-color var(--transition); font-family: var(--font-ui);
}
.search-input:focus { outline: none; border-color: var(--emerald); }
.search-input::placeholder { color: var(--text3); }

.loading {
  text-align: center; padding: 60px 24px;
  display: flex; flex-direction: column; align-items: center; gap: 16px;
}
.spinner {
  width: 40px; height: 40px;
  border: 3px solid rgba(255,255,255,0.07);
  border-top-color: var(--emerald);
  border-radius: 50%; animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.hidden { display: none !important; }

/* =========================================
   CRÉATION DE VIDÉO — Studio
   ========================================= */

/* Studio layout */
.video-studio {
  display: flex;
  gap: 28px;
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 24px 80px;
  align-items: flex-start;
}

/* Left: preview column */
.studio-preview {
  flex: 0 0 420px;
  position: sticky;
  top: calc(var(--nav-h) + 20px);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.studio-canvas-wrap {
  background: #000;
  border-radius: var(--radius);
  border: 1px solid var(--border2);
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(0,0,0,0.7);
  position: relative;
}
.studio-canvas-wrap canvas {
  display: block;
  width: 100%;
  height: auto;
}

/* Verse navigation */
.studio-verse-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}
.studio-nav-btn {
  background: var(--card);
  border: 1px solid var(--border2);
  color: var(--gold2);
  width: 38px; height: 38px;
  border-radius: 50%;
  font-size: 1rem;
  cursor: pointer;
  transition: all var(--transition);
  display: flex; align-items: center; justify-content: center;
}
.studio-nav-btn:hover {
  background: rgba(201,150,42,0.12);
  border-color: var(--gold);
  color: var(--gold3);
}
.studio-verse-counter {
  font-size: 0.88rem;
  color: var(--text2);
  font-family: var(--font-ui);
  min-width: 100px;
  text-align: center;
}

/* Generate button */
.generate-btn {
  width: 100%;
  background: linear-gradient(135deg, #059669 0%, #10b981 50%, #34d399 100%);
  border: none;
  color: #fff;
  padding: 16px 24px;
  border-radius: var(--radius-sm);
  font-size: 1.05rem;
  font-weight: 700;
  font-family: var(--font-ui);
  cursor: pointer;
  transition: all var(--transition);
  display: flex; align-items: center; justify-content: center; gap: 8px;
  letter-spacing: 0.3px;
  box-shadow: 0 4px 20px rgba(16,185,129,0.3);
}
.generate-btn:hover {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold2) 50%, var(--gold3) 100%);
  box-shadow: 0 4px 24px rgba(201,150,42,0.4);
  transform: translateY(-1px);
}
.generate-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}
.gen-icon { font-size: 1.2rem; }

/* Progress */
.studio-progress { }
.studio-progress-bar {
  height: 6px;
  background: rgba(255,255,255,0.08);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 8px;
}
.studio-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--emerald), var(--gold2));
  border-radius: 3px;
  transition: width 0.3s ease;
  width: 0%;
}
.studio-progress-text {
  font-size: 0.83rem;
  color: var(--text2);
  text-align: center;
}

/* Download */
.studio-download {
  text-align: center;
}
.download-link {
  display: inline-block;
  background: linear-gradient(135deg, rgba(201,150,42,0.15), rgba(201,150,42,0.08));
  border: 1px solid var(--gold);
  color: var(--gold2);
  padding: 12px 28px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
  transition: all var(--transition);
}
.download-link:hover {
  background: rgba(201,150,42,0.22);
  color: var(--gold3);
  box-shadow: 0 4px 16px rgba(201,150,42,0.25);
}

/* Right: controls column */
.studio-controls {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: calc(100vh - var(--nav-h) - 40px);
  overflow-y: auto;
  padding-right: 4px;
}

/* Each control card */
.studio-section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  transition: border-color var(--transition);
}
.studio-section:hover { border-color: rgba(201,150,42,0.28); }

.studio-section-title {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text3);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.studio-sel {
  width: 100%;
  font-size: 0.9rem;
  padding: 9px 12px;
  background: var(--card2);
}

/* Range row (de/à) */
.studio-range-row {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}
.studio-range-row label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  color: var(--text2);
}
.studio-num {
  background: var(--card2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  width: 74px;
  font-family: var(--font-ui);
  transition: border-color var(--transition);
}
.studio-num:focus { outline: none; border-color: var(--emerald); }

/* Format buttons */
.format-btns {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.format-btn {
  background: var(--card2);
  border: 1px solid var(--border);
  color: var(--text2);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font-ui);
}
.format-btn:hover { border-color: var(--emerald); color: var(--emerald2); }
.format-btn.active {
  background: rgba(16,185,129,0.14);
  border-color: var(--emerald);
  color: var(--emerald2);
  font-weight: 700;
}

/* Slider */
.studio-slider {
  width: 100%;
  accent-color: var(--emerald);
  cursor: pointer;
  height: 4px;
  margin-top: 6px;
}

/* Toggle */
.studio-toggle {
  margin-left: auto;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  color: var(--text3);
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font-ui);
}
.studio-toggle[data-on="true"] {
  background: rgba(16,185,129,0.14);
  border-color: var(--emerald);
  color: var(--emerald2);
}

.studio-sub-row {
  font-size: 0.82rem;
  color: var(--text3);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Color */
.color-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.studio-color {
  width: 48px; height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: none;
  cursor: pointer;
  padding: 2px;
}

#vTextColorVal {
  font-size: 0.85rem;
  color: var(--text2);
  font-family: monospace;
}

/* Tabs */
.studio-tab-btns {
  display: flex;
  gap: 4px;
  margin-bottom: 14px;
}
.studio-tab {
  background: var(--card2);
  border: 1px solid var(--border);
  color: var(--text2);
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font-ui);
}
.studio-tab:hover { border-color: var(--gold); color: var(--gold2); }
.studio-tab.active {
  background: rgba(201,150,42,0.12);
  border-color: var(--gold);
  color: var(--gold2);
  font-weight: 700;
}

/* Background category grid */
.bg-category-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.bg-cat-btn {
  background: var(--card2);
  border: 1px solid var(--border);
  color: var(--text2);
  padding: 10px 6px;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font-ui);
  text-align: center;
  line-height: 1.4;
}
.bg-cat-btn:hover { border-color: var(--gold); color: var(--gold2); }
.bg-cat-btn.active {
  border-color: var(--gold);
  background: rgba(201,150,42,0.14);
  color: var(--gold2);
  font-weight: 700;
}

/* Animated bg preview swatch */
.anim-bg-preview {
  height: 60px;
  border-radius: var(--radius-sm);
  margin-top: 12px;
  border: 1px solid var(--border);
  overflow: hidden;
}

/* Import */
.import-label {
  display: block;
  cursor: pointer;
  margin-bottom: 8px;
}
.import-btn {
  display: block;
  width: 100%;
  text-align: center;
  background: var(--card2);
  border: 1px dashed var(--border2);
  color: var(--gold2);
  padding: 14px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-family: var(--font-ui);
  transition: all var(--transition);
}
.import-btn:hover { border-color: var(--gold); background: rgba(201,150,42,0.08); }
.import-hint {
  font-size: 0.78rem;
  color: var(--text3);
  text-align: center;
}

/* Animated gradient keyframes for video backgrounds */
@keyframes bgShift1 {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Mobile responsive for studio */
@media (max-width: 900px) {
  .video-studio {
    flex-direction: column;
  }
  .studio-preview {
    position: static;
    flex: none;
    width: 100%;
  }
  .studio-controls {
    max-height: none;
    overflow-y: visible;
  }
}

/* =========================================
   FOOTER
   ========================================= */
.footer {
  background: var(--bg2); border-top: 1px solid var(--border);
  padding: 40px 24px; text-align: center;
}
.footer-inner { max-width: 700px; margin: 0 auto; }
.footer-brand { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 14px; }
.footer-ar { font-family: var(--font-ar); font-size: 1.4rem; color: var(--gold2); }
.footer-fr { font-family: var(--font-head); font-size: 0.95rem; color: var(--text2); font-style: italic; }
.footer-hadith { color: var(--text2); font-size: 0.9rem; font-style: italic; margin-bottom: 10px; line-height: 1.6; }
.footer-socials {
  display: flex; justify-content: center; gap: 18px; margin: 16px 0 12px;
}
.footer-socials a {
  color: var(--text3); transition: color 0.3s, transform 0.3s; display: flex;
}
.footer-socials a:hover { color: var(--em2); transform: translateY(-3px); }
.footer-copy { font-size: 0.78rem; color: var(--text3); }

/* =========================================
   TOAST
   ========================================= */
.toast {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--card2); border: 1px solid var(--border2);
  color: var(--text); padding: 12px 24px; border-radius: var(--radius-sm);
  font-size: 0.88rem; box-shadow: var(--shadow);
  opacity: 0; transition: all 0.3s ease; pointer-events: none; z-index: 9999;
  white-space: nowrap;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* =========================================
   RESPONSIVE
   ========================================= */
@media (max-width: 900px) {
  .hamburger { display: flex; margin-left: auto; }
  /* Whole dropdown (menu + controls) hidden until opened */
  .nav-dropdown { display: none; }
  .nav-dropdown.open {
    display: flex; flex-direction: column;
    position: absolute; top: var(--nav-h); left: 0; right: 0;
    background: rgba(7,18,13,0.98); backdrop-filter: blur(20px);
    padding: 14px 20px 20px;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 16px 40px rgba(0,0,0,0.4);
    max-height: calc(100vh - var(--nav-h)); overflow-y: auto;
    gap: 6px;
  }
  .nav-dropdown.open .nav-menu {
    display: flex; flex-direction: column; gap: 4px; flex: none;
  }
  .nav-dropdown.open .nav-item { padding: 12px 14px; font-size: 0.95rem; }
  .nav-dropdown.open .nav-controls {
    display: flex; flex-direction: row; flex-wrap: wrap; justify-content: center;
    gap: 8px; margin-top: 12px; padding-top: 14px;
    border-top: 1px solid var(--border);
  }

  .hadith-layout { flex-direction: column; }
  .hadith-sidebar { width: 100%; position: static; }
  .coll-list { flex-direction: row; flex-wrap: wrap; }
  .coll-btn { font-size: 0.78rem; padding: 7px 10px; }
  .reader-bar { flex-direction: column; align-items: flex-start; }
  .reader-meta { text-align: left; }
  .prayer-card { padding: 22px; }
}

@media (max-width: 600px) {
  .surah-grid { grid-template-columns: 1fr 1fr; gap: 10px; padding: 0 16px 40px; }
  .hero-cards { grid-template-columns: 1fr 1fr; gap: 12px; }
  .hero-stats { gap: 20px; flex-wrap: wrap; justify-content: center; }
  .dua-cats { grid-template-columns: repeat(3, 1fr); }
  .brand-sep { display: none; }
  .brand-fr { font-size: 0.92rem; }
  .toast { white-space: normal; max-width: calc(100vw - 32px); text-align: center; }
}

@media (max-width: 380px) {
  .surah-grid, .hero-cards { grid-template-columns: 1fr; }
  .dua-cats { grid-template-columns: 1fr 1fr; }
}

/* ── Slider with side labels ── */
.slider-labeled-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.slider-labeled-row .studio-slider {
  flex: 1;
}
.slider-label {
  font-size: 0.68rem;
  font-family: 'Lato', sans-serif;
  color: rgba(16,185,129,0.7);
  letter-spacing: 0.06em;
  white-space: nowrap;
  user-select: none;
}

/* ── Import thumbnail ── */
.import-thumb {
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: 8px;
  margin-top: 10px;
  background-size: cover;
  background-position: center;
  border: 1px solid rgba(16,185,129,0.3);
  position: relative;
  overflow: hidden;
}
.import-thumb::after {
  content: '✓ Fond chargé';
  position: absolute;
  bottom: 6px;
  right: 8px;
  font-size: 0.7rem;
  color: rgba(255,255,255,0.7);
  background: rgba(0,0,0,0.5);
  padding: 2px 6px;
  border-radius: 4px;
}

/* ── Preview button ── */
.preview-btn {
  display: block;
  width: 100%;
  padding: 10px 16px;
  margin-top: 10px;
  background: rgba(16,185,129,0.1);
  border: 1px solid rgba(16,185,129,0.45);
  border-radius: 8px;
  color: #10b981;
  font-size: 0.9rem;
  font-family: 'Lato', sans-serif;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  letter-spacing: 0.02em;
}
.preview-btn:hover {
  background: rgba(16,185,129,0.22);
  border-color: #10b981;
}

/* ── Preview modal ── */
.preview-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}
.preview-modal.hidden { display: none !important; }
.preview-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.88);
  backdrop-filter: blur(4px);
}
.preview-modal-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}
.preview-modal-close {
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.25);
  color: #fff;
  border-radius: 50%;
  width: 38px;
  height: 38px;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
}
.preview-modal-close:hover { background: rgba(255,255,255,0.28); }
#previewCanvas {
  max-width: 90vw;
  max-height: 82vh;
  border-radius: 10px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.7);
  display: block;
}
