/* ===== RESET & VARIABLES ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #1a3a2a;
  --bg2: #234d35;
  --bg3: #1a2e20;
  --card: #2a5040;
  --card-hover: #335e4a;
  --accent: #c9a227;
  --accent2: #e8c04a;
  --text: #f5f0e8;
  --text2: #b8c9b0;
  --text3: #7a9e80;
  --border: #3a6050;
  --danger: #e05252;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 20px rgba(0,0,0,0.3);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.2);
  --font-arab: 'LPMQ', 'Traditional Arabic', serif;
  --font-ui: 'Segoe UI', system-ui, sans-serif;
  --arab-size: 28px;
  --transition: 0.2s ease;
}

/* ===== LIGHT MODE ===== */
body.light {
  --bg: #f5f0e8;
  --bg2: #ede8da;
  --bg3: #e8e0cc;
  --card: #ffffff;
  --card-hover: #f5f0e6;
  --accent: #8b6914;
  --accent2: #a07820;
  --text: #1a2e20;
  --text2: #2d4a35;
  --text3: #5a7060;
  --border: #d4c9a8;
  --shadow: 0 4px 20px rgba(0,0,0,0.1);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
}

body.light #last-read-banner {
  background: linear-gradient(135deg, var(--card), #f0e8d0);
}
body.light #loading-overlay {
  background: rgba(245,240,232,0.92);
}

/* ===== SEPIA ===== */
body.sepia {
  --bg: #f2e8d5;
  --bg2: #e9ddc6;
  --bg3: #e0d4b8;
  --card: #fdf6ec;
  --card-hover: #f5edd8;
  --accent: #8b5e1a;
  --accent2: #a07030;
  --text: #2c1a0e;
  --text2: #4a3020;
  --text3: #7a5a3a;
  --border: #c8b090;
  --shadow: 0 4px 20px rgba(0,0,0,0.1);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
}
body.sepia #last-read-banner  { background: linear-gradient(135deg, var(--card), #eedcb8); }
body.sepia #loading-overlay   { background: rgba(242,232,213,0.92); }

/* ===== NAVY ===== */
body.navy {
  --bg: #0f1e3a;
  --bg2: #162844;
  --bg3: #0c1830;
  --card: #1e3356;
  --card-hover: #253d64;
  --accent: #c9a227;
  --accent2: #e8c04a;
  --text: #e8edf5;
  --text2: #a0b4cc;
  --text3: #607a99;
  --border: #2a4268;
  --shadow: 0 4px 20px rgba(0,0,0,0.4);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.25);
}

/* ===== MIDNIGHT ===== */
body.midnight {
  --bg: #111318;
  --bg2: #1a1d24;
  --bg3: #0d0f14;
  --card: #20242e;
  --card-hover: #282d3a;
  --accent: #c9a227;
  --accent2: #e8c04a;
  --text: #e8e4dc;
  --text2: #9a9690;
  --text3: #636068;
  --border: #2e323c;
  --shadow: 0 4px 20px rgba(0,0,0,0.5);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
}

