@font-face {
  font-family: 'Plus Jakarta Sans';
  src: url('../assets/fonts/plus_jakarta_sans.ttf') format('truetype');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Noto Sans Arabic';
  src: url('../assets/fonts/noto_sans_arabic.ttf') format('truetype');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Noto Sans Bengali';
  src: url('../assets/fonts/noto_sans_bengali.ttf') format('truetype');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Amiri';
  src: url('../assets/fonts/amiri.ttf') format('truetype');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg-top: #091B14;
  --bg-mid: #07140F;
  --bg-bottom: #050F0B;
  --surface: #0B1F17;
  --surface-card: #102A20;
  --surface-elevated: #153629;
  --surface-lowest: #06130E;
  --primary: #D6B472;
  --primary-soft: #E6CC98;
  --on-primary: #171207;
  --secondary: #3E8F6E;
  --secondary-bright: #56B38C;
  --text: #F3EFE6;
  --text-variant: #A0B8AC;
  --text-muted: #6F8A7D;
  --outline: #295644;
  --outline-variant: #1F4737;
  --error: #E58A7E;
  --glass-bg: rgba(10, 30, 22, 0.64);
  --glass-bg-hi: rgba(17, 46, 35, 0.82);
  --glass-border: rgba(255, 255, 255, 0.11);
  --glass-border-hi: rgba(214, 180, 114, 0.44);
  --glass-sheen: rgba(255, 255, 255, 0.045);
  --nav-bg: rgba(9, 25, 19, 0.88);
  --sheet-bg: #0D231A;
  --rail-width: 88px;
  --bottom-nav-height: 68px;
}

:root[data-theme="light"] {
  --bg-top: #F6F4EE;
  --bg-mid: #F0F2EC;
  --bg-bottom: #EDF1EC;
  --surface: #ECECE4;
  --surface-card: #E2E8E2;
  --surface-elevated: #D7E0D7;
  --surface-lowest: #FFFFFF;
  --primary: #134634;
  --primary-soft: #265D49;
  --on-primary: #F6F4EE;
  --secondary: #916C24;
  --secondary-bright: #7A591A;
  --text: #0E1F18;
  --text-variant: #4B6358;
  --text-muted: #5F776C;
  --outline: #9FB3A4;
  --outline-variant: #C5D2C7;
  --error: #B33A2E;
  --glass-bg: rgba(242, 245, 240, 0.82);
  --glass-bg-hi: rgba(225, 234, 226, 0.92);
  --glass-border: rgba(19, 70, 52, 0.14);
  --glass-border-hi: rgba(19, 70, 52, 0.45);
  --glass-sheen: rgba(255, 255, 255, 0.42);
  --nav-bg: rgba(240, 242, 236, 0.92);
  --sheet-bg: #F3F4EE;
}

@media (prefers-color-scheme: light) {
  :root[data-theme="system"] {
    --bg-top: #F6F4EE;
    --bg-mid: #F0F2EC;
    --bg-bottom: #EDF1EC;
    --surface: #ECECE4;
    --surface-card: #E2E8E2;
    --surface-elevated: #D7E0D7;
    --surface-lowest: #FFFFFF;
    --primary: #134634;
    --primary-soft: #265D49;
    --on-primary: #F6F4EE;
    --secondary: #916C24;
    --secondary-bright: #7A591A;
    --text: #0E1F18;
    --text-variant: #4B6358;
    --text-muted: #5F776C;
    --outline: #9FB3A4;
    --outline-variant: #C5D2C7;
    --error: #B33A2E;
    --glass-bg: rgba(242, 245, 240, 0.82);
    --glass-bg-hi: rgba(225, 234, 226, 0.92);
    --glass-border: rgba(19, 70, 52, 0.14);
    --glass-border-hi: rgba(19, 70, 52, 0.45);
    --glass-sheen: rgba(255, 255, 255, 0.42);
    --nav-bg: rgba(240, 242, 236, 0.92);
    --sheet-bg: #F3F4EE;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  color: var(--text);
  background: var(--bg-bottom);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

body.font-en {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
}

body.font-ur {
  font-family: 'Noto Sans Arabic', 'Plus Jakarta Sans', system-ui, sans-serif;
}

body.font-bn {
  font-family: 'Noto Sans Bengali', 'Plus Jakarta Sans', system-ui, sans-serif;
}

.font-arabic {
  font-family: 'Amiri', 'Noto Sans Arabic', serif;
  line-height: 1.75;
}

.font-en-ui {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
}

.font-ur-ui {
  font-family: 'Noto Sans Arabic', system-ui, sans-serif;
}

.font-bn-ui {
  font-family: 'Noto Sans Bengali', system-ui, sans-serif;
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: none;
}

.icon {
  width: 22px;
  height: 22px;
  display: block;
  flex-shrink: 0;
}

.icon-sm {
  width: 16px;
  height: 16px;
}

.icon-lg {
  width: 28px;
  height: 28px;
}

/* Atmospheric Background */
.atmosphere-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, var(--bg-top) 0%, var(--bg-mid) 52%, var(--bg-bottom) 100%);
  pointer-events: none;
  overflow: hidden;
}

