:root {
  --bg-1: #07161c;
  --bg-2: #102730;
  --bg-3: #123644;
  --card: #ffffff;
  --text-dark: #122129;
  --text-light: #eef4f5;
  --accent: #f2b33d;
  --accent-2: #3ea295;
  --muted: #67818b;
  --line: #d2e1e6;
  --shadow: 0 12px 30px rgba(1, 13, 18, 0.18);
  --radius: 18px;
}

body.theme-dawn {
  --bg-1: #fff2d9;
  --bg-2: #ffd9a8;
  --bg-3: #ffc285;
  --card: #fffefb;
  --text-dark: #2d2518;
  --text-light: #2d2518;
  --accent: #c86f0b;
  --accent-2: #2c8f89;
  --muted: #6d5a40;
  --line: #ecd9be;
  --shadow: 0 10px 24px rgba(80, 46, 0, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Manrope", sans-serif;
  color: var(--text-light);
  background:
    radial-gradient(circle at 8% 12%, rgba(242, 179, 61, 0.28), transparent 30%),
    radial-gradient(circle at 88% 10%, rgba(62, 162, 149, 0.24), transparent 34%),
    linear-gradient(150deg, var(--bg-1), var(--bg-2) 45%, var(--bg-3));
  min-height: 100vh;
  line-height: 1.5;
  transition: background 0.6s ease, color 0.4s ease;
}

html[dir="rtl"] body {
  font-family: "Tajawal", "Manrope", sans-serif;
}

.glow {
  position: fixed;
  width: 220px;
  height: 220px;
  border-radius: 999px;
  filter: blur(84px);
  opacity: 0.34;
  pointer-events: none;
  z-index: 0;
}

.glow-a {
  background: #f2b33d;
  top: 14%;
  left: -90px;
  transition: background 0.6s ease, transform 0.6s ease;
}

.glow-b {
  background: #3ea295;
  bottom: 8%;
  right: -90px;
  transition: background 0.6s ease, transform 0.6s ease;
}

body.page-practice {
  background:
    radial-gradient(circle at 15% 12%, rgba(83, 168, 161, 0.3), transparent 31%),
    radial-gradient(circle at 83% 16%, rgba(242, 179, 61, 0.24), transparent 35%),
    linear-gradient(150deg, #08212a, #133a48 46%, #1b4d5d);
}

body.page-practice .glow-a {
  background: #3ea295;
  transform: translateY(-8px);
}

body.page-practice .glow-b {
  background: #f2b33d;
  transform: translateY(8px);
}

body.theme-dawn.page-practice {
  background:
    radial-gradient(circle at 15% 12%, rgba(44, 143, 137, 0.22), transparent 31%),
    radial-gradient(circle at 83% 16%, rgba(200, 111, 11, 0.24), transparent 35%),
    linear-gradient(150deg, #fff3de, #ffe5c4 46%, #ffd8a8);
}

body.theme-dawn.page-practice .glow-a {
  background: #2c8f89;
}

body.theme-dawn.page-practice .glow-b {
  background: #c86f0b;
}

body.page-spiritual {
  background:
    radial-gradient(circle at 22% 10%, rgba(246, 207, 132, 0.29), transparent 33%),
    radial-gradient(circle at 78% 20%, rgba(104, 168, 187, 0.26), transparent 36%),
    linear-gradient(158deg, #0d2b2b, #184044 42%, #29545a);
}

body.page-spiritual .glow-a {
  background: #f6cf84;
}

body.page-spiritual .glow-b {
  background: #4ca6b3;
}

body.theme-dawn.page-spiritual {
  background:
    radial-gradient(circle at 22% 10%, rgba(200, 111, 11, 0.2), transparent 33%),
    radial-gradient(circle at 78% 20%, rgba(44, 143, 137, 0.2), transparent 36%),
    linear-gradient(158deg, #fff2db, #ffe8cc 42%, #ffdcb4);
}

body.theme-dawn.page-spiritual .glow-a {
  background: #d6913a;
}

body.theme-dawn.page-spiritual .glow-b {
  background: #2f9f95;
}

body.page-ambiance {
  background:
    radial-gradient(circle at 14% 8%, rgba(255, 199, 112, 0.35), transparent 30%),
    radial-gradient(circle at 84% 14%, rgba(131, 199, 224, 0.28), transparent 36%),
    linear-gradient(148deg, #101d30, #1e3755 45%, #2a4a6e);
}

body.page-ambiance .glow-a {
  background: #ffc770;
}

body.page-ambiance .glow-b {
  background: #83c7e0;
}

body.theme-dawn.page-ambiance {
  background:
    radial-gradient(circle at 14% 8%, rgba(200, 111, 11, 0.2), transparent 30%),
    radial-gradient(circle at 84% 14%, rgba(44, 143, 137, 0.2), transparent 36%),
    linear-gradient(148deg, #fff4df, #ffe9ca 45%, #ffdeba);
}

body.theme-dawn.page-ambiance .glow-a {
  background: #e0a34d;
}

body.theme-dawn.page-ambiance .glow-b {
  background: #43a79f;
}

/* Keep theme behavior consistent across every tab */
body.page-practice,
body.page-spiritual,
body.page-ambiance,
body.page-achievements {
  background:
    radial-gradient(circle at 8% 12%, rgba(242, 179, 61, 0.28), transparent 30%),
    radial-gradient(circle at 88% 10%, rgba(62, 162, 149, 0.24), transparent 34%),
    linear-gradient(150deg, var(--bg-1), var(--bg-2) 45%, var(--bg-3));
}

body.page-practice .glow-a,
body.page-spiritual .glow-a,
body.page-ambiance .glow-a,
body.page-achievements .glow-a {
  background: #f2b33d;
  transform: none;
}

body.page-practice .glow-b,
body.page-spiritual .glow-b,
body.page-ambiance .glow-b,
body.page-achievements .glow-b {
  background: #3ea295;
  transform: none;
}

body.theme-dawn.page-practice .glow-a,
body.theme-dawn.page-spiritual .glow-a,
body.theme-dawn.page-ambiance .glow-a,
body.theme-dawn.page-achievements .glow-a {
  background: #c86f0b;
}

body.theme-dawn.page-practice .glow-b,
body.theme-dawn.page-spiritual .glow-b,
body.theme-dawn.page-ambiance .glow-b,
body.theme-dawn.page-achievements .glow-b {
  background: #2c8f89;
}

main {
  width: min(1120px, 92vw);
  margin: 0 auto;
  padding: 22px 0 40px;
  position: relative;
  z-index: 1;
}

.hero {
  text-align: center;
  padding: 20px 14px 26px;
  animation: rise 0.7s ease-out;
}

.hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.network-banner {
  margin: 0 auto 12px;
  padding: 10px 12px;
  max-width: 820px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(176, 71, 71, 0.22);
  backdrop-filter: blur(2px);
}

.network-banner p {
  margin: 0;
  text-align: center;
  font-size: 0.9rem;
}

.network-banner[hidden] {
  display: none !important;
}

.update-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.update-banner p {
  flex: 1;
  text-align: start;
}

html[dir="rtl"] .update-banner {
  direction: rtl;
}

html[dir="rtl"] .update-banner p {
  text-align: right;
}

body.theme-dawn .network-banner {
  border-color: rgba(115, 54, 54, 0.3);
  background: rgba(198, 111, 11, 0.14);
}

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

.brand-logo {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  box-shadow: 0 8px 18px rgba(5, 28, 33, 0.25);
  background: rgba(255, 255, 255, 0.14);
}

.hero-controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.tag {
  display: inline-block;
  padding: 6px 12px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 999px;
  font-size: 0.76rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.08);
}

body.theme-dawn .tag {
  border-color: rgba(45, 37, 24, 0.35);
  background: rgba(255, 255, 255, 0.46);
}

h1 {
  margin: 10px 0;
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  line-height: 1.04;
}

.hero p {
  margin: 0 auto;
  max-width: 660px;
}

.hijri {
  margin-top: 8px;
  font-size: 0.9rem;
  opacity: 0.9;
}

.verse-banner {
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(9, 30, 39, 0.36);
  backdrop-filter: blur(6px);
}

.verse-label {
  margin: 0 0 6px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #e8f6ff;
}

.verse-text {
  margin: 0;
  color: #f8fcff;
  font-size: 0.95rem;
  line-height: 1.55;
}

body.theme-dawn .verse-banner {
  border-color: rgba(45, 37, 24, 0.24);
  background: rgba(255, 251, 242, 0.74);
}

body.theme-dawn .verse-label {
  color: #694511;
}

body.theme-dawn .verse-text {
  color: #3f2f18;
}

.page-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
}

.tab-btn {
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: var(--text-light);
}

.tab-btn.active {
  background: linear-gradient(120deg, var(--accent-2), #4abfb0);
  border-color: transparent;
  color: #ffffff;
}

.tab-btn:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
}

.card.hidden-page {
  display: none;
}

.grid {
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr;
}

.card {
  background: linear-gradient(145deg, #123f31, #0e3328 58%, #0b2a21);
  color: #e7f5ed;
  border: 1px solid rgba(139, 207, 166, 0.24);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  animation: rise 0.7s ease-out both;
}

.card.stagger-enter {
  opacity: 0;
  transform: translateY(12px) scale(0.995);
  animation: cardIn 0.45s ease forwards;
}

.card h2 {
  margin: 0 0 10px;
  font-size: 1.08rem;
  color: #f2fff7;
}

.card-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.kpi-row {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 12px 0;
}

.kpi {
  background: rgba(234, 249, 240, 0.1);
  border-radius: 12px;
  padding: 10px;
  text-align: center;
  border: 1px solid rgba(139, 207, 166, 0.2);
}

body.theme-dawn .kpi {
  background: rgba(234, 249, 240, 0.1);
}

.kpi strong {
  display: block;
  font-size: 1.12rem;
  color: #f3fff8;
}

.small {
  font-size: 0.84rem;
  color: var(--muted);
}

.meter {
  background: #dce8eb;
  border-radius: 999px;
  height: 12px;
  overflow: hidden;
}

.meter span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #f6ca79);
  transition: width 0.4s ease;
}

.quote {
  margin-top: 10px;
  padding: 12px;
  border-left: 3px solid var(--accent-2);
  background: rgba(11, 47, 37, 0.78);
  border-radius: 8px;
  color: #e8f8ee;
  font-weight: 500;
}

body.theme-dawn .quote {
  background: rgba(11, 47, 37, 0.78);
  color: #e8f8ee;
}

.reminder-flow {
  position: relative;
  overflow: hidden;
  background: linear-gradient(145deg, #0f3b2f, #0b2f25 58%, #0a271f);
  color: #e8f6ee;
  border: 1px solid rgba(142, 214, 173, 0.26);
}

.reminder-flow h2 {
  color: #f2fff7;
}

.reminder-flow .small {
  color: #b9dbc6;
}

body.theme-dawn .reminder-flow {
  background: linear-gradient(145deg, #18543f, #123e31 58%, #0f3429);
  color: #eaf8f1;
  border-color: rgba(116, 184, 143, 0.34);
}

.dua-flow {
  position: relative;
  margin-top: 8px;
  padding: 4px;
  border-radius: 12px;
  background: radial-gradient(circle at top right, rgba(126, 201, 151, 0.24), rgba(62, 162, 149, 0.14) 52%, transparent 80%);
}

.dua-orb {
  position: absolute;
  top: -18px;
  right: -14px;
  width: 72px;
  height: 72px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(246, 202, 121, 0.45) 0%, rgba(246, 202, 121, 0.1) 45%, transparent 70%);
  filter: blur(1px);
  pointer-events: none;
  animation: duaOrbPulse 3.6s ease-in-out infinite;
}

.quote-flow {
  position: relative;
  margin-top: 0;
  border-left-width: 4px;
  min-height: 86px;
  transition: transform 0.34s ease, opacity 0.34s ease, filter 0.34s ease;
}

.quote-flow.is-visible {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}

.quote-flow.is-leaving {
  opacity: 0;
  transform: translateY(8px);
  filter: blur(2px);
}

.dua-progress-wrap {
  margin-top: 10px;
  height: 4px;
  border-radius: 999px;
  background: rgba(16, 67, 79, 0.15);
  overflow: hidden;
}

.dua-progress {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), #f6ca79);
  border-radius: inherit;
}

.dua-progress.run {
  animation: duaProgressRun 12s linear forwards;
}

.hadith-flow-wrap {
  background: radial-gradient(circle at top right, rgba(90, 172, 112, 0.24), rgba(35, 128, 83, 0.14) 54%, transparent 82%);
}

.hadith-orb {
  background: radial-gradient(circle, rgba(90, 172, 112, 0.42) 0%, rgba(90, 172, 112, 0.12) 45%, transparent 70%);
}

.hadith-progress.run {
  animation-duration: 20s;
}

.hadith-flow .quote-flow {
  background: #e8f6ec;
  color: #153f2a;
  border-left-color: #3a9f66;
}

body.theme-dawn .hadith-flow .quote-flow {
  background: #ecf8ef;
  color: #1e4b31;
}

@keyframes duaProgressRun {
  from { width: 0%; }
  to { width: 100%; }
}

@keyframes duaOrbPulse {
  0%, 100% { transform: scale(1); opacity: 0.76; }
  50% { transform: scale(1.08); opacity: 1; }
}

.prayer-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.prayer-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(234, 249, 240, 0.1);
  border: 1px solid rgba(139, 207, 166, 0.18);
}

body.theme-dawn .prayer-list li {
  background: rgba(234, 249, 240, 0.1);
}

.prayer-list li.active {
  background: rgba(73, 176, 121, 0.22);
  border: 1px solid rgba(124, 220, 165, 0.5);
}

.panel {
  display: grid;
  gap: 8px;
}

.moon-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.moon-state {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: rgba(234, 249, 240, 0.1);
}

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

.laylat-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(234, 249, 240, 0.1);
}

.laylat-item strong {
  display: block;
  color: #e6faee;
}

#voiceTasbihStatus {
  font-weight: 700;
  color: #0f4d46;
}

#voiceTasbihLast {
  font-family: "Manrope", sans-serif;
  background: #f3f9fb;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
}

body.theme-dawn #voiceTasbihLast {
  background: #fff7eb;
}