/* ===== AL-BANTANI ===== */
body.albantani .btn-icon { background: var(--card); color: var(--text2); border-color: var(--border); }
body.albantani .btn-icon:hover { background: var(--bg3); color: var(--accent); border-color: var(--bg3); }
body.albantani .btn-icon.active { background: var(--accent); color: #ffffff; border-color: var(--accent); }
body.albantani .surah-header-card { background: linear-gradient(135deg, #4a2f2f, #382425); border-color: rgba(255,255,255,0.12); }
body.albantani .surah-header-card .sh-arab { color: #c9a020; }
body.albantani .surah-header-card .sh-name { color: #ffffff; }
body.albantani .surah-header-card .sh-meta { color: rgba(255,255,255,0.65); }
body.albantani .surah-header-card .sh-tafsir { color: rgba(255,255,255,0.75); }
body.albantani #btn-expand-tafsir { color: #c9a020; }

body.albantani .surah-info .surah-name-id { color: rgb(25 65 126); }
body.albantani .verse-card.playing {
  border-color: #8BC34A;
  box-shadow: 0 0 0 1px #8BC34A;
}


body.albantani {
  --bg: #f5f0e0;
  --bg2: #ede8d8;
  --bg3: #382425;
  --card: #ffffff;
  --card-hover: #f0ebe0;
  --accent: #c9a020;
  --accent2: #e8c04a;
  --text: #2a1a0a;
  --text2: #5a3a1a;
  --text3: #8a6a4a;
  --border: rgb(103 185 144 / 45%);
  --shadow: 0 4px 20px rgba(0,0,0,0.12);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
}

/* ===== MAROON ===== */
body.maroon {
  --bg: #f7ecec;
  --bg2: #f0dede;
  --bg3: #740303;
  --card: #ffffff;
  --card-hover: #fdf4f4;
  --accent: #800020;
  --accent2: #a01030;
  --text: #1a0505;
  --text2: #4a1818;
  --text3: #8a4545;
  --border: #e8c8c8;
  --shadow: 0 4px 20px rgba(116,3,3,0.1);
  --shadow-sm: 0 2px 8px rgba(116,3,3,0.07);
}
body.maroon #app-header  { background: linear-gradient(135deg, #740303, #5a0202); border-bottom: 1px solid rgba(255,255,255,0.12); color: #ffffff; }
body.maroon #app-header * { color: #ffffff; }
body.maroon #app-header .btn-icon { color: #ffffff; border-color: rgba(255,255,255,0.3); background: rgba(255,255,255,0.1); }
body.maroon #app-header .btn-icon:hover { background: rgba(255,255,255,0.2); }
body.maroon #app-header .btn-icon.active { background: #f7ecec; color: #740303; border-color: #f7ecec; }
body.maroon #btn-toggle-latin.active, body.maroon #btn-toggle-id.active, body.maroon #btn-toggle-en.active,
body.maroon #btn-toggle-tajweed.active, body.maroon #btn-toggle-isyarat.active, body.maroon #btn-toggle-tahfidz.active { background: #f7ecec; color: #740303; border-color: #f7ecec; }
body.maroon #app-header input[type=range] { accent-color: #f7ecec; }
body.maroon #font-slider::-webkit-slider-thumb { background: #f7ecec; }
body.maroon #bottom-nav  { background: #740303; border-top: 1px solid rgba(255,255,255,0.12); }
body.maroon .bnav-btn    { color: rgba(255,255,255,0.6); }
body.maroon .bnav-btn.active { color: #ffffff; }
body.maroon #btn-back    { color: #ffffff; }
body.maroon #audio-player { background: #fce8e8; border-top: 1px solid rgba(107,15,26,0.15); }
body.maroon .ap-label { color: rgba(74,24,24,0.65); }
body.maroon .ap-title { color: #4a1818; }
body.maroon .ap-time, body.maroon #ap-close { color: rgba(74,24,24,0.7); }
body.maroon #ap-progress::-webkit-slider-thumb { background: #800020; }
body.maroon #theme-icon  { border-color: #f7ecec !important; }
body.maroon .surah-header-card { background: linear-gradient(135deg, #740303, #a00505); border-color: rgba(255,255,255,0.12); }
body.maroon .surah-header-card .sh-arab { color: #fce8e8; }
body.maroon .surah-header-card .sh-name { color: #ffffff; }
body.maroon .surah-header-card .sh-meta { color: rgba(255,255,255,0.65); }
body.maroon .surah-header-card .sh-tafsir { color: rgba(255,255,255,0.75); }
body.maroon #btn-expand-tafsir { color: #fce8e8; }
body.maroon #header-title { color: #fce8e8; }
body.maroon #header-subtitle { color: rgba(255,255,255,0.7); }
body.maroon .surah-number { color: #ffffff; }
body.maroon #loading-overlay { background: rgba(247,236,236,0.92); }
body.maroon .sh-hafal-progress { color: rgba(255,255,255,0.8); }
body.maroon .sh-hafal-progress.done { color: #a8f0a8; }
body.maroon .btn-icon { background: var(--card); color: var(--accent); border-color: var(--border); }
body.maroon .btn-icon:hover { background: var(--accent); color: #ffffff; border-color: var(--accent); }
body.maroon .btn-icon.active { background: var(--accent); color: #ffffff; border-color: var(--accent); }
body.maroon .tab { color: var(--text2); }
body.maroon .tab.active { color: #ffffff; }
body.maroon .vr-text mark { background: #800020; color: #ffffff; }
body.maroon #audio-player { background: #f9f0f0; }
body.maroon .ap-btn.play-pause,
body.maroon .ap-btn.active-repeat { color: #ffffff; }
body.maroon .doa-num { color: #ffffff; }
body.maroon .doa-source-tag { background: #800020; color: #ffffff; }
body.maroon #btn-show-features { background: var(--card); color: var(--accent); }
body.maroon #btn-show-features:hover { background: var(--accent); color: #ffffff; }
body.maroon .hfb.active { color: #ffffff; }

/* ===== WHITE & GREEN (WB) ===== */
body.wb {
  --bg: #f5f5f5;
  --bg2: #ececec;
  --bg3: #004F25;
  --card: #ffffff;
  --card-hover: #f0f0f0;
  --accent: #004F25;
  --accent2: #006830;
  --text: #111111;
  --text2: #333333;
  --text3: #666666;
  --border: #d0d0d0;
  --shadow: 0 4px 20px rgba(0,0,0,0.08);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
}
body.wb #last-read-banner  { background: linear-gradient(135deg, #fff, #e8f5ee); }
body.wb #loading-overlay   { background: rgba(245,245,245,0.92); }
/* Elemen berlatar --accent/#004F25 butuh teks putih di tema WB */
body.wb .tab.active,
body.wb .hfb.active,
body.wb .btn-icon.active,
body.wb .tw-hfb.active,
body.wb .ap-btn.play-pause,
body.wb .ap-btn.active-repeat,
body.wb #btn-toggle-latin.active,
body.wb #btn-toggle-id.active,
body.wb #btn-toggle-en.active,
body.wb #btn-toggle-tajweed.active,
body.wb #btn-toggle-isyarat.active,
body.wb #btn-toggle-tahfidz.active { color: #ffffff; }
body.wb .surah-number { color: #ffffff; }
body.wb #header-title { color: #d3bb04; }
body.wb #header-subtitle { color: rgba(255,255,255,0.7); }
/* Bottom nav */
body.wb .bnav-btn { color: rgba(255,255,255,0.7); }
body.wb .bnav-btn.active { color: #dcf900; }
body.wb #btn-back { color: #dcf900; }
body.wb #font-slider::-webkit-slider-thumb { background: #d3bb04; }
body.wb #font-control label { color: #d3bb04; }
body.wb .btn-icon { background: var(--card); color: var(--accent); border-color: var(--accent); }
body.wb .btn-icon:hover { background: var(--bg3); color: #ffffff; border-color: var(--bg3); }
body.wb .surah-header-card { background: linear-gradient(135deg, #004F25, #006830); border-color: rgba(255,255,255,0.15); }
body.wb .surah-header-card .sh-arab { color: #dcf900; }
body.wb .surah-header-card .sh-name { color: #ffffff; }
body.wb .surah-header-card .sh-meta { color: rgba(255,255,255,0.65); }
body.wb .surah-header-card .sh-tafsir { color: rgba(255,255,255,0.75); }
body.wb .sl-hafal { color: #d3bb04; }
body.wb .sl-h-done { color: #006830; }
body.wb #btn-expand-tafsir { color: #dcf900; }
body.wb .sh-hafal-progress { color: #d3bb04; }
body.wb #btn-toggle-latin, body.wb #btn-toggle-id, body.wb #btn-toggle-en,
body.wb #btn-toggle-tajweed, body.wb #btn-toggle-isyarat, body.wb #btn-toggle-tahfidz,
body.wb #btn-tajweed-info, body.wb #btn-about, body.wb #btn-toggle-theme {
  color: #d3bb04; border-color: #d3bb04;
}
body.albantani #btn-about,
body.albantani #btn-toggle-theme { color: rgba(255,255,255,0.85); }
body.albantani #btn-show-features { color: #ffffff; }
body.albantani #btn-show-features:hover { color: #382425; }
body.wb .doa-num, body.wb .doa-source-tag { color: #ffffff; }
body.wb .btn-copy-doa { color: #004F25; border-color: #004F25; }
body.wb #audio-player { background: #006830; border-top: 1px solid rgba(255,255,255,0.15); }
body.wb .ap-label { color: #c3c0c0; }
body.wb .ap-title { color: #dcf900; }
body.wb #ap-progress::-webkit-slider-thumb { background: #dcf900; }
body.wb .ap-time, body.wb #ap-close { color: #c3c0c0; }
body.wb #install-banner button,
body.wb #btn-do-update { color: #ffffff; }
body.wb #btn-show-features { color: #ffffff; }
body.wb #btn-show-features:hover { color: #004F25; }
body.wb #last-read-banner .lrb-label,
body.wb #mushaf-bm-banner .lrb-label { color: #004F25; font-weight: 700; }
body.wb #last-read-banner .lrb-info,
body.wb #mushaf-bm-banner .lrb-info  { color: #111111; }
/* Semua active state pakai kuning #dcf900 */
body.wb .tab.active,
body.wb .hfb.active,
body.wb .btn-icon.active,
body.wb .tw-hfb.active,
body.wb .ap-btn.play-pause,
body.wb .ap-btn.active-repeat,
body.wb #btn-toggle-latin.active,
body.wb #btn-toggle-id.active,
body.wb #btn-toggle-en.active,
body.wb #btn-toggle-tajweed.active,
body.wb #btn-toggle-isyarat.active,
body.wb #btn-toggle-tahfidz.active { color: #dcf900; }

/* ===== BLACK & WHITE ===== */
body.bw {
  --bg: #0a0a0a;
  --bg2: #141414;
  --bg3: #050505;
  --card: #1e1e1e;
  --card-hover: #282828;
  --accent: #ffffff;
  --accent2: #e0e0e0;
  --text: #f0f0f0;
  --text2: #b0b0b0;
  --text3: #707070;
  --border: #3a3a3a;
  --shadow: 0 4px 20px rgba(0,0,0,0.5);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
}
body.bw img, body.bw canvas {
  filter: grayscale(1);
}
body.bw #btn-toggle-theme {
  font-size: 11px;
  font-weight: 800;
  color: #fff !important;
  text-shadow: 0 0 4px #fff;
}

/* ===== PINK FANTA ===== */
body.pinkfanta {
  --bg: #f7e0ea;
  --bg2: #f0d0df;
  --bg3: #e8609a;
  --card: #fdf0f5;
  --card-hover: #f5e4ed;
  --accent: #1565c0;
  --accent2: #1976d2;
  --text: #3a0a20;
  --text2: #7a2048;
  --text3: #b06080;
  --border: #f4b8d0;
  --shadow: 0 4px 20px rgba(214,51,132,0.1);
  --shadow-sm: 0 2px 8px rgba(214,51,132,0.07);
}
body.pinkfanta #last-read-banner { background: linear-gradient(135deg, #fff0f5, #fce4ee); }
body.pinkfanta #loading-overlay  { background: rgba(255,240,245,0.92); }
body.pinkfanta .surah-header-card { background: linear-gradient(135deg, #e8609a, #c0407a); border-color: rgba(255,255,255,0.2); }
body.pinkfanta .surah-header-card .sh-arab  { color: #fff5f8; }
body.pinkfanta .surah-header-card .sh-name  { color: #ffffff; }
body.pinkfanta .surah-header-card .sh-meta  { color: rgba(255,255,255,0.75); }
body.pinkfanta .surah-header-card .sh-tafsir { color: rgba(255,255,255,0.8); }
body.pinkfanta #btn-expand-tafsir { color: #fff5f8; }
body.pinkfanta #btn-about, body.pinkfanta #btn-toggle-theme { color: #ffffff; }
body.pinkfanta #header-title { color: #460044; }
body.pinkfanta #header-subtitle { color: rgba(255,255,255,0.8); }
body.pinkfanta #btn-back { color: #ffffff; }
body.pinkfanta #btn-toggle-latin, body.pinkfanta #btn-toggle-id, body.pinkfanta #btn-toggle-en,
body.pinkfanta #btn-toggle-tajweed, body.pinkfanta #btn-toggle-isyarat, body.pinkfanta #btn-toggle-tahfidz,
body.pinkfanta #btn-tajweed-info { color: #ffffff; border-color: rgba(255,255,255,0.5); }
body.pinkfanta #btn-toggle-latin.active, body.pinkfanta #btn-toggle-id.active, body.pinkfanta #btn-toggle-en.active,
body.pinkfanta #btn-toggle-tajweed.active, body.pinkfanta #btn-toggle-isyarat.active, body.pinkfanta #btn-toggle-tahfidz.active { background: #1565c0; color: #ffffff; border-color: #1565c0; }
body.pinkfanta #font-control label { color: #ffffff; }
body.pinkfanta #font-slider::-webkit-slider-thumb { background: #ffffff; }
body.pinkfanta .bnav-btn { color: rgba(70,0,68,0.75); }
body.pinkfanta .bnav-btn.active { color: #1565c0; }
body.pinkfanta .btn-icon { background: #fff0f5; color: #7a2048; border-color: #f4b8d0; }
body.pinkfanta .btn-icon:hover { background: #1565c0; color: #ffffff; border-color: #1565c0; }
body.pinkfanta .btn-icon.active { background: #1565c0; color: #ffffff; border-color: #1565c0; }
body.pinkfanta .sh-hafal-progress.done { color: #1565c0; }
body.pinkfanta .surah-number { background: #ffffff; border: 2px solid var(--bg3); color: var(--bg3); }
body.pinkfanta #audio-player { background: #460044; border-top: 1px solid rgba(255,255,255,0.15); }
body.pinkfanta .ap-label { color: rgba(255,255,255,0.6); }
body.pinkfanta .ap-title { color: #f9c4e8; }
body.pinkfanta .ap-time, body.pinkfanta #ap-close { color: rgba(255,255,255,0.7); }

/* ===== BABY BLUE ===== */
body.babyblue {
  --bg: #e8f4fd;
  --bg2: #dceef8;
  --bg3: #cfe7f5;
  --card: #ffffff;
  --card-hover: #f0f8ff;
  --accent: #1565c0;
  --accent2: #1976d2;
  --text: #0a2a44;
  --text2: #1a4060;
  --text3: #4a7090;
  --border: #b0d4ec;
  --shadow: 0 4px 20px rgba(0,0,0,0.08);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
}
body.babyblue #last-read-banner { background: linear-gradient(135deg, var(--card), #d8edf8); }
body.babyblue #loading-overlay  { background: rgba(232,244,253,0.92); }
body.albantani #app-header   { background: #1e1008; border-bottom: 1px solid rgba(201,160,32,0.2); }
body.albantani #audio-player { background: #382425; border-top: 1px solid rgba(201,160,32,0.2); }
body.albantani #bottom-nav   { background: #1e1008; border-top: 1px solid rgba(201,160,32,0.2); }
body.babyblue #app-header  { background: #1565c0; border-bottom: 1px solid rgba(255,255,255,0.15); color: #ffffff; }
body.babyblue #theme-icon  { border-color: #cfe7f5 !important; }
body.wb #theme-icon        { border-color: rgba(255,255,255,0.6) !important; }
body.babyblue #app-header * { color: #ffffff; }
body.babyblue #app-header .btn-icon { color: #ffffff; border-color: rgba(255,255,255,0.3); background: rgba(255,255,255,0.1); }
body.babyblue #app-header .btn-icon:hover { background: rgba(255,255,255,0.22); }
body.babyblue #app-header .btn-icon.active { background: #cfe7f5; color: #1565c0; border-color: #cfe7f5; }
body.babyblue #btn-toggle-latin.active, body.babyblue #btn-toggle-id.active, body.babyblue #btn-toggle-en.active,
body.babyblue #btn-toggle-tajweed.active, body.babyblue #btn-toggle-isyarat.active, body.babyblue #btn-toggle-tahfidz.active { background: #cfe7f5; color: #1565c0; border-color: #cfe7f5; }
body.babyblue #app-header input[type=range] { accent-color: #cfe7f5; }
body.babyblue #font-slider::-webkit-slider-thumb { background: #cfe7f5; }
body.babyblue #bottom-nav  { background: #1565c0; border-top: 1px solid rgba(255,255,255,0.15); }
body.babyblue .bnav-btn    { color: rgba(255,255,255,0.6); }
body.babyblue .bnav-btn.active { color: #ffffff; }
body.babyblue #audio-player { background: #cfe7f5; border-top: 1px solid rgba(21,101,192,0.2); }
body.babyblue .ap-label { color: rgba(10,42,68,0.65); }
body.babyblue .ap-title { color: #0a2a44; }
body.babyblue .ap-time, body.babyblue #ap-close { color: rgba(10,42,68,0.7); }
body.babyblue #ap-progress::-webkit-slider-thumb { background: #1565c0; }

html { scroll-behavior: smooth; scrollbar-gutter: stable; }

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

/* ===== FONT ===== */
@font-face {
  font-family: 'LPMQ';
  src: url('../assets/fonts/LPMQ.ttf') format('truetype'),
       url('../assets/fonts/LPMQ.eot') format('embedded-opentype');
  font-display: swap;
}

@font-face {
  font-family: 'LPMQ MSI ISYARAT';
  src: url('../assets/fonts/LPMQ-ISYARAT.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

.verse-isyarat {
  display: none;
  font-family: 'LPMQ MSI ISYARAT', serif;
  font-size: var(--arab-size);
  line-height: 2.5em;
  font-weight: 400;
  font-style: normal;
  direction: rtl;
  text-align: right;
  padding: 4px 16px 16px;
  margin-top: 4px;
  border-top: 1px dashed var(--border);
  color: var(--text2);
}

body.show-isyarat .verse-isyarat { display: block; }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg3); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ===== HEADER ===== */
#app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg3);
  border-bottom: 1px solid var(--border);
  padding: 10px 14px 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  backdrop-filter: blur(8px);
}

#header-row1 {
  display: flex;
  align-items: center;
  gap: 10px;
}

#header-text { flex: 1; min-width: 0; }

#header-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}
#header-controls::-webkit-scrollbar { display: none; }

.hc-sep {
  width: 1px;
  height: 18px;
  background: var(--border);
  flex-shrink: 0;
}

#btn-back {
  display: none;
  background: none;
  border: none;
  color: var(--accent);
  font-size: 22px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  flex-shrink: 0;
}

#header-title {
  font-size: clamp(12px, 3.5vw, 17px);
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#header-subtitle {
  font-size: 11px;
  color: var(--text3);
  font-weight: 400;
}

/* Header control buttons */
#btn-toggle-latin, #btn-toggle-id, #btn-toggle-en, #btn-toggle-tajweed, #btn-toggle-isyarat, #btn-toggle-tahfidz {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text3);
  font-size: 11px;
  padding: 4px 9px;
  border-radius: 20px;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  flex-shrink: 0;
}

#btn-toggle-latin.active, #btn-toggle-id.active, #btn-toggle-en.active, #btn-toggle-tajweed.active, #btn-toggle-isyarat.active, #btn-toggle-tahfidz.active {
  background: var(--accent);
  color: var(--bg3);
  border-color: var(--accent);
  font-weight: 700;
}

#btn-about {
  background: none;
  border: none;
  font-size: 16px;
  cursor: pointer;
  padding: 2px 4px;
  color: rgba(255,255,255,0.9);
  transition: color 0.2s;
}
#btn-about:hover { color: #ffffff; }

#btn-toggle-theme {
  background: none;
  border: none;
  font-size: 12px;
  color: var(--text2);
  cursor: pointer;
  padding: 2px 4px;
  flex-shrink: 0;
  line-height: 1;
  display: flex;
  align-items: center;
  gap: 3px;
}
#btn-toggle-theme #theme-icon { font-size: 14px; }

/* ===== TAJWEED COLORS ===== */
/* Only active when body.show-tajweed */
body.show-tajweed .tj-hamzat_wasl,
body.show-tajweed .tj-lam_shamsiyyah,
body.show-tajweed .tj-silent,
body.show-tajweed .tj-slnt            { color: #90a4ae; }

body.show-tajweed .tj-madd_2         { color: #4fc3f7; }
body.show-tajweed .tj-madd_246       { color: #29b6f6; }
body.show-tajweed .tj-madd_6         { color: #0288d1; }
body.show-tajweed .tj-madd_munfasil  { color: #4dd0e1; }
body.show-tajweed .tj-madd_muttasil  { color: #00acc1; }
body.show-tajweed .tj-madd_lazim     { color: #006064; }
body.show-tajweed .tj-madd_leen      { color: #80deea; }
body.show-tajweed .tj-madd_silah_qasirah,
body.show-tajweed .tj-madd_silah_tawilah { color: #b2ebf2; }

body.show-tajweed .tj-ghunnah                { color: #81c784; }
body.show-tajweed .tj-idgham_ghunnah         { color: #66bb6a; }
body.show-tajweed .tj-idgham_wo_ghunnah      { color: #2e7d32; }
body.show-tajweed .tj-idgham_shafawi         { color: #a5d6a7; }
body.show-tajweed .tj-idgham_mutajanisayn    { color: #4caf50; }
body.show-tajweed .tj-idgham_mutaqaribain    { color: #43a047; }

body.show-tajweed .tj-ikhfa          { color: #ffb74d; }
body.show-tajweed .tj-ikhfa_shafawi  { color: #ffa726; }

body.show-tajweed .tj-iqlab          { color: #ef5350; }

body.show-tajweed .tj-izhar          { color: #e0e0e0; }
body.show-tajweed .tj-izhar_shafawi  { color: #bdbdbd; }

body.show-tajweed .tj-qalqalah       { color: #ce93d8; }

body.light.show-tajweed .tj-izhar,
body.sepia.show-tajweed .tj-izhar,
body.babyblue.show-tajweed .tj-izhar,
body.wb.show-tajweed .tj-izhar               { color: #546e7a; }
body.light.show-tajweed .tj-izhar_shafawi,
body.sepia.show-tajweed .tj-izhar_shafawi,
body.babyblue.show-tajweed .tj-izhar_shafawi,
body.wb.show-tajweed .tj-izhar_shafawi       { color: #78909c; }
body.light.show-tajweed .tj-hamzat_wasl,
body.light.show-tajweed .tj-lam_shamsiyyah,
body.light.show-tajweed .tj-silent,
body.sepia.show-tajweed .tj-hamzat_wasl,
body.sepia.show-tajweed .tj-lam_shamsiyyah,
body.sepia.show-tajweed .tj-silent,
body.babyblue.show-tajweed .tj-hamzat_wasl,
body.babyblue.show-tajweed .tj-lam_shamsiyyah,
body.babyblue.show-tajweed .tj-silent,
body.wb.show-tajweed .tj-hamzat_wasl,
body.wb.show-tajweed .tj-lam_shamsiyyah,
body.wb.show-tajweed .tj-silent              { color: #9e9e9e; }

body.hide-latin .verse-latin { display: none; }
body.hide-id .verse-translation { display: none; }
body.hide-id .verse-card.show-id .verse-translation { display: block; }

.verse-translation-en {
  display: none;
  font-size: 13px;
  color: var(--text3);
  line-height: 1.8;
  margin-top: 4px;
  font-style: italic;
}

body.show-en .verse-translation-en { display: block; }

/* Font size control */
#font-control {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

#font-control label {
  font-size: 11px;
  color: var(--text3);
  white-space: nowrap;
}

#font-slider {
  -webkit-appearance: none;
  width: 70px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  outline: none;
}

#font-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
}

/* ===== MAIN CONTENT ===== */
#main {
  max-width: 800px;
  margin: 0 auto;
  padding: 16px;
  padding-bottom: 190px;
}

/* ===== SEARCH ===== */
#search-wrap {
  margin-bottom: 16px;
}

#search-mode-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
}

.tab {
  padding: 6px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text3);
  font-size: 13px;
  font-family: var(--font-ui);
  cursor: pointer;
  transition: all var(--transition);
}

.tab.active {
  background: var(--accent);
  color: var(--bg3);
  border-color: var(--accent);
  font-weight: 700;
}

#search-input-wrap {
  position: relative;
}

#search-input {
  width: 100%;
  padding: 12px 16px 12px 44px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 15px;
  font-family: var(--font-ui);
  outline: none;
  transition: border-color var(--transition);
}

#search-input::placeholder { color: var(--text3); }
#search-input:focus { border-color: var(--accent); }

#search-input-wrap::before {
  content: '';
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  pointer-events: none;
  background-color: var(--text3);
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 16 16' fill='none' stroke='currentColor' stroke-width='1.5' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='6.5' cy='6.5' r='4'/%3E%3Cline x1='9.5' y1='9.5' x2='13' y2='13'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 16 16' fill='none' stroke='currentColor' stroke-width='1.5' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='6.5' cy='6.5' r='4'/%3E%3Cline x1='9.5' y1='9.5' x2='13' y2='13'/%3E%3C/svg%3E");
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: contain;
  mask-size: contain;
}

/* ===== VERSE SEARCH RESULTS ===== */
.verse-result {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
}

.verse-result:hover {
  background: var(--card-hover);
  border-color: var(--accent);
}

.vr-meta {
  font-size: 12px;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 6px;
}

.vr-arab {
  font-family: var(--font-arab);
  font-size: 20px;
  direction: rtl;
  text-align: right;
  color: var(--text);
  margin-bottom: 6px;
  line-height: 1.8;
}

.vr-text {
  font-size: 13px;
  color: var(--text2);
  line-height: 1.7;
}

.vr-text mark {
  background: var(--accent);
  color: var(--bg3);
  border-radius: 3px;
  padding: 0 2px;
}
body.wb .vr-text mark { background: #dcf900; color: #004F25; }

#verse-search-status {
  padding: 12px 0 16px;
  text-align: center;
  font-size: 14px;
}
.verse-search-summary {
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 4px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.vs-summary-icon { font-size: 18px; margin-bottom: 2px; }
.vs-summary-text { font-size: 14px; font-weight: 600; color: var(--text); }
.vs-summary-sub  { font-size: 12px; color: var(--text3); }
.vs-surah-breakdown { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.vs-surah-chip {
  font-size: 11px; padding: 3px 8px; border-radius: 20px;
  background: var(--bg2); border: 1px solid var(--border);
  color: var(--text2); cursor: pointer; transition: all var(--transition);
}
.vs-surah-chip:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.vs-surah-chip b { color: var(--accent); }
.vs-surah-chip:hover b { color: #fff; }

#vs-bar-wrap {
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  margin-bottom: 10px;
  overflow: hidden;
}

#vs-bar {
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.25s ease;
}

#vs-text {
  font-size: 13px;
  color: var(--text3);
}

#vs-text b { color: var(--accent); font-weight: 700; }

.vs-scanning {
  color: var(--text3);
  font-style: italic;
}

/* ===== FILTER ROW ===== */
#filter-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
#hafal-filter-btns { display: flex; gap: 4px; align-items: center; width: 100%; }
.hfb { background: transparent; border: 1px solid var(--border); color: var(--text3); font-size: 11px; padding: 4px 10px; border-radius: 20px; cursor: pointer; white-space: nowrap; transition: all var(--transition); }
.hfb.active { background: var(--accent); color: var(--bg3); border-color: var(--accent); font-weight: 700; }
.hfb:hover:not(.active) { border-color: var(--accent); color: var(--text); }

.sl-hafal { font-size: 11px; color: var(--text3); margin-top: 3px; }
.sl-h-done { color: var(--accent); font-weight: 600; }

#filter-juz, #filter-revelation {
  flex: 1;
  padding: 9px 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 13px;
  font-family: var(--font-ui);
  outline: none;
  cursor: pointer;
  transition: border-color var(--transition);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%237a9e80'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
}

#filter-juz:focus, #filter-revelation:focus { border-color: var(--accent); }

#filter-juz option, #filter-revelation option {
  background: var(--card);
  color: var(--text);
}

/* ===== AYAT RANGE NAV (Surah / Dari Ayat / Ke Ayat) ===== */
.ayat-range-nav {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.ayat-range-nav .arn-field {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.ayat-range-nav label {
  font-size: 11px;
  color: var(--text3);
  font-weight: 600;
}

.ayat-range-nav select {
  width: 100%;
  padding: 9px 28px 9px 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 13px;
  font-family: var(--font-ui);
  outline: none;
  cursor: pointer;
  transition: border-color var(--transition);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%237a9e80'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}

.ayat-range-nav select:focus { border-color: var(--accent); }

.ayat-range-nav select option {
  background: var(--card);
  color: var(--text);
}

.surah-loading-inline {
  text-align: center;
  padding: 40px 0;
  color: var(--text3);
  font-size: 13px;
}

/* ===== LAST READ BANNER ===== */
#last-read-banner {
  display: none;
  background: linear-gradient(135deg, var(--card), #2a4a3a);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 16px;
  cursor: pointer;
  transition: background var(--transition);
}

#last-read-banner:hover { background: var(--card-hover); }

#mushaf-bm-banner {
  display: none;
  background: linear-gradient(135deg, var(--card), #2a4a3a);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 16px;
  cursor: pointer;
  transition: background var(--transition);
}
#mushaf-bm-banner:hover { background: var(--card-hover); }
#mushaf-bm-banner .lrb-label { font-size: 11px; color: var(--accent); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 4px; }
#mushaf-bm-banner .lrb-info  { font-size: 14px; color: var(--text); font-weight: 600; }

#last-read-banner .lrb-label {
  font-size: 11px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 4px;
}

#last-read-banner .lrb-label svg { width: 13px; height: 13px; display: block; flex-shrink: 0; }
#last-read-banner .lrb-info {
  font-size: 14px;
  color: var(--text);
  font-weight: 600;
}

/* ===== VERSE BOOKMARK BANNERS ===== */
#bookmark-banners {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 6px;
}

.bm-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, var(--card), #2a4a3a);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  cursor: pointer;
  transition: background var(--transition);
}
.bm-banner:hover { background: var(--card-hover); }

.bm-banner-info { flex: 1; min-width: 0; }

.bm-banner-label {
  font-size: 11px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 2px;
}

.bm-banner-verse {
  font-size: 14px;
  color: var(--text);
  font-weight: 600;
}

.bm-banner-del {
  background: none;
  border: none;
  color: var(--text3);
  font-size: 14px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  flex-shrink: 0;
  margin-left: 8px;
  line-height: 1;
}
.bm-banner-del:hover { background: var(--bg3); color: var(--danger); }

/* ===== SURAH LIST ===== */
#surah-list {
  display: grid;
  gap: 8px;
}

.surah-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: background var(--transition), border-color var(--transition), transform var(--transition);
  text-decoration: none;
  color: inherit;
}

.surah-card:hover {
  background: var(--card-hover);
  border-color: var(--accent);
  transform: translateY(-1px);
}

.surah-number {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
}

.surah-info { flex: 1; min-width: 0; }

.surah-name-id {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.surah-meta {
  font-size: 12px;
  color: var(--text3);
  margin-top: 2px;
}

.surah-name-arab {
  font-family: var(--font-arab);
  font-size: 22px;
  color: var(--accent);
  flex-shrink: 0;
  direction: rtl;
}

/* ===== SURAH DETAIL VIEW ===== */
#surah-detail { display: none; }

.surah-header-card {
  background: linear-gradient(135deg, var(--bg2), var(--bg3));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  margin-bottom: 16px;
}

.surah-header-card .sh-arab {
  font-family: var(--font-arab);
  font-size: 36px;
  color: var(--accent);
  direction: rtl;
  margin-bottom: 6px;
}

.surah-header-card .sh-name {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}

.surah-header-card .sh-meta {
  font-size: 13px;
  color: var(--text3);
  margin-top: 4px;
}

.surah-header-card .sh-tafsir {
  font-size: 13px;
  color: var(--text2);
  margin-top: 12px;
  line-height: 1.7;
  text-align: left;
  max-height: 80px;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.surah-header-card .sh-tafsir.expanded { max-height: 800px; }

#btn-expand-tafsir {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 12px;
  cursor: pointer;
  margin-top: 6px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
#btn-expand-tafsir svg { width: 12px; height: 12px; display: block; }

/* ===== BISMILLAH ===== */
.bismillah {
  text-align: center;
  font-family: var(--font-arab);
  font-size: 30px;
  color: var(--accent);
  direction: rtl;
  margin-bottom: 16px;
  padding: 12px;
  background: var(--bg2);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

/* ===== VERSE CARD ===== */
.verse-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 10px;
  transition: border-color var(--transition);
  scroll-margin-bottom: 190px;
}

.verse-card.verse-highlight {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent);
  animation: verseHighlightFade 3s ease forwards;
}
@keyframes verseHighlightFade {
  0%   { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
  70%  { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
  100% { border-color: var(--border); box-shadow: none; }
}
.verse-card.playing {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.verse-card.bookmarked {
  border-left: 3px solid var(--accent);
}

.verse-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.verse-number {
  font-family: var(--font-arab);
  font-size: 18px;
  color: var(--accent);
  flex-shrink: 0;
  direction: rtl;
  line-height: 1;
  padding-top: 2px;
}

.verse-actions {
  display: flex;
  gap: 6px;
}

.btn-icon svg, .ap-btn svg, #ap-close svg {
  width: 14px;
  height: 14px;
  pointer-events: none;
  display: block;
}
.ap-btn svg { width: 16px; height: 16px; }
.ap-btn.play-pause svg { width: 20px; height: 20px; }

.btn-icon {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text2);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  flex-shrink: 0;
}

.btn-icon:hover { background: var(--card-hover); color: var(--accent); border-color: var(--accent); }
.btn-icon.active { background: var(--accent); color: var(--bg3); border-color: var(--accent); }

.verse-arab {
  font-family: var(--font-arab);
  font-size: var(--arab-size);
  line-height: 2;
  direction: rtl;
  text-align: right;
  color: var(--text);
  margin-bottom: 14px;
}

.verse-latin {
  font-size: 14px;
  color: var(--text3);
  font-style: italic;
  line-height: 1.7;
  margin-bottom: 8px;
}

.verse-translation {
  font-size: 14px;
  color: var(--text2);
  line-height: 1.8;
}

/* ===== TAFSIR INLINE ===== */
.verse-tafsir {
  display: none;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text2);
  line-height: 1.8;
}

.verse-tafsir.visible { display: block; }

.tafsir-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent);
  margin-bottom: 6px;
  font-weight: 600;
}
.tafsir-loading {
  color: var(--text3);
  font-size: 12px;
  font-style: italic;
  animation: tafsirPulse 1.2s ease-in-out infinite;
}
@keyframes tafsirPulse { 0%,100%{opacity:.4} 50%{opacity:1} }

/* ===== AUDIO PLAYER (bottom sticky) ===== */
#audio-player {
  position: fixed;
  bottom: 58px;
  left: 0;
  right: 0;
  background: var(--bg3);
  border-top: 1px solid var(--border);
  padding: 10px 16px;
  z-index: 200;
  display: none;
}

#audio-player.visible { display: block; }

.ap-info {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.ap-label {
  font-size: 12px;
  color: var(--text3);
}

.ap-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  flex: 1;
}

.ap-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ap-btn {
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
}

.ap-btn:hover { background: var(--card-hover); }
.ap-btn.play-pause { background: var(--accent); color: var(--bg3); border-color: var(--accent); }
.ap-btn.play-pause:hover { background: var(--accent2); }
.ap-btn.active-repeat { background: var(--accent); color: var(--bg3); border-color: var(--accent); font-weight: 700; }
.ap-btn-sm { font-size: 0.72rem; padding: 2px 5px; min-width: 28px; opacity: 0.85; }

#ap-progress {
  flex: 1;
  -webkit-appearance: none;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

#ap-progress::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
}

.ap-time {
  font-size: 11px;
  color: var(--text3);
  white-space: nowrap;
}

#ap-close {
  background: none;
  border: none;
  color: var(--text3);
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
}

/* ===== FULLSCREEN READER ===== */
#fs-reader {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: var(--bg);
  display: none;
  flex-direction: column;
  overflow: hidden;
}
#fs-reader.visible { display: flex; }

#fs-controls {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
  z-index: 10;
}
#fs-controls.visible { opacity: 1; pointer-events: auto; }

#fs-topbar {
  position: absolute;
  top: 0; left: 0; right: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.55), transparent);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

#fs-bottombar {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.55), transparent);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

#fs-close, #fs-native-fs, #fs-tahfidz-btn {
  background: rgba(0,0,0,0.45);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff;
  border-radius: var(--radius-sm);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s;
}
#fs-close { padding: 6px 12px; font-size: 13px; }
#fs-native-fs { width: 36px; height: 36px; font-size: 18px; display:flex; align-items:center; justify-content:center; }
#fs-tahfidz-btn { padding: 5px 10px; font-size: 13px; }
#fs-close:hover, #fs-native-fs:hover, #fs-tahfidz-btn:hover { background: rgba(0,0,0,0.7); }
#fs-tahfidz-btn.active { background: var(--accent); border-color: var(--accent); color: var(--bg3); }

/* Tahfidz mode */
#fs-reader.tahfidz-mode #fs-verse-arab { filter: blur(10px); cursor: pointer; transition: filter 0.3s; }
#fs-reader.tahfidz-mode #fs-verse-arab.revealed { filter: none; }
#fs-reader.tahfidz-mode #fs-verse-latin,
#fs-reader.tahfidz-mode #fs-verse-trans-id,
#fs-reader.tahfidz-mode #fs-verse-trans-en { display: none !important; }

#fs-surah-info { flex: 1; text-align: center; }
#fs-surah-name { font-size: 15px; font-weight: 700; color: var(--accent); }
#fs-ayat-counter { font-size: 12px; color: rgba(255,255,255,0.65); margin-top: 2px; }

#fs-prev-btn, #fs-next-btn {
  background: rgba(0,0,0,0.45);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff;
  width: 44px; height: 44px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 20px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s;
}
#fs-prev-btn:hover, #fs-next-btn:hover { background: rgba(0,0,0,0.75); }
#fs-prev-btn:disabled, #fs-next-btn:disabled { opacity: 0.25; cursor: default; }

#fs-range {
  flex: 1;
  -webkit-appearance: none;
  height: 4px;
  background: rgba(255,255,255,0.3);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}
#fs-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
}

#fs-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 28px;
  text-align: center;
  cursor: pointer;
  user-select: none;
  overflow-y: auto;
  transition: opacity 0.15s;
}
#fs-content.fade { opacity: 0; }

#fs-verse-num {
  font-family: var(--font-arab);
  font-size: 20px;
  color: var(--accent);
  margin-bottom: 20px;
  direction: rtl;
}

.fs-arab {
  font-family: var(--font-arab);
  font-size: 38px;
  line-height: 2;
  direction: rtl;
  color: var(--text);
  margin-bottom: 20px;
  max-width: 720px;
  text-align: justify;
}

.fs-latin {
  font-size: 15px;
  color: var(--text3);
  font-style: italic;
  line-height: 1.8;
  margin-bottom: 12px;
  max-width: 620px;
}

.fs-trans-id {
  font-size: 18px;
  color: var(--text2);
  line-height: 1.8;
  max-width: 620px;
  margin-bottom: 8px;
}

.fs-trans-en {
  font-size: 14px;
  color: var(--text3);
  font-style: italic;
  line-height: 1.8;
  max-width: 620px;
}

/* ===== THEME SIDEBAR ===== */
#theme-sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 1100;
}
#theme-sidebar-overlay.visible { display: block; }

#theme-sidebar {
  position: fixed;
  top: 0;
  right: 0;
  width: 240px;
  max-width: 80vw;
  height: 100%;
  background: var(--bg2);
  border-left: 1px solid var(--border);
  z-index: 1101;
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(.4,0,.2,1);
  display: flex;
  flex-direction: column;
  box-shadow: -4px 0 24px rgba(0,0,0,0.25);
}
#theme-sidebar.open { transform: translateX(0); }

#theme-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}
#theme-sidebar-close {
  background: none;
  border: none;
  color: var(--text3);
  font-size: 16px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
}
#theme-sidebar-close:hover { color: var(--text); background: var(--card-hover); }

#theme-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.theme-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 1px solid transparent;
  transition: background var(--transition), border-color var(--transition);
}
.theme-item:hover { background: var(--card-hover); }
.theme-item.active { background: var(--card); border-color: var(--accent); }

.theme-swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.15);
  flex-shrink: 0;
  outline: 3px solid transparent;
  outline-offset: 2px;
  transition: outline-color 0.2s;
}
.theme-item.active .theme-swatch {
  outline-color: var(--accent);
}
.theme-item-name {
  font-size: 13px;
  color: var(--text);
  font-weight: 500;
}
.theme-item-desc {
  font-size: 11px;
  color: var(--text3);
  margin-top: 1px;
}

/* ===== iOS INSTALL HINT ===== */
#ios-install-hint {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--card);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 400;
  box-shadow: var(--shadow);
  font-size: 13px;
  color: var(--text);
  max-width: 90vw;
  white-space: normal;
  text-align: left;
  animation: slideUp 0.3s ease;
}
#ios-install-hint button {
  background: none;
  border: none;
  color: var(--text3);
  font-size: 16px;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0 4px;
}

/* ===== UPDATE & INSTALL BANNER ===== */
#install-banner {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--card);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 400;
  box-shadow: var(--shadow);
  font-size: 13px;
  color: var(--text);
  white-space: nowrap;
  animation: slideUp 0.3s ease;
}
#install-banner button {
  background: var(--accent);
  color: var(--bg3);
  border: none;
  border-radius: var(--radius-sm);
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
#btn-dismiss-install {
  background: none !important;
  color: var(--text3) !important;
  font-weight: 400 !important;
  padding: 4px 6px !important;
}

#update-banner {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--card);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 400;
  box-shadow: var(--shadow);
  font-size: 13px;
  color: var(--text);
  white-space: nowrap;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateX(-50%) translateY(16px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

#btn-do-update {
  background: var(--accent);
  color: var(--bg3);
  border: none;
  border-radius: var(--radius-sm);
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

#btn-dismiss-update {
  background: none;
  border: none;
  color: var(--text3);
  font-size: 16px;
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
}

/* ===== SCROLL TO TOP ===== */
#btn-scroll-top {
  position: fixed;
  bottom: 30px;
  right: 16px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text3);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  z-index: 140;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s, background var(--transition);
}

#btn-scroll-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

#btn-scroll-top:hover { background: var(--card-hover); color: var(--accent); }

/* ===== FAB MUSHAF ===== */
#btn-fs-open {
  position: fixed;
  bottom: 30px;
  left: 16px;
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--bg3);
  border: none;
  cursor: pointer;
  font-size: 22px;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
  z-index: 150;
  transition: background var(--transition), transform var(--transition);
}
#btn-fs-open:hover { background: var(--accent2); transform: scale(1.08); }

/* ===== TAJWEED INFO BUTTON ===== */
#btn-tajweed-info {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text3);
  font-size: 11px;
  font-weight: 700;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition);
  padding: 0;
}
#btn-tajweed-info:hover { border-color: var(--accent); color: var(--accent); }

/* ===== TAJWEED LEGEND MODAL ===== */
#tajweed-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 600;
  align-items: flex-end;
  justify-content: center;
}
#tajweed-overlay.visible { display: flex; }

#tajweed-legend {
  background: var(--bg2);
  border-top: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0;
  width: 100%;
  max-width: 600px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
}

#tl-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

#tl-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--accent);
}

#tl-close {
  background: none;
  border: none;
  color: var(--text3);
  font-size: 18px;
  cursor: pointer;
  padding: 2px 6px;
}

#tl-body {
  overflow-y: auto;
  padding: 12px 16px 24px;
}

.tl-group {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent);
  font-weight: 700;
  margin: 14px 0 8px;
}
.tl-group:first-child { margin-top: 2px; }

.tl-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.tl-swatch {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  flex-shrink: 0;
}

.tl-rule {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  min-width: 150px;
}

.tl-desc {
  font-size: 12px;
  color: var(--text3);
}

/* ===== LOADING ===== */
#loading-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(26,42,32,0.85);
  z-index: 500;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
}

#loading-overlay.visible { display: flex; }

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: 40px 16px;
  color: var(--text3);
}

.empty-state .es-icon { font-size: 48px; margin-bottom: 12px; }
.empty-state .es-text { font-size: 15px; }

/* ===== ABOUT MODAL ===== */
#about-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 700;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
#about-overlay.visible { display: flex; }

#about-card {
  background: var(--bg2);
  border-radius: 20px;
  padding: 28px 24px 24px;
  width: 100%;
  max-width: 340px;
  max-height: 85vh;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
  position: relative;
  animation: slideUp 0.25s ease;
}

#about-card::-webkit-scrollbar { width: 4px; }
#about-card::-webkit-scrollbar-track { background: transparent; }
#about-card::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

#about-close {
  position: absolute;
  top: 12px; right: 14px;
  background: none;
  border: none;
  font-size: 16px;
  cursor: pointer;
  color: var(--text3);
  padding: 4px 8px;
  border-radius: 6px;
}
#about-close:hover { background: var(--bg3); color: var(--text1); }

#about-logo {
  width: 64px; height: 64px;
  border-radius: 35px;
  margin-bottom: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

#about-appname {
  font-size: 18px;
  font-weight: 700;
  color: var(--text1);
  letter-spacing: 0.3px;
}

#about-version {
  font-size: 12px;
  color: var(--text3);
  margin-top: 2px;
}

.about-divider {
  height: 1px;
  background: var(--border);
  margin: 16px 0;
}

#about-orgs { padding: 0 4px; }

.about-org-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text3);
  margin-bottom: 8px;
}

.about-org-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.4;
}

.about-org-sub {
  font-size: 11px;
  color: var(--text3);
  margin: 4px 0;
}

#about-dedication { padding: 0 4px; }

.about-ded-dua {
  font-size: 22px;
  line-height: 1.8;
  color: var(--text1);
  font-family: 'Traditional Arabic', 'Scheherazade New', serif;
  margin-bottom: 10px;
}

.about-ded-trans {
  font-size: 12px;
  color: var(--text2);
  line-height: 1.6;
  font-style: italic;
}

.about-ded-ref {
  display: inline-block;
  margin-top: 4px;
  font-size: 11px;
  color: var(--accent);
  font-style: normal;
  font-weight: 600;
}

#btn-show-features {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text2);
  border-radius: var(--radius-sm);
  padding: 8px;
  font-size: 13px;
  cursor: pointer;
  transition: background var(--transition);
  margin-top: 4px;
}
#btn-show-features:hover { background: var(--card); color: var(--accent); }

/* ===== FEATURES MODAL ===== */
#features-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 800;
  align-items: flex-end;
  justify-content: center;
}
#features-overlay.visible { display: flex; }

#features-card {
  background: var(--bg2);
  border-radius: 20px 20px 0 0;
  width: 100%;
  max-width: 480px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 -4px 24px rgba(0,0,0,0.3);
  animation: slideUp 0.25s ease;
}