.atmosphere-glow-emerald {
  position: absolute;
  inset-inline-end: -14%;
  top: -12%;
  width: 65vw;
  height: 65vw;
  max-width: 640px;
  max-height: 640px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(28, 88, 65, 0.24) 0%, transparent 70%);
}

.atmosphere-glow-gold {
  position: absolute;
  inset-inline-start: -16%;
  top: 18%;
  width: 52vw;
  height: 52vw;
  max-width: 500px;
  max-height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(214, 180, 114, 0.1) 0%, transparent 70%);
}

:root[data-theme="light"] .atmosphere-glow-emerald,
:root[data-theme="light"] .atmosphere-glow-gold {
  opacity: 0.4;
}

/* Boot Splash */
.boot-splash {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.boot-logo {
  width: 72px;
  height: 72px;
  border-radius: 50%;
}

.boot-arabic {
  font-family: 'Amiri', serif;
  font-size: 28px;
  color: var(--primary);
}

/* Glass Surface */
.glass {
  background: linear-gradient(180deg, var(--glass-sheen) 0%, transparent 55%), var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-radius: 20px;
}

.glass-hi {
  background: linear-gradient(180deg, var(--glass-sheen) 0%, transparent 55%), var(--glass-bg-hi);
  border: 1px solid var(--glass-border-hi);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.22);
}

.glass-clickable {
  transition: transform 0.14s ease, border-color 0.18s ease, background-color 0.18s ease;
}

.glass-clickable:hover {
  border-color: var(--glass-border-hi);
}

.glass-clickable:active {
  transform: scale(0.99);
}

/* Offline Banner */
.offline-pill-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 8px auto 0;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(214, 180, 114, 0.14);
  border: 1px solid rgba(214, 180, 114, 0.4);
  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
  width: fit-content;
}

/* Onboarding Screen */
.onboarding-page {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 20px;
}

.onboarding-container {
  width: 100%;
  max-width: 520px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.onboarding-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
}

.onboarding-logo-ring {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: rgba(214, 180, 114, 0.12);
  display: grid;
  place-items: center;
}

.onboarding-logo-ring img {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
}

.onboarding-arabic-title {
  font-family: 'Amiri', serif;
  font-size: 32px;
  color: var(--primary);
  line-height: 1.2;
}

.onboarding-title {
  margin: 0;
  font-size: 27px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.onboarding-choose {
  margin: 0;
  font-size: 16px;
  font-weight: 500;
  color: var(--primary);
}

.onboarding-sub {
  margin: 0;
  font-size: 14px;
  color: var(--text-variant);
  max-width: 420px;
}

.lang-list {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.lang-card {
  width: 100%;
  min-height: 76px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 16px;
  text-align: start;
}

.lang-flag-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--surface-elevated);
  display: grid;
  place-items: center;
  font-size: 24px;
  flex-shrink: 0;
}

.lang-card-text {
  flex: 1;
  min-width: 0;
}

.lang-card-title {
  font-size: 18px;
  font-weight: 600;
}

.lang-card-sub {
  font-size: 13px;
  color: var(--text-variant);
}

.radio-ring {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--outline);
  flex-shrink: 0;
}

.onboarding-footer {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
}

.onboarding-audio-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-variant);
  text-align: center;
}

.onboarding-audio-note .icon {
  color: var(--primary);
  width: 16px;
  height: 16px;
}

