@font-face {
  font-family: 'Amiri Quran';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/AmiriQuran.woff2') format('woff2');
}

@font-face {
  font-family: 'Scheherazade New';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/ScheherazadeNew.woff2') format('woff2');
}

@font-face {
  font-family: 'Noto Naskh Arabic';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('../fonts/NotoNaskhArabic.woff2') format('woff2');
}

:root {
  color-scheme: light dark;
  --c1: #3b82f6;
  --c2: #15803d;
  --c3: #f59e0b;
  --ok: #10b981;
  --soft: #f1f5f9;
  --card-bg: #ffffff;
  --mushaf-bg: #fffdf7;
  --mushaf-border: #15803d;
  --ink: #0f172a;
  --muted: #64748b;
  --border: rgba(15, 23, 42, 0.1);
  --shadow: 0 10px 30px rgba(2, 6, 23, 0.1);
  --quran-fs: 1.55rem;
  --quran-fw: 400;
  --quran-font: 'Amiri Quran', 'Tajawal', serif;
}

[data-bs-theme="dark"] {
  --soft: #0f172a;
  --card-bg: #1e293b;
  --mushaf-bg: #141e2e;
  --mushaf-border: #22c55e;
  --ink: #e2e8f0;
  --muted: #94a3b8;
  --border: rgba(226, 232, 240, 0.12);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

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

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  padding: 0;
  max-width: 100vw;
  overflow-x: hidden;
  font-family: 'Tajawal', system-ui, -apple-system, sans-serif;
  background-color: var(--soft);
  color: var(--ink);
  min-height: 100vh;
}

.ic {
  width: 1.15em;
  height: 1.15em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: -0.17em;
  flex: none;
}

/* Hero */
.hero {
  background: linear-gradient(135deg, #0b1437 0%, #1e1b4b 55%, #312e81 100%);
  color: #ffffff;
  padding: 1.1rem 1rem 4.5rem;
  position: relative;
  overflow: hidden;
  text-align: center;
}

.hero-topbar {
  max-width: 960px;
  margin: 0 auto 0.9rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.hero-links,
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.btn-glass {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.38rem 0.7rem;
  font-size: 0.85rem;
  font-family: inherit;
  font-weight: 500;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 0.55rem;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.15s ease;
}

.btn-glass:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

.btn-glass.is-active {
  background: rgba(255, 255, 255, 0.28);
  border-color: #ffffff;
  font-weight: 700;
}

.hero-title h1 {
  font-size: clamp(1.35rem, 3.5vw, 2rem);
  font-weight: 700;
  margin: 0.2rem 0 0.3rem;
}

.hero-title p {
  margin: 0;
  opacity: 0.85;
  font-size: 0.92rem;
}

/* Main */
.main-wrap {
  max-width: 1180px;
  margin: -3.2rem auto 2.5rem;
  padding: 0 0.45rem;
  position: relative;
  z-index: 3;
}

.main-wrap.is-spread {
  max-width: 100%;
}

.panel {
  background: var(--card-bg);
  border-radius: 1.1rem;
  box-shadow: var(--shadow);
  padding: 1rem;
  margin-bottom: 1rem;
}

.toolbar {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.toolbar-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.toolbar-nav {
  padding-bottom: 0.45rem;
  border-bottom: 1px solid var(--border);
}

.btn-subtle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}

@media (max-width: 640px) {
  .toolbar-row {
    gap: 0.35rem;
  }

  .toolbar .surah-select {
    flex: 1 1 130px;
    min-width: 0;
  }

  .toolbar .font-select {
    flex: 1 1 120px;
    min-width: 0;
    font-size: 0.85rem;
    padding: 0.42rem 0.5rem;
  }

  .toolbar .btn-subtle .btn-lbl,
  .fs-bar .btn-subtle .btn-lbl,
  #fullscreenBtn .btn-lbl {
    display: none;
  }

  .toolbar .btn-subtle,
  #fullscreenBtn {
    padding: 0.44rem 0.58rem;
    min-width: 2.25rem;
  }
}

.surah-select,
.font-select,
.search-input {
  font-family: inherit;
  font-size: 0.95rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.65rem;
  border: 1px solid var(--border);
  background: var(--soft);
  color: var(--ink);
}

.surah-select {
  flex: 1 1 190px;
  font-weight: 700;
}

