:root {
  color-scheme: light;
  --ink: #152522;
  --muted: #65736d;
  --paper: #fffaf1;
  --surface: #ffffff;
  --teal: #0f766e;
  --teal-dark: #134e4a;
  --gold: #d6a444;
  --rose: #b25d72;
  --line: rgba(21, 37, 34, 0.12);
  --shadow: 0 18px 50px rgba(21, 37, 34, 0.12);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #eef8f4;
  --muted: #a5b8b1;
  --paper: #13231f;
  --surface: #172723;
  --teal: #2dd4bf;
  --teal-dark: #5eead4;
  --gold: #e7bc62;
  --rose: #e38aa1;
  --line: rgba(238, 248, 244, 0.14);
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.32);
}

:root[data-color-style="emerald"] {
  --teal: #047857;
  --teal-dark: #065f46;
  --gold: #c6a24b;
}

:root[data-color-style="indigo"] {
  --teal: #4f46e5;
  --teal-dark: #3730a3;
  --gold: #d6a444;
}

:root[data-color-style="rose"] {
  --teal: #be4767;
  --teal-dark: #9f3452;
  --gold: #d6a444;
}

:root[data-color-style="gold"] {
  --teal: #a66a13;
  --teal-dark: #7a4d0e;
  --gold: #d6a444;
}

:root[data-theme="dark"][data-color-style="emerald"] {
  --teal: #34d399;
  --teal-dark: #6ee7b7;
}

:root[data-theme="dark"][data-color-style="indigo"] {
  --teal: #a5b4fc;
  --teal-dark: #c7d2fe;
}

:root[data-theme="dark"][data-color-style="rose"] {
  --teal: #f0a1b6;
  --teal-dark: #fecdd3;
}

:root[data-theme="dark"][data-color-style="gold"] {
  --teal: #f4c96f;
  --teal-dark: #fde68a;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(180deg, #f4efe3 0%, #e8f0ec 48%, #f8f3ea 100%);
  color: var(--ink);
  font-family: "Segoe UI", Inter, system-ui, sans-serif;
}

:root[data-theme="dark"] body {
  background: linear-gradient(180deg, #081412 0%, #11211d 52%, #0b1715 100%);
}

button {
  border: 0;
  cursor: pointer;
  font: inherit;
}

.app-shell {
  width: min(100%, 480px);
  min-height: 100vh;
  margin: 0 auto;
  background: rgba(255, 250, 241, 0.82);
  box-shadow: 0 0 80px rgba(19, 78, 74, 0.16);
}

:root[data-theme="dark"] .app-shell {
  background: rgba(13, 24, 21, 0.92);
}

.hero {
  position: relative;
  min-height: 390px;
  overflow: hidden;
  color: #fffdf8;
}

.hero__image,
.hero__shade {
  position: absolute;
  inset: 0;
}

.hero__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero__shade {
  background:
    linear-gradient(180deg, rgba(11, 40, 37, 0.42), rgba(11, 40, 37, 0.2) 42%, rgba(11, 40, 37, 0.84)),
    radial-gradient(circle at 50% 45%, rgba(214, 164, 68, 0.24), transparent 38%);
}

.hero__content {
  position: relative;
  z-index: 1;
  display: flex;
  min-height: 390px;
  flex-direction: column;
  justify-content: space-between;
  padding: 22px 18px 20px;
}

.topbar,
.section-heading,
.progress-panel,
.status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 10px;
}

.app-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.24);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.eyebrow,
.muted,
.section-heading span {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero .eyebrow,
.hero .muted {
  color: rgba(255, 253, 248, 0.72);
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  max-width: 12ch;
  margin-top: 4px;
  font-size: 2.55rem;
  line-height: 0.98;
}

h2 {
  font-size: 1.08rem;
  line-height: 1.2;
}

.icon-button {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  color: inherit;
  backdrop-filter: blur(12px);
}

.icon-button svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.resume-card,
.progress-panel,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
}

:root[data-theme="dark"] .resume-card,
:root[data-theme="dark"] .progress-panel,
:root[data-theme="dark"] .panel {
  background: rgba(23, 39, 35, 0.92);
}

.resume-card {
  display: grid;
  gap: 16px;
  padding: 18px;
  color: var(--ink);
}