/* Primary Buttons */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 22px;
  border-radius: 16px;
  background: var(--primary);
  color: var(--on-primary);
  font-weight: 600;
  font-size: 15px;
  transition: opacity 0.15s ease, transform 0.12s ease;
}

.btn-primary:hover {
  opacity: 0.94;
}

.btn-primary:active {
  transform: scale(0.985);
}

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

.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 14px;
  border: 1px solid var(--outline);
  color: var(--text);
  font-weight: 500;
  font-size: 14px;
  background: transparent;
}

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

.btn-text {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  min-height: 40px;
  color: var(--primary);
  font-weight: 600;
  font-size: 13px;
}

.icon-btn {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-variant);
  transition: background-color 0.15s ease, color 0.15s ease;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

:root[data-theme="light"] .icon-btn:hover {
  background: rgba(19, 70, 52, 0.08);
}

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

/* Main Shell: Mobile Bottom Nav + Desktop Navigation Rail */
.app-shell {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.nav-rail {
  display: none;
}

.shell-main {
  flex: 1;
  width: 100%;
  padding-bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom, 0px) + 18px);
}

.shell-main.has-mini-player {
  padding-bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom, 0px) + 104px);
}

.content-column {
  width: 100%;
  max-width: 840px;
  margin: 0 auto;
  padding: 20px 18px 24px;
}

/* Bottom Dock (Mini Player + Mobile Bottom Nav) */
.bottom-dock {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 30;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.mini-player-wrap {
  width: 100%;
  max-width: 720px;
  padding: 0 14px 10px;
  pointer-events: auto;
}

.mini-player {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 20px;
}

.mini-artwork {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  object-fit: cover;
  flex-shrink: 0;
}

.mini-meta {
  flex: 1;
  min-width: 0;
  text-align: start;
}

.mini-title {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini-sub {
  font-size: 12px;
  color: var(--text-variant);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini-play-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(214, 180, 114, 0.16);
  color: var(--primary);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

:root[data-theme="light"] .mini-play-btn {
  background: rgba(19, 70, 52, 0.14);
}

.bottom-nav {
  width: 100%;
  height: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--nav-bg);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: space-around;
  pointer-events: auto;
}

.bottom-nav-item {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--text-variant);
  font-size: 11px;
  font-weight: 500;
}

.bottom-nav-item.active {
  color: var(--primary);
  font-weight: 600;
}

.bottom-nav-pill {
  padding: 4px 14px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bottom-nav-item.active .bottom-nav-pill {
  background: rgba(214, 180, 114, 0.16);
}

:root[data-theme="light"] .bottom-nav-item.active .bottom-nav-pill {
  background: rgba(19, 70, 52, 0.14);
}

/* Desktop / Tablet Navigation Rail */
@media (min-width: 768px) {
  .app-shell {
    flex-direction: row;
  }

  .nav-rail {
    position: fixed;
    top: 0;
    bottom: 0;
    inset-inline-start: 0;
    width: var(--rail-width);
    z-index: 35;
    background: var(--nav-bg);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-inline-end: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 8px;
    gap: 10px;
  }

  .rail-brand {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    margin-bottom: 16px;
    overflow: hidden;
  }

  .rail-brand img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .rail-item {
    width: 100%;
    padding: 10px 4px;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-variant);
  }

  .rail-item.active {
    color: var(--primary);
    font-weight: 600;
    background: rgba(214, 180, 114, 0.15);
  }

  :root[data-theme="light"] .rail-item.active {
    background: rgba(19, 70, 52, 0.12);
  }

  .shell-main {
    margin-inline-start: var(--rail-width);
    padding-bottom: 36px;
  }

  .shell-main.has-mini-player {
    padding-bottom: 108px;
  }

  .bottom-dock {
    inset-inline-start: var(--rail-width);
    padding-bottom: 12px;
  }

  .bottom-nav {
    display: none;
  }
}

/* Home Screen */
.section-stack {
  display: flex;
  flex-direction: column;
  gap: 26px;
}

.home-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.home-brand-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.home-logo {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.home-title-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.home-title-row h1 {
  margin: 0;
  font-size: 26px;
  font-weight: 600;
  line-height: 1.2;
}

.home-title-arabic {
  font-family: 'Amiri', serif;
  font-size: 24px;
  color: var(--primary);
}

.home-greeting-sub {
  font-size: 13px;
  color: var(--text-variant);
  margin-top: 2px;
}

.ambient-circle-btn {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--text-variant);
  flex-shrink: 0;
}

.ambient-circle-btn.active {
  color: var(--primary);
}

/* Continue Listening Hero Card */
.hero-card {
  position: relative;
  border-radius: 24px;
  overflow: hidden;
  min-height: 184px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
  cursor: pointer;
}

.hero-bg-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.34;
  pointer-events: none;
}