.laylat-criteria {
  margin-top: 8px;
  display: grid;
  gap: 5px;
}

.laylat-criterion {
  display: grid;
  grid-template-columns: 160px 1fr 42px;
  gap: 8px;
  align-items: center;
  font-size: 0.78rem;
  color: #35505a;
}

.laylat-bar {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: #dce8eb;
  overflow: hidden;
}

.laylat-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #3ea295, #7dcfbe);
}

.moon-icon {
  font-size: 2rem;
  line-height: 1;
  margin-bottom: 6px;
}

.mini-title {
  margin: 8px 0 6px;
  font-size: 1.02rem;
}

.story-text {
  margin: 0;
  color: #d5ede1;
}

.adhkar-columns {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr;
}

.audio-controls {
  display: grid;
  gap: 9px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-bottom: 10px;
}

.backup-controls {
  display: grid;
  gap: 9px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.tarawih-links {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.youtube-card {
  min-height: 150px;
  display: flex;
  align-items: flex-end;
  padding: 12px;
  border-radius: 14px;
  color: #f8fffd;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.01em;
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.2);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  background-color: #18313a;
  background-size: cover;
  background-position: center;
  box-shadow: 0 10px 22px rgba(5, 17, 19, 0.24);
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.youtube-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 26px rgba(5, 17, 19, 0.3);
  border-color: rgba(255, 255, 255, 0.45);
}

.youtube-card-channel {
  background-image:
    linear-gradient(180deg, rgba(12, 35, 40, 0.2) 20%, rgba(12, 35, 40, 0.86) 100%),
    url("https://i.ytimg.com/vi/XKn3ieDqCfI/hqdefault.jpg");
}

.youtube-card-live1 {
  background-image:
    linear-gradient(180deg, rgba(12, 35, 40, 0.2) 20%, rgba(12, 35, 40, 0.86) 100%),
    url("https://i.ytimg.com/vi/XKn3ieDqCfI/hqdefault.jpg");
}

.youtube-card-live2 {
  background-image:
    linear-gradient(180deg, rgba(12, 35, 40, 0.2) 20%, rgba(12, 35, 40, 0.86) 100%),
    url("https://i.ytimg.com/vi/VK_QIaHo82g/hqdefault.jpg");
}

body.theme-dawn .youtube-card {
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: 0 10px 20px rgba(86, 48, 0, 0.2);
}

.cloud-sync {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
  display: grid;
  gap: 9px;
}

#importDataFile {
  width: 100%;
  border: 1px solid #c5d6dc;
  border-radius: 10px;
  padding: 8px 10px;
  font: inherit;
  color: var(--text-dark);
  background: #ffffff;
}