#features-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

#features-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--accent);
}

#features-close {
  background: none;
  border: none;
  font-size: 16px;
  cursor: pointer;
  color: var(--text3);
  padding: 4px 8px;
  border-radius: 6px;
}
#features-close:hover { background: var(--bg3); color: var(--text1); }

#features-body {
  overflow-y: auto;
  padding: 14px 18px 24px;
}

.feat-group {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin: 14px 0 6px;
}
.feat-group:first-child { margin-top: 0; }

.feat-item {
  font-size: 13px;
  color: var(--text2);
  padding: 4px 0 4px 12px;
  border-left: 2px solid var(--border);
  margin-bottom: 3px;
  line-height: 1.4;
}

#about-footer {
  font-size: 12px;
  color: var(--text3);
}

/* ===== TOAST ===== */
#toast {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--card);
  border: 1px solid var(--accent);
  color: var(--text);
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 13px;
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
  white-space: nowrap;
  z-index: 300;
}

#toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 480px) {
  #main { padding: 10px; padding-bottom: 190px; }
  .surah-name-arab { font-size: 18px; }
  #font-control label { display: none; }
  #font-slider { width: 55px; }
  .surah-header-card .sh-arab { font-size: 28px; }
}

@media (min-width: 640px) {
  #surah-list { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 900px) {
  #surah-list { grid-template-columns: 1fr 1fr 1fr; }
  #app-header { padding: 14px 24px; }
  #main { padding: 20px 24px; padding-bottom: 190px; }
}