.hero-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(8, 25, 19, 0.88) 0%, rgba(10, 34, 26, 0.65) 55%, rgba(6, 17, 13, 0.78) 100%);
  pointer-events: none;
}

.hero-top,
.hero-bottom {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.hero-eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.1px;
  color: #D6B472;
}

.hero-arabic {
  font-family: 'Amiri', serif;
  font-size: 25px;
  color: #D6B472;
}

.hero-surah-title {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  color: #F3EFE6;
}

.hero-surah-meta {
  font-size: 13px;
  color: #B3C7BD;
  margin-top: 3px;
}

.hero-play-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  min-height: 44px;
  border-radius: 14px;
  background: #D6B472;
  color: #171207;
  font-weight: 600;
  font-size: 13px;
  flex-shrink: 0;
}

/* Section Headers & Horizontal Rows */
.section-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.section-title {
  margin: 0;
  font-size: 19px;
  font-weight: 600;
}

.horizontal-scroll {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: thin;
}

.reciter-showcase-card {
  width: 164px;
  flex-shrink: 0;
  overflow: hidden;
  border-radius: 20px;
  cursor: pointer;
}

.reciter-card-media {
  position: relative;
  height: 112px;
}

.reciter-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.reciter-card-grad {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 35%, rgba(0, 0, 0, 0.65) 100%);
}

.reciter-card-play {
  position: absolute;
  inset-inline-end: 10px;
  bottom: 10px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--on-primary);
  display: grid;
  place-items: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.reciter-card-body {
  padding: 12px 14px;
}

.reciter-card-name {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.reciter-card-style {
  font-size: 12px;
  color: var(--text-variant);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.history-card {
  width: 176px;
  flex-shrink: 0;
  padding: 14px;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: start;
}

.history-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Octagon Surah Emblem */
.surah-emblem {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  position: relative;
  font-size: 12px;
  font-weight: 600;
}

.surah-emblem::before {
  content: '';
  position: absolute;
  inset: 2px;
  background: var(--surface-elevated);
  border: 1.5px solid var(--outline);
  border-radius: 10px;
  transform: rotate(22.5deg);
  z-index: 0;
}

.surah-emblem.active::before {
  background: rgba(214, 180, 114, 0.18);
  border-color: var(--primary);
}

.surah-emblem span {
  position: relative;
  z-index: 1;
}

.surah-emblem.active span {
  color: var(--primary);
}

.surah-emblem-sm {
  width: 34px;
  height: 34px;
  font-size: 11px;
}

.explore-entry-card {
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: start;
  width: 100%;
}

.explore-entry-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(214, 180, 114, 0.16);
  color: var(--primary);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

:root[data-theme="light"] .explore-entry-icon {
  background: rgba(19, 70, 52, 0.12);
}

/* Explore, Library & List Screens */
.page-title {
  margin: 0 0 14px;
  font-size: 26px;
  font-weight: 600;
}

.segmented-control {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--surface-card);
  border: 1px solid var(--outline-variant);
  border-radius: 14px;
  padding: 4px;
  gap: 4px;
}

.segmented-btn {
  min-height: 40px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-variant);
  transition: background-color 0.15s ease, color 0.15s ease;
}

.segmented-btn.active {
  background: rgba(214, 180, 114, 0.2);
  color: var(--primary);
}

:root[data-theme="light"] .segmented-btn.active {
  background: rgba(19, 70, 52, 0.15);
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 14px;
  min-height: 48px;
  border-radius: 16px;
  background: var(--surface-card);
  border: 1px solid var(--outline-variant);
}

.search-box:focus-within {
  border-color: var(--primary);
}

.search-box input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-size: 14px;
  min-width: 0;
}

.search-box input::placeholder {
  color: var(--text-muted);
}