.font-select {
  flex: 0 1 175px;
  font-weight: 600;
}

.page-input {
  width: 5.2rem;
  font-family: 'Roboto Mono', monospace;
  font-size: 0.9rem;
  padding: 0.45rem 0.55rem;
  border-radius: 0.6rem;
  border: 1px solid var(--border);
  background: var(--soft);
  color: var(--ink);
  text-align: center;
}

.toolbar.index-search {
  flex-direction: row;
}

.search-input {
  flex: 1 1 auto;
  width: 100%;
}

.btn-subtle {
  border: 1px solid var(--border);
  background: var(--soft);
  color: var(--ink);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.48rem 0.8rem;
  border-radius: 0.6rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s ease;
}

.btn-subtle:hover:not(:disabled) {
  background: var(--border);
}

.btn-subtle:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-subtle.is-active,
.btn-subtle.is-active:hover:not(:disabled) {
  background: var(--c2);
  border-color: var(--c2);
  color: #ffffff;
}

.btn-subtle.is-active:hover:not(:disabled) {
  filter: brightness(1.08);
}

#autoScrollBtn.is-active,
#fsAutoScrollBtn.is-active {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: linear-gradient(135deg, #15803d, #0f766e);
  border-color: #16a34a;
  color: #ffffff;
  box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.28), 0 3px 10px rgba(21, 128, 61, 0.25);
}

#autoScrollBtn.is-active::before,
#fsAutoScrollBtn.is-active::before {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: #fde047;
  box-shadow: 0 0 6px #fde047;
  animation: autoScrollPulse 1.2s ease-in-out infinite;
}

@keyframes autoScrollPulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.45;
    transform: scale(0.75);
  }
}

@media (prefers-reduced-motion: reduce) {
  #autoScrollBtn.is-active::before,
  #fsAutoScrollBtn.is-active::before {
    animation: none;
  }
}

/* Surah Index Popup Modal */
.index-panel {
  margin-top: 0.85rem;
}

.index-modal[hidden] {
  display: none !important;
}

.index-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: rgba(2, 6, 23, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  box-sizing: border-box;
}

.index-modal-dialog {
  width: 100%;
  max-width: 820px;
  max-height: 85vh;
  max-height: 85dvh;
  background: var(--card-bg);
  color: var(--ink);
  border-radius: 1rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.index-modal-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
}

.index-modal-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
}

.index-modal-bd {
  padding: 0.85rem 1rem 1rem;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.index-search {
  margin-bottom: 0.75rem;
}

.surah-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 0.65rem;
}

.surah-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.75rem 0.85rem;
  border-radius: 0.85rem;
  border: 1px solid var(--border);
  background: var(--soft);
  color: var(--ink);
  font-family: inherit;
  text-align: start;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.surah-item:hover {
  border-color: var(--c2);
  transform: translateY(-1px);
}

.surah-item.is-current {
  border-color: var(--c2);
  background: rgba(21, 128, 61, 0.12);
  background: color-mix(in srgb, var(--c2) 12%, var(--soft));
}

.surah-num {
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 0.55rem;
  background: var(--c2);
  color: #ffffff;
  font-family: 'Roboto Mono', monospace;
  font-size: 0.82rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}

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

.surah-name {
  font-weight: 700;
  font-size: 1rem;
}

.surah-sub {
  font-size: 0.78rem;
  color: var(--muted);
}

/* Reader Card (Mushaf Tajweed Frame) */
.reader-card {
  background: var(--mushaf-bg);
  border-radius: 1rem;
  box-shadow: var(--shadow);
  border: 3px solid var(--mushaf-border);
  outline: 2px solid color-mix(in srgb, var(--mushaf-border) 35%, transparent);
  outline-offset: -6px;
  padding: 0.85rem 0.75rem;
}

.mushaf-page-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding-bottom: 0.55rem;
  margin-bottom: 0.9rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--c2);
}

[data-bs-theme="dark"] .mushaf-page-top {
  color: #4ade80;
}

.mushaf-page-num {
  text-align: center;
  margin-top: 1rem;
  font-family: 'Roboto Mono', monospace;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--c2);
}

[data-bs-theme="dark"] .mushaf-page-num {
  color: #4ade80;
}

