@import url('https://fonts.googleapis.com/css2?family=Amiri:wght@400;700&family=Noto+Sans+Thaana:wght@400;500;600;700&display=swap');

:root {
  color-scheme: light;
  --ink: #1d302d;
  --muted: #7d8983;
  --green: #245a49;
  --green-dark: #193f35;
  --green-soft: #e7f0e9;
  --paper: #fffefa;
  --canvas: #12382f;
  --line: #e9ece5;
  --gold: #caa66a;
  --meaning-font-size: 13px;
  --bottom-nav-height: 72px;
  font-family: "Faruma", "Noto Sans Thaana", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-padding-bottom: 200px; }

body {
  margin: 0;
  min-width: 0;
  background: var(--canvas);
  color: var(--ink);
  font-size: 14px;
}

button, input, select { font: inherit; }
button, a, select { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; }

.app-shell { min-height: 100vh; padding-bottom: 176px; }

.topbar {
  height: 76px;
  padding: 0 max(5.5vw, 28px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 254, 250, .88);
  border-bottom: 1px solid rgba(32, 63, 53, .07);
}

.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; }
.brand-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--green);
  color: #f5e7c4;
  font-family: "Amiri", serif;
  font-size: 27px;
  box-shadow: 0 5px 12px #245a4926;
}
.brand-copy { display: grid; gap: 1px; }
.brand-copy strong { font-size: 16px; line-height: 1.3; }
.brand-copy small { color: var(--muted); font-size: 10px; }
.top-nav { display: flex; align-items: center; gap: 34px; height: 100%; }
.nav-link { position: relative; text-decoration: none; color: #78827d; font-size: 13px; transition: color .2s; }
.nav-link:hover, .nav-link.active { color: var(--green); }
.nav-link.active::after { position: absolute; content: ""; height: 2px; left: 0; right: 0; bottom: -27px; background: var(--green); border-radius: 2px; }
.topbar-note { display: flex; align-items: center; gap: 8px; color: #78827d; font-size: 11px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #71a981; box-shadow: 0 0 0 4px #71a98120; }

.layout {
  width: min(1320px, calc(100% - 64px));
  margin: 32px auto 0;
  display: grid;
  grid-template-columns: 276px minmax(0, 1fr);
  align-items: start;
  gap: 32px;
}

.home-dashboard { width: min(1320px, calc(100% - 64px)); margin: 32px auto 0; }
.dashboard-grid { display: grid; grid-template-columns: minmax(260px, .75fr) minmax(0, 1.5fr); gap: 18px; margin-top: 18px; }
.dashboard-card { min-width: 0; padding: 21px 23px; background: var(--paper); border: 1px solid #e9ece5; border-radius: 16px; box-shadow: 0 10px 28px #1c3e2d06; }
.dashboard-card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; }
.dashboard-card-heading h2 { margin: 4px 0 0; font-size: 15px; font-weight: 600; }
.dashboard-icon { width: 35px; height: 35px; display: grid; place-items: center; border-radius: 11px; background: #f2f5ee; color: #b59a62; font-size: 22px; }
.dashboard-stat { display: flex; align-items: baseline; gap: 9px; margin-top: 18px; color: #7d8b81; }
.dashboard-stat strong { color: var(--green-dark); font: 38px/1 "Segoe UI", sans-serif; }
.dashboard-stat span, .weekly-total span { font-size: 10px; }
.dashboard-helper { margin: 10px 0 0; color: #89958d; font-size: 10px; line-height: 1.8; }
.home-reading-button { margin-top: 14px; padding: 8px 11px; display: inline-flex; align-items: center; gap: 8px; border: 0; border-radius: 9px; background: var(--green); color: #fffefa; font-size: 10px; cursor: pointer; }
.home-reading-button:hover { background: var(--green-dark); }
.home-reading-button svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.weekly-total { display: grid; justify-items: end; gap: 2px; color: #89958d; font-size: 9px; }
.weekly-total strong { color: var(--green); font: 22px/1 "Segoe UI", sans-serif; }
.week-chart { height: 112px; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); align-items: end; gap: 12px; margin-top: 11px; direction: ltr; }
.week-day { min-width: 0; height: 100%; display: grid; grid-template-rows: 14px 1fr 16px; justify-items: center; align-items: end; gap: 4px; }
.week-day-count { color: #9aa49c; font: 9px/1 "Segoe UI", sans-serif; }
.week-bar-track { width: min(24px, 70%); height: 64px; display: flex; align-items: end; overflow: hidden; border-radius: 12px; background: #f0f3ed; }
.week-bar-fill { width: 100%; min-height: 3px; border-radius: 12px; background: #8eaf91; transition: height .25s ease; }
.week-day.today .week-bar-fill { background: var(--green); }
.week-day-label { overflow: hidden; max-width: 100%; color: #89958d; font: 9px/1.2 "Segoe UI", sans-serif; text-overflow: ellipsis; white-space: nowrap; }
.week-day.today .week-day-label { color: var(--green); font-weight: 600; }

.surah-panel {
  position: sticky;
  top: 20px;
  min-width: 0;
  height: calc(100vh - 144px);
  min-height: 520px;
  display: flex;
  flex-direction: column;
  padding: 24px 18px 14px;
  background: var(--paper);
  border: 1px solid #e9ece5;
  border-radius: 17px;
  box-shadow: 0 12px 32px #1c3e2d08;
}
.panel-heading { display: flex; align-items: center; justify-content: space-between; padding: 0 4px 17px; }
.eyebrow { color: #9aa39c; font-size: 10px; letter-spacing: .03em; }
.panel-heading h2, .section-title-row h2 { margin: 4px 0 0; font-size: 17px; font-weight: 600; }
.surah-total { display: grid; place-items: center; width: 31px; height: 31px; border-radius: 50%; background: #f1f4ef; color: #879189; font-size: 11px; }
.search-box {
  height: 42px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 11px;
  background: #f7f8f4;
  border: 1px solid #edf0e9;
  border-radius: 10px;
}
.search-box svg { width: 16px; height: 16px; fill: none; stroke: #9da69f; stroke-width: 1.7; flex: 0 0 auto; }
.search-box input { flex: 1; width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 11px; }
.search-box input::placeholder { color: #a4aca5; }
.search-box kbd { color: #aeb5af; font: 10px/1 sans-serif; border: 1px solid #e1e6de; border-radius: 4px; padding: 3px 5px; }
.surah-list { min-width: 0; overflow: auto; flex: 1; margin: 12px -8px 0; padding: 0 5px; scrollbar-width: thin; scrollbar-color: #dfe5dc transparent; }
.surah-option {
  width: 100%;
  min-height: 58px;
  padding: 8px 9px;
  display: grid;
  grid-template-columns: 32px 1fr auto;
  align-items: center;
  gap: 9px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  text-align: right;
  cursor: pointer;
  transition: background .16s, color .16s;
}
.surah-option:hover { background: #f5f7f2; }
.surah-option.active { background: var(--green-soft); color: var(--green-dark); }
.surah-number { width: 29px; height: 29px; display: grid; place-items: center; border: 1px solid #e9ede7; border-radius: 9px; color: #98a199; font: 11px/1 sans-serif; transform: rotate(45deg); }
.surah-number span { transform: rotate(-45deg); }
.surah-option.active .surah-number { background: #fffefa; border-color: #d5e5d8; color: var(--green); }
.surah-names { min-width: 0; display: grid; gap: 3px; }
.surah-names strong { overflow: hidden; color: #33423b; font-size: 11px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.surah-option.active .surah-names strong { color: var(--green-dark); }
.surah-names small { color: #9aa39d; font: 10px/1.2 "Faruma", "Noto Sans Thaana", sans-serif; direction: ltr; text-align: right; }
.surah-arabic { color: #506d5c; font: 18px/1.2 "Amiri", serif; white-space: nowrap; }
.sidebar-footer { display: flex; align-items: center; gap: 8px; padding: 13px 5px 0; border-top: 1px solid #eff1eb; color: #929c94; font-size: 9px; }
.mini-star { color: #bf9c5e; font-size: 15px; }

.app-shell.qibla-mode .home-dashboard,
.app-shell.qibla-mode .layout,
.app-shell.qibla-mode .reciter-directory,
.app-shell.qibla-mode .audio-player,
.app-shell.prayer-times-mode .home-dashboard,
.app-shell.prayer-times-mode .layout,
.app-shell.prayer-times-mode .reciter-directory,
.app-shell.prayer-times-mode .audio-player,
.app-shell.story-mode .home-dashboard,
.app-shell.story-mode .layout,
.app-shell.story-mode .reciter-directory,
.app-shell.story-mode .audio-player { display: none; }
.feature-page {
  display: none;
  width: min(820px, calc(100% - 56px));
  margin: 28px auto 0;
  padding: 26px;
  background: var(--paper);
  border: 1px solid #e9ece5;
  border-radius: 17px;
  box-shadow: 0 12px 32px #1c3e2d08;
}
.app-shell.qibla-mode .qibla-page,
.app-shell.prayer-times-mode .prayer-times-page { display: block; }
.app-shell.story-mode .story-page { display: block; width: min(940px, calc(100% - 56px)); }
.story-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.story-heading > div { min-width: 0; }
.feature-heading { margin-bottom: 20px; }
.feature-heading h2 { margin: 4px 0 6px; font-size: 20px; font-weight: 600; }
.feature-heading p { margin: 0; color: #879189; font-size: 11px; }
.feature-location-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 15px; border: 1px solid #edf0e9; border-radius: 11px; background: #f8f9f5; }
.feature-location-row > div { display: grid; gap: 4px; min-width: 0; }
.feature-location-row strong { color: #53665a; font-size: 11px; }
.feature-action { flex: 0 0 auto; padding: 8px 11px; border: 1px solid #dfe7dd; border-radius: 8px; background: #fffefa; color: var(--green); font-size: 10px; cursor: pointer; }
.feature-action:hover { background: #eaf2eb; }
.qibla-content { display: flex; align-items: center; justify-content: center; gap: 40px; padding: 28px 8px 12px; }
.compass-dial { position: relative; width: min(230px, 52vw); aspect-ratio: 1; flex: 0 0 auto; border: 1px solid #dfe7dd; border-radius: 50%; background: radial-gradient(circle, #fffefa 57%, #f1f5ef 58%, #fffefa 60%); box-shadow: 0 10px 24px #1c3e2d0b; }
.compass-dial::before, .compass-dial::after { position: absolute; content: ""; background: #e6ece4; }
.compass-dial::before { top: 10%; bottom: 10%; left: 50%; width: 1px; }
.compass-dial::after { top: 50%; right: 10%; left: 10%; height: 1px; }
.compass-north, .compass-east, .compass-south, .compass-west { position: absolute; z-index: 1; color: #78877d; font: 10px/1 "Segoe UI", sans-serif; }
.compass-north { top: 9px; left: 50%; color: var(--green); transform: translateX(-50%); }
.compass-east { top: 50%; right: 10px; transform: translateY(-50%); }
.compass-south { bottom: 9px; left: 50%; transform: translateX(-50%); }
.compass-west { top: 50%; left: 10px; transform: translateY(-50%); }
.qibla-arrow { position: absolute; z-index: 2; top: 50%; left: 50%; width: 43px; height: 65px; fill: var(--green); transform: translate(-50%, -50%); transform-origin: center; transition: transform .25s ease; }
.qibla-reading { display: grid; justify-items: start; gap: 8px; }
.qibla-reading strong { color: var(--green); font: 38px/1 "Segoe UI", sans-serif; direction: ltr; }
.qibla-reading > span { color: #53665a; font-size: 13px; }
.qibla-reading p { max-width: 230px; margin: 0; color: #879189; font-size: 10px; line-height: 1.8; }
.prayer-date { margin-bottom: 16px; }
.prayer-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.prayer-time-card { min-height: 70px; padding: 13px 15px; display: flex; align-items: center; justify-content: space-between; gap: 9px; border: 1px solid #e9ece5; border-radius: 11px; background: #fffefa; color: #53665a; }
.prayer-time-card.next { border-color: #b7ceba; background: #eaf2eb; color: var(--green-dark); }
.prayer-time-card span { font-size: 12px; }
.prayer-time-card time { color: var(--green); font: 600 16px/1 "Segoe UI", sans-serif; direction: ltr; }
.feature-note { margin: 15px 2px 0; color: #929c94; font-size: 9px; line-height: 1.8; }
.prophet-story-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.prophet-story { min-width: 0; border: 1px solid #e9ece5; border-radius: 11px; background: #fffefa; }
.prophet-story summary { min-height: 52px; padding: 11px 13px; display: flex; align-items: center; justify-content: space-between; gap: 10px; cursor: pointer; list-style: none; }
.prophet-story summary::-webkit-details-marker { display: none; }
.prophet-story summary::after { flex: 0 0 auto; content: "+"; color: var(--green); font: 18px/1 "Segoe UI", sans-serif; }
.prophet-story[open] summary::after { content: "-"; }
.prophet-story-name { color: #33423b; font-size: 13px; font-weight: 600; }
.prophet-story-name-latin { margin-left: auto; color: #929c94; font: 10px/1.2 "Segoe UI", sans-serif; }
.prophet-story-body { padding: 0 13px 13px; border-top: 1px solid #f0f2ed; }
.prophet-story-body p { margin: 10px 0; color: #65756a; font-size: 12px; line-height: 2; }
.prophet-story-references { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: #929c94; font: 9px/1.5 "Segoe UI", sans-serif; }
.prophet-story-references a { flex: 0 0 auto; color: var(--green); font: 10px/1.5 "Faruma", "Noto Sans Thaana", sans-serif; text-decoration: none; }
.prophet-story-source-links { min-width: 0; display: flex; flex-wrap: wrap; justify-content: flex-start; gap: 4px 9px; direction: ltr; }
.prophet-story-source-links a { flex: 0 0 auto; font: 10px/1.5 "Segoe UI", sans-serif; }
.prophet-story-references a:hover { text-decoration: underline; }

.app-shell.surah-directory-mode .home-dashboard,
.app-shell.surah-directory-mode .reading-area,
.app-shell.surah-directory-mode .audio-player,
.app-shell.surah-reader-mode .home-dashboard,
.app-shell.surah-reader-mode .surah-panel { display: none; }
.app-shell.audio-directory-mode .home-dashboard,
.app-shell.audio-directory-mode .layout { display: none; }
.reciter-directory {
  display: none;
  width: min(1120px, calc(100% - 56px));
  margin: 28px auto 0;
  padding: 24px;
  background: var(--paper);
  border: 1px solid #e9ece5;
  border-radius: 17px;
  box-shadow: 0 12px 32px #1c3e2d08;
}
.app-shell.audio-directory-mode .reciter-directory { display: block; }
.reciter-directory-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.reciter-directory-heading h2 { margin: 4px 0 0; font-size: 19px; font-weight: 600; }
.reciter-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; margin-top: 20px; }
.reciter-option-item { min-width: 0; }
.reciter-option {
  width: 100%;
  min-width: 0;
  min-height: 67px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid #e9ece5;
  border-radius: 11px;
  background: #fffefa;
  color: #53665a;
  text-align: left;
  cursor: pointer;
  transition: background .16s, border-color .16s;
}
.reciter-option:hover { background: #f5f7f2; }
.reciter-option.active { border-color: #b7ceba; background: #eaf2eb; color: var(--green-dark); }
.reciter-option-number { width: 31px; height: 31px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 9px; background: #f1f4ef; color: #879189; font: 10px/1 "Segoe UI", sans-serif; }
.reciter-option.active .reciter-option-number { background: #fffefa; color: var(--green); }
.reciter-option-copy { min-width: 0; display: grid; gap: 4px; }
.reciter-option-copy strong, .reciter-option-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reciter-option-copy strong { color: #33423b; font: 600 11px/1.3 "Faruma", "Noto Sans Thaana", "Segoe UI", sans-serif; }
.reciter-option-copy small { color: #9aa39d; font: 9px/1.2 "Faruma", "Noto Sans Thaana", "Segoe UI", sans-serif; }
.reciter-option-check { width: 17px; height: 17px; flex: 0 0 auto; margin-left: auto; fill: none; stroke: var(--green); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; opacity: 0; }
.reciter-option.active .reciter-option-check { opacity: 1; }
.app-shell.surah-directory-mode .layout,
.app-shell.surah-reader-mode .layout {
  width: min(1120px, calc(100% - 56px));
  margin: 28px auto 0;
  grid-template-columns: minmax(0, 1fr);
}
.app-shell.surah-directory-mode .surah-panel {
  position: static;
  height: auto;
  min-height: 0;
}
.app-shell.surah-directory-mode .surah-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
  max-height: none;
  overflow: visible;
  flex: none;
  margin: 12px 0 0;
}
.app-shell.surah-directory-mode .sidebar-footer { display: flex; }
.back-to-surahs {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 11px;
  border: 1px solid #e4e9e1;
  border-radius: 9px;
  background: #fffefa;
  color: #77837a;
  font-size: 10px;
  cursor: pointer;
}
.back-to-surahs[hidden] { display: none; }
.back-to-surahs svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.app-shell.surah-reader-mode .back-to-surahs { display: inline-flex; }

.reading-area { min-width: 0; }
.welcome-card {
  position: relative;
  min-height: 224px;
  overflow: hidden;
  padding: 30px 39px;
  display: flex;
  align-items: center;
  background: var(--green-dark);
  border-radius: 18px;
  color: #fffefa;
  box-shadow: 0 16px 35px #193f351c;
}
.welcome-content { position: relative; z-index: 1; max-width: 440px; }
.welcome-kicker { display: flex; align-items: center; gap: 8px; color: #bed4c4; font-size: 10px; }
.kicker-line { width: 22px; height: 1px; background: #a9bd9e; }
.welcome-card h1 { margin: 15px 0 8px; font-size: 26px; font-weight: 500; line-height: 1.65; }
.welcome-card h1 em { color: #e7ce9e; font-style: normal; }
.welcome-card p { margin: 0; color: #c2d0c6; font-size: 11px; line-height: 1.9; }
.welcome-art { position: absolute; width: 280px; height: 225px; left: 28px; bottom: 0; }
.art-orbit { position: absolute; left: 35px; bottom: -119px; border: 1px solid #d5dfc31c; border-radius: 50%; }
.orbit-one { width: 220px; height: 220px; }
.orbit-two { width: 290px; height: 290px; left: 0; bottom: -154px; }
.art-star { position: absolute; color: #e8d2a4; }
.star-one { top: 30px; left: 125px; font-size: 20px; }
.star-two { top: 61px; left: 219px; font-size: 15px; }
.star-three { top: 17px; left: 194px; font-size: 28px; }
.art-mosque { position: absolute; bottom: 0; left: 89px; width: 112px; height: 153px; }
.mosque-base { position: absolute; width: 97px; height: 68px; bottom: 0; left: 8px; background: #d9c79e; border-radius: 38px 38px 0 0; }
.mosque-base::before, .mosque-base::after { content: ""; position: absolute; bottom: 0; width: 24px; height: 48px; background: #d9c79e; border-radius: 13px 13px 0 0; }
.mosque-base::before { left: -12px; }
.mosque-base::after { right: -12px; }
.mosque-dome { position: absolute; z-index: 1; width: 62px; height: 47px; bottom: 62px; left: 25px; background: #e4d4b2; border-radius: 50% 50% 6px 6px; }
.mosque-dome::before { content: ""; position: absolute; width: 2px; height: 13px; top: -13px; left: 30px; background: #ddc89b; }
.mosque-dome::after { content: ""; position: absolute; width: 6px; height: 6px; top: -18px; left: 28px; border-radius: 50%; background: #ddc89b; }
.mosque-minaret { position: absolute; bottom: 0; z-index: 2; width: 13px; height: 115px; background: #c8b487; border-radius: 8px 8px 0 0; }
.mosque-minaret::before { content: ""; position: absolute; left: -3px; top: 16px; width: 19px; height: 3px; border-radius: 4px; background: #dcca9f; }
.mosque-minaret::after { content: ""; position: absolute; left: 4px; top: -11px; width: 5px; height: 13px; background: #ddc89b; clip-path: polygon(50% 0,100% 100%,0 100%); }
.minaret-left { left: 0; height: 99px; }
.minaret-right { right: 0; height: 125px; }
.mosque-moon { position: absolute; z-index: 2; top: 0; left: 73px; color: #e5ce9e; font: 24px/1 serif; transform: rotate(-23deg); }

.section-title-row { display: flex; align-items: end; justify-content: space-between; margin: 31px 2px 15px; }
.section-title-row h2 { font-size: 18px; }
.bookmark-filter { display: flex; align-items: center; gap: 7px; padding: 9px 12px; border: 1px solid #e4e9e1; border-radius: 9px; background: #fffefa; color: #77837a; font-size: 10px; cursor: pointer; transition: .2s; }
.bookmark-filter svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; }
.bookmark-filter:hover, .bookmark-filter[aria-pressed="true"] { border-color: #b7ceba; background: #eaf2eb; color: var(--green); }

.chapter-card { padding: 24px 27px; background: var(--paper); border: 1px solid #e9ece5; border-radius: 16px; box-shadow: 0 10px 28px #1c3e2d06; }
.chapter-heading { display: flex; align-items: center; justify-content: space-between; padding-bottom: 20px; border-bottom: 1px solid #edf0e9; }
.chapter-heading-copy { display: flex; align-items: center; gap: 12px; }
.chapter-badge { width: 43px; height: 43px; display: grid; place-items: center; flex: 0 0 auto; border: 1px solid #e6ecdf; border-radius: 13px; color: var(--green); font: 23px/1 "Amiri", serif; }
.chapter-heading h3 { margin: 0; font-size: 15px; font-weight: 600; }
.chapter-heading p { margin: 4px 0 0; color: #929c95; font-size: 10px; }
.chapter-arabic { color: var(--green); font: 27px/1.3 "Amiri", serif; }
.chapter-switcher { display: flex; gap: 7px; }
.switch-button { width: 31px; height: 31px; display: grid; place-items: center; border: 1px solid #e9ede6; border-radius: 9px; background: #fffefa; color: #8b968d; cursor: pointer; }
.switch-button:hover { background: #f0f5ef; color: var(--green); }
.switch-button svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.bismillah { padding: 17px 0 9px; text-align: center; color: #466c55; font: 27px/1.8 "Amiri", serif; }
.verse-list { display: grid; }
.verse-card { padding: 18px 2px 19px; border-bottom: 1px solid #f0f1ec; scroll-margin: 40px 0 200px; }
.verse-card:last-child { border-bottom: 0; }
.verse-toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 15px; }
.verse-number { display: flex; align-items: center; gap: 8px; color: #9da69e; font: 10px/1 "Faruma", "Noto Sans Thaana", sans-serif; }
.verse-number span { width: 25px; height: 25px; display: grid; place-items: center; border: 1px solid #e8ede5; border-radius: 9px; color: #65816b; }
.verse-actions { display: flex; gap: 4px; }
.verse-action { width: 29px; height: 29px; display: grid; place-items: center; border: 0; border-radius: 8px; background: transparent; color: #9ba49c; cursor: pointer; }
.verse-action:hover, .verse-action.saved { background: #edf4ed; color: var(--green); }
.verse-action.marked { background: #e7f0e9; color: var(--green); }
.verse-action svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.verse-action.saved svg { fill: #dbeade; }
.verse-arabic { margin: 0 0 13px; color: #223b31; font: 27px/2 "Amiri", serif; text-align: right; }
.verse-translation { margin: 0; color: #65756a; font-size: var(--meaning-font-size); line-height: 2.1; }
.verse-card.playing { padding-right: 12px; border-right: 2px solid #80a58a; background: linear-gradient(270deg, #f3f7f1 0, transparent 62%); }
.empty-bookmarks { padding: 45px 15px; text-align: center; color: #909b92; line-height: 2; }
.empty-bookmarks strong { display: block; color: #53675a; font-size: 13px; }
.chapter-loading { min-height: 260px; display: flex; align-items: center; justify-content: center; gap: 12px; color: #89958b; font-size: 12px; }
.list-loading { display: flex; justify-content: center; align-items: center; gap: 9px; min-height: 120px; color: #929c95; font-size: 11px; }
.spinner { width: 17px; height: 17px; border: 2px solid #e2e9df; border-top-color: #5e8a68; border-radius: 50%; animation: spin .75s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.source-note { display: flex; align-items: flex-start; gap: 8px; margin: 15px 2px 0; color: #939d95; font-size: 9px; line-height: 1.9; }
.source-note p { margin: 0; }
.source-note a { color: #64816a; text-decoration: underline; text-underline-offset: 2px; }
.source-symbol { color: #8a9b8a; font: 13px/1.5 sans-serif; }

.audio-player {
  position: fixed;
  z-index: 5;
  right: 0;
  bottom: var(--bottom-nav-height);
  left: 0;
  min-height: 88px;
  padding: 13px max(5.5vw, 28px);
  display: grid;
  grid-template-columns: 1fr minmax(260px, 1.35fr) 1fr;
  align-items: center;
  gap: 35px;
  background: rgba(255, 254, 250, .96);
  border-top: 1px solid #e8ece4;
  box-shadow: 0 -8px 25px #18382c0a;
  backdrop-filter: blur(12px);
}
.now-playing { display: flex; align-items: center; gap: 11px; min-width: 0; }
.quran-cover { width: 43px; height: 43px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 11px; background: #e8efe7; color: #6a8b6b; font: 25px/1 "Amiri", serif; }
.now-playing-copy { display: grid; gap: 4px; min-width: 0; }
.now-playing-copy strong { overflow: hidden; color: #37463d; font-size: 11px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.now-playing-copy .eyebrow { font-size: 9px; }
.now-playing-copy small { overflow: hidden; color: #8b968d; font: 9px/1.2 "Faruma", "Noto Sans Thaana", "Segoe UI", sans-serif; text-overflow: ellipsis; white-space: nowrap; }
.player-controls { display: grid; gap: 5px; }
.transport { display: flex; align-items: center; justify-content: center; gap: 15px; }
.icon-button, .play-button { display: grid; place-items: center; border: 0; cursor: pointer; }
.icon-button { width: 27px; height: 27px; background: transparent; color: #829087; }
.icon-button:hover { color: var(--green); }
.icon-button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.play-button { width: 34px; height: 34px; border-radius: 50%; background: var(--green); color: #fff; box-shadow: 0 4px 10px #245a492e; }
.play-button:hover { background: #1c493b; transform: scale(1.04); }
.play-button svg { width: 15px; height: 15px; fill: currentColor; }
.pause-icon { display: none; }
.play-button.is-playing .play-icon { display: none; }
.play-button.is-playing .pause-icon { display: block; }
.timeline { display: flex; align-items: center; gap: 9px; direction: ltr; color: #9da69e; font: 9px/1 sans-serif; }
.timeline input { flex: 1; height: 3px; margin: 0; accent-color: var(--green); cursor: pointer; }
.player-options { min-width: 0; display: flex; align-items: center; justify-content: flex-end; gap: 8px; color: #869188; font-size: 10px; }
.reciter-icon { width: 18px; height: 18px; flex: 0 0 auto; fill: none; stroke: #6b8a70; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.player-options select { min-width: 0; max-width: 190px; padding: 7px 25px 7px 8px; border: 0; outline: 0; border-radius: 7px; background: #f5f7f2; color: #53665a; font-size: 10px; cursor: pointer; }
.player-options option { direction: rtl; }
.bottom-nav {
  position: fixed;
  z-index: 6;
  right: 0;
  bottom: 0;
  left: 0;
  height: var(--bottom-nav-height);
  padding: 5px max(5vw, 20px);
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  direction: ltr;
  background: rgba(255, 254, 250, .98);
  border-top: 1px solid #e8ece4;
  box-shadow: 0 -7px 22px #18382c0a;
}
.bottom-nav-item {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 4px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #63746a;
  font: 11px/1.2 "Segoe UI", sans-serif;
  cursor: pointer;
}
.bottom-nav-item svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.bottom-nav-item:hover, .bottom-nav-item.active { background: #e8f0e8; color: var(--green-dark); }
.bottom-nav-item.active span { font-weight: 600; }
.settings-dialog {
  width: min(420px, calc(100% - 32px));
  padding: 23px;
  border: 1px solid #e7ece4;
  border-radius: 17px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 25px 80px #102e2450;
}
.settings-dialog::backdrop { background: #0c211b99; backdrop-filter: blur(3px); }
.settings-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 23px; }
.settings-header h2 { margin: 5px 0 0; font-size: 17px; }
.settings-close { width: 32px; height: 32px; border: 0; border-radius: 9px; background: #f0f3ee; color: #607066; font: 23px/1 sans-serif; cursor: pointer; }
.setting-control { display: grid; gap: 12px; color: #627268; font-size: 12px; }
.setting-control span { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.setting-control strong { color: var(--green); font: 12px/1 sans-serif; direction: ltr; }
.setting-control input { width: 100%; accent-color: var(--green); }
.setting-control select { width: 100%; min-height: 40px; padding: 0 11px; border: 1px solid #e4e9e1; border-radius: 9px; background: #fffefa; color: var(--ink); }
.settings-reset { margin-top: 17px; padding: 8px 12px; border: 1px solid #e4e9e1; border-radius: 8px; background: #f8f9f5; color: #66776c; font-size: 10px; cursor: pointer; }
.settings-reset:hover { background: #edf3ec; color: var(--green); }
.toast { position: fixed; z-index: 10; bottom: 174px; left: 50%; max-width: calc(100% - 36px); padding: 11px 16px; border: 1px solid #e5e9e2; border-radius: 10px; background: #fffefa; color: #6b4c42; font-size: 11px; box-shadow: 0 8px 25px #1c3e2d18; opacity: 0; pointer-events: none; transform: translate(-50%, 10px); transition: opacity .2s, transform .2s; }
.toast.visible { opacity: 1; transform: translate(-50%, 0); }

html[dir="ltr"] .surah-option { text-align: left; }
html[dir="ltr"] .surah-names small { text-align: left; }
html[lang="en"] { font-family: "Segoe UI", Arial, sans-serif; }
html[lang="ar"] { font-family: "Amiri", serif; }

@media (min-width: 1450px) {
  .layout { margin-top: 38px; gap: 38px; }
  .welcome-card { min-height: 245px; }
  .welcome-art { transform: scale(1.08); transform-origin: bottom left; left: 42px; }
}

@media (max-width: 900px) {
  .home-dashboard { width: min(100% - 36px, 720px); margin-top: 20px; }
  .dashboard-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; margin-top: 14px; }
  .layout { width: min(100% - 36px, 720px); grid-template-columns: minmax(0, 1fr); gap: 20px; margin-top: 20px; }
  .surah-panel { position: static; height: auto; min-height: auto; padding: 18px 15px 12px; }
  .app-shell.surah-directory-mode .layout,
  .app-shell.surah-reader-mode .layout { width: min(720px, calc(100% - 36px)); margin-top: 20px; }
  .app-shell.surah-directory-mode .surah-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .reciter-directory { width: min(720px, calc(100% - 36px)); margin-top: 20px; padding: 18px 15px; }
  .reciter-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .feature-page { width: min(720px, calc(100% - 36px)); margin-top: 20px; padding: 20px; }
  .app-shell.story-mode .story-page { width: min(720px, calc(100% - 36px)); }
  .prophet-story-list { grid-template-columns: 1fr; }
  .prayer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .panel-heading { padding-bottom: 12px; }
  .surah-list { display: grid; width: 100%; max-height: 300px; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; overflow-x: hidden; overflow-y: auto; flex: none; margin: 10px 0 0; padding: 0 2px 4px; }
  .surah-option { min-width: 0; min-height: 52px; grid-template-columns: 27px minmax(0, 1fr) auto; gap: 5px; padding: 6px; }
  .surah-number { width: 24px; height: 24px; font-size: 9px; }
  .surah-arabic { font-size: 16px; }
  .sidebar-footer { display: none; }
  .audio-player { grid-template-columns: 1fr 1.1fr; gap: 14px 20px; padding: 10px 22px; }
  .player-options { grid-column: 1 / -1; justify-content: center; }
  .player-controls { grid-column: 2; grid-row: 1; }
  .now-playing { grid-column: 1; grid-row: 1; }
  .app-shell { padding-bottom: 180px; }
}

@media (max-width: 560px) {
  .home-dashboard { display: flex; flex-direction: column; gap: 12px; }
  .dashboard-grid { order: -1; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 0; }
  .dashboard-card { padding: 11px; }
  .dashboard-card-heading { gap: 5px; }
  .dashboard-card-heading h2 { font-size: 10px; }
  .dashboard-icon { width: 27px; height: 27px; font-size: 17px; }
  .dashboard-stat { margin-top: 11px; }
  .dashboard-stat strong { font-size: 27px; }
  .dashboard-stat span, .weekly-total span { font-size: 8px; }
  .dashboard-helper { display: none; }
  .home-reading-button { margin-top: 11px; padding: 7px; gap: 5px; font-size: 9px; }
  .weekly-total strong { font-size: 18px; }
  .week-chart { height: 82px; gap: 2px; margin-top: 8px; }
  .week-day { grid-template-rows: 10px 1fr 13px; gap: 3px; }
  .week-day-count, .week-day-label { font-size: 7px; }
  .week-bar-track { width: 11px; height: 41px; }
  .week-day-label { font-size: 7px; }
  .topbar { height: 63px; padding: 0 18px; }
  .brand-mark { width: 35px; height: 35px; }
  .top-nav { gap: 18px; }
  .nav-link { font-size: 11px; }
  .nav-link.active::after { bottom: -22px; }
  .topbar-note { display: none; }
  .layout { width: calc(100% - 28px); margin-top: 14px; gap: 17px; }
  .surah-panel { padding: 15px 12px 11px; }
  .app-shell.surah-directory-mode .layout,
  .app-shell.surah-reader-mode .layout { width: calc(100% - 28px); margin-top: 14px; }
  .app-shell.surah-directory-mode .surah-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .reciter-directory { width: calc(100% - 28px); margin-top: 14px; padding: 15px 12px; }
  .reciter-directory-heading h2 { font-size: 16px; }
  .reciter-list { grid-template-columns: minmax(0, 1fr); gap: 6px; margin-top: 14px; }
  .reciter-option { min-height: 61px; gap: 7px; padding: 8px; }
  .reciter-option-number { width: 26px; height: 26px; font-size: 9px; }
  .reciter-option-copy strong { font-size: 9px; }
  .reciter-option-copy small { font-size: 8px; }
  .feature-page { width: calc(100% - 28px); margin-top: 14px; padding: 16px 13px; }
  .app-shell.story-mode .story-page { width: calc(100% - 28px); }
  .feature-heading h2 { font-size: 17px; }
  .feature-location-row { padding: 10px; }
  .feature-location-row strong { font-size: 9px; }
  .feature-action { padding: 7px 8px; font-size: 9px; }
  .qibla-content { flex-direction: column; gap: 18px; padding-top: 20px; }
  .compass-dial { width: min(210px, 60vw); }
  .qibla-reading { justify-items: center; text-align: center; }
  .qibla-reading strong { font-size: 32px; }
  .qibla-reading p { max-width: 270px; }
  .prayer-grid { gap: 7px; }
  .prayer-time-card { min-height: 62px; padding: 10px; }
  .prayer-time-card span { font-size: 10px; }
  .prayer-time-card time { font-size: 14px; }
  .bottom-nav { padding-right: 7px; padding-left: 7px; }
  .bottom-nav-item { gap: 2px; font-size: 9px; }
  .bottom-nav-item svg { width: 19px; height: 19px; }
  .search-box { height: 39px; }
  .surah-list { grid-template-columns: repeat(2, minmax(0, 1fr)); max-height: 280px; }
  .welcome-card { min-height: 209px; padding: 25px 22px; }
  .welcome-content { max-width: 75%; }
  .welcome-card h1 { font-size: 21px; }
  .welcome-card p { font-size: 10px; }
  .welcome-art { left: -79px; opacity: .7; transform: scale(.85); transform-origin: bottom left; }
  .section-title-row { margin: 23px 1px 12px; }
  .section-title-row h2 { font-size: 15px; }
  .bookmark-filter { padding: 8px; font-size: 9px; }
  .chapter-card { padding: 18px 16px; }
  .chapter-heading h3 { font-size: 13px; }
  .chapter-arabic { font-size: 24px; }
  .chapter-heading p { font-size: 9px; }
  .verse-arabic { font-size: 24px; }
  .verse-translation { font-size: var(--meaning-font-size); }
  .audio-player { min-height: 105px; padding: 9px 14px 11px; grid-template-columns: 1fr 1fr; gap: 6px 10px; }
  .quran-cover { width: 37px; height: 37px; }
  .now-playing-copy strong { font-size: 10px; }
  .transport { gap: 9px; }
  .timeline { gap: 6px; }
  .player-options { font-size: 9px; }
  .player-options select { max-width: 210px; font-size: 9px; }
  .app-shell { padding-bottom: 190px; }
  .toast { bottom: 190px; }
}

@media (max-height: 600px) {
  .app-shell { padding-bottom: calc(var(--bottom-nav-height) + 16px); }
  .audio-player { position: static; margin-top: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

html[lang="dv"] {
  --paper: #ffffff;
  --ink: #172a22;
  --muted: #4b5c51;
  --line: #dfe6de;
  --meaning-font-size: 18px;
  font-family: "Faruma", "Noto Sans Thaana", "Segoe UI", sans-serif;
}

html[lang="dv"] body { font-size: 16px; }
html[lang="dv"] .brand-copy small,
html[lang="dv"] .eyebrow,
html[lang="dv"] .topbar-note { color: #53665a; font-size: 12px; }
html[lang="dv"] .dashboard-card-heading h2 { font-size: 17px; }
html[lang="dv"] .dashboard-stat span,
html[lang="dv"] .weekly-total,
html[lang="dv"] .week-day-label { color: #53665a; font-size: 12px; }
html[lang="dv"] .dashboard-helper,
html[lang="dv"] .feature-heading p,
html[lang="dv"] .qibla-reading p,
html[lang="dv"] .feature-note,
html[lang="dv"] .source-note { color: #46594d; font-size: 12px; }
html[lang="dv"] .surah-names strong { color: #24372d; font-size: 14px; }
html[lang="dv"] .surah-names small,
html[lang="dv"] .feature-location-row strong,
html[lang="dv"] .feature-action,
html[lang="dv"] .prayer-time-card span,
html[lang="dv"] .bookmark-filter,
html[lang="dv"] .settings-reset { color: #354a3d; font-size: 13px; }
html[lang="dv"] .sidebar-footer { color: #53665a; font-size: 12px; }
html[lang="dv"] .prophet-story-name { color: #24372d; font-size: 16px; }
html[lang="dv"] .prophet-story-body p { color: #263a2f; font-size: 16px; line-height: 2.2; }
html[lang="dv"] .prophet-story-references { color: #53665a; font-size: 12px; }
html[lang="dv"] .chapter-heading h3 { color: #20362a; font-size: 20px; }
html[lang="dv"] .chapter-heading p { color: #53665a; font-size: 13px; }
html[lang="dv"] .verse-number { color: #53665a; font-size: 13px; }
html[lang="dv"] .verse-translation { color: #20362a; font-weight: 500; line-height: 2.25; }
html[lang="dv"] .empty-bookmarks { color: #53665a; }
html[lang="dv"] .source-note a { color: #245a49; }
html[lang="dv"] .now-playing-copy strong { color: #20362a; font-size: 14px; }
html[lang="dv"] .now-playing-copy small,
html[lang="dv"] .player-options,
html[lang="dv"] .player-options select,
html[lang="dv"] .setting-control { color: #46594d; font-size: 13px; }
html[lang="dv"] .bottom-nav-item { font-size: 12px; }