body.theme-dawn #importDataFile {
  background: #fffefb;
  border-color: #e5cfac;
}

#recitationPlayer {
  width: 100%;
}

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

.tasbih-count {
  text-align: center;
  font-size: 2rem;
  font-weight: 800;
  color: #f1fff7;
  background: rgba(234, 249, 240, 0.12);
  border-radius: 12px;
  padding: 6px 10px;
}

#tasbihPlus {
  border-radius: 999px;
  min-height: 54px;
  font-size: 1rem;
  letter-spacing: 0.02em;
  box-shadow: 0 10px 18px rgba(20, 85, 80, 0.25);
}

.tasbih-visual-wrap {
  display: grid;
  gap: 8px;
}

.tasbih-visual {
  display: grid;
  grid-template-columns: repeat(11, 1fr);
  gap: 5px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(234, 249, 240, 0.1);
}

.tasbih-bead {
  width: 100%;
  padding-bottom: 100%;
  border-radius: 999px;
  background: #d4e3e8;
  transition: background 0.25s ease, transform 0.2s ease;
}

.tasbih-bead.filled {
  background: linear-gradient(140deg, #3ea295, #f2b33d);
  transform: scale(1.03);
}

.reward-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 10px 0;
}

.achievements-list {
  margin-top: 10px;
  display: grid;
  gap: 7px;
}

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