/* Auto Scroll */
.auto-scroll {
    position: fixed;
    left: 0;
    top: 50%;
    display: none;
}

.scroll-title {
    position: absolute;
    top: 8px;
    font-size: .65em;
    font-weight: 500;
    left: 10px;
    height: 100px;
    text-transform: uppercase;
    cursor: pointer;
    writing-mode: vertical-rl;
    display: none;
    transition: left 0.2s ease;
}


svg:not(:root).svg-inline--fa {
    overflow: visible;
}

.svg-inline--fa.fa-w-20 {
    width: 1.25em;
}

.svg-inline--fa {
    display: inline-block;
    font-size: inherit;
    height: 1em;
    overflow: visible;
    vertical-align: -.125em;
    padding-bottom: 2px;
}

#speednav {
    background: var(--bg3);
    padding: 10px;
    float: left;
    width: 47px;
    height: 110px
}

#speednav ul{
  margin-left: 30px;
}

.speedbar {
    list-style-type: none;
    border: 1px solid #424242;
    height: 12px;
    margin-left: -38px
}

#speed1 {
    background: #ddd;
    width: 38px;
    cursor: pointer
}

/* ===== BOTTOM NAV ===== */
#bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  background: var(--bg3);
  border-top: 1px solid var(--border);
  z-index: 210;
  height: 58px;
}