.arabic {
  font-family: "Traditional Arabic", "Arabic Typesetting", "Times New Roman", serif;
  margin-top: 8px;
  color: var(--teal-dark);
  font-size: 1.42rem;
  line-height: 1.7;
}

:root[data-arabic-style="serif"] .arabic,
:root[data-arabic-style="serif"] .mushaf-line {
  font-family: Georgia, "Times New Roman", serif;
}

:root[data-arabic-style="system"] .arabic,
:root[data-arabic-style="system"] .mushaf-line {
  font-family: "Segoe UI", Tahoma, Arial, sans-serif;
}

.mushaf-line {
  border: 1px solid rgba(214, 164, 68, 0.28);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(214, 164, 68, 0.08), rgba(255, 250, 241, 0.92), rgba(214, 164, 68, 0.08)),
    #fffaf1;
  padding: 14px;
  color: #182521;
  font-size: 1.72rem;
  line-height: 2.15;
  text-align: justify;
}

.mushaf-page {
  position: relative;
  width: min(100%, 720px);
  margin: 16px auto 0;
  border: 2px double rgba(214, 164, 68, 0.72);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(214, 164, 68, 0.08), transparent 10%, transparent 90%, rgba(214, 164, 68, 0.08)),
    #fffaf1;
  padding: clamp(10px, 2vw, 22px);
  box-shadow:
    inset 0 0 0 8px rgba(255, 255, 255, 0.46),
    inset 0 0 0 10px rgba(214, 164, 68, 0.18);
}

:root[data-theme="dark"] .mushaf-page {
  background:
    linear-gradient(90deg, rgba(214, 164, 68, 0.12), transparent 10%, transparent 90%, rgba(214, 164, 68, 0.12)),
    #13231f;
}

.page-text {
  margin-top: 0;
  min-height: min(76vh, 840px);
  padding: clamp(18px, 4vw, 42px);
  font-size: 2.18rem;
  line-height: 2.5;
  text-align: justify;
  text-align-last: center;
}

@media (max-width: 560px) {
  .page-text {
    min-height: 68vh;
    padding: 18px;
    font-size: 1.78rem;
    line-height: 2.35;
  }
}

.ayah-inline {
  border-radius: 6px;
  padding: 1px 3px;
  transition: background 160ms ease;
}

.surah-bismillah {
  display: block;
  width: min(100%, 560px);
  margin: 18px auto 14px;
  border: 1px solid rgba(214, 164, 68, 0.52);
  border-radius: 999px;
  background:
    linear-gradient(90deg, rgba(214, 164, 68, 0.18), transparent 18%, transparent 82%, rgba(214, 164, 68, 0.18)),
    rgba(255, 250, 241, 0.82);
  color: var(--ink);
  font-size: 1.55rem;
  line-height: 1.8;
  padding: 8px 18px;
  text-align: center;
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.34);
}

.surah-bismillah.is-playing {
  background: rgba(214, 164, 68, 0.22);
  border-radius: 999px;
}

:root[data-theme="dark"] .surah-bismillah {
  background:
    linear-gradient(90deg, rgba(214, 164, 68, 0.2), transparent 18%, transparent 82%, rgba(214, 164, 68, 0.2)),
    rgba(19, 35, 31, 0.86);
}

.ayah-inline.is-playing {
  background: rgba(214, 164, 68, 0.22);
  box-shadow: 0 0 0 1px rgba(214, 164, 68, 0.3);
}

.ayah-number {
  color: var(--gold);
  font-family: "Segoe UI", Inter, system-ui, sans-serif;
  font-size: 0.82rem;
  font-weight: 900;
}

:root[data-theme="dark"] .mushaf-line {
  background:
    linear-gradient(90deg, rgba(231, 188, 98, 0.1), rgba(19, 35, 31, 0.94), rgba(231, 188, 98, 0.1)),
    #13231f;
  color: #f8fff9;
}

.tajweed {
  font-weight: 700;
}

.tajweed-h,
.tajweed-g {
  color: #0f766e;
}

.tajweed-l,
.tajweed-n {
  color: #b25d72;
}

.tajweed-s,
.tajweed-o {
  color: #b7791f;
}

.tajweed-w,
.tajweed-q {
  color: #5b65b7;
}