.chip-bar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chip-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  flex: 1;
  padding: 2px 0;
}

.chip {
  min-height: 36px;
  padding: 6px 14px;
  border-radius: 10px;
  border: 1px solid var(--outline-variant);
  background: var(--surface-card);
  color: var(--text-variant);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}

.chip.active {
  background: rgba(214, 180, 114, 0.2);
  border-color: var(--primary);
  color: var(--primary);
  font-weight: 600;
}

:root[data-theme="light"] .chip.active {
  background: rgba(19, 70, 52, 0.14);
}

.sort-dropdown-wrap {
  position: relative;
}

.sort-menu {
  position: absolute;
  top: 46px;
  inset-inline-end: 0;
  min-width: 190px;
  background: var(--sheet-bg);
  border: 1px solid var(--glass-border-hi);
  border-radius: 14px;
  padding: 6px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  z-index: 25;
}

.sort-menu-item {
  width: 100%;
  text-align: start;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
}

.sort-menu-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.sort-menu-item.active {
  color: var(--primary);
  font-weight: 600;
}

.list-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.surah-row {
  padding: 12px 14px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.surah-row-main {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: start;
  cursor: pointer;
}

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

.surah-row-title {
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.surah-row-title.active {
  color: var(--primary);
}

.surah-row-sub {
  font-size: 12px;
  color: var(--text-variant);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.surah-row-arabic {
  font-family: 'Amiri', serif;
  font-size: 20px;
  color: var(--primary);
  flex-shrink: 0;
}

.surah-row-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.reciter-row {
  padding: 12px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.reciter-row-main {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: start;
  cursor: pointer;
}

.reciter-row-avatar {
  width: 60px;
  height: 60px;
  border-radius: 14px;
  object-fit: cover;
  flex-shrink: 0;
}

/* Surah Detail / Reading Screen & Reciter Detail */
.top-app-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.top-app-bar-title {
  flex: 1;
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.surah-banner {
  padding: 22px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
}

.surah-banner-arabic {
  font-family: 'Amiri', serif;
  font-size: 36px;
  color: var(--primary);
}

.surah-banner-actions {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.surah-banner-actions .btn-primary {
  flex: 1;
}

.ayah-card {
  padding: 16px;
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ayah-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ayah-badge {
  padding: 4px 10px;
  border-radius: 8px;
  background: rgba(214, 180, 114, 0.16);
  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
}

:root[data-theme="light"] .ayah-badge {
  background: rgba(19, 70, 52, 0.12);
}

.ayah-arabic-text {
  font-family: 'Amiri', serif;
  direction: rtl;
  text-align: right;
  line-height: 1.85;
  color: var(--text);
}

.ayah-translation-text {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-variant);
}

.ayah-translation-rtl {
  direction: rtl;
  text-align: right;
  font-family: 'Noto Sans Arabic', sans-serif;
}

/* Reciter Detail Banner */
.reciter-hero {
  overflow: hidden;
  border-radius: 22px;
}

.reciter-hero-top {
  position: relative;
  height: 170px;
}

.reciter-hero-top img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.reciter-hero-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 10%, rgba(6, 17, 13, 0.9) 100%);
}

.reciter-hero-overlay {
  position: absolute;
  bottom: 14px;
  inset-inline: 16px;
  color: #F3EFE6;
}

.reciter-hero-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.notice-box {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(214, 180, 114, 0.1);
  border: 1px solid rgba(214, 180, 114, 0.35);
  font-size: 13px;
  color: var(--text-variant);
}

/* Empty States */
.empty-state {
  padding: 36px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
}

.empty-state img {
  width: 210px;
  height: 156px;
  border-radius: 20px;
  object-fit: cover;
}

.empty-state h3 {
  margin: 4px 0 0;
  font-size: 19px;
}

.empty-state p {
  margin: 0;
  font-size: 13px;
  color: var(--text-variant);
  max-width: 340px;
}

/* Settings */
.settings-group-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  margin: 0 4px 8px;
}

.settings-card {
  border-radius: 20px;
  overflow: hidden;
}

.settings-row {
  width: 100%;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: start;
}

.settings-row-clickable {
  cursor: pointer;
}

.settings-row-clickable:hover {
  background: rgba(255, 255, 255, 0.04);
}

.settings-row-icon {
  color: var(--primary);
  flex-shrink: 0;
}

.settings-row-text {
  flex: 1;
  min-width: 0;
}

.settings-row-title {
  font-size: 14px;
  font-weight: 600;
}

.settings-row-sub {
  font-size: 12px;
  color: var(--text-variant);
  margin-top: 2px;
}

.settings-divider {
  height: 1px;
  margin-inline: 16px;
  background: var(--outline-variant);
  opacity: 0.55;
}

.bismillah-preview {
  margin-top: 10px;
  padding: 12px;
  border-radius: 14px;
  background: var(--surface-lowest);
  text-align: center;
  direction: rtl;
  font-family: 'Amiri', serif;
  color: var(--primary);
}

/* Range & Toggle Switch */
input[type="range"].sukoon-slider {
  width: 100%;
  accent-color: var(--primary);
  cursor: pointer;
  direction: ltr;
}

.switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 28px;
  flex-shrink: 0;
}

.switch input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}

.switch-track {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: var(--outline);
  transition: background-color 0.18s ease;
}

.switch-track::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #F3EFE6;
  transition: transform 0.18s ease;
}

