/* ==========================================================================
   AL-MUNTALAQ PWA - STYLESHEET
   Siri Fiqh Dakwah & Harakah - Syeikh Muhammad Ahmad Ar-Rasyid
   Identiti Visual: Emerald Heritage Green & Royal Islamic Gold
   ========================================================================== */

@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 Forest Emerald Obsidian */
  --bg-app: #061512;
  --bg-sidebar: #081f19;
  --bg-card: rgba(10, 36, 30, 0.78);
  --bg-card-hover: rgba(16, 52, 43, 0.88);
  --bg-header: rgba(8, 30, 25, 0.90);
  --bg-input: #0e2b24;
  --border-subtle: rgba(16, 185, 129, 0.25);
  --border-card: rgba(16, 185, 129, 0.12);

  /* Brand Accents - Islamic Emerald & Heritage Gold */
  --gold-primary: #d4af37;
  --gold-light: #f5d77f;
  --gold-dark: #aa8620;
  --gold-glow: rgba(212, 175, 55, 0.35);

  --emerald-primary: #10b981;
  --emerald-light: #34d399;
  --emerald-dark: #059669;
  --emerald-glow: rgba(16, 185, 129, 0.4);

  --blue-primary: #38bdf8;

  /* Typography */
  --text-main: #f1f8f5;
  --text-muted: #93a8a2;
  --text-light: #d1e2dc;
  --text-gold: #f5d77f;

  /* 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(0, 0, 0, 0.45);
}

[data-theme="light"] {
  /* Light Theme - Fresh Soft Sage & Mint Cream */
  --bg-app: #f2f7f4;
  --bg-sidebar: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f0f7f3;
  --bg-header: rgba(255, 255, 255, 0.94);
  --bg-input: #e6f3ec;
  --border-subtle: rgba(16, 185, 129, 0.35);
  --border-card: #d1fae5;

  --text-main: #062b22;
  --text-muted: #4b6b62;
  --text-light: #164e3f;
  --text-gold: #9e7500;
  --shadow-glow: 0 10px 25px -5px rgba(6, 78, 59, 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(16, 185, 129, 0.3);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--emerald-primary);
}

/* ================= 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(0, 0, 0, 0.2);
}

.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(16, 185, 129, 0.5), 0 0 8px rgba(212, 175, 55, 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(52, 211, 153, 0.7), 0 0 14px rgba(212, 175, 55, 0.6);
  border-color: var(--emerald-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(--emerald-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, #062b22 35%, #9e7500 70%, #059669 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(16, 185, 129, 0.25), rgba(6, 78, 59, 0.45));
  border: 1.5px solid rgba(52, 211, 153, 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, #e6f4ed, #d1fae5);
  border-color: #34d399;
  color: #065f46;
  box-shadow: 0 1px 4px rgba(16, 185, 129, 0.2);
}

.chapter-header-btn:hover .chapter-num-badge {
  background: linear-gradient(135deg, var(--gold-primary), #b45309);
  color: #061512;
  border-color: var(--gold-light);
  box-shadow: 0 0 10px rgba(212, 175, 55, 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-bullet,
.subtopic-num {
  flex-shrink: 0;
  line-height: 1.45;
  color: inherit;
  opacity: 0.85;
}

.subtopic-bullet {
  font-size: 0.82rem;
  margin-top: 2px;
  color: var(--emerald-primary);
}

.subtopic-num {
  min-width: 1.45rem;
  font-weight: 600;
  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(16, 185, 129, 0.08);
}

.subtopic-nav-btn.active-sub {
  color: var(--emerald-light);
  background: rgba(16, 185, 129, 0.16);
  font-weight: 600;
  border-left: 3px solid var(--emerald-primary);
}

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

[data-theme="light"] .subtopic-nav-btn.active-sub {
  color: #065f46;
  background: #d1fae5;
  border-left-color: #059669;
}

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

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

/* Hero / Announcement Card - Emerald Heritage Glow */
.hero-card {
  background: linear-gradient(135deg, rgba(10, 42, 34, 0.94), rgba(6, 26, 21, 0.98));
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: var(--radius-md);
  padding: 1.5rem 2rem;
  margin-bottom: 2rem;
  position: relative;
  overflow: hidden;
  box-shadow: 0 12px 35px rgba(6, 78, 59, 0.25);
  transition: var(--transition);
}