.primary-action {
  min-height: 54px;
  border-radius: 8px;
  background: var(--teal);
  color: #fff;
  font-weight: 800;
  box-shadow: 0 10px 24px rgba(15, 118, 110, 0.25);
}

.primary-action:disabled,
.secondary-action:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.mode-tabs,
.quick-actions {
  display: grid;
  gap: 8px;
  padding: 16px 16px 0;
}

.mode-tabs {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.mode-detail {
  margin: 12px 16px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.66);
  padding: 12px;
}

:root[data-theme="dark"] .mode-detail {
  background: rgba(23, 39, 35, 0.84);
}

.mode-detail strong {
  display: block;
  margin-top: 3px;
}

.mode-detail p:last-child {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.compact-action {
  min-height: 38px;
  margin-top: 10px;
  padding: 0 12px;
}

.tab,
.quick-actions button {
  min-height: 42px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--teal-dark);
  font-size: 0.83rem;
  font-weight: 800;
  box-shadow: inset 0 0 0 1px var(--line);
}

.tab.is-active,
.quick-actions button:hover {
  background: var(--teal-dark);
  color: #fff;
}

.progress-panel {
  margin: 16px;
  padding: 16px;
  justify-content: flex-start;
}

.progress-panel p {
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.5;
}

.ring {
  --angle: calc(var(--progress) * 3.6deg);
  display: grid;
  width: 86px;
  height: 86px;
  flex: 0 0 86px;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--gold) var(--angle), rgba(19, 78, 74, 0.13) 0);
}

.ring::before {
  content: "";
  position: absolute;
}

.ring span {
  display: grid;
  width: 62px;
  height: 62px;
  place-items: center;
  border-radius: 50%;
  background: var(--paper);
  font-weight: 800;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 0 16px;
}

.stats-grid article {
  min-height: 78px;
  padding: 12px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  text-align: center;
  box-shadow: inset 0 0 0 1px var(--line);
}

.stats-grid strong {
  display: block;
  font-size: 1.18rem;
}

