/* ==========================================================================
   AL-AWAIQ PWA - STYLESHEET
   Siri Fiqh Haraki & Halangan Dakwah - Syeikh Muhammad Ahmad Ar-Rasyid
   Identiti Visual: Ruby Crimson & Radiant Gold / Deep Midnight
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Amiri:ital,wght@0,400;0,700;1,400&family=Outfit:wght@300;400;500;600;700;800&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

:root {
  /* Dark Theme (Default) - Deep Cosmic Midnight Sapphire */
  --bg-app: #061712;
  --bg-sidebar: #09201a;
  --bg-card: rgba(26, 17, 32, 0.82);
  --bg-card-hover: rgba(43, 24, 48, 0.90);
  --bg-header: rgba(15, 23, 42, 0.92);
  --bg-input: #1e1b2e;
  --border-subtle: rgba(56, 189, 248, 0.28);
  --border-card: rgba(56, 189, 248, 0.12);

  /* Brand Accents - Royal Sapphire & Radiant Amber Gold */
  --gold-primary: #eab308;
  --gold-light: #fde047;
  --gold-dark: #ca8a04;
  --gold-glow: rgba(234, 179, 8, 0.38);

  --sapphire-primary: #059669;
  --sapphire-light: #34d399;
  --sapphire-dark: #064e3b;
  --sapphire-glow: rgba(16, 185, 129, 0.45);

  --emerald-primary: #10b981;
  --emerald-glow: rgba(16, 185, 129, 0.3);

  --blue-primary: #38bdf8;

  /* Typography */
  --text-main: #f0f6fc;
  --text-muted: #94a7c4;
  --text-light: #cde0f7;
  --text-gold: #fde047;

  /* Sizing & Transitions */
  --font-base: 1.05rem;
  --sidebar-w: 320px;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-glow: 0 8px 32px 0 rgba(190, 18, 60, 0.25);
}

[data-theme="light"] {
  /* Light Theme - Clean Glacier Pearl & Cool Slate */
  --bg-app: #f1f5fa;
  --bg-sidebar: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f3f7fd;
  --bg-header: rgba(255, 255, 255, 0.94);
  --bg-input: #e4edf8;
  --border-subtle: rgba(2, 132, 199, 0.35);
  --border-card: #cbd5e1;

  --text-main: #0b172a;
  --text-muted: #475569;
  --text-light: #1e3a8a;
  --text-gold: #b45309;
  --shadow-glow: 0 10px 25px -5px rgba(2, 132, 199, 0.08);
}

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

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-app);
  color: var(--text-main);
  line-height: 1.65;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}

::-webkit-scrollbar-track {
  background: var(--bg-app);
}

::-webkit-scrollbar-thumb {
  background: rgba(56, 189, 248, 0.3);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--sapphire-light);
}

/* ================= HEADER ================= */
.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: 68px;
  background: var(--bg-header);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-card);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  box-shadow: 0 4px 20px rgba(2, 132, 199, 0.16);
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.brand-logo {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--gold-primary);
  box-shadow: 0 0 16px rgba(2, 132, 199, 0.5), 0 0 8px rgba(234, 179, 8, 0.4);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

.brand-logo:hover {
  transform: scale(1.08) rotate(4deg);
  box-shadow: 0 0 22px rgba(56, 189, 248, 0.7), 0 0 14px rgba(234, 179, 8, 0.6);
  border-color: var(--sapphire-light);
}

.brand-text h1 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #ffffff 30%, var(--gold-light) 65%, var(--sapphire-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: flex;
  align-items: center;
  gap: 8px;
}

[data-theme="light"] .brand-text h1 {
  background: linear-gradient(135deg, #0b172a 35%, #b45309 70%, #0284c7 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-text .ar-badge {
  font-family: 'Amiri', serif;
  font-size: 1.2rem;
  color: var(--gold-primary);
  -webkit-text-fill-color: var(--gold-primary);
}

.brand-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Header Controls */
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Layer Switcher Pill */
.layer-switcher {
  display: flex;
  align-items: center;
  background: var(--bg-input);
  padding: 4px;
  border-radius: 30px;
  border: 1px solid var(--border-card);
}

.layer-btn {
  padding: 6px 14px;
  border-radius: 20px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
}

.layer-btn.active {
  background: linear-gradient(135deg, var(--gold-primary), var(--gold-dark));
  color: #0b132b;
  box-shadow: 0 2px 10px var(--gold-glow);
}

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border-card);
  background: var(--bg-input);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.icon-btn:hover {
  border-color: var(--gold-primary);
  color: var(--gold-primary);
  transform: translateY(-2px);
}

/* Butang Muat Turun Versi Penuh PDF */
.pdf-download-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-input);
  border: 1px solid var(--border-card);
  color: var(--text-main);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.pdf-download-btn:hover {
  background: linear-gradient(135deg, var(--gold-primary), var(--gold-dark));
  color: #0b132b;
  border-color: var(--gold-primary);
  box-shadow: 0 2px 10px var(--gold-glow);
  transform: translateY(-2px);
}

.pdf-download-btn .pdf-btn-icon {
  font-size: 0.95rem;
}

[data-theme="light"] .pdf-download-btn {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #1e293b;
}

[data-theme="light"] .pdf-download-btn:hover {
  background: linear-gradient(135deg, var(--gold-primary), var(--gold-dark));
  color: #0b132b;
  border-color: var(--gold-primary);
}

/* ================= MAIN CONTAINER ================= */
.app-container {
  display: flex;
  max-width: 1440px;
  margin: 0 auto;
  min-height: calc(100vh - 68px);
}

/* ================= SIDEBAR ================= */
.app-sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-card);
  height: calc(100vh - 68px);
  position: sticky;
  top: 68px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-box-wrap {
  padding: 1.1rem;
  border-bottom: 1px solid var(--border-card);
  position: sticky;
  top: 0;
  background: var(--bg-sidebar);
  z-index: 10;
}

.search-input-group {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 12px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 10px 14px 10px 38px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-card);
  background: var(--bg-input);
  color: var(--text-main);
  font-size: 0.9rem;
  outline: none;
  transition: var(--transition);
}

.search-input:focus {
  border-color: var(--gold-primary);
  box-shadow: 0 0 10px var(--gold-glow);
}

.clear-search-btn {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: none;
}

/* Chapter Tree List */
.chapter-nav-list {
  list-style: none;
  padding: 0.75rem 0.5rem;
  flex: 1;
}

.chapter-nav-item {
  margin-bottom: 6px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid transparent;
  transition: var(--transition);
}

.chapter-nav-item.active-chapter {
  border-color: var(--border-subtle);
  background: rgba(212, 175, 55, 0.05);
}

.chapter-header-btn {
  width: 100%;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: none;
  border: none;
  color: var(--text-main);
  font-family: inherit;
  font-size: 1.02rem;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  line-height: 1.35;
}

.chapter-header-btn:hover {
  background: var(--bg-card-hover);
  color: var(--gold-light);
}

.chapter-num-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 26px;
  padding: 0 5px;
  background: linear-gradient(135deg, rgba(190, 18, 60, 0.25), rgba(30, 58, 138, 0.45));
  border: 1.5px solid rgba(56, 189, 248, 0.55);
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 700;
  color: #ffffff;
  margin-right: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  transition: all 0.2s ease;
}

[data-theme="light"] .chapter-num-badge {
  background: linear-gradient(135deg, #e0f2fe, #bae6fd);
  border-color: #38bdf8;
  color: #0369a1;
  box-shadow: 0 1px 4px rgba(2, 132, 199, 0.2);
}

.chapter-header-btn:hover .chapter-num-badge {
  background: linear-gradient(135deg, var(--gold-primary), #ca8a04);
  color: #060e20;
  border-color: var(--gold-light);
  box-shadow: 0 0 10px rgba(234, 179, 8, 0.6);
  transform: scale(1.05);
}

.chapter-title-text {
  flex: 1;
  white-space: normal;
  line-height: 1.35;
}

.chevron-icon {
  transition: transform 0.25s ease;
  color: var(--text-muted);
  flex-shrink: 0;
  margin-left: 6px;
}

.chapter-nav-item.open .chevron-icon {
  transform: rotate(90deg);
}

.subtopic-list {
  list-style: none;
  padding: 6px 8px 10px 22px;
  display: none;
}

.chapter-nav-item.open .subtopic-list {
  display: block;
}

.subtopic-nav-btn {
  width: 100%;
  padding: 10px 12px;
  margin-bottom: 4px;
  border-radius: 8px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.98rem;
  line-height: 1.45;
  text-align: left;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: flex-start;
  gap: 8px;
  white-space: normal;
  word-break: break-word;
}

.subtopic-num {
  flex-shrink: 0;
  min-width: 1.45rem;
  font-weight: 600;
  line-height: 1.45;
  color: inherit;
  opacity: 0.85;
  text-align: left;
}

.subtopic-title-text {
  flex: 1;
  text-align: left;
  line-height: 1.45;
  white-space: normal;
  word-break: break-word;
}

.subtopic-nav-btn:hover {
  color: var(--text-main);
  background: rgba(2, 132, 199, 0.08);
}

.subtopic-nav-btn.active-sub {
  color: var(--sapphire-light);
  background: rgba(2, 132, 199, 0.18);
  font-weight: 600;
  border-left: 3px solid var(--sapphire-light);
}

.subtopic-nav-btn.active-sub .subtopic-num {
  color: var(--gold-light);
  opacity: 1;
}

[data-theme="light"] .subtopic-nav-btn.active-sub {
  color: #0284c7;
  background: #e0f2fe;
  border-left-color: #0284c7;
}

[data-theme="light"] .subtopic-nav-btn.active-sub .subtopic-num {
  color: #0369a1;
}

/* ================= CONTENT AREA ================= */
.app-content {
  flex: 1;
  padding: 2rem 2.5rem;
  max-width: 950px;
  margin: 0 auto;
}

/* Hero / Announcement Card - Royal Sapphire & Star Gold Glow */
.hero-card {
  background: linear-gradient(135deg, rgba(14, 30, 64, 0.95), rgba(8, 18, 40, 0.98));
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: var(--radius-md);
  padding: 1.5rem 2rem;
  margin-bottom: 2rem;
  position: relative;
  overflow: hidden;
  box-shadow: 0 12px 35px rgba(2, 132, 199, 0.22);
  transition: var(--transition);
}

.hero-card::after {
  content: 'المسار';
  font-family: 'Amiri', serif;
  position: absolute;
  right: -10px;
  bottom: -30px;
  font-size: 9rem;
  color: rgba(56, 189, 248, 0.06);
  pointer-events: none;
}

.hero-badge {
  display: inline-block;
  background: rgba(2, 132, 199, 0.18);
  border: 1px solid var(--sapphire-light);
  color: var(--sapphire-light);
  padding: 4px 12px;
  border-radius: 30px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}

.hero-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.8rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

/* Fon Arab Amiri untuk (المَسَار) supaya sepadan dengan tajuk Arab bab */
.hero-ar-title {
  font-family: 'Amiri', serif;
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--gold-light);
  letter-spacing: 0;
}

[data-theme="light"] .hero-ar-title {
  color: #b45309;
}

.hero-desc {
  font-size: 0.95rem;
  color: #cbd5e1;
  max-width: 680px;
  margin-bottom: 1rem;
  line-height: 1.7;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  margin-top: 10px;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: #94a3b8;
}

.stat-item strong {
  color: var(--gold-light);
  font-size: 1.05rem;
}

/* Penyesuaian Mod Cerah (Light Mode) untuk Hero Card */
[data-theme="light"] .hero-card {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid rgba(212, 175, 55, 0.35);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .hero-card::after {
  color: rgba(212, 175, 55, 0.08);
}

[data-theme="light"] .hero-badge {
  background: rgba(212, 175, 55, 0.12);
  border: 1px solid rgba(170, 134, 32, 0.4);
  color: #8c6b00;
}

[data-theme="light"] .hero-title {
  color: #0f172a;
}

[data-theme="light"] .hero-desc {
  color: #1e293b;
  font-weight: 450;
}

[data-theme="light"] .stat-item {
  color: #475569;
}

[data-theme="light"] .stat-item strong {
  color: #b38600;
}

/* Reading View Container */
.reader-container {
  display: block;
}

.chapter-heading-banner {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-card);
}

.ch-badge-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.ch-pill {
  background: rgba(2, 132, 199, 0.18);
  border: 1px solid var(--sapphire-light);
  color: var(--sapphire-light);
  padding: 3px 12px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

[data-theme="light"] .ch-pill {
  background: #e0f2fe;
  border-color: #0284c7;
  color: #0369a1;
}

.ch-ar-title {
  font-family: 'Amiri', serif;
  font-size: 1.6rem;
  color: var(--gold-light);
  direction: rtl;
  unicode-bidi: isolate;
  display: inline-block;
}

[data-theme="light"] .ch-ar-title {
  color: #996515;
}

.subtopic-main-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.35;
}

/* Reading Toolbar */
.reading-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-card);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 1.8rem;
}

.mode-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--gold-primary);
  font-weight: 600;
}