.switch input:checked + .switch-track {
  background: var(--primary);
}

.switch input:checked + .switch-track::after {
  transform: translateX(20px);
  background: var(--on-primary);
}

/* Full-Screen Now Playing Sanctuary */
.now-playing-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: #040E0A;
  color: #F3EFE6;
  display: flex;
  justify-content: center;
  overflow: hidden;
}

.np-video-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.92;
  pointer-events: none;
}

.np-fallback-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.22;
  pointer-events: none;
}

.np-scrim {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 44%, rgba(3, 16, 11, 0.3) 0%, transparent 60%),
    linear-gradient(180deg, rgba(3, 17, 12, 0.78) 0%, rgba(4, 21, 15, 0.48) 22%, rgba(4, 20, 14, 0.44) 50%, rgba(3, 16, 11, 0.72) 76%, rgba(2, 9, 6, 0.94) 100%);
  pointer-events: none;
}

.np-foreground {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 640px;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 16px calc(12px + env(safe-area-inset-bottom, 0px));
}

.np-top-bar {
  display: flex;
  align-items: center;
  gap: 4px;
}

.np-top-bar .icon-btn {
  color: #F3EFE6;
}

.np-title-center {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.np-title-en {
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.np-title-ar {
  font-family: 'Amiri', serif;
  font-size: 20px;
  color: #D6B472;
}

.np-reciter-pill-row {
  display: flex;
  justify-content: center;
  padding: 4px 0 8px;
}

.np-reciter-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(10, 33, 24, 0.72);
  border: 1px solid rgba(214, 180, 114, 0.36);
  color: #F3EFE6;
  font-size: 13px;
  font-weight: 600;
}

.np-reciter-pill .icon {
  color: #D6B472;
  width: 16px;
  height: 16px;
}

.np-status-strip {
  display: flex;
  justify-content: center;
  margin-bottom: 6px;
}

.np-error-pill {
  padding: 8px 14px;
  border-radius: 12px;
  background: rgba(229, 138, 126, 0.25);
  border: 1px solid #E58A7E;
  color: #FAD8D4;
  font-size: 12px;
  text-align: center;
}

.np-sleep-pill {
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(17, 46, 35, 0.8);
  border: 1px solid rgba(214, 180, 114, 0.45);
  color: #D6B472;
  font-size: 12px;
  font-weight: 600;
}

.np-lyrics-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 32vh 4px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  scroll-behavior: smooth;
  scrollbar-width: none;
}

.np-lyrics-stage::-webkit-scrollbar {
  display: none;
}

.lyrics-ayah {
  width: 100%;
  text-align: center;
  border-radius: 18px;
  padding: 12px 16px;
  background: rgba(4, 17, 12, 0.28);
  opacity: 0.4;
  transition: opacity 0.25s ease, background-color 0.25s ease, border-color 0.25s ease;
  cursor: pointer;
}

.lyrics-ayah.near {
  opacity: 0.68;
}

.lyrics-ayah.current {
  opacity: 1;
  padding: 20px;
  border-radius: 22px;
  background: rgba(7, 26, 19, 0.78);
  border: 1px solid rgba(214, 180, 114, 0.36);
}