.bnav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text3);
  transition: color var(--transition);
  padding: 0;
}

.bnav-btn.active {
  color: var(--accent);
}

.bnav-icon {
  font-size: 20px;
  line-height: 1;
}

.bnav-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

/* Adjust main padding to account for bottom nav */
#main { padding-bottom: 190px; }
#toast { bottom: 68px; }
#update-banner { bottom: 70px; }
#btn-scroll-top { bottom: 70px; }
#btn-fs-open { bottom: 70px; }

/* ===== DOA VIEW ===== */
#doa-view {
  padding: 0 14px 80px;
  max-width: 720px;
  margin: 0 auto;
}

.doa-header-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

.doa-source {
  font-size: 12px;
  color: var(--accent);
  font-weight: 600;
}

.doa-total {
  font-size: 12px;
  color: var(--text3);
}

.doa-cat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

@media (min-width: 480px) { .doa-cat-grid { grid-template-columns: 1fr 1fr 1fr; } }

.doa-cat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), transform var(--transition);
  text-align: center;
}

.doa-cat-card:hover {
  background: var(--card-hover);
  border-color: var(--accent);
  transform: translateY(-2px);
}

.doa-cat-icon {
  font-size: 28px;
  line-height: 1;
}

.doa-cat-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.doa-cat-count {
  font-size: 11px;
  color: var(--text3);
}