.reward-day {
  display: grid;
  gap: 6px;
  align-items: end;
  justify-items: center;
}

.reward-day-bar {
  width: 100%;
  height: 56px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: linear-gradient(to top, #3ea295 var(--h, 0%), #eef5f8 var(--h, 0%));
}

.reward-day-label {
  font-size: 0.72rem;
  color: var(--muted);
}

.achievement-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 10px;
  background: rgba(234, 249, 240, 0.1);
  font-size: 0.86rem;
}

.achievement-item.done {
  border-color: #81c9ba;
  background: rgba(77, 182, 127, 0.22);
}

.card .small {
  color: #badbc8;
}

.card input[type="number"],
.card input[type="text"],
.card select {
  background: rgba(8, 36, 28, 0.84);
  color: #e9fbf0;
  border-color: rgba(140, 211, 169, 0.34);
}

.card select {
  background: #f2f7f3;
  color: #000000;
  border-color: #a7c9b3;
}

.card select option {
  color: #000000;
  background: #ffffff;
}

.card input::placeholder {
  color: rgba(201, 230, 213, 0.76);
}

body.theme-dawn .card.quran-section,
body.theme-dawn .card.challenges-section,
body.theme-dawn .card.readingplan-section,
body.theme-dawn .card.adhkar-section {
  background: linear-gradient(145deg, #edf7ef, #e4f1e8 62%, #dcecdf);
  color: #10261b;
  border-color: #b8d3c1;
}

body.theme-dawn .card.quran-section h2,
body.theme-dawn .card.challenges-section h2,
body.theme-dawn .card.readingplan-section h2,
body.theme-dawn .card.adhkar-section h2,
body.theme-dawn .card.quran-section .small,
body.theme-dawn .card.challenges-section .small,
body.theme-dawn .card.readingplan-section .small,
body.theme-dawn .card.adhkar-section .small,
body.theme-dawn .card.quran-section label,
body.theme-dawn .card.challenges-section label,
body.theme-dawn .card.readingplan-section label,
body.theme-dawn .card.adhkar-section label,
body.theme-dawn .card.quran-section p,
body.theme-dawn .card.challenges-section p,
body.theme-dawn .card.readingplan-section p,
body.theme-dawn .card.adhkar-section p,
body.theme-dawn .card.adhkar-section .mini-title,
body.theme-dawn .card.challenges-section .challenge {
  color: #000000;
}

body.theme-dawn .card.quran-section input[type="number"],
body.theme-dawn .card.challenges-section input[type="number"],
body.theme-dawn .card.readingplan-section input[type="number"],
body.theme-dawn .card.adhkar-section input[type="number"],
body.theme-dawn .card.quran-section input[type="text"],
body.theme-dawn .card.challenges-section input[type="text"],
body.theme-dawn .card.readingplan-section input[type="text"],
body.theme-dawn .card.adhkar-section input[type="text"],
body.theme-dawn .card.quran-section select,
body.theme-dawn .card.challenges-section select,
body.theme-dawn .card.readingplan-section select,
body.theme-dawn .card.adhkar-section select {
  background: #ffffff;
  color: #000000;
  border-color: #9db8a7;
}

body.theme-dawn .card.challenges-section .challenge,
body.theme-dawn .card.adhkar-section .challenge {
  background: #ffffff;
  border-color: #bad1c2;
}

body.theme-dawn .card.quran-section #quranText,
body.theme-dawn .card.challenges-section #challengeStats,
body.theme-dawn .card.readingplan-section #readingProjection,
body.theme-dawn .card.adhkar-section #adhkarStats {
  color: #000000;
}