.stats-grid span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.quick-actions {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.dashboard-grid {
  display: grid;
  gap: 12px;
  padding: 16px 16px 28px;
}

.panel {
  padding: 16px;
}

.panel p {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.5;
}

.week-bars {
  display: grid;
  height: 92px;
  grid-template-columns: repeat(7, 1fr);
  align-items: end;
  gap: 8px;
  margin-top: 16px;
}

.week-bars span {
  height: var(--height);
  min-height: 18px;
  border-radius: 8px 8px 2px 2px;
  background: linear-gradient(180deg, var(--gold), var(--rose));
}

.metric-list {
  display: grid;
  gap: 10px;
  margin: 16px 0 0;
}

.metric-list div {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

dt {
  color: var(--muted);
  font-weight: 700;
}

dd {
  margin: 0;
  font-weight: 800;
}

.status-row {
  justify-content: flex-start;
  margin-top: 14px;
}

.status-row span {
  border-radius: 999px;
  background: rgba(214, 164, 68, 0.16);
  color: #7a5416;
  padding: 7px 10px;
  font-size: 0.78rem;
  font-weight: 800;
}

.word {
  font-family: "Traditional Arabic", "Arabic Typesetting", "Times New Roman", serif;
  color: var(--teal-dark);
  font-size: 2.6rem;
  line-height: 1.1;
}

dialog {
  width: min(calc(100% - 28px), 440px);
  max-height: min(86vh, 760px);
  border: 0;
  border-radius: 8px;
  padding: 0;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.25);
}

dialog.reader-dialog {
  width: min(calc(100% - 20px), 920px);
  max-height: min(94vh, 920px);
}

dialog::backdrop {
  background: rgba(7, 25, 24, 0.55);
}

.dialog-close {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(19, 78, 74, 0.08);
  color: var(--teal-dark);
}

.dialog-body {
  padding: 28px 18px 18px;
  max-height: min(86vh, 760px);
  overflow: auto;
}

.reader-dialog .dialog-body {
  max-height: min(94vh, 920px);
}

.dialog-body h2 {
  margin-bottom: 12px;
  font-size: 1.35rem;
}

.dialog-body ul {
  display: grid;
  gap: 10px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.dialog-body li {
  border-radius: 8px;
  background: #f6f1e7;
  padding: 12px;
  color: var(--muted);
}

.reader {
  padding-top: 34px;
}

.reader.goal-met-flash {
  animation: goal-met-flash 1.8s ease;
}

@keyframes goal-met-flash {
  0%,
  100% {
    box-shadow: none;
  }

  35% {
    box-shadow: inset 0 0 0 999px rgba(214, 164, 68, 0.12);
  }
}

.live-source {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.surah-info {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.surah-info > div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(15, 118, 110, 0.06);
  padding: 10px;
}

.surah-info strong {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  color: var(--ink);
}

.surah-info span:not([lang]) {
  display: inline-block;
  margin: 0 6px 6px 0;
  border-radius: 999px;
  background: rgba(214, 164, 68, 0.16);
  padding: 5px 8px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 900;
}

.surah-info-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.info-pill {
  min-height: 28px;
  border-radius: 999px;
  background: var(--teal);
  color: #fff;
  padding: 5px 10px;
  font-size: 0.75rem;
  font-weight: 900;
}

.surah-info-more {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.reader-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.reader-bottom-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 16px;
}

.icon-action {
  display: grid;
  min-height: 46px;
  place-items: center;
  border-radius: 8px;
  background: rgba(19, 78, 74, 0.1);
  color: var(--teal-dark);
  font-size: 1.3rem;
  font-weight: 900;
}

.icon-action.small {
  min-width: 36px;
  min-height: 34px;
  font-size: 1rem;
}

.surah-info-panel {
  display: grid;
  gap: 16px;
}

.surah-info-hero {
  border-bottom: 1px solid var(--line);
  padding-bottom: 16px;
}

.surah-info-arabic {
  margin-bottom: 10px;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2.4rem;
  line-height: 1.4;
}

.source-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.source-panel {
  color: var(--ink);
  line-height: 1.65;
}

.source-note {
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.88rem;
}


.ayah-list,
.search-results {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.ayah-card,
.search-result {
  border-radius: 8px;
  background: #f6f1e7;
  padding: 14px;
}

.ayah-card.is-playing {
  outline: 2px solid var(--gold);
  background: rgba(214, 164, 68, 0.14);
}

.verse-surah-break {
  display: grid;
  gap: 10px;
  margin: 0 0 12px;
  border-bottom: 1px solid rgba(214, 164, 68, 0.28);
  padding-bottom: 12px;
}

.verse-surah-break > div {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
}

.verse-surah-break strong {
  color: var(--ink);
}

.verse-surah-break span:not([lang]) {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.verse-bismillah {
  margin-top: 4px;
}

:root[data-theme="dark"] .ayah-card,
:root[data-theme="dark"] .search-result,
:root[data-theme="dark"] .dialog-body li,
:root[data-theme="dark"] .reciter-option {
  background: #20342f;
}

.ayah-card p,
.search-result p {
  color: var(--ink);
}

.translation-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.translation-list p {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.companion-panel {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 250, 241, 0.74);
  padding: 12px;
}

:root[data-theme="dark"] .companion-panel {
  background: rgba(19, 35, 31, 0.72);
}

.companion-panel p {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.ayah-meta {
  color: var(--teal);
  font-size: 0.78rem;
  font-weight: 800;
}

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

.audio-player {
  width: 100%;
  margin-top: 12px;
}

.continuous-player {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 250, 241, 0.88);
  padding: 12px;
}

.memorization-player {
  grid-template-columns: 1fr auto auto auto;
}

.repeat-control {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.repeat-control input {
  width: 64px;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  padding: 0 8px;
  font: inherit;
}

@media (max-width: 620px) {
  .memorization-player {
    grid-template-columns: 1fr 1fr;
  }

  .memorization-player > div,
  .memorization-player audio {
    grid-column: 1 / -1;
  }
}

:root[data-theme="dark"] .continuous-player {
  background: rgba(32, 52, 47, 0.92);
}

.continuous-player strong,
.continuous-player span {
  display: block;
}

.continuous-player span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.continuous-player .primary-action,
.continuous-player .secondary-action {
  min-height: 42px;
  margin: 0;
  padding: 0 12px;
}

.continuous-player audio {
  grid-column: 1 / -1;
  margin-top: 0;
}

.full-width {
  width: 100%;
  margin-top: 16px;
}

.secondary-action {
  min-height: 48px;
  border-radius: 8px;
  background: rgba(19, 78, 74, 0.1);
  color: var(--teal-dark);
  font-weight: 800;
}

.memorization-text.is-hidden {
  min-height: 90px;
  border-radius: 8px;
  background: repeating-linear-gradient(
    135deg,
    rgba(19, 78, 74, 0.1),
    rgba(19, 78, 74, 0.1) 8px,
    rgba(214, 164, 68, 0.1) 8px,
    rgba(214, 164, 68, 0.1) 16px
  );
  color: transparent;
  text-shadow: none;
  user-select: none;
}

.memorization-text.is-hidden * {
  color: transparent !important;
}

.memory-ayah {
  display: inline;
  padding-inline: 2px;
}

.memory-method-panel,
.memory-bridge {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.5);
}

.memory-method-header,
.memory-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
}

.memory-method-panel input[type="range"] {
  width: 100%;
  margin-top: 12px;
}

.memory-levels {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-align: center;
}

.memory-actions {
  margin-top: 16px;
}

.memory-actions .secondary-action {
  margin-top: 0;
}

.memory-blank {
  display: inline-flex;
  min-width: 2.4em;
  min-height: 1.25em;
  align-items: center;
  justify-content: center;
  margin-inline: 0.08em;
  border-bottom: 2px solid currentColor;
  color: var(--gold-dark);
}

.search-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-top: 16px;
}

.search-form input {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink);
  font: inherit;
}

.search-form .primary-action {
  min-height: 48px;
  padding: 0 14px;
}

.settings-form {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.settings-form label,
.settings-form fieldset {
  display: grid;
  gap: 7px;
  margin: 0;
}

.settings-form fieldset {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.settings-form legend,
.settings-form label span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
}

.settings-form select,
.settings-form input[type="search"],
.settings-form input[type="text"],
.settings-form input[type="date"],
.settings-form input[type="number"],
.settings-form textarea,
.member-name input,
.share-link-row input {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  padding: 0 12px;
  font: inherit;
}

.settings-form textarea {
  min-height: 82px;
  padding-top: 10px;
  resize: vertical;
}

.range-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.share-modal,
.group-panel,
.group-list,
.group-sections,
.bookmark-panel,
.bookmark-list,
.activity-list {
  display: grid;
  gap: 14px;
}

.share-card-preview {
  border: 1px solid rgba(214, 164, 68, 0.52);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(214, 164, 68, 0.12), rgba(15, 118, 110, 0.06)),
    var(--paper);
  padding: 18px;
}

.share-card-preview .arabic {
  font-size: 1.8rem;
}

.share-actions,
.share-link-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.share-link-row {
  grid-template-columns: 1fr auto;
  align-items: center;
}

.group-card,
.bookmark-card,
.group-section,
.celebration {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(15, 118, 110, 0.06);
  padding: 14px;
}

.group-card,
.bookmark-card {
  display: grid;
  gap: 12px;
}

.bookmark-card {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.bookmark-card p {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.45;
}

.group-card h3,
.group-dashboard h3 {
  margin: 0;
}

.group-card p,
.group-section p,
.group-dashboard > p {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.45;
}

.group-stat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.group-stat-row span {
  border-radius: 999px;
  background: rgba(214, 164, 68, 0.16);
  padding: 7px 10px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.group-progress-bar {
  position: relative;
  min-height: 42px;
  overflow: hidden;
  border-radius: 8px;
  background: rgba(15, 118, 110, 0.1);
}

.group-progress-bar::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--group-progress);
  background: linear-gradient(90deg, var(--teal), var(--gold));
}

.group-progress-bar span {
  position: relative;
  z-index: 1;
  display: grid;
  min-height: 42px;
  place-items: center;
  color: var(--ink);
  font-weight: 900;
}

.group-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.group-metrics article {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 8px;
  text-align: center;
}

.group-metrics strong {
  display: block;
  font-size: 1.1rem;
}

.group-metrics span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
}

.member-name {
  display: grid;
  gap: 8px;
}

.group-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.group-section.completed {
  background: rgba(45, 212, 191, 0.12);
}

.group-section.claimed {
  background: rgba(214, 164, 68, 0.12);
}

.group-section-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.group-section-actions .primary-action,
.group-section-actions .secondary-action {
  min-height: 38px;
  padding: 0 12px;
}

.celebration {
  background: rgba(214, 164, 68, 0.16);
  color: var(--ink);
  font-weight: 800;
}

.activity-list p {
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.52);
  padding: 10px;
  color: var(--muted);
}