/* DOA CARD */
.doa-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 16px;
  margin-bottom: 12px;
}

.doa-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.btn-copy-doa {
  margin-left: auto;
  background: none;
  border: 1px solid var(--border);
  color: var(--text3);
  border-radius: var(--radius-sm);
  width: 28px;
  height: 28px;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition);
}
.btn-copy-doa:hover { border-color: var(--accent); color: var(--accent); }

.doa-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--bg3);
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.doa-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
}

.doa-arab {
  font-family: var(--font-arab);
  font-size: 26px;
  line-height: 2;
  direction: rtl;
  text-align: right;
  color: var(--text);
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}

.doa-latin {
  font-size: 13px;
  font-style: italic;
  color: var(--text3);
  line-height: 1.8;
  margin-bottom: 10px;
}

.doa-arti {
  font-size: 14px;
  color: var(--text2);
  line-height: 1.8;
  margin-bottom: 10px;
}

.doa-source-tag {
  font-size: 11px;
  color: var(--accent);
  background: var(--bg3);
  border-radius: 999px;
  padding: 2px 10px;
  display: inline-block;
  font-weight: 600;
}

/* Hide Latin in doa when body.hide-latin */
body.hide-latin .doa-latin { display: none; }

/* ===== MUSHAF DIGITAL ===== */
#mushaf-view {
  display: none;
  flex-direction: column;
  align-items: center;
  min-height: calc(100vh - 58px);
  background: var(--bg3);
  padding-bottom: 80px;
}