.tasbih-fullscreen {
  position: fixed;
  inset: 0;
  background: rgba(4, 20, 28, 0.92);
  z-index: 99;
  display: grid;
  place-items: center;
  padding: 20px;
  overscroll-behavior: contain;
  touch-action: none;
}

.tasbih-fullscreen[hidden] {
  display: none !important;
}

.tasbih-fullscreen-inner {
  width: min(560px, 95vw);
  text-align: center;
  color: #eef4f5;
}

#tasbihFsStats {
  font-size: clamp(1.1rem, 4vw, 1.5rem);
  font-weight: 800;
}

.tasbih-fs-count {
  margin: 6px auto 10px;
  font-size: clamp(2.6rem, 11vw, 5rem);
  line-height: 1;
  font-weight: 800;
  color: #fff2cb;
  text-shadow: 0 8px 20px rgba(0, 0, 0, 0.45);
}

.tasbih-fs-ring {
  width: min(80vw, 360px);
  aspect-ratio: 1 / 1;
  border-radius: 999px;
  margin: 12px auto 8px;
  padding: 10px;
  background:
    radial-gradient(circle at center, rgba(4, 20, 28, 0.84) 62%, transparent 64%),
    conic-gradient(var(--ring-color, #f2b33d) var(--pct, 0%), rgba(255, 255, 255, 0.16) 0);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  display: grid;
  place-items: center;
  transition: background 0.35s ease, box-shadow 0.35s ease;
}

.tasbih-fs-ring[data-stage="idle"] {
  --ring-color: #7a94a3;
}

.tasbih-fs-ring[data-stage="low"] {
  --ring-color: #f08a6b;
  box-shadow: 0 12px 32px rgba(240, 138, 107, 0.25);
}

.tasbih-fs-ring[data-stage="mid"] {
  --ring-color: #f2b33d;
  box-shadow: 0 12px 32px rgba(242, 179, 61, 0.26);
}

.tasbih-fs-ring[data-stage="high"] {
  --ring-color: #3ea295;
  box-shadow: 0 12px 32px rgba(62, 162, 149, 0.28);
}

.tasbih-fs-ring[data-stage="done"] {
  --ring-color: #57c26f;
  box-shadow: 0 12px 36px rgba(87, 194, 111, 0.35);
}

.tasbih-fs-button {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 999px;
  font-size: clamp(2rem, 8vw, 3rem);
  font-weight: 800;
  color: #ffffff;
  background: radial-gradient(circle at 30% 20%, #f7d284, #c88619 45%, #8e5a0f 100%);
  box-shadow: 0 20px 36px rgba(0, 0, 0, 0.4), inset 0 8px 18px rgba(255, 255, 255, 0.24);
  margin: 0;
  transition: transform 0.08s ease, filter 0.18s ease;
}

.tasbih-fs-button:active,
.tasbih-fs-button.pressed {
  transform: scale(0.97);
  filter: brightness(1.06);
}

#tasbihFsPct {
  font-weight: 800;
  color: #e8f6ff;
}

body.lock-scroll {
  overflow: hidden;
  touch-action: none;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  background: rgba(11, 28, 37, 0.92);
  color: #f5fbfd;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 0.9rem;
  z-index: 120;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
}

.onboarding-modal {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: grid;
  place-items: center;
  background: rgba(2, 10, 14, 0.68);
  backdrop-filter: blur(4px);
  padding: 16px;
}

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

.onboarding-card {
  width: min(520px, 100%);
  background: #ffffff;
  color: var(--text-dark);
  border-radius: 16px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 18px;
  display: grid;
  gap: 10px;
}

body.theme-dawn .onboarding-card {
  background: #fffefb;
}

.toast[hidden] {
  display: none !important;
}

body.theme-dawn .tasbih-count {
  background: #fff6e8;
  color: #7a460e;
}

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

#challengeDifficultyLabel {
  align-self: center;
}

#saveQiyamRakaat {
  width: 100%;
}