.hero-card::after {
  content: 'المنطلق';
  font-family: 'Amiri', serif;
  position: absolute;
  right: -10px;
  bottom: -30px;
  font-size: 9rem;
  color: rgba(16, 185, 129, 0.06);
  pointer-events: none;
}

.hero-badge {
  display: inline-block;
  background: rgba(16, 185, 129, 0.16);
  border: 1px solid var(--emerald-primary);
  color: var(--emerald-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 (المُنْطَلَق) */
.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: #9e7500;
}

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

.hero-stats {
  display: flex;
  gap: 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(16, 185, 129, 0.16);
  border: 1px solid var(--emerald-primary);
  color: var(--emerald-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: #d1fae5;
  border-color: #059669;
  color: #065f46;
}

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

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

.chapter-parent-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.12rem;
  font-weight: 600;
  color: var(--gold-light);
  margin: 6px 0 2px 0;
  opacity: 0.95;
  letter-spacing: 0.2px;
}

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

/* 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;
}

/* Highlight Arabic passages */
.content-body .arabic-text {
  font-family: 'Amiri', serif;
  font-size: 1.35rem;
  line-height: 2.1;
  color: var(--gold-light);
  direction: rtl;
  text-align: right;
  background: rgba(212, 175, 55, 0.05);
  padding: 0.8rem 1.2rem;
  border-radius: var(--radius-sm);
  border-right: 3px solid var(--gold-primary);
  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: 700;
  color: var(--emerald-primary);
  display: block;
  margin-bottom: 4px;
}

/* 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;
}

/* 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-bullet,
  .subtopic-num {
    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 - Emerald & Gold) */
.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(212, 175, 55, 0.45);
  background: linear-gradient(135deg, rgba(8, 31, 25, 0.9) 0%, rgba(14, 43, 36, 0.95) 100%);
  color: var(--gold-light, #f5d77f);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35), 0 0 12px rgba(212, 175, 55, 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: var(--gold-light, #f5d77f);
  stroke-width: 2.6;
  stroke-linecap: round;
  display: block;
  transition: transform 0.2s ease, stroke 0.2s ease;
}

.mobile-menu-btn:hover {
  border-color: var(--gold-primary, #d4af37);
  color: #ffffff;
  background: linear-gradient(135deg, rgba(14, 43, 36, 0.95) 0%, rgba(22, 65, 54, 0.95) 100%);
  box-shadow: 0 4px 16px rgba(212, 175, 55, 0.4), 0 0 16px rgba(16, 185, 129, 0.25);
  transform: translateY(-1px);
}

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

.mobile-menu-btn:active {
  transform: scale(0.92);
  background: rgba(212, 175, 55, 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%, #f0fdf4 100%);
  border-color: rgba(16, 185, 129, 0.6);
  color: #047857;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.18), 0 1px 3px rgba(0, 0, 0, 0.08);
}

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

body.light-theme .mobile-menu-btn:hover {
  background: #dcfce7;
  border-color: #059669;
  color: #065f46;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

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

@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;
  }
}

/* ================= ENHANCED READER SUB-HEADINGS & ELEMENTS ================= */
.reader-subheading {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--gold-light);
  margin: 2.2rem 0 1rem 0;
  padding: 0.6rem 1rem;
  background: linear-gradient(90deg, rgba(212, 175, 55, 0.12) 0%, rgba(15, 23, 42, 0.02) 100%);
  border-left: 4px solid var(--gold-primary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  display: flex;
  align-items: center;
  gap: 10px;
  scroll-margin-top: 90px;
}

[data-theme="light"] .reader-subheading {
  color: #8c6b00;
  background: linear-gradient(90deg, rgba(212, 175, 55, 0.15) 0%, rgba(240, 245, 250, 0.2) 100%);
  border-left: 4px solid #b38600;
}

.sub-ornament {
  color: var(--gold-primary);
  font-size: 1rem;
}

/* Al-Quran Calligraphy Frame */
.reader-quran-box {
  margin: 1.4rem auto;
  padding: 1.2rem 1.8rem;
  background: rgba(16, 185, 129, 0.05);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: var(--radius-md);
  text-align: center;
  position: relative;
  box-shadow: inset 0 0 15px rgba(16, 185, 129, 0.03);
}

.reader-quran-box .quran-ayah {
  font-family: 'Amiri', 'Traditional Arabic', serif;
  font-size: 1.5rem;
  line-height: 2.3;
  color: var(--emerald-primary);
  direction: rtl;
}

[data-theme="light"] .reader-quran-box {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.3);
}

[data-theme="light"] .reader-quran-box .quran-ayah {
  color: #047857;
}

/* 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: #334155;
}

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

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

/* STRICT ARABIC TYPOGRAPHY INTEGRITY - NEVER ITALICIZED OR SKEWED */
.arabic-text,
.quran-ayah,
.reader-quran-box,
.ar-quote,
.arabic-ref-title,
.book-ref-title:lang(ar),
.book-ref-title[dir="rtl"],
.fn-card-body .arabic-text,
.fn-card-body .arabic-ref-title,
[lang="ar"],
:lang(ar) {
  font-style: normal !important;
  transform: none !important;
  font-family: 'Amiri', 'Traditional Arabic', serif !important;
}


/* ==========================================================================
   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;
}



/* Enhanced Summary Section */
.summary-container h3, 
.summary-container h4 {
  color: var(--gold-light);
  margin: 1.4rem 0 0.6rem 0;
}

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

.summary-container li {
  margin-bottom: 0.6rem;
  line-height: 1.75;
}

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

/* 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 {
  display: block;
  font-family: 'Amiri', serif;
  font-size: 1.55rem;
  line-height: 1.9;
  color: var(--gold-light);
  direction: rtl;
  margin: 0.6rem 0;
  padding: 8px 16px;
  background: rgba(212, 175, 55, 0.08);
  border-right: 3px solid var(--gold-primary);
  border-radius: var(--radius-sm);
}

.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 seperti 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; /* Melengkung bulat kemas */
  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; /* Bentuk melengkung elegan seperti nota kaki */
  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; /* Sudut melengkung anggun */
  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; /* Melengkung */
  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; /* Bentuk bujur melengkung */
  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; /* Lengkung sempurna seperti butang nota kaki */
  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;
}