.tools-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tool-btn {
  background: var(--bg-input);
  border: 1px solid var(--border-card);
  color: var(--text-muted);
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.tool-btn:hover {
  color: var(--gold-primary);
  border-color: var(--gold-primary);
}

/* Reading Content Card */
.content-body {
  font-size: var(--font-base);
  line-height: 1.85;
  color: var(--text-light);
}

.content-body p {
  margin-bottom: 1.25rem;
  text-align: justify;
  text-align-last: left;
}

.content-body p.intro-lead-in {
  text-align: justify;
  text-align-last: left;
  -webkit-text-align-last: left;
  margin-bottom: 0.6rem;
}

/* Highlight Arabic passages - Jajaran Kanan Penuh Mutlak (RTL Standard) */
.content-body p.arabic-text,
.content-body div.arabic-text,
.content-body .arabic-text,
.content-body .ar-quote,
.content-body .ar-verse-line,
.content-body .ar-poem-quote,
.content-body .ar-quote-block,
.content-body [dir="rtl"].arabic-text {
  font-family: 'Amiri', serif !important;
  font-size: 1.35rem;
  line-height: 2.2;
  color: var(--gold-light) !important;
  direction: rtl !important;
  text-align: right !important;
  text-align-last: right !important;
  -webkit-text-align-last: right !important;
  unicode-bidi: isolate !important;
  display: block !important;
  width: 100% !important;
  box-sizing: border-box !important;
  background: rgba(212, 175, 55, 0.05);
  padding: 0.8rem 1.2rem;
  border-radius: var(--radius-sm);
  border-right: 3px solid var(--gold-primary);
  border-left: none !important;
  margin: 1rem 0;
}

[data-theme="light"] .content-body .arabic-text {
  color: #8c6b00;
  background: rgba(212, 175, 55, 0.08);
  border-right: 3px solid #b38600;
}

/* Quotes / Tokoh highlight box */
.quote-highlight-box {
  background: rgba(16, 185, 129, 0.08);
  border-left: 4px solid var(--emerald-primary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 1rem 1.4rem;
  margin: 1.5rem 0;
  font-style: italic;
  color: var(--text-main);
}

.quote-highlight-box .tokoh-name {
  font-style: normal;
  font-weight: inherit;
  color: inherit;
  display: inline;
}

/* Ensure any Arabic text inside quotes is NEVER italicized */
.quote-highlight-box .arabic-text,
.quote-highlight-box .ar-quote,
.quote-highlight-box .quran-ayah,
.quote-highlight-box .arabic-ref-title,
.quote-highlight-box [lang="ar"],
.quote-highlight-box :lang(ar) {
  font-style: normal !important;
  transform: none !important;
  font-family: 'Amiri', 'Traditional Arabic', serif !important;
}


/* Summary Scope Toggle (Per-Subtopic vs Full Chapter) */
.summary-scope-toggle-bar {
  display: inline-flex;
  align-items: center;
  background: rgba(14, 28, 58, 0.7);
  border: 1px solid var(--border-card);
  border-radius: 9999px;
  padding: 4px;
  margin-bottom: 1.5rem;
  gap: 6px;
  max-width: 100%;
}

[data-theme="light"] .summary-scope-toggle-bar {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.summary-scope-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: 9999px;
  font-family: 'Outfit', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
}

.summary-scope-btn:hover {
  color: var(--gold-light);
  background: rgba(254, 240, 138, 0.08);
}

.summary-scope-btn.active {
  background: linear-gradient(135deg, var(--gold-primary), var(--gold-dark));
  color: #060e20;
  font-weight: 700;
  border-color: var(--gold-light);
  box-shadow: 0 2px 10px rgba(234, 179, 8, 0.35);
}

[data-theme="light"] .summary-scope-btn.active {
  background: linear-gradient(135deg, #d97706, #b45309);
  color: #ffffff;
  border-color: #f59e0b;
}

@media (max-width: 600px) {
  .summary-scope-toggle-bar {
    width: 100%;
    display: flex;
    justify-content: stretch;
  }

  .summary-scope-btn {
    flex: 1;
    justify-content: center;
    padding: 8px 10px;
    font-size: 0.82rem;
  }
}

/* Layer 2 Markdown Summary Specific Styling */
.summary-container {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.8rem;
  box-shadow: var(--shadow-glow);
}

.summary-container h4 {
  font-family: 'Outfit', sans-serif;
  color: var(--gold-light);
  margin-top: 1.2rem;
  margin-bottom: 0.5rem;
  font-size: 1.15rem;
}

[data-theme="light"] .summary-container h4 {
  color: #996515;
}

.summary-container ul {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

.summary-container li {
  margin-bottom: 0.4rem;
}

/* Reader Bottom Navigation */
.reader-bottom-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-card);
  gap: 16px;
}

.nav-jump-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  color: var(--text-main);
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 48%;
}

.nav-jump-btn:hover:not(:disabled) {
  border-color: var(--gold-primary);
  color: var(--gold-light);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
}

.nav-jump-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* Search Results Modal / Overlay */
.search-results-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  z-index: 100;
  padding: 2rem 1rem;
  overflow-y: auto;
}

.search-results-overlay.open {
  display: block;
}

.search-modal {
  background: var(--bg-sidebar);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  max-width: 720px;
  margin: 2rem auto;
  padding: 1.5rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.search-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-card);
}

.search-results-list {
  max-height: 60vh;
  overflow-y: auto;
}

.search-result-item {
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-card);
  margin-bottom: 8px;
  cursor: pointer;
  transition: var(--transition);
}

.search-result-item:hover {
  background: var(--bg-card-hover);
  border-color: var(--gold-primary);
}

.search-result-title {
  font-weight: 700;
  color: var(--gold-light);
  font-size: 0.95rem;
  margin-bottom: 4px;
}

.search-result-snippet {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.search-result-snippet mark {
  background: rgba(212, 175, 55, 0.35);
  color: #fff;
  padding: 1px 4px;
  border-radius: 2px;
}

/* Toast Notification */
.toast-notice {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--bg-card);
  border: 1px solid var(--gold-primary);
  color: #fff;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
  font-size: 0.88rem;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 10px;
  transform: translateY(100px);
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.toast-notice.show {
  transform: translateY(0);
  opacity: 1;
}

/* ================= RESPONSIVE ================= */
@media (max-width: 900px) {
  .app-sidebar {
    position: fixed;
    left: 0;
    top: 68px;
    z-index: 40;
    transform: translateX(-100%);
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.4);
    width: min(350px, 88vw);
  }

  /* HP Optimized Scroll Menu Typography */
  .chapter-header-btn {
    font-size: 1.06rem !important;
    padding: 13px 14px !important;
  }

  .chapter-num-badge {
    min-width: 30px !important;
    height: 30px !important;
    font-size: 0.85rem !important;
    margin-right: 10px !important;
  }

  .subtopic-nav-btn {
    font-size: 1.02rem !important;
    /* Font subtopik diperbesar untuk HP */
    padding: 11px 14px !important;
    /* Sentuhan jari lebih lapang & selesa */
    line-height: 1.48 !important;
    margin-bottom: 5px !important;
    gap: 9px !important;
  }

  .subtopic-num {
    min-width: 1.55rem !important;
    line-height: 1.48 !important;
  }

  .subtopic-title-text {
    line-height: 1.48 !important;
  }

  .search-input {
    font-size: 0.98rem !important;
    padding: 12px 14px 12px 40px !important;
  }

  .app-sidebar.open-mobile {
    transform: translateX(0);
  }

  .app-content {
    padding: 1.5rem 1rem;
  }

  .mobile-menu-btn {
    display: flex !important;
  }
}

/* Mobile Navigation Drawer Toggle Button (Diperbesar & Jelas untuk Mobile) */
.mobile-menu-btn {
  display: none;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border-radius: 12px;
  border: 1.5px solid rgba(245, 158, 11, 0.45);
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.9) 0%, rgba(30, 41, 59, 0.95) 100%);
  color: #fbbf24;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3), 0 0 12px rgba(245, 158, 11, 0.22);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
}

.mobile-menu-btn .menu-icon-svg {
  width: 24px;
  height: 24px;
  stroke: #fbbf24;
  stroke-width: 2.6;
  stroke-linecap: round;
  display: block;
  transition: transform 0.2s ease, stroke 0.2s ease;
}

.mobile-menu-btn:hover {
  border-color: #f59e0b;
  color: #fef08a;
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.95) 0%, rgba(51, 65, 85, 0.95) 100%);
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.4), 0 0 16px rgba(14, 165, 233, 0.25);
  transform: translateY(-1px);
}

.mobile-menu-btn:hover .menu-icon-svg {
  stroke: #fef08a;
  transform: scale(1.06);
}

.mobile-menu-btn:active {
  transform: scale(0.92);
  background: rgba(245, 158, 11, 0.25);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

body.light-theme .mobile-menu-btn {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border-color: rgba(217, 119, 6, 0.6);
  color: #b45309;
  box-shadow: 0 2px 8px rgba(217, 119, 6, 0.18), 0 1px 3px rgba(0, 0, 0, 0.08);
}

body.light-theme .mobile-menu-btn .menu-icon-svg {
  stroke: #b45309;
}

body.light-theme .mobile-menu-btn:hover {
  background: #fef3c7;
  border-color: #b45309;
  color: #78350f;
  box-shadow: 0 4px 12px rgba(217, 119, 6, 0.3);
}

body.light-theme .mobile-menu-btn:hover .menu-icon-svg {
  stroke: #78350f;
}

@media (max-width: 600px) {
  .app-header {
    padding: 0 0.75rem;
    height: 64px;
  }

  .brand-wrapper {
    gap: 8px;
  }

  .brand-logo {
    width: 38px;
    height: 38px;
  }

  .brand-text h1 {
    font-size: 1.05rem;
  }

  .brand-subtitle {
    display: none;
    /* Kemaskan ruang header pada mobile agar butang menu & tajuk luas dan tidak bertindih */
  }

  .pdf-btn-text {
    display: none;
  }

  .pdf-download-btn {
    padding: 0;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    justify-content: center;
  }
}

/* ==========================================================================
   MUTIARA HIKMAH DAKWAH (LAYER 3 & SIDEBAR PROMO) - AL-AWAIQ
   ========================================================================== */

/* 1. Sidebar Promo Card */
.sidebar-hikmah-promo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  margin: 10px 14px 16px 14px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.12) 0%, rgba(16, 185, 129, 0.08) 100%);
  border: 1px solid rgba(212, 175, 55, 0.35);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.sidebar-hikmah-promo:hover {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.22) 0%, rgba(16, 185, 129, 0.16) 100%);
  border-color: var(--gold-light);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(212, 175, 55, 0.25);
}

.hikmah-promo-icon {
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(212, 175, 55, 0.18);
  border: 1px solid rgba(212, 175, 55, 0.4);
  flex-shrink: 0;
}

.hikmah-promo-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}

.hikmah-promo-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--gold-light);
  line-height: 1.2;
}

.hikmah-promo-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.2;
  margin-top: 2px;
}

.hikmah-promo-badge {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 12px;
  background: var(--gold-primary);
  color: #0b132b;
  letter-spacing: 0.5px;
}

/* 2. Mutiara Hikmah Main Container */
.hikmah-container {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  animation: fadeIn 0.4s ease-out forwards;
}

/* 3. Featured Hero Random Quote Card */
.hikmah-hero-card {
  position: relative;
  background: linear-gradient(145deg, rgba(14, 23, 42, 0.95) 0%, rgba(8, 13, 26, 0.98) 100%);
  border: 1.5px solid rgba(212, 175, 55, 0.4);
  border-radius: var(--radius-lg);
  padding: 2.2rem;
  box-shadow: 0 15px 35px -10px rgba(0, 0, 0, 0.5), 0 0 25px rgba(212, 175, 55, 0.15);
  overflow: hidden;
  backdrop-filter: blur(16px);
  transition: all 0.3s ease;
}

[data-theme="light"] .hikmah-hero-card {
  background: linear-gradient(145deg, #ffffff 0%, #fdfbf7 100%);
  border-color: rgba(212, 175, 55, 0.5);
  box-shadow: 0 15px 35px -10px rgba(212, 175, 55, 0.15), 0 4px 15px rgba(0, 0, 0, 0.05);
}

.hikmah-hero-card::before {
  content: '“';
  position: absolute;
  top: -20px;
  right: 20px;
  font-family: 'Amiri', serif;
  font-size: 11rem;
  color: rgba(212, 175, 55, 0.07);
  line-height: 1;
  pointer-events: none;
  user-select: none;
}

.hikmah-hero-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(212, 175, 55, 0.2);
}

.hikmah-tag-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.hikmah-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 4px 12px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.25), rgba(16, 185, 129, 0.2));
  color: var(--gold-light);
  border: 1px solid rgba(212, 175, 55, 0.45);
}

.hikmah-speaker-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 4px 14px;
  border-radius: 20px;
  background: rgba(16, 185, 129, 0.15);
  color: var(--emerald-primary);
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.hikmah-hero-quote {
  font-size: 1.28rem;
  line-height: 1.85;
  color: var(--text-main);
  font-family: 'Plus Jakarta Sans', sans-serif;
  margin-bottom: 1.6rem;
  position: relative;
  z-index: 2;
}