input[type="number"],
select {
  width: 100%;
  border: 1px solid #c5d6dc;
  border-radius: 10px;
  padding: 10px;
  font: inherit;
  color: var(--text-dark);
  background: #ffffff;
  outline: none;
}

body.theme-dawn input[type="number"],
body.theme-dawn select {
  background: #fffefb;
  border-color: #e5cfac;
}

input:focus,
select:focus {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 3px rgba(62, 162, 149, 0.15);
}

button {
  border: none;
  padding: 10px 13px;
  border-radius: 10px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

button:active {
  transform: scale(0.98);
}

.btn-main {
  background: linear-gradient(120deg, var(--accent-2), #4abfb0);
  color: white;
}

.btn-alt {
  background: #edf4f7;
  color: #18313a;
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.16);
  color: inherit;
  border: 1px solid rgba(255, 255, 255, 0.35);
}

body.theme-dawn .btn-ghost {
  background: rgba(255, 255, 255, 0.64);
  border-color: rgba(45, 37, 24, 0.3);
}

.qiyam-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  margin-top: 8px;
}

.night {
  border: 1px solid var(--line);
  border-radius: 8px;
  text-align: center;
  padding: 6px 0;
  font-size: 0.78rem;
  background: #f8fcfd;
  cursor: pointer;
  user-select: none;
}

body.theme-dawn .night {
  background: #fffdf8;
}

.night.done {
  background: #dbf1eb;
  border-color: #81c9ba;
  color: #155348;
  font-weight: 700;
}

.challenges {
  display: grid;
  gap: 8px;
  margin: 10px 0;
}

.challenge {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f8fcfd;
  color: #17333c;
}

body.theme-dawn .challenge {
  background: #fffef8;
}

.challenge input {
  width: 18px;
  height: 18px;
  accent-color: #2f9f95;
}

.challenge span {
  color: inherit;
}

/* Night mode readability for multi-choice rows (Defis + Adhkar) */
body:not(.theme-dawn) .card.challenges-section .challenge,
body:not(.theme-dawn) .card.adhkar-section .challenge {
  background: rgba(8, 36, 28, 0.84);
  border-color: rgba(140, 211, 169, 0.34);
  color: #e9fbf0;
}

body:not(.theme-dawn) .card.challenges-section .challenge input,
body:not(.theme-dawn) .card.adhkar-section .challenge input {
  accent-color: #4abfb0;
}

.badge-wrap {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: #f8fcfd;
  display: grid;
  justify-items: center;
  gap: 10px;
}

body.theme-dawn .badge-wrap {
  background: #fffef8;
}

.badge {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 800;
  background: #eaf7f4;
  color: #1a5f53;
}

.badge-chart-wrap .badge {
  margin-top: 2px;
}

.badge-metrics {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.badge-metric {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.7);
  display: grid;
  justify-items: center;
  gap: 6px;
}