#mushaf-pages {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  padding: 6px 4px;
  overflow: hidden;
  position: relative;
  min-height: calc(100vh - 160px);
}
#mushaf-pages.loading::before {
  content: '';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg2);
  z-index: 2;
}
#mushaf-pages.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: mushaf-spin 0.7s linear infinite;
  z-index: 3;
}
@keyframes mushaf-spin { to { transform: translate(-50%, -50%) rotate(360deg); } }

.mushaf-img {
  width: auto;
  max-height: calc(100vh - 169px);
  object-fit: contain;
  display: block;
  background: #fff;
  box-shadow: var(--shadow);
}

.mushaf-img.single {
  width: auto;
  max-width: 100%;
  max-height: calc(100vh - 169px);
}

@media (max-width: 599px) {
  .mushaf-img { width: 100%; max-height: calc(100vh - 169px); }
}

#mushaf-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 8px 16px;
  background: var(--bg3);
  border-top: 1px solid var(--border);
  z-index: 205;
}

#mushaf-prev, #mushaf-next {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
  flex-shrink: 0;
}
#mushaf-prev:hover, #mushaf-next:hover { background: var(--card-hover); color: var(--accent); }
#mushaf-prev:disabled, #mushaf-next:disabled { opacity: 0.3; cursor: default; }

#mushaf-page-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

#mushaf-page-input {
  width: 56px;
  padding: 5px 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--text);
  font-size: 14px;
  text-align: center;
  outline: none;
}
#mushaf-page-input:focus { border-color: var(--accent); }

#mushaf-page-info {
  font-size: 13px;
  color: var(--text3);
  white-space: nowrap;
}

#mushaf-bookmark {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text3);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  flex-shrink: 0;
}
#mushaf-bookmark:hover  { border-color: var(--accent); color: var(--accent); }
#mushaf-bookmark.active { background: var(--accent); color: var(--bg3); border-color: var(--accent); }

#mushaf-bm-bar {
  position: fixed;
  bottom: 58px;
  left: 50%;
  transform: translateX(-50%);
  display: none;
  align-items: center;
  gap: 8px;
  background: var(--card);
  border: 1px solid var(--accent);
  border-radius: 999px;
  padding: 6px 14px 6px 12px;
  font-size: 13px;
  color: var(--text);
  z-index: 206;
  box-shadow: var(--shadow);
  white-space: nowrap;
}

#mushaf-bm-label { font-size: 15px; }

#mushaf-bm-jump {
  background: var(--accent);
  color: var(--bg3);
  border: none;
  border-radius: 999px;
  padding: 3px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

#mushaf-bm-clear {
  background: none;
  border: none;
  color: var(--text3);
  font-size: 14px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}
#mushaf-bm-clear:hover { color: var(--danger); }

.btn-mushaf { font-size: 14px; }

#speed2 {
    background: #ccc;
    width: 38px;
    cursor: pointer
}

#speed3 {
    background: #bbb;
    width: 38px;
    cursor: pointer
}

#speed4 {
    background: #aaa;
    width: 38px;
    cursor: pointer
}

#speed5 {
    background: #999;
    width: 38px;
    cursor: pointer
}

/* ===== INDEKS TEMATIS ===== */
#indeks-view {
  padding: 0 14px 80px;
  max-width: 720px;
  margin: 0 auto;
}

.idx-intro {
  text-align: center;
  color: var(--text3);
  font-size: 12px;
  padding: 10px 0 14px;
}

#indeks-cat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

@media (min-width: 480px) {
  #indeks-cat-grid { grid-template-columns: repeat(3, 1fr); }
}

.idx-cat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 10px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  color: var(--text);
  text-align: center;
  transition: all var(--transition);
}

.idx-cat-card:hover, .idx-cat-card:active {
  background: var(--card-hover);
  border-color: var(--accent);
  transform: translateY(-2px);
}

.idx-cat-icon { font-size: 26px; line-height: 1; }
.idx-cat-name { font-size: 11px; font-weight: 600; line-height: 1.3; }

#indeks-detail-hdr {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0 12px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 4px;
}

.idx-det-icon { font-size: 30px; }
.idx-det-name { font-size: 17px; font-weight: 700; color: var(--accent); }
.idx-det-sub  { font-size: 12px; color: var(--text3); margin-top: 2px; }

.idx-node { border-bottom: 1px solid var(--border); }

.idx-hdr {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 11px 4px;
  cursor: pointer;
  user-select: none;
  transition: color var(--transition);
}

.idx-hdr:hover { color: var(--accent); }

.idx-chev {
  font-size: 9px;
  flex-shrink: 0;
  margin-top: 4px;
  transition: transform 0.2s;
  color: var(--text3);
}

.idx-hdr.open .idx-chev { transform: rotate(90deg); }

.idx-node.idx-d1 > .idx-hdr > .idx-lbl {
  font-weight: 700;
  font-size: 15px;
  color: var(--accent);
}

.idx-lbl { flex: 1; font-size: 13px; line-height: 1.4; }

.idx-body {
  padding-left: 14px;
  border-left: 2px solid var(--border);
  margin-left: 10px;
}

.idx-leaf {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 7px 4px 7px 16px;
  border-bottom: 1px solid rgba(58,96,80,0.25);
}

.idx-leaf .idx-lbl { font-size: 12px; color: var(--text2); }

.idx-verses {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 3px;
}