.hikmah-hero-quote .ar-quote,
.hikmah-card-body .ar-quote,
.quote-highlight-box .ar-quote,
.ar-quote {
  display: block !important;
  width: 100% !important;
  font-family: 'Amiri', 'Traditional Arabic', serif !important;
  font-style: normal !important;
  font-weight: 400 !important;
  font-size: 1.45rem !important;
  line-height: 2.2 !important;
  color: var(--gold-light, #fde047) !important;
  direction: rtl !important;
  text-align: right !important;
  text-align-last: right !important;
  -webkit-text-align-last: right !important;
  unicode-bidi: isolate !important;
  margin: 0.8rem 0 1rem 0 !important;
  padding: 12px 18px !important;
  background: rgba(212, 175, 55, 0.08) !important;
  border-right: 4px solid var(--gold-primary, #d4af37) !important;
  border-left: none !important;
  border-radius: 10px !important;
  word-spacing: 0.08em !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  box-sizing: border-box !important;
}

[data-theme="light"] .hikmah-hero-quote .ar-quote,
[data-theme="light"] .hikmah-card-body .ar-quote,
[data-theme="light"] .ar-quote {
  color: #8c6b00 !important;
  background: rgba(212, 175, 55, 0.1) !important;
  border-right-color: #b38600 !important;
  box-shadow: 0 2px 8px rgba(212, 175, 55, 0.08);
}

/* Jajaran bait syair berbilang baris: baris kedua dan seterusnya mesti rapat ke margin kanan */
.ar-quote .ar-verse-line,
.ar-verse-line {
  display: block !important;
  direction: rtl !important;
  text-align: right !important;
  text-align-last: right !important;
  -webkit-text-align-last: right !important;
  unicode-bidi: isolate !important;
  width: 100% !important;
  margin: 0 !important;
  margin-bottom: 0.45rem !important;
  line-height: 2.2 !important;
}

.ar-quote .ar-verse-line:last-child,
.ar-verse-line:last-child {
  margin-bottom: 0 !important;
}

/* Terjemahan Bahasa Melayu */
.hikmah-trans-text {
  font-size: 0.98rem;
  line-height: 1.75;
  color: var(--text-main);
  font-style: italic;
  margin-bottom: 0.85rem;
  padding: 4px 6px;
}

/* Kotak Panggilan Dimensi Fiqh Tarbawi Haraki */
.hikmah-fiqh-box {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-left: 3px solid var(--emerald-primary);
  border-radius: 8px;
  padding: 10px 14px;
  margin-top: 0.65rem;
  font-size: 0.92rem;
  line-height: 1.65;
}

[data-theme="light"] .hikmah-fiqh-box {
  background: rgba(16, 185, 129, 0.06);
  border-color: rgba(5, 150, 105, 0.25);
  border-left-color: #059669;
}

.hikmah-fiqh-badge {
  display: inline-block;
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--emerald-primary);
  margin-bottom: 4px;
}

[data-theme="light"] .hikmah-fiqh-badge {
  color: #047857;
}

.hikmah-fiqh-text {
  color: var(--text-main);
}

.hikmah-hero-source {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.86rem;
  color: var(--text-muted);
  margin-bottom: 1.8rem;
}

.hikmah-hero-source strong {
  color: var(--gold-light);
}

/* Action Buttons Bar */
.hikmah-actions-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.hikmah-action-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  padding: 10px 22px !important;
  min-height: 42px !important;
  border-radius: 25px !important;
  /* Bentuk melengkung elegan persis nota kaki */
  font-size: 0.9rem !important;
  font-family: 'Outfit', sans-serif !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  outline: none !important;
  border: 1px solid rgba(212, 175, 55, 0.45) !important;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25) !important;
  user-select: none !important;
}

.hikmah-btn-primary {
  background: linear-gradient(135deg, var(--gold-primary), var(--gold-dark)) !important;
  color: #0b132b !important;
  border-color: var(--gold-light) !important;
}

.hikmah-btn-primary:hover {
  background: linear-gradient(135deg, #fcd34d, var(--gold-primary)) !important;
  color: #000000 !important;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(212, 175, 55, 0.45) !important;
}

.hikmah-btn-secondary {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.16) 0%, rgba(6, 78, 59, 0.35) 100%) !important;
  color: var(--gold-light) !important;
  border-color: rgba(212, 175, 55, 0.45) !important;
}

.hikmah-btn-secondary:hover {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.3) 0%, rgba(5, 150, 105, 0.5) 100%) !important;
  border-color: var(--gold-light) !important;
  color: #ffffff !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(212, 175, 55, 0.35) !important;
}

.hikmah-btn-emerald {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2) 0%, rgba(6, 78, 59, 0.45) 100%) !important;
  color: #34d399 !important;
  border-color: rgba(16, 185, 129, 0.5) !important;
}

.hikmah-btn-emerald:hover {
  background: linear-gradient(135deg, #10b981, #059669) !important;
  color: #ffffff !important;
  border-color: #34d399 !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.4) !important;
}

/* 4. Filter & Search Bar */
.hikmah-toolbar {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 1rem;
}

.hikmah-search-wrap {
  position: relative;
  width: 100%;
}

.hikmah-search-input {
  width: 100% !important;
  padding: 12px 20px 12px 46px !important;
  border-radius: 25px !important;
  border: 1px solid rgba(212, 175, 55, 0.4) !important;
  background: linear-gradient(135deg, rgba(14, 23, 42, 0.95) 0%, rgba(8, 13, 26, 0.98) 100%) !important;
  color: var(--text-main) !important;
  font-size: 0.95rem !important;
  font-family: 'Plus Jakarta Sans', sans-serif !important;
  outline: none !important;
  transition: all 0.25s ease !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
}

[data-theme="light"] .hikmah-search-input {
  background: linear-gradient(135deg, #ffffff 0%, #fdfbf7 100%) !important;
  border-color: rgba(180, 138, 28, 0.45) !important;
  color: #0f172a !important;
}

.hikmah-search-input:focus {
  border-color: var(--gold-primary) !important;
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.25), 0 0 15px rgba(212, 175, 55, 0.2) !important;
}

.hikmah-search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gold-light);
  pointer-events: none;
}

.hikmah-filter-chips {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: none;
}

.hikmah-filter-chips::-webkit-scrollbar {
  display: none;
}

.hikmah-chip-btn {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  padding: 7px 18px !important;
  min-height: 34px !important;
  border-radius: 22px !important;
  border: 1px solid rgba(212, 175, 55, 0.35) !important;
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.1) 0%, rgba(6, 78, 59, 0.25) 100%) !important;
  color: var(--text-muted) !important;
  font-size: 0.84rem !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  white-space: nowrap !important;
  transition: all 0.25s ease !important;
  font-family: 'Outfit', sans-serif !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15) !important;
}

.hikmah-chip-btn:hover {
  border-color: var(--gold-primary) !important;
  color: var(--gold-light) !important;
  transform: translateY(-1.5px);
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.2) 0%, rgba(6, 78, 59, 0.4) 100%) !important;
}

.hikmah-chip-btn.active {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.35) 0%, rgba(16, 185, 129, 0.3) 100%) !important;
  border-color: var(--gold-light) !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  box-shadow: 0 3px 12px rgba(212, 175, 55, 0.3), 0 0 10px rgba(16, 185, 129, 0.25) !important;
  transform: translateY(-1.5px);
}

[data-theme="light"] .hikmah-chip-btn {
  background: linear-gradient(135deg, rgba(255, 251, 235, 0.95) 0%, rgba(240, 253, 244, 0.9) 100%) !important;
  border-color: rgba(180, 138, 28, 0.4) !important;
  color: #64748b !important;
}

[data-theme="light"] .hikmah-chip-btn.active {
  background: linear-gradient(135deg, #b48a1c 0%, #059669 100%) !important;
  color: #ffffff !important;
}

/* 5. Quotes Grid */
.hikmah-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.4rem;
  margin-top: 0.5rem;
}

.hikmah-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--bg-card);
  border: 1px solid rgba(212, 175, 55, 0.28);
  border-radius: 18px;
  padding: 1.5rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}

.hikmah-card:hover {
  border-color: rgba(212, 175, 55, 0.65);
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(212, 175, 55, 0.18);
}

.hikmah-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.9rem;
}

.hikmah-card-speaker {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--emerald-primary);
  background: rgba(16, 185, 129, 0.12);
  padding: 4px 12px;
  border-radius: 16px;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.hikmah-card-index {
  font-size: 0.74rem;
  color: var(--gold-light);
  font-weight: 700;
  background: rgba(212, 175, 55, 0.1);
  padding: 2px 8px;
  border-radius: 12px;
  border: 1px solid rgba(212, 175, 55, 0.25);
}

.hikmah-card-body {
  font-size: 0.96rem;
  line-height: 1.75;
  color: var(--text-main);
  flex: 1;
  margin-bottom: 1.2rem;
}

.hikmah-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.9rem;
  border-top: 1px solid rgba(212, 175, 55, 0.15);
  gap: 8px;
}

[data-theme="light"] .hikmah-card-footer {
  border-top-color: #e2e8f0;
}

.hikmah-card-chapter {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.78rem;
  color: var(--gold-light);
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  padding: 4px 12px;
  border-radius: 16px;
  background: rgba(212, 175, 55, 0.1);
  border: 1px solid rgba(212, 175, 55, 0.3);
  transition: all 0.2s ease;
}

.hikmah-card-chapter:hover {
  background: rgba(212, 175, 55, 0.22);
  border-color: var(--gold-light);
  transform: translateY(-1px);
}

.hikmah-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* BUTANG SALIN & BAB (REKA BENTUK MELENGKUNG PERSIS NOTA KAKI) */
.hikmah-card-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  padding: 5px 14px !important;
  min-height: 32px !important;
  border-radius: 20px !important;
  font-size: 0.82rem !important;
  font-family: 'Outfit', sans-serif !important;
  font-weight: 700 !important;
  letter-spacing: 0.3px !important;
  cursor: pointer !important;
  outline: none !important;
  border: 1px solid rgba(212, 175, 55, 0.45) !important;
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.16) 0%, rgba(6, 78, 59, 0.35) 100%) !important;
  color: var(--gold-light) !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2) !important;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
  user-select: none !important;
}

.hikmah-card-btn:hover {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.28) 0%, rgba(5, 150, 105, 0.5) 100%) !important;
  border-color: var(--gold-light) !important;
  color: #ffffff !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(212, 175, 55, 0.35), 0 0 12px rgba(16, 185, 129, 0.3) !important;
}

.hikmah-card-btn:active {
  transform: translateY(0) scale(0.96);
}

[data-theme="light"] .hikmah-card-btn {
  background: linear-gradient(135deg, rgba(255, 251, 235, 0.95) 0%, rgba(240, 253, 244, 0.9) 100%) !important;
  border: 1px solid rgba(180, 138, 28, 0.45) !important;
  color: #8c6b00 !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05) !important;
}

[data-theme="light"] .hikmah-card-btn:hover {
  background: #b48a1c !important;
  color: #ffffff !important;
  border-color: #8c6b00 !important;
}

/* Responsive Overrides */
@media (max-width: 768px) {
  .hikmah-grid {
    grid-template-columns: 1fr;
  }

  .hikmah-hero-card {
    padding: 1.4rem;
  }

  .hikmah-hero-quote {
    font-size: 1.1rem;
  }

  .layer-switcher {
    padding: 2px;
  }

  .layer-btn {
    padding: 5px 10px;
    font-size: 0.76rem;
    gap: 4px;
  }
}

@media (max-width: 480px) {
  .layer-btn span {
    font-size: 0.72rem;
  }

  .hikmah-hero-badge {
    font-size: 0.7rem;
  }

  .hikmah-action-btn {
    flex: 1;
    justify-content: center;
    padding: 8px 12px;
    font-size: 0.8rem;
  }
}


/* ==========================================================================
   NUMBERED ITEM CARDS (Kamus Istilah Haraki & Senarai Berurutan)
   ========================================================================== */
.numbered-item-card {
  display: flex !important;
  align-items: flex-start;
  gap: 14px;
  background: rgba(14, 28, 58, 0.72);
  border: 1px solid rgba(56, 189, 248, 0.22);
  border-left: 4px solid var(--gold-primary);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  margin: 1.1rem 0;
  transition: all 0.25s ease;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.28);
}

.numbered-item-card:hover {
  background: rgba(22, 42, 82, 0.90);
  border-color: var(--gold-primary);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(234, 179, 8, 0.2);
}

.num-card-badge {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-primary), var(--gold-dark));
  color: #060e20;
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(234, 179, 8, 0.45);
  margin-top: 2px;
}

.num-card-content {
  flex: 1;
}

.num-card-title {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--gold-light);
  margin-bottom: 6px;
  line-height: 1.4;
}

.num-card-title em {
  font-style: italic;
  color: #ffffff;
}

.num-card-desc {
  font-size: 0.95rem;
  color: var(--text-light);
  line-height: 1.65;
}

/* ==========================================================================
   LAUHAH KHITHATHIYAH - INFOGRAPHIC FLOW SYSTEM
   ========================================================================== */
.custom-html-block {
  width: 100%;
}