.badge-pie {
  --pct: 0%;
  width: 132px;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, #f8fcfd 56%, transparent 57%),
    conic-gradient(#1d5aa7 var(--pct), #d6e1ea 0);
  box-shadow: inset 0 0 0 1px #c7d6e2;
  display: grid;
  place-items: center;
}

.badge-pie-inner {
  width: 62%;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  background: #f8fcfd;
  display: grid;
  place-items: center;
  box-shadow: inset 0 0 0 1px #dbe5ec;
}

.badge-pie-inner strong {
  color: #103a6e;
  font-size: 1.02rem;
}

.badge-pie-compact {
  width: 104px;
}

.badge-metric .small {
  margin: 0;
}

.tasbih-kpi-controls {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  align-items: center;
}

.tasbih-bars {
  margin-top: 12px;
  min-height: 150px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(20px, 1fr));
  gap: 7px;
  align-items: end;
}

.tasbih-bar-item {
  min-width: 0;
  display: grid;
  gap: 5px;
  justify-items: center;
}

.tasbih-bar {
  width: 100%;
  min-height: 8px;
  border-radius: 7px 7px 4px 4px;
  background: linear-gradient(180deg, #4fd1b7 0%, #15715f 100%);
  box-shadow: 0 4px 12px rgba(16, 86, 73, 0.18);
}

.tasbih-bar-label {
  font-size: 0.68rem;
  opacity: 0.82;
  white-space: nowrap;
}

body.theme-dawn .tasbih-bar {
  background: linear-gradient(180deg, #f5ba6d 0%, #b86221 100%);
  box-shadow: 0 4px 12px rgba(139, 77, 24, 0.2);
}

.gallery-controls {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

.quran-reader-controls {
  display: grid;
  grid-template-columns: minmax(220px, 2fr) repeat(2, minmax(90px, 0.8fr)) auto;
  gap: 10px;
  align-items: end;
  margin-top: 8px;
}

.quran-reader-field {
  display: grid;
  gap: 6px;
}

.quran-reader-content {
  margin-top: 10px;
  display: grid;
  gap: 10px;
}

.quran-ayah {
  border: 1px solid rgba(200, 222, 210, 0.24);
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.05);
}

.quran-ayah-ar {
  margin: 0;
  font-family: "Tajawal", sans-serif;
  font-size: 1.05rem;
  line-height: 1.9;
}

.quran-ayah-tr {
  margin: 6px 0 0;
  font-size: 0.92rem;
  line-height: 1.55;
  opacity: 0.92;
}

body.theme-dawn .quran-ayah {
  border: 1px solid rgba(133, 97, 45, 0.25);
  background: rgba(255, 247, 235, 0.88);
}

.quran-web-controls {
  display: grid;
  grid-template-columns: minmax(220px, 320px) 1fr;
  gap: 10px;
  align-items: end;
}

.quran-web-field {
  display: grid;
  gap: 6px;
}

.quran-web-field input[type="number"] {
  background: #f4f8f6;
  color: #0e2e26;
  border: 1px solid #9ec8b2;
  font-weight: 700;
}

.quran-web-field input[type="number"]::placeholder {
  color: #6c8f80;
}

.quran-web-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-start;
}

.quran-web-actions .btn-main,
.quran-web-actions .btn-alt {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 14px;
  text-align: center;
  white-space: nowrap;
}

.quran-web-actions a.btn-alt {
  text-decoration: none;
  border: 1px solid #c7d8df;
}

.quran-web-actions a.btn-alt:hover {
  opacity: 0.95;
}

body:not(.theme-dawn) .quran-web-actions a.btn-alt {
  background: rgba(233, 243, 248, 0.96);
  color: #1a3340;
}

.quran-web-frame-wrap {
  margin-top: 10px;
  width: 100%;
  overflow: hidden;
  border-radius: 12px;
}

#quranWebFrame {
  display: block;
  width: 100% !important;
  height: clamp(620px, 78vh, 1100px);
  min-height: 620px;
  border: 1px solid rgba(194, 223, 208, 0.25);
  border-radius: 12px;
  background: #ffffff;
}

body.theme-dawn #quranWebFrame {
  border-color: rgba(133, 97, 45, 0.28);
}

.gallery {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}


.gallery img {
  width: 100%;
  height: 190px;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: var(--shadow);
  transition: transform 0.35s ease;
}

.gallery img:hover {
  transform: translateY(-3px) scale(1.01);
}

footer {
  margin-top: 16px;
  text-align: center;
  font-size: 0.86rem;
  opacity: 0.95;
}