.lyrics-ayah-num {
  font-size: 11px;
  font-weight: 600;
  color: #B3C7BD;
  margin-bottom: 8px;
}

.lyrics-ayah.current .lyrics-ayah-num {
  color: #D6B472;
}

.lyrics-ayah-ar {
  font-family: 'Amiri', serif;
  direction: rtl;
  color: #DCE7E1;
  line-height: 1.78;
  text-shadow: 0 2px 6px rgba(2, 9, 6, 0.8);
}

.lyrics-ayah.current .lyrics-ayah-ar {
  color: #FBF8F1;
}

.lyrics-ayah-trans {
  margin-top: 14px;
  font-size: 15px;
  line-height: 1.55;
  color: #D8E4DE;
  text-shadow: 0 2px 6px rgba(2, 9, 6, 0.8);
}

.relocate-fab {
  position: sticky;
  bottom: 12px;
  align-self: center;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 999px;
  background: rgba(17, 46, 35, 0.92);
  border: 1px solid rgba(214, 180, 114, 0.55);
  color: #D6B472;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.45);
}

/* Controls Deck (always dark-glass over video) */
.np-controls-deck {
  margin-top: 8px;
  padding: 14px 18px;
  border-radius: 26px;
  background: rgba(10, 30, 22, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.seek-section {
  direction: ltr;
}

.seek-section input[type="range"] {
  width: 100%;
  accent-color: #D6B472;
  cursor: pointer;
}

.seek-times {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #C2D4CB;
  margin-top: 2px;
}

.seek-ayah-label {
  color: #D6B472;
  font-weight: 600;
}

.transport-row {
  direction: ltr;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.transport-row .icon-btn {
  color: #F3EFE6;
}

.transport-play-btn {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: #D6B472;
  color: #171207;
  display: grid;
  place-items: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.utility-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.utility-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.11);
  color: #D6B472;
  font-size: 12px;
  font-weight: 600;
  max-width: 48%;
}

.utility-pill span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Modals / Bottom Sheets */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(2, 8, 5, 0.66);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

@media (min-width: 680px) {
  .sheet-backdrop {
    align-items: center;
    padding: 24px;
  }
}

.sheet-panel {
  width: 100%;
  max-width: 540px;
  max-height: 86dvh;
  overflow-y: auto;
  background: var(--sheet-bg);
  border: 1px solid var(--glass-border-hi);
  border-radius: 24px 24px 0 0;
  padding: 20px 20px calc(24px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
}

@media (min-width: 680px) {
  .sheet-panel {
    border-radius: 24px;
  }
}

.sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.sheet-title {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
}

.sheet-subtitle {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--text-variant);
}

.sheet-option-card {
  width: 100%;
  padding: 13px 15px;
  border-radius: 16px;
  background: var(--surface-card);
  border: 1px solid var(--outline-variant);
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: start;
}

.sheet-option-card.selected {
  background: rgba(214, 180, 114, 0.14);
  border-color: var(--primary);
}

:root[data-theme="light"] .sheet-option-card.selected {
  background: rgba(19, 70, 52, 0.1);
}

.video-preview-box {
  width: 100%;
  height: 180px;
  border-radius: 14px;
  overflow: hidden;
  background: #040E0A;
}

.video-preview-box video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.progress-bar-track {
  width: 100%;
  height: 5px;
  border-radius: 4px;
  background: var(--outline-variant);
  overflow: hidden;
  margin-top: 8px;
  direction: ltr;
}

.progress-bar-fill {
  height: 100%;
  background: var(--primary);
  transition: width 0.15s ease;
}

.spinner {
  width: 22px;
  height: 22px;
  border: 2.5px solid rgba(214, 180, 114, 0.25);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.spinner-dark {
  border-color: rgba(23, 18, 7, 0.25);
  border-top-color: #171207;
}

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

.toast-root {
  position: fixed;
  bottom: 92px;
  inset-inline: 16px;
  z-index: 90;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.toast-msg {
  max-width: 480px;
  padding: 10px 16px;
  border-radius: 14px;
  background: #102A20;
  border: 1px solid rgba(214, 180, 114, 0.45);
  color: #F3EFE6;
  font-size: 13px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  pointer-events: auto;
}