.lauhah-infographic-wrap {
  margin: 2.2rem 0;
  padding: 2rem 1.6rem;
  background: linear-gradient(180deg, rgba(10, 22, 48, 0.96) 0%, rgba(6, 14, 32, 0.98) 100%);
  border: 1px solid rgba(234, 179, 8, 0.4);
  border-radius: 18px;
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.6), 0 0 30px rgba(234, 179, 8, 0.12);
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.lauhah-infographic-wrap::before {
  content: '';
  position: absolute;
  top: 0;
  left: 10%;
  right: 10%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold-primary), transparent);
}

.infographic-header {
  text-align: center;
  margin-bottom: 2rem;
  max-width: 650px;
}

.infographic-badge {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 20px;
  background: rgba(234, 179, 8, 0.15);
  border: 1px solid var(--gold-primary);
  color: var(--gold-light);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.infographic-title {
  font-family: 'Amiri', serif;
  font-size: 1.95rem;
  color: var(--gold-light);
  margin: 6px 0;
  direction: rtl;
  text-shadow: 0 2px 10px rgba(234, 179, 8, 0.35);
}

.infographic-subtitle {
  font-family: 'Outfit', sans-serif;
  color: var(--text-muted);
  font-size: 0.92rem;
  font-weight: 500;
}

/* FLOW STEPS & CARDS */
.flow-step {
  width: 100%;
  max-width: 640px;
  display: flex;
  justify-content: center;
}

.flow-card {
  width: 100%;
  background: rgba(14, 28, 58, 0.85);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 1.25rem 1.5rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  position: relative;
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.flow-card:hover {
  transform: translateY(-2px);
  border-color: var(--gold-light);
}

/* ROOT: AQIDAH & NIAT */
.card-root {
  text-align: center;
  background: linear-gradient(135deg, rgba(234, 179, 8, 0.14) 0%, rgba(14, 28, 58, 0.92) 100%);
  border: 2px solid var(--gold-primary);
  box-shadow: 0 0 25px rgba(234, 179, 8, 0.25);
}

.card-root .card-icon {
  font-size: 1.8rem;
  margin-bottom: 4px;
}

.card-root .card-title-ar {
  font-family: 'Amiri', serif;
  font-size: 1.6rem;
  color: var(--gold-light);
  direction: rtl;
}

.card-root .card-title-ms {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: #ffffff;
  font-size: 1.15rem;
  margin-top: 2px;
}

.card-root .card-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-top: 6px;
  line-height: 1.5;
}

/* FLOW ARROWS */
.flow-arrow-down {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 1rem 0;
  position: relative;
}

.arrow-line {
  width: 2px;
  height: 28px;
  background: linear-gradient(180deg, var(--gold-primary), var(--sapphire-light));
}

.arrow-badge {
  margin-top: 4px;
  padding: 4px 14px;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-light);
  background: rgba(2, 132, 199, 0.22);
  border: 1px solid rgba(56, 189, 248, 0.38);
  border-radius: 12px;
}

/* 2 BRANCHES GRID (SIDE BY SIDE / STACKED) */
.flow-branches-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  width: 100%;
}

.branch-card {
  background: rgba(14, 28, 58, 0.78);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 14px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
}

.branch-operasional {
  border-top: 4px solid var(--sapphire-light);
}

.branch-fasa {
  border-top: 4px solid var(--emerald-primary);
}

.branch-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 0.8rem;
  margin-bottom: 0.9rem;
  position: relative;
}

.branch-badge {
  position: absolute;
  top: 0;
  right: 0;
  font-size: 0.72rem;
  padding: 3px 9px;
  border-radius: 10px;
  background: rgba(56, 189, 248, 0.2);
  color: var(--sapphire-light);
  font-weight: 700;
}

.branch-fasa .branch-badge {
  background: rgba(16, 185, 129, 0.2);
  color: var(--emerald-primary);
}

.branch-header h4 {
  font-family: 'Amiri', serif;
  font-size: 1.4rem;
  color: var(--gold-light);
  margin: 0;
  direction: rtl;
}

.branch-sub {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 0.92rem;
  color: #ffffff;
  margin-top: 4px;
}

.branch-sub small {
  font-weight: 400;
  color: var(--text-muted);
}

.branch-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.branch-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  color: var(--text-light);
  background: rgba(6, 14, 32, 0.45);
  padding: 7px 10px;
  border-radius: 8px;
  border-left: 2px solid transparent;
}

.branch-operasional .branch-list li {
  border-left-color: var(--sapphire-light);
}

.branch-fasa .branch-list li {
  border-left-color: var(--emerald-primary);
}

.pill-num {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--gold-light);
}

/* FLOW CARD HEADERS & GRIDS */
.flow-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 0.7rem;
}

.step-num-badge {
  padding: 4px 10px;
  background: linear-gradient(135deg, var(--gold-dark), var(--gold-primary));
  color: #060e20;
  border-radius: 6px;
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 0.78rem;
  text-transform: uppercase;
}

.flow-card-titles .card-title-ar {
  font-family: 'Amiri', serif;
  font-size: 1.3rem;
  color: var(--gold-light);
  direction: rtl;
}

.flow-card-titles .card-title-ms {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  color: #ffffff;
}

/* TACTICS */
.card-tactics {
  border-left: 4px solid var(--gold-primary);
}

.tactics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
}

.tactic-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: rgba(6, 14, 32, 0.5);
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.88rem;
}

.tactic-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--gold-primary);
  color: #060e20;
  font-weight: 800;
  font-size: 0.78rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

/* LEADERSHIP (BAB 19) */
.card-leadership {
  border-left: 4px solid var(--sapphire-light);
}

.leadership-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 8px;
}

.lead-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(6, 14, 32, 0.45);
  border: 1px solid rgba(56, 189, 248, 0.15);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.86rem;
  color: var(--text-light);
}

.lead-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--sapphire-primary);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* KHATIMAH (PENUTUP) */
.card-khatimah {
  border-left: 4px solid var(--emerald-primary);
}

.khatimah-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.khatimah-pill {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: rgba(6, 14, 32, 0.5);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 0.86rem;
}

.khatimah-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--emerald-primary);
  color: #060e20;
  font-weight: 800;
  font-size: 0.78rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}


/* ==========================================================================
   IN-PAGE SEARCH HIGHLIGHTING & FLOATING NAVIGATOR BAR (Kajian & Penyelidikan)
   ========================================================================== */

/* Sorotan Kata Kunci Dalam Teks (Search Match) */
mark.content-search-match {
  background: rgba(245, 158, 11, 0.38) !important;
  color: #fef08a !important;
  font-weight: 600 !important;
  padding: 1px 5px !important;
  border-radius: 4px !important;
  border-bottom: 2px solid #f59e0b !important;
  transition: all 0.25s ease !important;
  scroll-margin-top: 140px !important;
  display: inline !important;
}

[data-theme="light"] mark.content-search-match {
  background: #fef08a !important;
  color: #78350f !important;
  border-bottom: 2px solid #d97706 !important;
}

/* Sorotan Aktif Semasa (Focused Match) */
mark.content-search-match.active-match {
  background: #f59e0b !important;
  color: #0b172a !important;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.55), 0 0 18px rgba(245, 158, 11, 0.75) !important;
  font-weight: 700 !important;
  animation: searchMatchPulse 1.2s infinite alternate !important;
}

@keyframes searchMatchPulse {
  0% {
    filter: brightness(1);
  }

  100% {
    filter: brightness(1.25);
  }
}

/* Palang Terapung Navigasi Carian (Floating Search Navigator) */
.search-floating-bar {
  position: fixed;
  bottom: 84px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(14, 28, 58, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(245, 158, 11, 0.5);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.55), 0 0 25px rgba(245, 158, 11, 0.25);
  padding: 8px 16px;
  border-radius: 40px;
  z-index: 1000;
  animation: sfbSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  color: #f8fafc;
  font-family: inherit;
  max-width: 90vw;
}

[data-theme="light"] .search-floating-bar {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(217, 119, 6, 0.45);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.15), 0 0 20px rgba(217, 119, 6, 0.2);
  color: #0f172a;
}

@keyframes sfbSlideUp {
  from {
    opacity: 0;
    transform: translate(-50%, 25px);
  }

  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

.sfb-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  white-space: nowrap;
}

.sfb-query {
  font-weight: 700;
  color: #fbbf24;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: inline-block;
  vertical-align: bottom;
}

[data-theme="light"] .sfb-query {
  color: #d97706;
}

.sfb-count {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

[data-theme="light"] .sfb-count {
  background: rgba(217, 119, 6, 0.15);
  color: #b45309;
  border-color: rgba(217, 119, 6, 0.25);
}

.sfb-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.sfb-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #f1f5f9;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.75rem;
  transition: all 0.2s ease;
}

[data-theme="light"] .sfb-btn {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.12);
  color: #1e293b;
}

.sfb-btn:hover {
  background: rgba(245, 158, 11, 0.35);
  border-color: #f59e0b;
  color: #fbbf24;
  transform: scale(1.1);
}

.sfb-close-btn:hover {
  background: rgba(239, 68, 68, 0.3) !important;
  border-color: #ef4444 !important;
  color: #fca5a5 !important;
}

@media (max-width: 640px) {
  .search-floating-bar {
    bottom: 78px;
    padding: 6px 12px;
    gap: 8px;
  }

  .sfb-badge {
    font-size: 0.8rem;
  }

  .sfb-query {
    max-width: 90px;
  }
}


.sfb-topic-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(245, 158, 11, 0.22);
  border: 1px solid rgba(245, 158, 11, 0.45);
  color: #fef08a;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

[data-theme="light"] .sfb-topic-btn {
  background: rgba(217, 119, 6, 0.15);
  border-color: rgba(217, 119, 6, 0.35);
  color: #92400e;
}

.sfb-topic-btn:hover {
  background: #f59e0b;
  color: #0b172a;
  transform: scale(1.04);
}

.sfb-divider {
  width: 1px;
  height: 18px;
  background: rgba(255, 255, 255, 0.2);
  margin: 0 2px;
}

[data-theme="light"] .sfb-divider {
  background: rgba(0, 0, 0, 0.15);
}

.sfb-btn:disabled,
.sfb-btn[disabled] {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

.search-result-item.active-reading {
  border-left: 4px solid #f59e0b !important;
  background: rgba(245, 158, 11, 0.14) !important;
}

.search-result-current-badge {
  display: inline-block;
  background: #f59e0b;
  color: #0b172a;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 10px;
  margin-left: 8px;
  vertical-align: middle;
}



/* Lencana Status Layer Hasil Carian (Versi Penuh vs Ringkasan) */
.search-layer-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
  margin-left: 8px;
  vertical-align: middle;
}

.search-layer-badge.badge-layer1 {
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
  border: 1px solid rgba(52, 211, 153, 0.35);
}

.search-layer-badge.badge-layer2 {
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

[data-theme="light"] .search-layer-badge.badge-layer1 {
  background: rgba(16, 185, 129, 0.12);
  color: #065f46;
  border-color: rgba(16, 185, 129, 0.3);
}

[data-theme="light"] .search-layer-badge.badge-layer2 {
  background: rgba(245, 158, 11, 0.15);
  color: #92400e;
  border-color: rgba(245, 158, 11, 0.3);
}

/* Inline Footnote Markers */
.fn-ref {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--gold-light);
  background: rgba(212, 175, 55, 0.15);
  padding: 2px 6px;
  border-radius: 10px;
  margin: 0 3px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  vertical-align: super;
  text-decoration: none;
}

.fn-ref:hover {
  background: var(--gold-primary);
  color: #000;
  transform: scale(1.15);
  box-shadow: 0 0 8px rgba(212, 175, 55, 0.5);
}

/* ==========================================================================
   PREMIUM ISLAMIC FOOTNOTES & RETURN NAVIGATION SYSTEM (UI/UX PRO MAX)
   Theme: Obsidian Emerald & Illuminated Antique Gold (Manuscript Aesthetics)
   ========================================================================== */

/* Chapter Footnotes Section Container */
.chapter-footnotes-section {
  margin-top: 4rem;
  padding-top: 2.5rem;
  border-top: 1px solid rgba(212, 175, 55, 0.25);
  position: relative;
}

.chapter-footnotes-section::before {
  content: '❧  ❖  ☙';
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-main);
  padding: 0 16px;
  color: var(--gold-primary);
  font-size: 0.95rem;
  letter-spacing: 4px;
}

/* Footnotes Header Bar */
.footnotes-title-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 1.5rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.fn-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.fn-title-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.2), rgba(16, 185, 129, 0.15));
  border: 1px solid rgba(212, 175, 55, 0.35);
  color: var(--gold-light);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.fn-title-text h4 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.18rem;
  font-weight: 700;
  color: var(--gold-light);
  margin: 0;
  line-height: 1.2;
}

.fn-title-text .fn-arabic-subtitle {
  font-family: 'Amiri', serif;
  font-size: 1.05rem;
  color: var(--emerald-primary);
  line-height: 1.1;
  display: block;
}

.fn-total-pill {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--gold-light);
  background: rgba(212, 175, 55, 0.1);
  border: 1px solid rgba(212, 175, 55, 0.3);
  padding: 4px 12px;
  border-radius: 20px;
  letter-spacing: 0.5px;
}