.vocabulary-panel,
.vocab-list {
  display: grid;
  gap: 12px;
}

.vocab-focus {
  border: 1px solid rgba(214, 164, 68, 0.34);
  border-radius: 8px;
  background: rgba(214, 164, 68, 0.08);
  padding: 12px;
}

.vocab-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 250, 241, 0.74);
  padding: 12px;
}

.vocab-card .arabic {
  font-size: 2.1rem;
}

.vocab-card p {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.45;
}

:root[data-theme="dark"] .vocab-card {
  background: rgba(32, 52, 47, 0.82);
}

:root[data-theme="dark"] .activity-list p {
  background: rgba(8, 20, 18, 0.42);
}

@media (max-width: 620px) {
  .group-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .group-section,
  .bookmark-card,
  .share-link-row {
    grid-template-columns: 1fr;
  }

  .group-section-actions {
    justify-content: stretch;
  }

  .group-section-actions button,
  .share-actions button {
    width: 100%;
  }
}

.slider-group {
  display: grid;
  gap: 8px;
}

.slider-group > span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
}

.speed-slider {
  display: grid;
  grid-template-columns: 1fr 56px;
  align-items: center;
  gap: 10px;
}

.speed-slider input {
  width: 100%;
  accent-color: var(--teal);
}

.speed-slider output {
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.1);
  color: var(--teal-dark);
  padding: 6px 8px;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 900;
}