/* 6. Chapter In-Text Hikmah Strip (Preview in Layer 1 & 2) */
.chapter-hikmah-box {
  margin: 2.5rem 0 1.5rem 0;
  padding: 1.6rem;
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.12) 0%, rgba(6, 78, 59, 0.25) 100%);
  border: 1px solid rgba(212, 175, 55, 0.4);
  border-radius: 20px; /* Lengkung lembut kemas */
  position: relative;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.18);
}

.chapter-hikmah-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--gold-light);
  margin-bottom: 0.8rem;
}

/* 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;
  }
}

/* ================= SUBTOPIC INTIPATI RINGKASAN STYLES ================= */
.reader-subheading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.sub-heading-content {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.btn-sub-summary-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(212, 175, 55, 0.45);
  color: var(--gold-light);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.btn-sub-summary-toggle:hover {
  background: rgba(212, 175, 55, 0.25);
  border-color: var(--gold-primary);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(212, 175, 55, 0.35);
}

.sub-summary-box {
  margin: 1rem 0 1.5rem 0;
  background: linear-gradient(135deg, rgba(6, 21, 18, 0.85) 0%, rgba(12, 36, 31, 0.85) 100%);
  border: 1px solid rgba(212, 175, 55, 0.4);
  border-left: 5px solid var(--gold-primary);
  border-radius: 10px;
  padding: 1.2rem 1.4rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35), inset 0 0 20px rgba(16, 185, 129, 0.05);
  backdrop-filter: blur(10px);
  animation: fadeInDown 0.3s ease-out;
}

[data-theme="light"] .sub-summary-box {
  background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
  border-color: rgba(212, 175, 55, 0.5);
  border-left: 5px solid #b38600;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}

.sub-summary-box-inner {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sub-summary-box-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(212, 175, 55, 0.25);
  padding-bottom: 8px;
  color: var(--gold-light);
  font-size: 0.95rem;
}

.btn-close-subsum {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: var(--text-muted);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  transition: all 0.2s ease;
}

.btn-close-subsum:hover {
  background: rgba(239, 68, 68, 0.3);
  color: #fff;
}

.sub-summary-box-body {
  font-size: 0.92rem;
  line-height: 1.7;
  color: var(--text-main);
}

.subtopic-summary-card details summary::-webkit-details-marker {
  display: none;
}

.subtopic-summary-card[open] summary .sub-toggle-arrow {
  transform: rotate(180deg);
}

.sub-toggle-arrow {
  transition: transform 0.25s ease;
}

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



/* ==========================================================================
   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: #061512 !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(8, 31, 25, 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: #061512;
    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: #061512;
    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);
  }
}

/* ==========================================================================
   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;
}