/* Footnotes List Grid */
.footnotes-list-box {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Premium Footnote Card */
.footnote-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 18px;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.65) 0%, rgba(6, 78, 59, 0.2) 100%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(212, 175, 55, 0.18);
  border-left: 3.5px solid var(--gold-primary);
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  line-height: 1.7;
  color: var(--text-light);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  scroll-margin-top: 110px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .footnote-card {
  background: linear-gradient(135deg, rgba(255, 253, 245, 0.95) 0%, rgba(240, 253, 244, 0.8) 100%);
  border-color: rgba(180, 138, 28, 0.25);
  border-left-color: #b48a1c;
  color: #1e293b;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

.footnote-card:hover {
  border-color: rgba(212, 175, 55, 0.4);
  border-left-color: var(--gold-light);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25), 0 0 12px rgba(212, 175, 55, 0.1);
}

.footnote-card.fn-highlight {
  border-color: var(--gold-light);
  border-left-color: #10b981;
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.2) 0%, rgba(16, 185, 129, 0.22) 100%);
  box-shadow: 0 0 24px rgba(212, 175, 55, 0.4), 0 4px 16px rgba(16, 185, 129, 0.25);
  transform: translateX(6px);
}

/* Card Topbar: Simplified to Left Return Badge Button */
.fn-card-topbar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin-bottom: 2px;
}

/* Islamic Rub-El-Hizb Left Badge Button (Click to return to text) */
.fn-card-badge-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  min-height: 32px;
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.16) 0%, rgba(6, 78, 59, 0.35) 100%);
  border: 1px solid rgba(212, 175, 55, 0.4);
  border-radius: 8px;
  color: var(--gold-light);
  font-family: 'Outfit', -apple-system, sans-serif;
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.4px;
  cursor: pointer;
  outline: none;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  user-select: none;
}

.fn-card-badge-btn:hover {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.28) 0%, rgba(5, 150, 105, 0.5) 100%);
  border-color: var(--gold-light);
  color: #ffffff;
  transform: translateY(-1.5px);
  box-shadow: 0 4px 14px rgba(212, 175, 55, 0.35), 0 0 12px rgba(16, 185, 129, 0.3);
}

.fn-card-badge-btn:active {
  transform: translateY(0) scale(0.97);
}

.fn-card-badge-btn:focus-visible {
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.5), 0 0 12px rgba(16, 185, 129, 0.4);
}

.fn-card-badge-btn .fn-islamic-star {
  color: var(--gold-primary);
  font-size: 0.82rem;
  line-height: 1;
  transition: transform 0.25s ease, color 0.2s ease;
}

.fn-card-badge-btn:hover .fn-islamic-star {
  transform: rotate(45deg);
  color: var(--gold-light);
}

.fn-card-badge-btn .fn-badge-arrow {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  color: #34d399;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.2s ease;
}

.fn-card-badge-btn:hover .fn-badge-arrow {
  color: #ffffff;
  transform: translateX(-3px);
}

.fn-card-badge-btn .fn-card-badge-num {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--gold-light);
  line-height: 1;
  transition: color 0.2s ease;
}

.fn-card-badge-btn:hover .fn-card-badge-num {
  color: #ffffff;
}

/* Light Mode Badge Button */
[data-theme="light"] .fn-card-badge-btn {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(240, 253, 244, 0.9) 100%);
  border: 1px solid rgba(180, 138, 28, 0.45);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .fn-card-badge-btn .fn-islamic-star {
  color: #b48a1c;
}

[data-theme="light"] .fn-card-badge-btn .fn-badge-arrow {
  color: #047857;
}

[data-theme="light"] .fn-card-badge-btn .fn-card-badge-num {
  color: #8c6b00;
}

[data-theme="light"] .fn-card-badge-btn:hover {
  background: linear-gradient(135deg, #fefce8 0%, #dcfce7 100%);
  border-color: #b48a1c;
  box-shadow: 0 4px 12px rgba(180, 138, 28, 0.25);
}

[data-theme="light"] .fn-card-badge-btn:hover .fn-card-badge-num {
  color: #064e3b;
}

[data-theme="light"] .fn-card-badge-btn:hover .fn-badge-arrow {
  color: #047857;
}

/* Redundant Right Button Hidden */
.fn-back-btn {
  display: none !important;
}

/* Footnote Card Body Text */
.fn-card-body {
  flex: 1;
  font-family: inherit;
  color: var(--text-light);
  line-height: 1.75;
  font-size: 0.96rem;
}

[data-theme="light"] .fn-card-body {
  color: #1e293b;
}

/* Enhanced Italic Styling for Latin Book & Reference Titles */
.fn-card-body em,
.book-ref-title {
  font-style: italic !important;
  font-weight: 600 !important;
  color: #34d399 !important;
  /* Luminous emerald green */
  display: inline-block;
  transform: skewX(-9deg);
  /* Slants Latin titles */
  padding: 0 2px;
  letter-spacing: 0.01em;
}

[data-theme="light"] .fn-card-body em,
[data-theme="light"] .book-ref-title {
  color: #047857 !important;
  /* Deep scholarly emerald green */
  font-style: italic !important;
  font-weight: 600 !important;
  display: inline-block;
  transform: skewX(-9deg);
  padding: 0 2px;
  letter-spacing: 0.01em;
}

/* STRICT ARABIC TYPOGRAPHY INTEGRITY - GLORIOUS GOLDEN AMIRI KHAT (IMAGE 2 STANDARD) */
.arabic-text,
.quran-ayah,
.reader-quran-box,
.ar-quote,
.prolog-center-arabic,
.arabic-ref-title,
.arabic-inline,
.quran-verse,
.hadith-text,
.book-ref-title:lang(ar),
.book-ref-title[dir="rtl"],
.fn-card-body .arabic-text,
.fn-card-body .arabic-ref-title,
.quote-highlight-box .arabic-text,
.quote-highlight-box .arabic-inline,
.quote-highlight-box .quran-ayah,
.quote-highlight-box .arabic-ref-title,
[lang="ar"],
:lang(ar) {
  font-style: normal !important;
  transform: none !important;
  font-family: 'Amiri', 'Traditional Arabic', serif !important;
  font-weight: 400 !important;
  color: var(--gold-light) !important;
}

[data-theme="light"] .arabic-text,
[data-theme="light"] .quran-ayah,
[data-theme="light"] .reader-quran-box,
[data-theme="light"] .ar-quote,
[data-theme="light"] .prolog-center-arabic,
[data-theme="light"] .arabic-ref-title,
[data-theme="light"] .arabic-inline,
[data-theme="light"] .quran-verse,
[data-theme="light"] .hadith-text,
[data-theme="light"] .book-ref-title:lang(ar),
[data-theme="light"] .book-ref-title[dir="rtl"],
[data-theme="light"] .fn-card-body .arabic-text,
[data-theme="light"] .fn-card-body .arabic-ref-title,
[data-theme="light"] .quote-highlight-box .arabic-text,
[data-theme="light"] .quote-highlight-box .arabic-inline,
[data-theme="light"] .quote-highlight-box .quran-ayah,
[data-theme="light"] .quote-highlight-box .arabic-ref-title,
[data-theme="light"] [lang="ar"],
[data-theme="light"] :lang(ar) {
  color: #8c6b00 !important;
}

.arabic-inline,
.quran-verse,
.hadith-text {
  direction: rtl;
  display: inline;
  padding: 0 4px;
  font-size: 1.25rem;
  line-height: 1.9;
}



/* ==========================================================================
   IN-TEXT CITATION BADGES & RETURN ANIMATIONS (.fn-ref)
   ========================================================================== */

.fn-ref {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'Outfit', sans-serif;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--gold-light);
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.18) 0%, rgba(16, 185, 129, 0.12) 100%);
  border: 1px solid rgba(212, 175, 55, 0.4);
  padding: 1px 6px;
  margin: 0 3px;
  border-radius: 5px;
  cursor: pointer;
  text-decoration: none;
  vertical-align: super;
  line-height: 1;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  scroll-margin-top: 140px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

.fn-ref:hover {
  background: linear-gradient(135deg, var(--gold-primary), #f59e0b);
  border-color: var(--gold-light);
  color: #0f172a;
  transform: translateY(-2px) scale(1.08);
  box-shadow: 0 4px 14px rgba(212, 175, 55, 0.55);
}

[data-theme="light"] .fn-ref {
  color: #8c6b00;
  background: linear-gradient(135deg, rgba(255, 251, 235, 0.95), rgba(240, 253, 244, 0.9));
  border-color: rgba(180, 138, 28, 0.45);
}

[data-theme="light"] .fn-ref:hover {
  background: #b48a1c;
  border-color: #8c6b00;
  color: #ffffff;
}

/* Islamic Golden Halo Pulse on Return */
.fn-ref-return-highlight {
  animation: islamicGoldenHaloPulse 2.8s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes islamicGoldenHaloPulse {
  0% {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #ffffff;
    border-color: var(--gold-light);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.9), 0 0 25px rgba(212, 175, 55, 0.8);
    transform: scale(1.45);
  }

  25% {
    background: linear-gradient(135deg, #10b981, #d4af37);
    color: #ffffff;
    box-shadow: 0 0 0 10px rgba(16, 185, 129, 0), 0 0 18px rgba(212, 175, 55, 0.5);
    transform: scale(1.25);
  }

  60% {
    background: rgba(16, 185, 129, 0.35);
    color: var(--gold-light);
    border-color: var(--gold-primary);
    transform: scale(1.1);
  }

  100% {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.18), rgba(16, 185, 129, 0.12));
    color: var(--gold-light);
    transform: scale(1);
  }
}

/* Warm Reading Context Highlight Wash on Paragraph */
.para-return-glow {
  transition: all 0.6s ease;
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.12) 0%, rgba(212, 175, 55, 0.08) 100%) !important;
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  margin-left: -12px;
  margin-right: -12px;
  border-left: 3px solid #10b981;
}

[data-theme="light"] .para-return-glow {
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.15) 0%, rgba(212, 175, 55, 0.12) 100%) !important;
  border-left-color: #059669;
}

/* ==================== INTERNAL SUBHEADINGS (THEMATIC ANCHORS) ==================== */
.internal-subheading-card {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 32px 0 16px 0;
  padding: 12px 18px;
  background: linear-gradient(90deg, rgba(2, 132, 199, 0.16) 0%, rgba(14, 28, 58, 0.45) 100%);
  border-left: 4px solid var(--sapphire-light, #38bdf8);
  border-radius: 0 10px 10px 0;
  font-family: var(--font-heading, 'Outfit', sans-serif);
  font-size: 1.08rem;
  font-weight: 700;
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
  line-height: 1.45;
}

.subheading-accent {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold-primary, #eab308);
  box-shadow: 0 0 10px var(--gold-glow, rgba(234, 179, 8, 0.6));
  flex-shrink: 0;
}

.subheading-title {
  flex: 1;
  letter-spacing: -0.01em;
  color: var(--text-primary, #f8fafc);
}


/* ==========================================================================
   PROLOG PUITIS & KETERANGAN PROLOG (EPIGRAF PEMBUKA)
   ========================================================================== */
.prolog-center-card {
  text-align: center;
  margin: 1.5rem auto;
  max-width: 820px;
  padding: 2.8rem 2rem;
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.06) 0%, rgba(15, 23, 42, 0.75) 100%);
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.35);
}

.prolog-center-bismillah {
  font-family: 'Amiri', serif;
  font-size: 1.9rem;
  color: var(--gold-light);
  line-height: 2.3;
  margin-bottom: 1.6rem;
  text-align: center;
  font-weight: 700;
}

.prolog-center-arabic {
  font-family: 'Amiri', serif;
  font-size: 1.55rem;
  line-height: 2.4;
  color: var(--gold-light);
  direction: rtl;
  text-align: center;
  margin-bottom: 2.2rem;
}

.prolog-center-divider {
  width: 160px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold-primary), transparent);
  margin: 2.2rem auto;
}

.prolog-center-malay {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.15rem;
  line-height: 2.15;
  color: var(--text-main);
  text-align: center;
  font-style: italic;
}

.prolog-nav-note {
  margin-top: 2.2rem;
  padding: 1.1rem 1.5rem;
  background: rgba(212, 175, 55, 0.08);
  border: 1px dashed rgba(212, 175, 55, 0.35);
  border-radius: var(--radius-sm);
  text-align: center;
  font-size: 0.94rem;
  color: var(--gold-light);
  line-height: 1.7;
}

.prolog-nav-note strong {
  color: #fff;
}