.mushaf-spread {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 720px) and (orientation: landscape), (min-width: 900px) {
  .mushaf-spread {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }

  .mushaf-spread > .mushaf-page-pane:first-child {
    padding-inline-end: 1.25rem;
    border-inline-end: 2px dashed var(--border);
  }
}

.surah-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.4rem 0.75rem;
  padding: 0.42rem 0.9rem;
  margin-bottom: 0.85rem;
  border-radius: 0.65rem;
  background: linear-gradient(135deg, #166534 0%, #047857 55%, #065f46 100%);
  color: #ffffff;
  border: 1.5px solid #d97706;
  box-shadow: inset 0 0 0 2px rgba(254, 243, 199, 0.2), 0 3px 10px rgba(4, 120, 87, 0.16);
}

.surah-header h2 {
  font-family: 'Tajawal', system-ui, sans-serif;
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.3;
  color: #ffffff;
}

.surah-header .meta {
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.25;
  color: #fef3c7;
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(254, 243, 199, 0.25);
  padding: 0.16rem 0.6rem;
  border-radius: 999px;
}

.basmalah {
  font-family: var(--quran-font);
  text-align: center;
  font-size: calc(var(--quran-fs) * 1.04);
  font-weight: 400;
  line-height: 1.75;
  margin: 0 0 0.85rem;
  color: var(--ink);
}

/* Mushaf Inline Mode */
.mushaf-flow {
  font-family: var(--quran-font);
  font-size: var(--quran-fs);
  font-weight: var(--quran-fw);
  line-height: 2.4;
  text-align: justify;
  text-align-last: center;
  color: var(--ink);
}

.ayah-inline {
  cursor: pointer;
  border-radius: 0.35rem;
  transition: background-color 0.15s ease;
}

.ayah-inline:hover {
  background: rgba(21, 128, 61, 0.1);
  background: color-mix(in srgb, var(--c2) 10%, transparent);
}

.ayah-inline.is-bookmarked {
  background: rgba(245, 158, 11, 0.18);
  background: color-mix(in srgb, var(--c3) 18%, transparent);
}

.ayah-num {
  display: inline-block;
  margin: 0 0.28rem;
  font-size: 0.78em;
  font-weight: 700;
  color: var(--c2);
  white-space: nowrap;
}

[data-bs-theme="dark"] .ayah-num {
  color: #a5b4fc;
}

/* Verse-by-verse Mode */
.ayah-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.ayah-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.85rem;
  padding: 0.9rem 1rem;
  border-radius: 0.85rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  cursor: pointer;
}

.ayah-row.is-bookmarked {
  border-color: var(--c3);
  background: rgba(245, 158, 11, 0.1);
  background: color-mix(in srgb, var(--c3) 10%, var(--card-bg));
}

.ayah-row-text {
  font-family: var(--quran-font);
  font-size: var(--quran-fs);
  font-weight: var(--quran-fw);
  line-height: 2.3;
  flex: 1;
}