.idx-v {
  display: inline-block;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 20px;
  background: rgba(201,162,39,0.13);
  color: var(--accent);
  cursor: pointer;
  font-weight: 600;
  transition: all var(--transition);
  font-family: monospace;
}

.idx-v:hover {
  background: var(--accent);
  color: #1a3a2a;
}
body.wb .idx-v { background: rgba(0,79,37,0.1); color: var(--accent); }
body.wb .idx-v:hover { background: var(--accent); color: #dcf900; }

/* ===== TEMA SEARCH RESULTS ===== */
.tema-card {
  margin: 6px 12px;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--card-bg);
  border: 1px solid var(--border);
}

.tema-cat {
  font-size: 11px;
  color: var(--text3);
  margin-bottom: 3px;
}

.tema-path {
  font-size: 13px;
  color: var(--text);
  font-weight: 600;
  margin-bottom: 6px;
  line-height: 1.4;
}

/* ===== INDEKS SEARCH ===== */
#indeks-search-wrap {
  padding: 8px 12px 4px;
}

#indeks-search {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--text);
  font-size: 13px;
  outline: none;
  transition: border-color var(--transition);
}

#indeks-search:focus {
  border-color: var(--accent);
}

/* ===== SHARE BUTTON ===== */
.btn-share { color: var(--text2); }
.btn-share:hover { color: var(--accent); }

/* ===== VERSE LEGEND ===== */
.verse-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 2px;
  align-items: center;
  font-size: 11px;
  color: var(--text3);
  padding: 6px 14px 10px;
  opacity: 0.75;
}
.verse-legend span { white-space: nowrap; display: inline-flex; align-items: center; gap: 3px; }
.verse-legend svg { width: 11px; height: 11px; pointer-events: none; }
.vl-sep { margin: 0 3px; opacity: 0.5; }

/* ===== TAHFIDZ MODE (surah view) ===== */
body.tahfidz-mode .verse-arab { filter: blur(10px); cursor: pointer; transition: filter 0.3s; user-select: none; }
body.tahfidz-mode .verse-arab.revealed { filter: none; cursor: default; }
body.tahfidz-mode .verse-latin,
body.tahfidz-mode .verse-translation,
body.tahfidz-mode .verse-translation-en,
body.tahfidz-mode .verse-isyarat { display: none !important; }

/* ===== HAFAL ===== */
.btn-hafal { color: var(--text3); }
.btn-hafal.active { color: #4caf50; font-weight: 700; }
.sh-hafal-progress { font-size: 12px; color: var(--text3); margin-top: 6px; }
.sh-hafal-progress.done { color: #4caf50; font-weight: 600; }

/* ===== REVEAL COUNTER ===== */
.reveal-count { display: none; font-size: 11px; color: var(--text3); padding: 3px 0 2px; font-style: italic; }
body.tahfidz-mode .reveal-count { display: block; }
#fs-reveal-count { display: none; font-size: 13px; color: var(--text3); margin-top: 8px; font-style: italic; }

/* ===== KHATAM TRACKER ===== */
#khatam-widget {
  margin: 4px 12px 6px;
  border-radius: 10px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  overflow: hidden;
}

#khatam-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  cursor: pointer;
  user-select: none;
}

.kw-icon { font-size: 16px; display: flex; align-items: center; }

.kw-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  flex: 1;
}

#khatam-progress-text {
  font-size: 12px;
  color: var(--accent);
  font-weight: 600;
}

#khatam-reset {
  background: none;
  border: none;
  color: var(--text2);
  font-size: 16px;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  line-height: 1;
  transition: color var(--transition);
}

#khatam-reset:hover { color: var(--accent); }

#khatam-chevron {
  font-size: 12px;
  color: var(--text2);
  display: flex;
  align-items: center;
}
#khatam-chevron svg { width: 14px; height: 14px; display: block; }

#khatam-juz-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  padding: 8px 12px 12px;
}

.khatam-juz {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  padding: 6px 2px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  transition: all var(--transition);
  min-height: 46px;
}

.khatam-juz.kj-partial {
  border-color: rgba(201,162,39,0.5);
  background: rgba(201,162,39,0.08);
}

.khatam-juz.kj-full {
  border-color: var(--accent);
  background: rgba(201,162,39,0.2);
}

.kj-num {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}

.kj-prog {
  font-size: 9px;
  color: var(--text2);
  margin-top: 2px;
}

.khatam-juz.kj-full .kj-num { color: var(--accent); }
.khatam-juz.kj-full .kj-prog { color: var(--accent); }

/* ===== TAHFIDZ TRACKER ===== */
#tahfidz-widget {
  margin: 4px 12px 6px;
  border-radius: 10px;
  border: 1px solid var(--border);
  overflow: hidden;
}
#tw-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  cursor: pointer;
  user-select: none;
}
#tw-header:hover { background: var(--card-hover); }
#tw-summary { flex: 1; font-size: 12px; color: var(--accent); font-weight: 600; }
#tw-reset { background: none; border: none; color: var(--text2); font-size: 16px; cursor: pointer; padding: 2px 4px; border-radius: 4px; line-height: 1; transition: color var(--transition); }
#tw-reset:hover { color: var(--accent); }
#tw-chevron { font-size: 12px; color: var(--text2); display: flex; align-items: center; }
#tw-chevron svg { width: 14px; height: 14px; display: block; }

.tw-progress-wrap { height: 5px; background: var(--border); overflow: hidden; margin: 0 12px 6px; border-radius: 3px; }
.tw-progress-bar { height: 100%; background: var(--accent); border-radius: 3px; transition: width 0.4s ease; min-width: 3px; }
.tw-stats { font-size: 11px; color: var(--text3); padding: 0 12px 8px; text-align: center; }
.tw-section-label { font-size: 10px; font-weight: 700; letter-spacing: 0.6px; text-transform: uppercase; color: var(--text3); padding: 6px 12px 4px; display: flex; align-items: center; gap: 6px; }
.tw-clear-juz { font-size: 11px; cursor: pointer; opacity: 0.6; font-weight: 400; letter-spacing: 0; text-transform: none; }
.tw-clear-juz:hover { opacity: 1; color: var(--danger); }
.tw-hf-btns { display: flex; gap: 3px; margin-left: auto; }
.tw-hfb { font-size: 10px; padding: 2px 6px; border-radius: 10px; border: 1px solid var(--border); background: transparent; color: var(--text3); cursor: pointer; font-weight: 600; letter-spacing: 0; text-transform: none; transition: all 0.15s; display: inline-flex; align-items: center; gap: 3px; }
.tw-hfb svg { width: 10px; height: 10px; display: block; flex-shrink: 0; }
.tw-hfb.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.tw-hfb:hover:not(.active) { border-color: var(--accent); color: var(--accent); }
.khatam-juz.kj-active { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.tw-juz-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 5px; padding: 0 12px 10px; }

.tw-surah-scroll { max-height: 220px; overflow-y: auto; }
.tw-surah-row { display: grid; grid-template-columns: 1fr auto; gap: 1px 6px; padding: 6px 12px; border-top: 1px solid var(--border); }
.tw-surah-row.tw-progress { cursor: pointer; transition: background var(--transition); }
.tw-surah-row.tw-progress:hover { background: var(--card-hover); }
.tw-surah-name { font-size: 12px; color: var(--text2); }
.tw-surah-count { font-size: 11px; color: var(--text3); white-space: nowrap; }
.tw-surah-bar-wrap { grid-column: 1 / -1; height: 3px; background: var(--border); border-radius: 2px; overflow: hidden; margin-top: 3px; }
.tw-surah-bar { height: 100%; background: var(--accent); border-radius: 2px; }
.tw-surah-row.tw-done .tw-surah-name { color: var(--accent); font-weight: 600; }
.tw-surah-row.tw-done .tw-surah-count { color: var(--accent); font-weight: 600; }
.tw-surah-row.tw-done .tw-surah-bar { background: var(--accent); }
.tw-surah-row.tw-progress .tw-surah-count { color: #b8860b; }
body.wb .tw-surah-row.tw-done .tw-surah-name { color: #006830; }
body.wb .tw-surah-row.tw-done .tw-surah-count { color: #006830; }
body.wb .tw-surah-row.tw-done .tw-surah-bar { background: #006830; }
body.wb .tw-surah-row.tw-progress .tw-surah-count { color: #d3bb04; }
body.wb .tw-surah-row.tw-progress .tw-surah-bar { background: #d3bb04; }
body.babyblue .tw-surah-row.tw-progress .tw-surah-count { color: #b45309; }
body.babyblue .tw-surah-row.tw-progress .tw-surah-bar { background: #f59e0b; }
body.maroon .tw-surah-row.tw-done .tw-surah-name { color: #2e7d32; }
body.maroon .tw-surah-row.tw-done .tw-surah-count { color: #2e7d32; }
body.maroon .tw-surah-row.tw-done .tw-surah-bar { background: #2e7d32; }
body.maroon .tw-surah-row.tw-progress .tw-surah-count { color: #800020; }
body.maroon .tw-surah-row.tw-progress .tw-surah-bar { background: #800020; }