.prolog-jump-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
  padding: 10px 22px;
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.22) 0%, rgba(212, 175, 55, 0.08) 100%);
  border: 1.5px solid var(--gold-primary);
  border-radius: var(--radius-sm, 8px);
  color: var(--gold-light, #fde047);
  font-weight: 700;
  text-decoration: none;
  font-size: 0.98rem;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.prolog-jump-link:hover {
  background: var(--gold-primary);
  color: #060e20 !important;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--gold-glow, rgba(234, 179, 8, 0.5));
}

.prolog-jump-link strong {
  color: inherit;
}

/* ==========================================================================
   KESELAMATAN KANDUNGAN & KUNCI ANTI-SALIN (CONTENT PROTECTION)
   ========================================================================== */
body,
.app-container,
.content-body,
.reader-container,
.single-subtopic-view,
.subtopic-paragraphs,
.chapter-summary-card,
.hikmah-card,
.modal-content {
  -webkit-user-select: none !important;
  -moz-user-select: none !important;
  -ms-user-select: none !important;
  user-select: none !important;
  -webkit-touch-callout: none !important;
}

/* Pengecualian Khas: Ruangan input carian boleh ditaip & dipilih teksnya */
input,
textarea,
.search-input {
  -webkit-user-select: text !important;
  -moz-user-select: text !important;
  -ms-user-select: text !important;
  user-select: text !important;
}


/* Explicit Default Styling for Quotes & Poetry Translations */
.quote-highlight-box {
  background: rgba(16, 185, 129, 0.08);
  border-left: 4px solid var(--emerald-primary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 1rem 1.4rem;
  margin: 1.5rem 0;
  font-style: italic !important;
  color: var(--text-main) !important;
  font-family: inherit !important;
}

.quote-highlight-box em,
.quote-highlight-box .book-ref-title {
  color: var(--text-main) !important;
  font-style: italic !important;
  font-weight: 400 !important;
  transform: none !important;
  display: inline !important;
  font-family: inherit !important;
  letter-spacing: normal !important;
}

[data-theme="light"] .quote-highlight-box,
[data-theme="light"] .quote-highlight-box em,
[data-theme="light"] .quote-highlight-box .book-ref-title {
  color: var(--text-main) !important;
  transform: none !important;
  font-family: inherit !important;
}


/* ==========================================================================
   CHAPTER MODE OPTIONS (VERSI PENUH & RINGKASAN)
   ========================================================================== */

/* 1. Pill Button di Chapter Heading Banner */
.ch-pill {
  cursor: pointer;
  transition: all 0.2s ease;
}

.ch-pill:hover {
  background: rgba(190, 18, 60, 0.45);
  border-color: var(--gold-light);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(190, 18, 60, 0.4);
}

/* 2. Interactive Mode Switcher Tabs on Chapter Title Banner */
.chapter-mode-tabs {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(14, 23, 42, 0.75);
  border: 1px solid rgba(251, 113, 133, 0.3);
  border-radius: 26px;
  padding: 5px 6px;
  margin-top: 14px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.ch-mode-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 16px;
  border-radius: 20px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: 'Outfit', sans-serif;
}

.ch-mode-tab:hover {
  color: var(--gold-light);
  background: rgba(251, 113, 133, 0.15);
  transform: translateY(-1px);
}

.ch-mode-tab.active {
  background: linear-gradient(135deg, rgba(190, 18, 60, 0.9), rgba(136, 19, 55, 0.95));
  color: #ffffff;
  border-color: rgba(251, 113, 133, 0.65);
  box-shadow: 0 3px 12px rgba(190, 18, 60, 0.5);
  font-weight: 700;
}

.ch-mode-tab.active .mode-icon {
  transform: scale(1.15);
}

/* 3. Sidebar Chapter Quick Mode Bar */
.sidebar-mode-selector-li {
  list-style: none;
  padding: 6px 12px 10px 12px;
  margin-bottom: 6px;
  border-bottom: 1px dashed rgba(251, 113, 133, 0.2);
}

.sidebar-mode-pill-bar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.sidebar-pill-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 14px;
  font-size: 0.82rem;
  font-weight: 600;
  font-family: 'Outfit', sans-serif;
  cursor: pointer;
  border: 1px solid rgba(251, 113, 133, 0.25);
  background: rgba(190, 18, 60, 0.12);
  color: var(--text-light);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-pill-btn:hover {
  background: rgba(190, 18, 60, 0.32);
  border-color: var(--sapphire-light);
  color: #ffffff;
  transform: translateY(-1.5px);
  box-shadow: 0 3px 10px rgba(190, 18, 60, 0.3);
}

.sidebar-pill-btn.active {
  background: linear-gradient(135deg, var(--gold-primary), var(--gold-dark));
  color: #0b1120 !important;
  border-color: var(--gold-light);
  font-weight: 700;
  box-shadow: 0 2px 10px rgba(234, 179, 8, 0.4);
}

/* 4. Chapter Option Modal Dialog (Popup) */
.chapter-select-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(4, 7, 15, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.2rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.chapter-select-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.chapter-select-modal-box {
  background: linear-gradient(145deg, #130c1a 0%, #0c1426 100%);
  border: 1.5px solid rgba(251, 113, 133, 0.4);
  border-radius: 22px;
  max-width: 480px;
  width: 100%;
  padding: 1.8rem;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.65), 0 0 24px rgba(190, 18, 60, 0.3);
  transform: scale(0.92);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.chapter-select-overlay.show .chapter-select-modal-box {
  transform: scale(1);
}

.ch-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.8rem;
}

.ch-modal-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 12px;
  background: rgba(234, 179, 8, 0.15);
  border: 1px solid rgba(234, 179, 8, 0.45);
  color: var(--gold-light);
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.5px;
}

.ch-modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.3rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.ch-modal-close:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

.ch-modal-title {
  margin: 0 0 0.4rem 0;
  font-family: 'Outfit', sans-serif;
  font-size: 1.28rem;
  color: #ffffff;
  font-weight: 700;
  line-height: 1.35;
}

.ch-modal-arabic {
  font-family: 'Amiri', serif;
  font-size: 1.15rem;
  color: var(--gold-light);
  direction: rtl;
  margin-bottom: 0.75rem;
}

.ch-modal-desc {
  font-size: 0.92rem;
  color: var(--text-muted);
  margin-bottom: 1.3rem;
  line-height: 1.5;
}

.ch-modal-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ch-modal-btn {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1.5px solid rgba(251, 113, 133, 0.25);
  background: rgba(14, 23, 42, 0.75);
  color: var(--text-main);
  text-align: left;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.ch-modal-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.btn-modal-lengkap:hover {
  background: linear-gradient(135deg, rgba(14, 30, 64, 0.95), rgba(190, 18, 60, 0.4));
  border-color: #38bdf8;
}

.btn-modal-ringkasan:hover {
  background: linear-gradient(135deg, rgba(190, 18, 60, 0.45), rgba(234, 179, 8, 0.25));
  border-color: var(--gold-light);
}

.ch-modal-btn-icon {
  font-size: 1.8rem;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 2px;
}

.ch-modal-btn-title {
  font-size: 1.02rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 4px;
  font-family: 'Outfit', sans-serif;
}

.btn-modal-lengkap .ch-modal-btn-title {
  color: #7dd3fc;
}

.btn-modal-ringkasan .ch-modal-btn-title {
  color: var(--gold-light);
}

.ch-modal-btn-sub {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.ch-modal-footer {
  margin-top: 1.3rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: center;
}

.ch-modal-subtopics-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: var(--text-muted);
  padding: 8px 18px;
  border-radius: 20px;
  font-size: 0.86rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  font-family: 'Outfit', sans-serif;
}

.ch-modal-subtopics-btn:hover {
  color: #ffffff;
  border-color: var(--gold-light);
  background: rgba(255, 255, 255, 0.08);
}

/* Light Theme Adaptations */
[data-theme="light"] .chapter-mode-tabs {
  background: #ffffff;
  border-color: rgba(190, 18, 60, 0.25);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .chapter-select-modal-box {
  background: linear-gradient(145deg, #ffffff 0%, #f4f7fc 100%);
  border-color: rgba(190, 18, 60, 0.3);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.18);
}

[data-theme="light"] .ch-modal-title {
  color: #0b172a;
}

[data-theme="light"] .ch-modal-btn {
  background: #ffffff;
  border-color: rgba(190, 18, 60, 0.2);
  color: #0b172a;
}

[data-theme="light"] .btn-modal-lengkap .ch-modal-btn-title {
  color: #0369a1;
}

[data-theme="light"] .btn-modal-ringkasan .ch-modal-btn-title {
  color: #b45309;
}


/* ==========================================================================
   AMIRI GOLD STANDARD - ARABIC TYPOGRAPHY (FONT BIASA REGULAR 400)
   ========================================================================== */
.summary-arabic-quote-box {
  background: rgba(212, 175, 55, 0.08) !important;
  border: 1px solid rgba(212, 175, 55, 0.35) !important;
  border-right: 4px solid var(--gold-primary, #d4af37) !important;
  border-radius: 10px !important;
  padding: 0.9rem 1.35rem !important;
  margin: 0.9rem 0 1.1rem 0 !important;
  text-align: right !important;
  direction: rtl !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15) !important;
}

.arabic-text-amiri-gold,
.summary-arabic-quote-box .arabic-text-amiri-gold {
  font-family: 'Amiri', 'Traditional Arabic', serif !important;
  font-size: 1.45rem !important;
  font-weight: 400 !important;
  /* Font biasa tidak tebal supaya tasykil/baris jelas */
  line-height: 2.2 !important;
  color: var(--gold-light, #f5c542) !important;
  letter-spacing: normal !important;
  direction: rtl !important;
  text-align: right !important;
  display: block !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25) !important;
}

[data-theme="light"] .summary-arabic-quote-box {
  background: rgba(212, 175, 55, 0.07) !important;
  border-color: rgba(180, 140, 20, 0.35) !important;
  border-right-color: #b38600 !important;
}

[data-theme="light"] .arabic-text-amiri-gold,
[data-theme="light"] .summary-arabic-quote-box .arabic-text-amiri-gold {
  color: #8c6b00 !important;
}


/* ==========================================================================
   AMIRI GOLD STANDARD - STRICT NON-ITALIC ARABIC TYPOGRAPHY
   Penyelarasan Rasmi: Semua Teks Arab Berwarna Gold & Tidak Italic
   ========================================================================== */

:lang(ar),
[dir="rtl"],
.arabic-text,
.ar-quote,
.ar-badge,
.ch-ar-title,
.hero-ar-title,
.arabic-inline,
.arabic-text-amiri-gold,
.summary-arabic-quote-box,
.summary-arabic-quote-box * {
  font-family: 'Amiri', 'Traditional Arabic', serif !important;
  color: var(--gold-light, #fde047) !important;
  font-style: normal !important;
  text-decoration: none !important;
}

/* Memastikan tiada teks Arab di dalam em, i, atau blockquote menjadi condong (italic) */
em:has(:lang(ar)),
i:has(:lang(ar)),
em [dir="rtl"],
i [dir="rtl"],
.summary-subheading-banner span[dir="rtl"],
.summary-subheading-banner .arabic-text-amiri-gold {
  font-family: 'Amiri', serif !important;
  color: var(--gold-light, #fde047) !important;
  font-style: normal !important;
  font-weight: 700 !important;
  font-size: 1.15em !important;
  display: inline-block !important;
  line-height: 1.6 !important;
}

.summary-subheading-banner {
  font-family: 'Plus Jakarta Sans', sans-serif;
  color: var(--emerald-light, #34d399) !important;
}

.summary-subheading-banner em {
  font-style: normal !important;
}

[data-theme="light"] :lang(ar),
[data-theme="light"] [dir="rtl"],
[data-theme="light"] .arabic-text-amiri-gold {
  color: #9a6800 !important;
  font-style: normal !important;
}


/* ==========================================================================
   STANDARD AMIRI GOLD MUTLAK - TIADA TEKS ARAB ITALIC / CONDONG
   Semua teks Arab di seluruh sistem diwajibkan menggunakan font Amiri,
   warna Gold, dan berkeadaan TEGAK (font-style: normal !important).
   ========================================================================== */

:lang(ar),
[dir="rtl"],
.arabic-text,
.arabic-inline,
.arabic-ref-title,
.arabic-text-amiri-gold,
.hero-ar-title,
.ch-ar-title,
.summary-arabic-quote-box,
.summary-arabic-quote-box * {
  font-family: 'Amiri', 'Traditional Arabic', serif !important;
  color: var(--gold-light, #fde047) !important;
  font-style: normal !important;
  text-decoration: none !important;
}

/* Halang sebarang tag em atau i daripada mencenderungkan teks Arab */
em :lang(ar),
i :lang(ar),
em [dir="rtl"],
i [dir="rtl"],
em .arabic-text-amiri-gold,
i .arabic-text-amiri-gold,
.summary-subheading-banner span[dir="rtl"],
.summary-subheading-banner .arabic-text-amiri-gold {
  font-family: 'Amiri', serif !important;
  color: var(--gold-light, #fde047) !important;
  font-style: normal !important;
  font-weight: 700 !important;
  font-size: 1.25em !important;
  display: inline-block !important;
  line-height: 1.6 !important;
}

.summary-subheading-banner {
  font-family: 'Plus Jakarta Sans', sans-serif;
  color: var(--emerald-light, #34d399) !important;
}

.summary-subheading-banner em {
  font-style: normal !important;
}

/* Mod Terang (Light Theme) */
[data-theme="light"] :lang(ar),
[data-theme="light"] [dir="rtl"],
[data-theme="light"] .arabic-text-amiri-gold {
  color: #b45309 !important;
  font-style: normal !important;
}

/* Arabic Quote inside Green Quote Box */
.quote-highlight-box .ar-quote-block,
.quote-highlight-box .ar-quote {
  display: block !important;
  width: 100% !important;
  font-family: 'Amiri', serif !important;
  color: var(--gold-light, #fde047) !important;
  font-size: 1.35rem !important;
  line-height: 2.2 !important;
  margin-bottom: 0.75rem !important;
  text-align: right !important;
  text-align-last: right !important;
  -webkit-text-align-last: right !important;
  direction: rtl !important;
  font-style: normal !important;
  unicode-bidi: isolate !important;
  box-sizing: border-box !important;
}

[data-theme="light"] .quote-highlight-box .ar-quote-block,
[data-theme="light"] .quote-highlight-box .ar-quote {
  color: #8c6b00 !important;
}

.quote-highlight-box.arabic-quote-box {
  background: rgba(16, 185, 129, 0.08) !important;
  border-right: 4px solid var(--emerald-primary) !important;
  border-left: none !important;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm) !important;
  padding: 1rem 1.4rem !important;
  margin: 1.5rem 0 !important;
  direction: rtl !important;
  text-align: right !important;
  text-align-last: right !important;
  -webkit-text-align-last: right !important;
  unicode-bidi: isolate !important;
  font-family: 'Amiri', serif !important;
  font-size: 1.35rem !important;
  line-height: 2.2 !important;
  color: var(--gold-light, #fde047) !important;
  font-style: normal !important;
  display: block !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

[data-theme="light"] .quote-highlight-box.arabic-quote-box {
  background: rgba(5, 150, 105, 0.08) !important;
  border-left: 4px solid #059669 !important;
  color: #8c6b00 !important;
}


/* ==========================================================================
   ENHANCED SUMMARY SUBTOPIC UI: PILL BANNER, NUMBERED LIST, KUNCI AMAL, NAV
   ========================================================================== */

/* Summary Subheading Banner Pill */
.summary-subheading-banner {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.95rem;
  color: var(--emerald-light, #34d399);
  font-weight: 600;
  margin: 0.4rem 0 1.1rem 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.subheading-banner-icon {
  font-size: 1.1rem;
}

.subheading-banner-text {
  font-weight: 600;
}

/* Styled Ordered List with Counter Badges */
.summary-ordered-list {
  list-style: none;
  counter-reset: summary-counter;
  padding-left: 0;
  margin: 1rem 0 1.25rem 0;
}

.summary-ordered-list li {
  counter-increment: summary-counter;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 0.85rem;
  line-height: 1.75;
}

.summary-ordered-list li::before {
  content: counter(summary-counter);
  flex-shrink: 0;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.82rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 3px;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Kunci Amal Haraki Callout Box */
.summary-kunci-amal-box {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.12), rgba(16, 185, 129, 0.12));
  border: 1px solid rgba(212, 175, 55, 0.4);
  border-left: 4px solid var(--gold-primary, #d4af37);
  border-radius: 10px;
  padding: 0.9rem 1.2rem;
  margin: 1.4rem 0 0.5rem 0;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-weight: 500;
  color: #fef08a;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.kunci-amal-icon {
  font-size: 1.35rem;
  line-height: 1.2;
}

.kunci-amal-body {
  flex: 1;
  line-height: 1.7;
}

.kunci-amal-body strong {
  color: #facc15;
}

/* Summary Footer Navigation & Quick Jump */
.summary-footer-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: 1.75rem;
  padding-top: 1.15rem;
  border-top: 1px solid rgba(16, 185, 129, 0.25);
  flex-wrap: wrap;
}

.summary-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(16, 185, 129, 0.12);
  color: var(--emerald-light, #34d399);
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.summary-nav-btn:hover:not(:disabled) {
  background: rgba(16, 185, 129, 0.25);
  border-color: var(--emerald-light, #34d399);
  transform: translateY(-1px);
}

.summary-nav-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.summary-jump-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.2), rgba(212, 175, 55, 0.35));
  color: #fff;
  border: 1px solid var(--gold-primary, #d4af37);
  border-radius: 8px;
  padding: 8px 18px;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(212, 175, 55, 0.25);
  transition: all 0.2s ease;
}

.summary-jump-btn:hover {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.35), rgba(212, 175, 55, 0.5));
  box-shadow: 0 4px 14px rgba(212, 175, 55, 0.4);
  transform: translateY(-1px);
}

@media (max-width: 640px) {
  .summary-footer-nav {
    flex-direction: column;
    gap: 12px;
  }

  .summary-footer-nav .summary-jump-btn {
    width: 100%;
    justify-content: center;
    order: -1;
  }

  .summary-footer-nav .summary-nav-btn {
    width: 100%;
    justify-content: center;
  }
}


/* ========================================================
   SEKILAS TONGGAK AMALAN TARBIAH (3 RUKUN ASAS SALAF)
   ======================================================== */

.sidebar-tarbiah-promo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  margin: 0 14px 16px 14px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(212, 175, 55, 0.10) 100%);
  border: 1px solid rgba(16, 185, 129, 0.35);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.sidebar-tarbiah-promo:hover {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.25) 0%, rgba(212, 175, 55, 0.20) 100%);
  border-color: var(--emerald-light, #34d399);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.25);
}

.tarbiah-promo-icon {
  font-size: 1.45rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(16, 185, 129, 0.2);
  flex-shrink: 0;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.tarbiah-promo-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.tarbiah-promo-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #a7f3d0;
  line-height: 1.25;
}

.tarbiah-promo-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.2;
  margin-top: 3px;
}

.tarbiah-promo-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 6px;
  background: rgba(16, 185, 129, 0.2);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.4);
  letter-spacing: 0.4px;
}

/* Modal Overlay & Box */
.tarbiah-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.tarbiah-modal-box {
  background: var(--bg-card, #062315);
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-top: 4px solid var(--emerald-primary, #10b981);
  border-radius: 16px;
  max-width: 720px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
  animation: modalFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.tarbiah-modal-header {
  padding: 1.2rem 1.5rem 0.5rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tarbiah-modal-badge {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.8px;
  padding: 3px 10px;
  border-radius: 20px;
  background: rgba(16, 185, 129, 0.2);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.tarbiah-modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.2s;
}

.tarbiah-modal-close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.tarbiah-modal-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--gold-light, #fde047);
  padding: 0.2rem 1.5rem 0 1.5rem;
  margin: 0;
}

.tarbiah-modal-subtitle {
  font-size: 0.86rem;
  color: var(--text-muted);
  padding: 0.35rem 1.5rem 1rem 1.5rem;
  margin: 0;
  border-bottom: 1px solid rgba(16, 185, 129, 0.2);
}

.tarbiah-modal-body {
  padding: 1.25rem 1.5rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* Pillar Card */
.tarbiah-pillar-card {
  background: rgba(5, 46, 22, 0.4);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 12px;
  padding: 1.15rem;
  transition: all 0.25s ease;
}

.tarbiah-pillar-card:hover {
  border-color: rgba(212, 175, 55, 0.4);
  background: rgba(5, 46, 22, 0.6);
}

.tarbiah-pillar-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 0.85rem;
}

.tarbiah-pillar-icon {
  font-size: 1.6rem;
  line-height: 1;
}

.tarbiah-pillar-titles h4 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: #fef08a;
}

.tarbiah-pillar-tag {
  font-size: 0.72rem;
  color: #a7f3d0;
  font-weight: 500;
}

.tarbiah-quote-box {
  background: rgba(0, 0, 0, 0.25);
  border-right: 3px solid var(--gold-primary, #d4af37);
  padding: 0.75rem 1rem;
  border-radius: 6px;
  margin: 0.6rem 0;
  text-align: right;
  line-height: 1.8;
}

.tarbiah-quote-trans {
  font-size: 0.88rem;
  line-height: 1.65;
  color: var(--text-main, #e2e8f0);
  margin: 0.4rem 0 0.8rem 0;
}

.tarbiah-checklist {
  list-style: none;
  padding-left: 0;
  margin: 0.5rem 0 0 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.tarbiah-checklist li {
  position: relative;
  padding-left: 24px;
  font-size: 0.86rem;
  line-height: 1.5;
  color: #d1fae5;
}

.tarbiah-checklist li::before {
  content: '✓';
  position: absolute;
  left: 2px;
  top: 0;
  color: var(--emerald-light, #34d399);
  font-weight: 700;
}

.tarbiah-modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid rgba(16, 185, 129, 0.2);
  display: flex;
  justify-content: flex-end;
}

.tarbiah-modal-btn {
  background: linear-gradient(135deg, #059669, #047857);
  color: #fff;
  border: 1px solid rgba(16, 185, 129, 0.5);
  border-radius: 8px;
  padding: 9px 20px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.tarbiah-modal-btn:hover {
  background: linear-gradient(135deg, #10b981, #059669);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}


/* ========================================================
   MODUL KHAS: UMMAH FADHILAH & PERADABAN BARU ISLAM (PBI)
   Sumbangan Al-Raqā'iq dalam Kuasa Watan & Peradaban
   ======================================================== */

.sidebar-peradaban-promo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  margin: 0 14px 16px 14px;
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.16) 0%, rgba(217, 119, 6, 0.15) 100%);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.sidebar-peradaban-promo:hover {
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.28) 0%, rgba(217, 119, 6, 0.25) 100%);
  border-color: #38bdf8;
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(2, 132, 199, 0.25);
}

.peradaban-promo-icon {
  font-size: 1.45rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(2, 132, 199, 0.25);
  border: 1px solid rgba(56, 189, 248, 0.4);
  flex-shrink: 0;
}

.peradaban-promo-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.peradaban-promo-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #7dd3fc;
  line-height: 1.25;
}

.peradaban-promo-sub {
  font-size: 0.72rem;
  color: var(--gold-light, #fde047);
  line-height: 1.2;
  margin-top: 3px;
}

.peradaban-promo-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 6px;
  background: rgba(2, 132, 199, 0.25);
  color: #bae6fd;
  border: 1px solid rgba(56, 189, 248, 0.45);
  letter-spacing: 0.4px;
}

/* Peradaban Modal Enhancements */
.peradaban-modal-box {
  border-top: 4px solid #38bdf8 !important;
  max-width: 760px !important;
}

.peradaban-modal-badge {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.8px;
  padding: 3px 10px;
  border-radius: 20px;
  background: rgba(2, 132, 199, 0.25);
  color: #7dd3fc;
  border: 1px solid rgba(56, 189, 248, 0.45);
}

.peradaban-modal-title {
  color: #7dd3fc !important;
}

.peradaban-modal-subtitle {
  border-bottom: 1px solid rgba(56, 189, 248, 0.2) !important;
}

/* Panel Muat Turun Fail Sedia Digunakan */
.peradaban-download-panel {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.85) 0%, rgba(30, 41, 59, 0.85) 100%);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 12px;
  padding: 0.9rem 1.2rem;
  margin: 0.6rem 1.5rem 0.5rem 1.5rem;
}

.download-panel-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--gold-light, #fde047);
  margin-bottom: 0.65rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.download-buttons-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 640px) {
  .download-buttons-group {
    grid-template-columns: 1fr;
  }
}

.peradaban-doc-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  text-decoration: none;
  font-family: inherit;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.peradaban-doc-btn.docx-btn {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.25) 0%, rgba(30, 64, 175, 0.35) 100%);
  border: 1px solid rgba(59, 130, 246, 0.5);
  color: #bfdbfe;
}

.peradaban-doc-btn.docx-btn:hover {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.45) 0%, rgba(30, 64, 175, 0.55) 100%);
  border-color: #60a5fa;
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
  color: #ffffff;
}

.peradaban-doc-btn.pdf-btn {
  background: linear-gradient(135deg, rgba(225, 29, 72, 0.25) 0%, rgba(159, 18, 57, 0.35) 100%);
  border: 1px solid rgba(244, 63, 94, 0.5);
  color: #fecdd3;
}

.peradaban-doc-btn.pdf-btn:hover {
  background: linear-gradient(135deg, rgba(225, 29, 72, 0.45) 0%, rgba(159, 18, 57, 0.55) 100%);
  border-color: #fb7185;
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(225, 29, 72, 0.35);
  color: #ffffff;
}

.peradaban-doc-btn .doc-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.peradaban-doc-btn .doc-info {
  display: flex;
  flex-direction: column;
}

.peradaban-doc-btn .doc-main-text {
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.2;
}

.peradaban-doc-btn .doc-sub-text {
  font-size: 0.72rem;
  opacity: 0.85;
  margin-top: 2px;
}

/* Highlight & Cards */
.peradaban-card-highlight {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.7) 0%, rgba(30, 41, 59, 0.7) 100%);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 12px;
  padding: 1.15rem;
}

.peradaban-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.peradaban-card-icon {
  font-size: 1.4rem;
}

.peradaban-desc-text {
  font-size: 0.88rem;
  line-height: 1.6;
  color: #e2e8f0;
  margin: 0.4rem 0 0 0;
}

.peradaban-pillar-card {
  background: rgba(15, 23, 42, 0.5) !important;
  border: 1px solid rgba(56, 189, 248, 0.2) !important;
}

.peradaban-pillar-card:hover {
  background: rgba(15, 23, 42, 0.75) !important;
  border-color: #38bdf8 !important;
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(2, 132, 199, 0.25) !important;
}

.simbiotik-chain-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  margin-top: 0.75rem;
}