@media (min-width: 760px) {
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .card.span-2 {
    grid-column: span 2;
  }

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

  .gallery img {
    height: 212px;
  }

  .adhkar-columns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .week-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .moon-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 759px) {
  main {
    width: min(100%, 96vw);
    padding: 14px 0 28px;
  }

  .hero {
    padding: 14px 8px 18px;
  }

  .hero-top {
    flex-direction: column;
    align-items: stretch;
  }

  .brand-block {
    justify-content: center;
  }

  .hero-controls {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .hero-controls select {
    grid-column: span 2;
  }

  .page-tabs {
    position: sticky;
    top: 8px;
    z-index: 14;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 6px;
    border-radius: 12px;
    background: rgba(7, 22, 28, 0.5);
    backdrop-filter: blur(8px);
  }

  .tab-btn {
    flex: 0 0 auto;
    min-width: 118px;
    white-space: nowrap;
  }

  .grid {
    gap: 11px;
  }

  .card {
    padding: 14px;
    border-radius: 14px;
  }

  .card h2 {
    font-size: 1rem;
  }

  .card-row {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .controls,
  .audio-controls,
  .backup-controls,
  .reward-kpis,
  .gallery-controls,
  .quran-reader-controls,
  .quran-web-controls {
    grid-template-columns: 1fr;
  }

  .update-banner {
    flex-direction: column;
    align-items: stretch;
  }

  .tasbih-kpi-controls {
    grid-template-columns: 1fr;
  }

  .week-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .qiyam-grid {
    grid-template-columns: repeat(5, 1fr);
  }

  .gallery img {
    height: 170px;
  }

  #quranWebFrame {
    height: 62vh;
    min-height: 480px;
  }

  .tasbih-fullscreen {
    padding: 12px;
  }

  .tasbih-fullscreen-inner {
    width: 100%;
    max-width: 520px;
  }

  .tasbih-fs-ring {
    width: min(90vw, 420px);
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.995);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .card.stagger-enter {
    opacity: 1;
    transform: none;
    animation: none;
  }
}


/* THEME-RESET: targeted cards */
body.theme-dawn .card.quran-section,
body.theme-dawn .card.qiyam-section,
body.theme-dawn .card.tasbih-kpi-section,
body.theme-dawn .card.adhkar-section {
  background: linear-gradient(145deg, #edf7ef, #e4f1e8 62%, #dcecdf);
  color: #10261b;
  border-color: #b8d3c1;
}

body.theme-dawn .card.quran-section h2,
body.theme-dawn .card.qiyam-section h2,
body.theme-dawn .card.tasbih-kpi-section h2,
body.theme-dawn .card.adhkar-section h2,
body.theme-dawn .card.quran-section .small,
body.theme-dawn .card.qiyam-section .small,
body.theme-dawn .card.tasbih-kpi-section .small,
body.theme-dawn .card.adhkar-section .small,
body.theme-dawn .card.quran-section label,
body.theme-dawn .card.qiyam-section label,
body.theme-dawn .card.tasbih-kpi-section label,
body.theme-dawn .card.adhkar-section label,
body.theme-dawn .card.quran-section p,
body.theme-dawn .card.qiyam-section p,
body.theme-dawn .card.tasbih-kpi-section p,
body.theme-dawn .card.adhkar-section p,
body.theme-dawn .card.adhkar-section .mini-title {
  color: #000000;
}

body.theme-dawn .card.quran-section input[type="number"],
body.theme-dawn .card.qiyam-section input[type="number"],
body.theme-dawn .card.tasbih-kpi-section input[type="number"],
body.theme-dawn .card.adhkar-section input[type="number"],
body.theme-dawn .card.quran-section input[type="text"],
body.theme-dawn .card.qiyam-section input[type="text"],
body.theme-dawn .card.tasbih-kpi-section input[type="text"],
body.theme-dawn .card.adhkar-section input[type="text"],
body.theme-dawn .card.quran-section select,
body.theme-dawn .card.qiyam-section select,
body.theme-dawn .card.tasbih-kpi-section select,
body.theme-dawn .card.adhkar-section select {
  background: #ffffff;
  color: #000000;
  border-color: #9db8a7;
}

body.theme-dawn .card.adhkar-section .challenge {
  background: #ffffff;
  border-color: #bad1c2;
}

body.theme-dawn .card.quran-section #quranText,
body.theme-dawn .card.qiyam-section #qiyamStats,
body.theme-dawn .card.qiyam-section #qiyamRakaatStats,
body.theme-dawn .card.tasbih-kpi-section #tasbihStatsSummary,
body.theme-dawn .card.adhkar-section #adhkarStats {
  color: #000000;
}

body.theme-dawn .card.tasbih-kpi-section .kpi strong,
body.theme-dawn .card.tasbih-kpi-section #tasbihKpiTotal,
body.theme-dawn .card.tasbih-kpi-section #tasbihKpiDailyAvg,
body.theme-dawn .card.tasbih-kpi-section #tasbihKpiBest {
  color: #123f86;
}