/* Tajweed Colors (Mushaf Al-Tajweed palette) */
.tj-madd6 { color: #b91c1c; }
.tj-madd4 { color: #e11d48; }
.tj-madd2 { color: #d97706; }
.tj-ghunnah { color: #15803d; }
.tj-tafkheem { color: #1d4ed8; }
.tj-qalqalah { color: #0284c7; }
.tj-silent { color: #94a3b8; }

[data-bs-theme="dark"] .tj-madd6 { color: #f87171; }
[data-bs-theme="dark"] .tj-madd4 { color: #fb7185; }
[data-bs-theme="dark"] .tj-madd2 { color: #fbbf24; }
[data-bs-theme="dark"] .tj-ghunnah { color: #4ade80; }
[data-bs-theme="dark"] .tj-tafkheem { color: #60a5fa; }
[data-bs-theme="dark"] .tj-qalqalah { color: #38bdf8; }
[data-bs-theme="dark"] .tj-silent { color: #64748b; }

.tajweed-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.55rem 1rem;
  margin-top: 1.25rem;
  padding: 0.65rem 0.75rem;
  border-radius: 0.65rem;
  background: var(--soft);
  border: 1px solid var(--border);
  font-size: 0.78rem;
  color: var(--ink);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.legend-dot {
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 999px;
  display: inline-block;
  background: currentColor;
}

.ayah-row-badge {
  min-width: 2.2rem;
  height: 2.2rem;
  border-radius: 999px;
  background: var(--soft);
  border: 1px solid var(--border);
  color: var(--c2);
  font-weight: 700;
  font-size: 0.88rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}

.reader-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.status-msg {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--muted);
}

.site-footer {
  text-align: center;
  padding: 1rem 1rem 2rem;
  font-size: 0.85rem;
  color: var(--muted);
}

@media (max-width: 576px) {
  .reader-card {
    padding: 1rem 0.85rem;
  }

  .reader-nav .btn-subtle {
    flex: 1 1 auto;
    text-align: center;
    padding: 0.45rem 0.5rem;
    font-size: 0.8rem;
  }
}

/* Fullscreen No-Scroll Mode */
.fs-bar {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  padding-top: 0.4rem;
  margin-top: 0.4rem;
  border-top: 1px solid var(--border);
  flex: none;
  min-width: 0;
  overflow: hidden;
}

.fs-bar .hero-actions {
  flex-wrap: nowrap;
  gap: 0.3rem;
  flex-shrink: 0;
}

.fs-bar .btn-subtle,
.fs-bar .font-select {
  white-space: nowrap;
  flex-shrink: 0;
}

.fs-info {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

@media (max-width: 640px) {
  .fs-bar {
    gap: 0.25rem;
  }

  .fs-bar .hero-actions {
    gap: 0.25rem;
  }

  .fs-bar .btn-subtle,
  .fs-bar .font-select {
    padding: 0.25rem 0.48rem;
    font-size: 0.72rem;
    min-height: 0;
  }

  .fs-info {
    font-size: 0.72rem;
  }
}

html.is-fullscreen,
html.is-fullscreen body {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

html.is-fullscreen .hero,
html.is-fullscreen .panel,
html.is-fullscreen .site-footer,
html.is-fullscreen #tajweedLegend,
html.is-fullscreen #readerNav {
  display: none !important;
}

html.is-fullscreen .main-wrap,
html.is-fullscreen .main-wrap.is-spread {
  max-width: 100%;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  margin: 0;
  padding: 0.15rem;
  display: flex;
  flex-direction: column;
}

html.is-fullscreen .reader-card {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 0.35rem 0.45rem;
  border-radius: 0.55rem;
}

html.is-fullscreen #readerContent {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

html.is-fullscreen #readerContent:not(.is-book-carousel) {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

html.is-fullscreen .mushaf-spread {
  height: 100%;
}

html.is-fullscreen .mushaf-page-pane {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 0.4rem;
  height: 100%;
  overflow: hidden;
}

html.is-fullscreen .mushaf-flow {
  line-height: 2.1;
  margin: auto 0;
}

html.is-fullscreen .mushaf-page-top {
  margin-bottom: 0.45rem;
  padding-bottom: 0.3rem;
}

html.is-fullscreen .mushaf-page-num {
  display: none;
}

/* Swipe & 3-Page Book Carousel */
#readerContent {
  will-change: transform, opacity;
}

#readerContent.is-book-carousel {
  direction: ltr;
  overflow: hidden;
  width: 100%;
}

.book-track {
  display: flex;
  direction: ltr;
  width: 300%;
  align-items: flex-start;
  will-change: transform;
  transform: translate3d(-33.333333%, 0, 0);
}

html.is-fullscreen .book-track {
  height: 100%;
  align-items: stretch;
}

.book-track.is-animating {
  transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1);
}

.book-slot {
  width: 33.333333%;
  flex: 0 0 33.333333%;
  direction: rtl;
  box-sizing: border-box;
  padding: 0;
  position: relative;
}

.book-slot::before,
.book-slot::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 10px;
  pointer-events: none;
  opacity: 0;
  z-index: 4;
  background: var(--bg);
  transition: opacity 0.12s ease;
}

.book-slot::before {
  left: -5px;
  box-shadow: inset -1px 0 0 var(--border);
}

.book-slot::after {
  right: -5px;
  box-shadow: inset 1px 0 0 var(--border);
}

#readerContent.is-swiping .book-slot::before,
#readerContent.is-swiping .book-slot::after,
.book-track.is-animating .book-slot::before,
.book-track.is-animating .book-slot::after {
  opacity: 1;
}

html.is-fullscreen .book-slot {
  height: 100%;
  overflow: hidden;
}

#readerContent.is-swiping {
  transition: none;
}

#readerContent.is-swipe-reset {
  transition: transform 0.2s ease, opacity 0.2s ease;
}

@keyframes pageTurnNext {
  from {
    opacity: 0.75;
    transform: translate3d(-24px, 0, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes pageTurnPrev {
  from {
    opacity: 0.75;
    transform: translate3d(24px, 0, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

#readerContent.is-turn-next {
  animation: pageTurnNext 0.16s cubic-bezier(0.22, 1, 0.36, 1) both;
}

#readerContent.is-turn-prev {
  animation: pageTurnPrev 0.16s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@media (prefers-reduced-motion: reduce) {
  #readerContent.is-turn-next,
  #readerContent.is-turn-prev {
    animation: none;
  }
  .book-track.is-animating {
    transition: none;
  }
}

.ayah-search-meta {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 0.65rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
}

.ayah-search-results {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  max-height: 400px;
  overflow-y: auto;
}

.ayah-result-item {
  display: block;
  width: 100%;
  padding: 0.7rem 0.6rem;
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0.45rem;
  background: transparent;
  color: var(--ink);
  font-family: inherit;
  text-align: start;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.ayah-result-item:last-child {
  border-bottom: 0;
}

.ayah-result-item:hover {
  background: var(--soft);
}

.ayah-result-crumb {
  font-size: 0.78rem;
  color: #15803d;
  margin-bottom: 0.15rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

[data-bs-theme="dark"] .ayah-result-crumb {
  color: #4ade80;
}

.ayah-result-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #1a0dab;
  margin-bottom: 0.2rem;
  line-height: 1.4;
}

[data-bs-theme="dark"] .ayah-result-title {
  color: #8ab4f8;
}

.ayah-result-item:hover .ayah-result-title {
  text-decoration: underline;
}

.ayah-result-text {
  font-family: var(--quran-font);
  font-size: 1.15rem;
  line-height: 1.85;
  color: var(--ink);
  opacity: 0.9;
}

.ayah-result-text mark,
mark.search-word-hit {
  background: rgba(250, 204, 21, 0.42);
  color: inherit;
  border-radius: 0.22rem;
  padding: 0 0.12rem;
}

.is-search-hit {
  background: rgba(250, 204, 21, 0.14);
  border-radius: 0.35rem;
}

/* Compact headers & bottom bar on mobile landscape */
@media (orientation: landscape) and (max-height: 640px) {
  .mushaf-page-top {
    font-size: 0.72rem;
    padding-bottom: 0.15rem;
    margin-bottom: 0.2rem;
  }

  .surah-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.18rem 0.65rem;
    margin-bottom: 0.22rem;
    border-radius: 0.45rem;
    border-width: 1px;
  }

  .surah-header h2 {
    font-family: 'Tajawal', system-ui, sans-serif;
    font-size: 0.95rem;
    line-height: 1.25;
    margin: 0;
  }

  .surah-header .meta {
    font-size: 0.7rem;
    line-height: 1.2;
    white-space: nowrap;
  }

  .basmalah {
    margin: 0 0 0.15rem;
    line-height: 1.35;
  }

  html.is-fullscreen .main-wrap,
  html.is-fullscreen .main-wrap.is-spread {
    padding: 0.2rem;
  }

  html.is-fullscreen .reader-card {
    padding: 0.28rem 0.55rem;
  }

  html.is-fullscreen .mushaf-spread {
    gap: 0.85rem;
  }

  html.is-fullscreen .mushaf-spread > .mushaf-page-pane:first-child {
    padding-inline-end: 0.55rem;
  }

  html.is-fullscreen .mushaf-page-pane {
    gap: 0.12rem;
  }

  html.is-fullscreen .mushaf-page-top {
    margin-bottom: 0.12rem;
    padding-bottom: 0.1rem;
  }

  html.is-fullscreen .fs-bar {
    padding-top: 0.18rem;
    margin-top: 0.15rem;
  }

  html.is-fullscreen .fs-bar .btn-subtle,
  html.is-fullscreen .fs-bar .font-select {
    padding: 0.16rem 0.5rem;
    font-size: 0.72rem;
    min-height: 0;
    line-height: 1.25;
  }

  html.is-fullscreen .fs-info {
    font-size: 0.72rem;
  }
}