@media (max-width: 680px) {
  .simbiotik-chain-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .chain-arrow {
    transform: rotate(90deg);
    margin: 4px auto;
  }
}

.chain-box {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 8px;
  padding: 0.75rem;
  text-align: center;
}

.chain-badge {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--gold-light);
  margin-bottom: 4px;
}

.chain-arrow {
  font-size: 1.2rem;
  color: var(--gold-light);
  font-weight: 700;
  text-align: center;
}

.tetralogi-summary-box {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(217, 119, 6, 0.3);
  border-radius: 10px;
  padding: 1rem;
}

.tetralogi-list {
  margin: 0;
  padding-left: 1.2rem;
  font-size: 0.85rem;
  line-height: 1.6;
  color: #cbd5e1;
}

.peradaban-close-footer-btn {
  background: linear-gradient(135deg, #0284c7, #0369a1) !important;
  border: 1px solid #38bdf8 !important;
}

.peradaban-close-footer-btn:hover {
  background: linear-gradient(135deg, #0ea5e9, #0284c7) !important;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.4) !important;
}

/* Light Theme Overrides */
[data-theme="light"] .sidebar-peradaban-promo {
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.08) 0%, rgba(217, 119, 6, 0.08) 100%);
  border-color: rgba(2, 132, 199, 0.3);
}