.reciter-speed-list {
  display: grid;
  gap: 12px;
}

.reciter-speed {
  display: grid;
  gap: 7px;
  border-radius: 8px;
  background: rgba(15, 118, 110, 0.06);
  padding: 10px;
}

.checkbox-row {
  grid-template-columns: auto 1fr;
  align-items: center;
}

.checkbox-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--teal);
}

.session-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 12px;
}

.session-status span {
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.1);
  color: var(--teal-dark);
  padding: 8px 10px;
  font-size: 0.82rem;
  font-weight: 900;
}

.page-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

.reader-view-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

.page-nav .secondary-action {
  min-height: 42px;
}

.read-progress {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(15, 118, 110, 0.08);
  color: var(--teal-dark);
  padding: 10px 12px;
  font-size: 0.88rem;
  font-weight: 800;
  line-height: 1.45;
}

.index-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 16px;
}

.index-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.index-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 5px 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f6f1e7;
  color: var(--ink);
  padding: 12px;
  text-align: left;
}

:root[data-theme="dark"] .index-row {
  background: #20342f;
}

.index-row span:first-child {
  font-weight: 900;
}

.index-row span[dir="rtl"] {
  color: var(--teal-dark);
  font-family: "Traditional Arabic", "Arabic Typesetting", "Times New Roman", serif;
  font-size: 1.25rem;
}

.index-row small {
  grid-column: 1 / -1;
  color: var(--muted);
  font-weight: 800;
}

.index-complete-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.14);
  padding: 3px 8px;
  color: var(--teal-dark);
  font-size: 0.72rem;
  font-weight: 900;
}

:root[data-theme="dark"] .index-complete-badge {
  background: rgba(52, 211, 153, 0.16);
  color: var(--teal);
}

.favorite-reciter-row,
.reciter-form {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.favorite-reciter-row {
  grid-template-columns: 1fr;
}

.favorite-reciter-row span {
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.1);
  color: var(--teal-dark);
  padding: 8px 10px;
  font-size: 0.78rem;
  font-weight: 800;
}

.reciter-option {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f6f1e7;
  padding: 12px;
  font-weight: 800;
}

.reciter-option input {
  width: 18px;
  height: 18px;
  accent-color: var(--teal);
}

.reciter-note {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 800;
}

.settings-save-note {
  margin: 0;
  color: var(--teal);
  font-size: 0.85rem;
  font-weight: 900;
  text-align: center;
}

.settings-help {
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

@media (min-width: 780px) {
  body {
    padding: 26px;
  }

  .app-shell {
    border-radius: 24px;
    overflow: hidden;
  }
}