[data-theme="light"] .peradaban-promo-title {
  color: #0369a1;
}

[data-theme="light"] .peradaban-modal-box {
  background: #ffffff;
  border-color: rgba(2, 132, 199, 0.4);
}

[data-theme="light"] .peradaban-modal-title {
  color: #0369a1 !important;
}

[data-theme="light"] .peradaban-download-panel {
  background: #f8fafc;
  border-color: rgba(2, 132, 199, 0.3);
}

[data-theme="light"] .peradaban-card-highlight {
  background: #f0f9ff;
  border-color: rgba(2, 132, 199, 0.25);
}

[data-theme="light"] .peradaban-pillar-card {
  background: #f8fafc !important;
  border-color: rgba(203, 213, 225, 0.8) !important;
}

[data-theme="light"] .peradaban-desc-text {
  color: #334155;
}

[data-theme="light"] .chain-box {
  background: #ffffff;
  border-color: rgba(217, 119, 6, 0.4);
}

[data-theme="light"] .chain-box p {
  color: #475569 !important;
}

[data-theme="light"] .tetralogi-summary-box {
  background: #fffbeb;
  border-color: rgba(217, 119, 6, 0.3);
}

[data-theme="light"] .tetralogi-list {
  color: #334155;
}

/* === UMMAH FADHILAH & PBI SIDEBAR PROMO (3 LAJUR SEBARIS PERSIS AL-RAQAIQ) === */
.sidebar-peradaban-promo {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
  padding: 10px 14px !important;
  margin: 0 14px 16px 14px !important;
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.16) 0%, rgba(217, 119, 6, 0.15) 100%) !important;
  border: 1px solid rgba(56, 189, 248, 0.35) !important;
  border-radius: 12px !important;
  cursor: pointer !important;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2) !important;
  box-sizing: border-box !important;
}

.sidebar-peradaban-promo:hover {
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.28) 0%, rgba(217, 119, 6, 0.25) 100%) !important;
  border-color: #38bdf8 !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 6px 18px rgba(2, 132, 199, 0.25) !important;
}

.peradaban-promo-icon {
  font-size: 1.45rem !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 38px !important;
  height: 38px !important;
  border-radius: 10px !important;
  background: rgba(2, 132, 199, 0.25) !important;
  border: 1px solid rgba(56, 189, 248, 0.4) !important;
  flex-shrink: 0 !important;
}

.peradaban-promo-info {
  flex: 1 1 auto !important;
  display: flex !important;
  flex-direction: column !important;
  min-width: 0 !important;
  text-align: left !important;
}

.peradaban-promo-title {
  font-size: 0.88rem !important;
  font-weight: 700 !important;
  color: #7dd3fc !important;
  line-height: 1.25 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.peradaban-promo-sub {
  font-size: 0.72rem !important;
  color: var(--gold-light, #fde047) !important;
  line-height: 1.2 !important;
  margin-top: 3px !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.peradaban-promo-badge {
  font-size: 0.68rem !important;
  font-weight: 700 !important;
  padding: 3px 7px !important;
  border-radius: 6px !important;
  background: rgba(2, 132, 199, 0.25) !important;
  color: #bae6fd !important;
  border: 1px solid rgba(56, 189, 248, 0.45) !important;
  letter-spacing: 0.4px !important;
  flex-shrink: 0 !important;
  white-space: nowrap !important;
}

/* ==========================================================================
   MODAL PERADABAN SPOTLIGHT (UMMAH FADHILAH & PBI) - FULL FIXED OVERLAY & DIALOG
   ========================================================================== */
#modalPeradabanSpotlight,
.peradaban-modal-overlay,
.tarbiah-modal-overlay.peradaban-modal-overlay {
  display: none !important; /* DEFAULT IS HIDDEN */
  position: fixed !important;
  inset: 0 !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background: rgba(0, 0, 0, 0.85) !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
  z-index: 999999 !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 1rem !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
}

#modalPeradabanSpotlight.show,
.peradaban-modal-overlay.show,
.tarbiah-modal-overlay.peradaban-modal-overlay.show {
  display: flex !important; /* ONLY DISPLAYED WHEN .show IS ACTIVE */
}

/* Modal Dialog Box */
#modalPeradabanSpotlight .peradaban-modal-box,
#modalPeradabanSpotlight .tarbiah-modal-box,
.peradaban-modal-box {
  position: relative !important;
  background: #091a29 !important;
  border: 1.5px solid rgba(56, 189, 248, 0.5) !important;
  border-top: 5px solid #38bdf8 !important;
  border-radius: 18px !important;
  max-width: 780px !important;
  width: 100% !important;
  max-height: 88vh !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.85), 0 0 35px rgba(2, 132, 199, 0.3) !important;
  margin: auto !important;
  animation: peradabanModalFadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

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

/* Header */
#modalPeradabanSpotlight .peradaban-modal-header,
#modalPeradabanSpotlight .tarbiah-modal-header {
  padding: 1.2rem 1.5rem 0.6rem 1.5rem !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  border-bottom: 1px solid rgba(56, 189, 248, 0.15) !important;
  flex-shrink: 0 !important;
}

#modalPeradabanSpotlight .peradaban-modal-badge,
#modalPeradabanSpotlight .tarbiah-modal-badge {
  font-size: 0.75rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.8px !important;
  padding: 4px 12px !important;
  border-radius: 20px !important;
  background: rgba(2, 132, 199, 0.25) !important;
  color: #7dd3fc !important;
  border: 1px solid rgba(56, 189, 248, 0.45) !important;
}

/* Close Button (Header) */
#modalPeradabanSpotlight .tarbiah-modal-close,
#modalPeradabanSpotlight .icon-btn.tarbiah-modal-close,
#modalPeradabanSpotlight #btnClosePeradabanModal {
  background: rgba(255, 255, 255, 0.08) !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  color: #e2e8f0 !important;
  font-size: 1.25rem !important;
  line-height: 1 !important;
  cursor: pointer !important;
  width: 34px !important;
  height: 34px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 8px !important;
  transition: all 0.2s ease !important;
  flex-shrink: 0 !important;
}

#modalPeradabanSpotlight .tarbiah-modal-close:hover,
#modalPeradabanSpotlight #btnClosePeradabanModal:hover {
  background: rgba(239, 68, 68, 0.25) !important;
  border-color: #ef4444 !important;
  color: #ffffff !important;
  transform: scale(1.05) !important;
}

/* Titles */
#modalPeradabanSpotlight .peradaban-modal-title,
#modalPeradabanSpotlight .tarbiah-modal-title {
  font-size: 1.35rem !important;
  font-weight: 700 !important;
  color: #7dd3fc !important;
  padding: 0.8rem 1.5rem 0.2rem 1.5rem !important;
  margin: 0 !important;
  line-height: 1.3 !important;
  flex-shrink: 0 !important;
}

#modalPeradabanSpotlight .peradaban-modal-subtitle,
#modalPeradabanSpotlight .tarbiah-modal-subtitle {
  font-size: 0.86rem !important;
  color: #cbd5e1 !important;
  padding: 0.2rem 1.5rem 0.8rem 1.5rem !important;
  margin: 0 !important;
  border-bottom: 1px solid rgba(56, 189, 248, 0.2) !important;
  line-height: 1.4 !important;
  flex-shrink: 0 !important;
}

/* Body (Scrollable!) */
#modalPeradabanSpotlight .peradaban-modal-body,
#modalPeradabanSpotlight .tarbiah-modal-body {
  padding: 1.25rem 1.5rem !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 1.25rem !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
}

/* Footer */
#modalPeradabanSpotlight .tarbiah-modal-footer,
#modalPeradabanSpotlight .peradaban-modal-footer {
  padding: 1rem 1.5rem !important;
  border-top: 1px solid rgba(56, 189, 248, 0.2) !important;
  display: flex !important;
  justify-content: flex-end !important;
  flex-shrink: 0 !important;
  background: rgba(15, 23, 42, 0.5) !important;
}

#modalPeradabanSpotlight #btnPeradabanModalCloseFooter,
#modalPeradabanSpotlight .peradaban-close-footer-btn,
#modalPeradabanSpotlight .tarbiah-modal-btn {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%) !important;
  color: #ffffff !important;
  border: 1px solid rgba(56, 189, 248, 0.5) !important;
  border-radius: 10px !important;
  padding: 9px 24px !important;
  font-size: 0.92rem !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.35) !important;
}

#modalPeradabanSpotlight #btnPeradabanModalCloseFooter:hover,
#modalPeradabanSpotlight .peradaban-close-footer-btn:hover,
#modalPeradabanSpotlight .tarbiah-modal-btn:hover {
  background: linear-gradient(135deg, #38bdf8 0%, #0284c7 100%) !important;
  box-shadow: 0 6px 20px rgba(56, 189, 248, 0.45) !important;
  transform: translateY(-1px) !important;
}

/* Light Theme Support */
[data-theme="light"] #modalPeradabanSpotlight,
[data-theme="light"] .peradaban-modal-overlay {
  background: rgba(15, 23, 42, 0.6) !important;
}

[data-theme="light"] #modalPeradabanSpotlight .peradaban-modal-box,
[data-theme="light"] #modalPeradabanSpotlight .tarbiah-modal-box {
  background: #ffffff !important;
  border-color: rgba(2, 132, 199, 0.4) !important;
  color: #0f172a !important;
}

[data-theme="light"] #modalPeradabanSpotlight .peradaban-modal-title,
[data-theme="light"] #modalPeradabanSpotlight .tarbiah-modal-title {
  color: #0369a1 !important;
}

[data-theme="light"] #modalPeradabanSpotlight .peradaban-modal-subtitle,
[data-theme="light"] #modalPeradabanSpotlight .tarbiah-modal-subtitle {
  color: #475569 !important;
}

[data-theme="light"] #modalPeradabanSpotlight .tarbiah-modal-close,
[data-theme="light"] #modalPeradabanSpotlight #btnClosePeradabanModal {
  background: rgba(0, 0, 0, 0.05) !important;
  color: #334155 !important;
}

/* ==========================================================================
   PENJAZARAN KANAN MUTLAK SEMUA TEKS ARAB (AMIRI GOLD) - ANTI-JATUH KIRI
   Menjamin setiap barisan petikan teks Arab, termasuk barisan kedua dan
   seterusnya, dijajarkan 100% rapat ke kanan (RTL right-aligned).
   ========================================================================== */
.content-body p.arabic-text,
.content-body div.arabic-text,
.content-body .arabic-text,
.content-body .ar-quote,
.content-body .ar-verse-line,
.content-body .ar-poem-quote,
.content-body .ar-quote-block,
.content-body .quote-highlight-box.arabic-quote-box,
.content-body .quote-highlight-box .ar-quote,
.content-body .quote-highlight-box .ar-quote-block,
.content-body .summary-arabic-quote-box,
.content-body .summary-arabic-quote-box .arabic-text-amiri-gold,
.content-body [dir="rtl"].arabic-text,
.arabic-text,
.ar-quote,
.ar-verse-line,
.ar-poem-quote,
.ar-quote-block,
.quote-highlight-box.arabic-quote-box,
.summary-arabic-quote-box,
.summary-arabic-quote-box .arabic-text-amiri-gold,
.hikmah-card-body .ar-quote,
.hikmah-card-body .ar-verse-line {
  direction: rtl !important;
  text-align: right !important;
  text-align-last: right !important;
  -webkit-text-align-last: right !important;
  unicode-bidi: isolate !important;
  box-sizing: border-box !important;
}

/* Elakkan span inline-block memecahkan jajaran perenggan quote */
.quote-highlight-box .ar-quote-block,
.quote-highlight-box .ar-quote {
  display: block !important;
  width: 100% !important;
}
