/* ==================== EMBEDDED ISLAMIC & UI FONTS (100% OFFLINE) ==================== */
@font-face {
  font-family: 'AmiriQuran';
  src: url('../assets/fonts/AmiriQuran-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'UthmanicHafs';
  src: url('../assets/fonts/UthmanicHafs1-Ver09.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'QuranNaskh';
  src: url('../assets/fonts/AdobeNaskh-Medium.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'DuaArabic';
  src: url('../assets/fonts/AdobeArabic-Regular.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'DuaArabic';
  src: url('../assets/fonts/AdobeArabic-Bold.otf') format('opentype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

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

@font-face {
  font-family: 'UIFont';
  src: url('../assets/fonts/IBMPlexArabic-SemiBold.ttf') format('truetype');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

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

/* ==================== ROYAL ISLAMIC SANCTUARY DESIGN TOKENS ==================== */
:root {
  color-scheme: dark;

  --font-ui: 'UIFont', system-ui, -apple-system, sans-serif;
  --font-quran: 'AmiriQuran', 'UthmanicHafs', 'QuranNaskh', serif;
  --font-dua: 'DuaArabic', 'AmiriQuran', 'QuranNaskh', serif;
  --font-scale: 1;
  --sticky-height: 58px;

  /* Light Mode Tokens (Warm Illuminated Ivory Parchment) */
  --bg-page-solid: #efe6d3;
  --bg-page-grad: radial-gradient(ellipse 95% 45% at 50% 0%, #fcf7eb 0%, #f1e7d2 52%, #e4d6b9 100%);
  --bg-card: rgba(255, 252, 245, 0.88);
  --bg-card-solid: #fffcf5;
  --bg-card-done: rgba(235, 248, 242, 0.9);
  --bg-surface: rgba(255, 255, 255, 0.85);
  --bg-emerald-soft: rgba(226, 243, 236, 0.88);
  --bg-gold-soft: rgba(250, 240, 214, 0.85);
  --bg-manuscript: rgba(248, 238, 212, 0.45);
  --border-card: rgba(186, 154, 88, 0.36);
  --border-done: rgba(34, 134, 98, 0.48);
  --border-gold: rgba(188, 146, 62, 0.52);

  --ink: #16221f;
  --muted: #4b5d58;
  --emerald: #0e4f42;
  --emerald-deep: #062821;
  --emerald-bright: #197461;
  --gold: #8f6417;
  --gold-light: #cfa349;

  --sunnah-bg: rgba(218, 242, 232, 0.92);
  --sunnah-fg: #0b4f38;
  --sunnah-bd: rgba(74, 158, 126, 0.42);
  --sugg-bg: rgba(250, 239, 212, 0.92);
  --sugg-fg: #754e0b;
  --sugg-bd: rgba(207, 163, 73, 0.5);

  --header-bg: rgba(7, 42, 35, 0.88);
  --header-bg-stuck: rgba(5, 32, 27, 0.94);
  --nav-dock-bg: rgba(255, 252, 245, 0.9);
  --hero-grad: linear-gradient(155deg, #104e41 0%, #083028 54%, #041d18 100%);
  --shadow-card: 0 8px 24px rgba(15, 42, 34, 0.08);
  --shadow-lg: 0 16px 38px rgba(6, 28, 23, 0.22);

  --pattern-opacity: 0.13;
  --pattern-svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='88' viewBox='0 0 88 88'%3E%3Cg fill='none' stroke='%238c651c' stroke-width='0.85'%3E%3Crect x='28' y='28' width='32' height='32' rx='1'/%3E%3Crect x='28' y='28' width='32' height='32' rx='1' transform='rotate(45 44 44)'/%3E%3Ccircle cx='44' cy='44' r='9'/%3E%3Ccircle cx='44' cy='44' r='2.4' fill='%238c651c'/%3E%3Cpath d='M0 44 L21 44 M67 44 L88 44 M44 0 L44 21 M44 67 L44 88'/%3E%3Cpath d='M0 0 L18 18 M88 0 L70 18 M0 88 L18 70 M88 88 L70 70'/%3E%3Ccircle cx='0' cy='0' r='12'/%3E%3Ccircle cx='88' cy='0' r='12'/%3E%3Ccircle cx='0' cy='88' r='12'/%3E%3Ccircle cx='88' cy='88' r='12'/%3E%3C/g%3E%3C/svg%3E");
  --ambient-glow: radial-gradient(circle at 50% -6%, rgba(215, 174, 86, 0.18), transparent 52%);

  --scrollbar-track: #e8dec8;
  --scrollbar-thumb: #b49a64;

  accent-color: var(--emerald);
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

:root:has(> head > meta[name="color-scheme"][content="dark"]) {
  color-scheme: dark;
}

:root:has(> head > meta[name="color-scheme"][content="light"]) {
  color-scheme: light;
}

/* ==================== DARK ROYAL SANCTUARY MODE ==================== */
@media (prefers-color-scheme: dark) {
  :root:not(:has(> head > meta[name="color-scheme"][content="light"])) {
    --bg-page-solid: #04100d;
    --bg-page-grad: radial-gradient(ellipse 90% 48% at 50% 0%, #0e352b 0%, #061a15 44%, #030c0a 100%);
    --bg-card: rgba(9, 28, 24, 0.8);
    --bg-card-solid: #0b221d;
    --bg-card-done: rgba(11, 44, 35, 0.86);
    --bg-surface: rgba(14, 39, 33, 0.84);
    --bg-emerald-soft: rgba(14, 48, 39, 0.82);
    --bg-gold-soft: rgba(45, 34, 14, 0.78);
    --bg-manuscript: rgba(5, 18, 15, 0.56);
    --border-card: rgba(218, 178, 92, 0.24);
    --border-done: rgba(52, 168, 128, 0.52);
    --border-gold: rgba(226, 186, 98, 0.44);

    --ink: #f6efe0;
    --muted: #a6bdb6;
    --emerald: #268c72;
    --emerald-deep: #051c17;
    --emerald-bright: #34a889;
    --gold: #e6c06c;
    --gold-light: #f0d38d;

    --sunnah-bg: rgba(14, 58, 45, 0.88);
    --sunnah-fg: #8ce9c8;
    --sunnah-bd: rgba(52, 168, 128, 0.45);
    --sugg-bg: rgba(50, 38, 16, 0.86);
    --sugg-fg: #f3d284;
    --sugg-bd: rgba(226, 186, 98, 0.45);

    --header-bg: rgba(5, 22, 18, 0.84);
    --header-bg-stuck: rgba(4, 17, 14, 0.94);
    --nav-dock-bg: rgba(6, 22, 18, 0.9);
    --hero-grad: linear-gradient(155deg, rgba(16, 68, 56, 0.92) 0%, rgba(8, 38, 31, 0.94) 55%, rgba(4, 21, 17, 0.96) 100%);
    --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 18px 44px rgba(0, 0, 0, 0.62);

    --pattern-opacity: 0.14;
    --pattern-svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='88' viewBox='0 0 88 88'%3E%3Cg fill='none' stroke='%23e5be6c' stroke-width='0.82'%3E%3Crect x='28' y='28' width='32' height='32' rx='1'/%3E%3Crect x='28' y='28' width='32' height='32' rx='1' transform='rotate(45 44 44)'/%3E%3Ccircle cx='44' cy='44' r='9'/%3E%3Ccircle cx='44' cy='44' r='2.4' fill='%23e5be6c'/%3E%3Cpath d='M0 44 L21 44 M67 44 L88 44 M44 0 L44 21 M44 67 L44 88'/%3E%3Cpath d='M0 0 L18 18 M88 0 L70 18 M0 88 L18 70 M88 88 L70 70'/%3E%3Ccircle cx='0' cy='0' r='12'/%3E%3Ccircle cx='88' cy='0' r='12'/%3E%3Ccircle cx='0' cy='88' r='12'/%3E%3Ccircle cx='88' cy='88' r='12'/%3E%3C/g%3E%3C/svg%3E");
    --ambient-glow: radial-gradient(circle at 50% -8%, rgba(230, 192, 108, 0.15), transparent 56%);

    --scrollbar-track: #081814;
    --scrollbar-thumb: #2b5449;
  }
}

:root:has(> head > meta[name="color-scheme"][content="dark"]) {
  --bg-page-solid: #04100d;
  --bg-page-grad: radial-gradient(ellipse 90% 48% at 50% 0%, #0e352b 0%, #061a15 44%, #030c0a 100%);
  --bg-card: rgba(9, 28, 24, 0.8);
  --bg-card-solid: #0b221d;
  --bg-card-done: rgba(11, 44, 35, 0.86);
  --bg-surface: rgba(14, 39, 33, 0.84);
  --bg-emerald-soft: rgba(14, 48, 39, 0.82);
  --bg-gold-soft: rgba(45, 34, 14, 0.78);
  --bg-manuscript: rgba(5, 18, 15, 0.56);
  --border-card: rgba(218, 178, 92, 0.24);
  --border-done: rgba(52, 168, 128, 0.52);
  --border-gold: rgba(226, 186, 98, 0.44);

  --ink: #f6efe0;
  --muted: #a6bdb6;
  --emerald: #268c72;
  --emerald-deep: #051c17;
  --emerald-bright: #34a889;
  --gold: #e6c06c;
  --gold-light: #f0d38d;

  --sunnah-bg: rgba(14, 58, 45, 0.88);
  --sunnah-fg: #8ce9c8;
  --sunnah-bd: rgba(52, 168, 128, 0.45);
  --sugg-bg: rgba(50, 38, 16, 0.86);
  --sugg-fg: #f3d284;
  --sugg-bd: rgba(226, 186, 98, 0.45);

  --header-bg: rgba(5, 22, 18, 0.84);
  --header-bg-stuck: rgba(4, 17, 14, 0.94);
  --nav-dock-bg: rgba(6, 22, 18, 0.9);
  --hero-grad: linear-gradient(155deg, rgba(16, 68, 56, 0.92) 0%, rgba(8, 38, 31, 0.94) 55%, rgba(4, 21, 17, 0.96) 100%);
  --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 18px 44px rgba(0, 0, 0, 0.62);

  --pattern-opacity: 0.14;
  --pattern-svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='88' viewBox='0 0 88 88'%3E%3Cg fill='none' stroke='%23e5be6c' stroke-width='0.82'%3E%3Crect x='28' y='28' width='32' height='32' rx='1'/%3E%3Crect x='28' y='28' width='32' height='32' rx='1' transform='rotate(45 44 44)'/%3E%3Ccircle cx='44' cy='44' r='9'/%3E%3Ccircle cx='44' cy='44' r='2.4' fill='%23e5be6c'/%3E%3Cpath d='M0 44 L21 44 M67 44 L88 44 M44 0 L44 21 M44 67 L44 88'/%3E%3Cpath d='M0 0 L18 18 M88 0 L70 18 M0 88 L18 70 M88 88 L70 70'/%3E%3Ccircle cx='0' cy='0' r='12'/%3E%3Ccircle cx='88' cy='0' r='12'/%3E%3Ccircle cx='0' cy='88' r='12'/%3E%3Ccircle cx='88' cy='88' r='12'/%3E%3C/g%3E%3C/svg%3E");
  --ambient-glow: radial-gradient(circle at 50% -8%, rgba(230, 192, 108, 0.15), transparent 56%);

  --scrollbar-track: #081814;
  --scrollbar-thumb: #2b5449;
}

:root[data-quran-font="amiri"] {
  --font-quran: 'AmiriQuran', 'UthmanicHafs', 'QuranNaskh', serif;
}

:root[data-quran-font="naskh"] {
  --font-quran: 'QuranNaskh', 'AmiriQuran', 'UthmanicHafs', serif;
}

:root[data-quran-font="uthmani"] {
  --font-quran: 'UthmanicHafs', 'AmiriQuran', 'QuranNaskh', serif;
}

/* ==================== RESET & FULL-APP ISLAMIC WALLPAPER ==================== */
*, *::before, *::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--sticky-height) + 14px);
  -webkit-tap-highlight-color: transparent;
  background-color: var(--bg-page-solid);
}

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

body {
  margin: 0;
  font-family: var(--font-ui);
  background-color: var(--bg-page-solid);
  background-image: var(--bg-page-grad);
  background-attachment: fixed;
  color: var(--ink);
  line-height: 1.7;
  direction: rtl;
  min-height: 100dvh;
  padding-bottom: 88px;
  position: relative;
  overflow-x: clip;
}

/* Seamless full-app Islamic Girih geometric star-lattice background */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: var(--pattern-svg);
  background-size: 88px 88px;
  opacity: var(--pattern-opacity);
}

/* Soft top golden lantern atmospheric halo */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: var(--ambient-glow);
}

.page-shell {
  position: relative;
  z-index: 1;
  overflow-anchor: none;
}

@media (min-width: 860px) {
  body {
    padding-bottom: 44px;
  }
}

button, input {
  font-family: inherit;
}

button {
  cursor: pointer;
}

:focus-visible {
  outline: 2.5px solid var(--gold-light);
  outline-offset: 2px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link:focus {
  position: fixed;
  top: 10px;
  right: 10px;
  width: auto;
  height: auto;
  clip: auto;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--emerald-deep);
  color: #fff;
  z-index: 1000;
  text-decoration: none;
}

svg.icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* ==================== CLEAN STICKY COMMAND BAR ==================== */
.sticky-container {
  position: sticky;
  top: 0;
  z-index: 45;
  container-type: scroll-state;
  container-name: top-header;
}

.sticky-header {
  background: var(--header-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: #fff;
  border-bottom: 1px solid rgba(229, 190, 108, 0.28);
  transition: background-color 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

@container top-header scroll-state(stuck: top) {
  .sticky-header {
    background: var(--header-bg-stuck);
    border-bottom-color: rgba(229, 190, 108, 0.45);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.32);
  }
}

.sticky-container.is-stuck .sticky-header {
  background: var(--header-bg-stuck);
  border-bottom-color: rgba(229, 190, 108, 0.45);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.32);
}

.sticky-inner {
  max-width: 980px;
  margin: 0 auto;
  padding: 9px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.brand-mini {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.brand-emblem {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  border: 1px solid rgba(235, 208, 140, 0.55);
  background: linear-gradient(145deg, rgba(22, 74, 62, 0.9), rgba(6, 28, 23, 0.95));
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: #f3d794;
  box-shadow: inset 0 0 10px rgba(230, 192, 108, 0.16);
}

.brand-emblem svg {
  width: 22px;
  height: 22px;
}

.brand-title-stack {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  min-width: 0;
}

.brand-mini-text {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fffaf0;
  white-space: nowrap;
}

.sticky-mini-progress {
  font-size: 0.72rem;
  font-weight: 600;
  color: #ecd08c;
  white-space: nowrap;
}

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.glass-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  min-width: 36px;
  padding: 0 10px;
  border-radius: 11px;
  border: 1px solid rgba(235, 208, 140, 0.25);
  background: rgba(255, 255, 255, 0.08);
  color: #fffaf0;
  font-size: 0.78rem;
  font-weight: 600;
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
  white-space: nowrap;
}

.glass-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(235, 208, 140, 0.55);
}

.glass-btn:active {
  transform: scale(0.96);
}

.glass-btn.icon-only {
  width: 36px;
  padding: 0;
}

.glass-btn.theme-toggle-btn {
  background: rgba(230, 192, 108, 0.16);
  border-color: rgba(235, 208, 140, 0.45);
  color: #fae2a3;
}

.glass-btn.theme-toggle-btn:hover {
  background: rgba(230, 192, 108, 0.28);
}

.glass-btn.gold-cta {
  background: linear-gradient(135deg, rgba(226, 186, 98, 0.28), rgba(165, 119, 35, 0.34));
  border-color: rgba(235, 208, 140, 0.65);
  color: #fff6dc;
  font-weight: 700;
}

.desktop-only-btn,
.btn-label-md {
  display: none;
}

@media (min-width: 720px) {
  .desktop-only-btn {
    display: inline-flex;
  }
  .btn-label-md {
    display: inline;
  }
}

/* ==================== COMPACT FLOATING MIHRAB HERO CARD ==================== */
.hero-outer {
  max-width: 980px;
  margin: 12px auto 0;
  padding: 0 12px;
}

.hero-banner {
  position: relative;
  overflow: hidden;
  background: var(--hero-grad);
  color: #fff;
  border-radius: 24px;
  border: 1.5px solid rgba(230, 192, 108, 0.42);
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 240, 200, 0.16);
}

.hero-pattern {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.14;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='72' viewBox='0 0 72 72'%3E%3Cg fill='none' stroke='%23f0d38d' stroke-width='0.85'%3E%3Crect x='20' y='20' width='32' height='32' rx='1'/%3E%3Crect x='20' y='20' width='32' height='32' rx='1' transform='rotate(45 36 36)'/%3E%3Ccircle cx='36' cy='36' r='6.5'/%3E%3C/g%3E%3C/svg%3E");
}

.hero-arch-glow {
  position: absolute;
  top: -76px;
  left: 50%;
  transform: translateX(-50%);
  width: min(100%, 380px);
  height: 170px;
  background: radial-gradient(circle, rgba(240, 211, 141, 0.24) 0%, transparent 72%);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  padding: 14px 16px 15px;
}

.hero-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(235, 208, 140, 0.32);
  font-size: 0.72rem;
  font-weight: 600;
  color: #f4e2b3;
}

.meta-chip.streak-pill {
  background: rgba(230, 192, 108, 0.22);
  border-color: rgba(240, 211, 141, 0.58);
  color: #ffeab4;
  font-weight: 700;
}

.meta-chip.offline-dot {
  background: rgba(34, 152, 112, 0.28);
  border-color: rgba(135, 228, 196, 0.45);
  color: #b7f5de;
}

.hero-title-block {
  text-align: center;
  margin: 0 0 12px;
}

.basmalah-hero {
  font-family: var(--font-quran);
  font-size: clamp(1.18rem, 3.6vw, 1.45rem);
  color: #f3d794;
  margin: 0;
  line-height: 1.55;
}

.hero-title {
  margin: 2px 0 0;
  font-size: clamp(1.32rem, 4.2vw, 1.82rem);
  font-weight: 700;
  line-height: 1.28;
  color: #ffffff;
  letter-spacing: 0.01em;
}

.hero-ornament-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 6px auto 4px;
  max-width: 220px;
  color: #e6c06c;
}

.hero-ornament-line span {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(230, 192, 108, 0.7), transparent);
}

.hero-greeting-line {
  margin: 0;
  font-size: 0.78rem;
  color: rgba(255, 250, 236, 0.84);
}

.hero-progress-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(0, 0, 0, 0.26);
  border: 1px solid rgba(235, 208, 140, 0.32);
  border-radius: 15px;
  padding: 9px 13px;
}

.progress-ring-wrap {
  position: relative;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}

.progress-ring-svg {
  width: 44px;
  height: 44px;
  transform: rotate(-90deg);
}

.progress-ring-track {
  fill: none;
  stroke: rgba(255, 255, 255, 0.14);
  stroke-width: 4.5;
}

.progress-ring-fill {
  fill: none;
  stroke: #f0d38d;
  stroke-width: 4.5;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.35s ease;
}

.progress-ring-text {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: #fff;
}

.progress-info {
  flex: 1;
  min-width: 0;
}

.progress-info-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 6px;
}

.progress-label {
  font-size: 0.84rem;
  font-weight: 700;
  color: #fff;
}

.progress-counts {
  font-size: 0.8rem;
  font-weight: 700;
  color: #f3d794;
  white-space: nowrap;
}

.progress-bar-bg {
  height: 6px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.14);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #caa042, #f8e2a2);
  transition: width 0.35s ease;
}

/* ==================== NAVIGATION (DESKTOP TABS + MOBILE FLOATING DOCK) ==================== */
.desktop-tabs {
  display: none;
  max-width: 980px;
  margin: 14px auto 4px;
  padding: 0 12px;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}

@media (min-width: 860px) {
  .desktop-tabs {
    display: flex;
  }
}

.tab-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: 99px;
  border: 1px solid var(--border-card);
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: var(--shadow-card);
  transition: all 0.2s ease;
}

.tab-pill:hover {
  border-color: var(--gold-light);
  transform: translateY(-1px);
}

.tab-pill[aria-selected="true"] {
  background: linear-gradient(135deg, var(--emerald-deep), var(--emerald));
  color: #fffaf0;
  border-color: var(--gold-light);
  box-shadow: 0 8px 20px rgba(6, 36, 29, 0.32);
}

.mobile-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 3px;
  padding: 6px 8px calc(7px + env(safe-area-inset-bottom, 0px));
  background: var(--nav-dock-bg);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid var(--border-gold);
  box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.18);
}

@media (min-width: 860px) {
  .mobile-bottom-nav {
    display: none;
  }
}

.bottom-nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 6px 2px;
  border: 1px solid transparent;
  border-radius: 13px;
  background: transparent;
  color: var(--muted);
  font-size: 0.69rem;
  font-weight: 600;
  transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.bottom-nav-btn svg.icon {
  width: 20px;
  height: 20px;
}

.bottom-nav-btn[aria-selected="true"] {
  color: var(--gold);
  background: var(--bg-emerald-soft);
  border-color: var(--border-card);
  font-weight: 700;
}

/* ==================== MAIN WORKSPACE & FILTER CHIPS ==================== */
.main-container {
  max-width: 980px;
  margin: 0 auto;
  padding: 12px 12px 24px;
}

.new-day-banner {
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  border: 1.5px solid var(--border-gold);
  border-radius: 18px;
  padding: 13px 15px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  box-shadow: var(--shadow-card);
}

.new-day-banner strong {
  display: block;
  color: var(--gold);
  font-size: 0.92rem;
}

.new-day-banner span {
  font-size: 0.82rem;
  color: var(--muted);
}

.new-day-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-rail {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
}

.filter-rail-viewport {
  position: relative;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  border-radius: 99px;
}

.filter-strip {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 2px 2px;
  margin-bottom: 0;
  scrollbar-width: none;
  scroll-behavior: smooth;
}

.filter-strip::-webkit-scrollbar {
  display: none;
}

.filter-rail-viewport::before,
.filter-rail-viewport::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 24px;
  pointer-events: none;
  z-index: 2;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.filter-rail-viewport::before {
  right: 0;
  background: linear-gradient(to left, var(--bg-page-solid), transparent);
}

.filter-rail-viewport::after {
  left: 0;
  background: linear-gradient(to right, var(--bg-page-solid), transparent);
}

.filter-rail.can-right .filter-rail-viewport::before {
  opacity: 0.9;
}

.filter-rail.can-left .filter-rail-viewport::after {
  opacity: 0.9;
}

.rail-arrow {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--border-gold);
  background: var(--bg-card);
  backdrop-filter: blur(8px);
  color: var(--gold);
  display: none;
  place-items: center;
  flex-shrink: 0;
  box-shadow: var(--shadow-card);
  transition: transform 0.15s ease, opacity 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.filter-rail.is-scrollable .rail-arrow {
  display: grid;
}

.rail-arrow:hover:not(:disabled) {
  background: var(--bg-emerald-soft);
  border-color: var(--gold-light);
}

.rail-arrow:active:not(:disabled) {
  transform: scale(0.92);
}

.rail-arrow:disabled {
  opacity: 0.28;
  cursor: default;
}

.rail-arrow svg.icon {
  width: 15px;
  height: 15px;
}

.chip-btn {
  flex-shrink: 0;
  padding: 7px 14px;
  border-radius: 99px;
  border: 1px solid var(--border-card);
  background: var(--bg-card);
  backdrop-filter: blur(8px);
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.chip-btn:hover {
  border-color: var(--gold-light);
}

.chip-btn[aria-pressed="true"] {
  background: linear-gradient(135deg, var(--emerald-deep), var(--emerald));
  color: #fffaf0;
  border-color: var(--gold-light);
}

.notice-strip {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--bg-gold-soft);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-gold);
  border-radius: 15px;
  padding: 10px 13px;
  margin-bottom: 14px;
  font-size: 0.8rem;
  color: var(--ink);
  line-height: 1.65;
}

/* ==================== SECTION HEADERS (CALLIGRAPHIC RIBBON) ==================== */
.section-banner {
  position: relative;
  overflow: hidden;
  background: var(--hero-grad);
  color: #fff;
  border-radius: 17px;
  border: 1px solid rgba(230, 192, 108, 0.45);
  border-right: 4px solid var(--gold-light);
  padding: 12px 15px;
  margin: 18px 0 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  box-shadow: var(--shadow-card);
}

.section-banner::after {
  content: '';
  position: absolute;
  left: -14px;
  top: 50%;
  transform: translateY(-50%);
  width: 72px;
  height: 72px;
  opacity: 0.14;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cg fill='none' stroke='%23f0d38d' stroke-width='1.5'%3E%3Crect x='14' y='14' width='36' height='36'/%3E%3Crect x='14' y='14' width='36' height='36' transform='rotate(45 32 32)'/%3E%3Ccircle cx='32' cy='32' r='9'/%3E%3C/g%3E%3C/svg%3E");
  background-size: contain;
}

.section-num-label {
  display: block;
  font-size: 0.72rem;
  color: #f3d794;
  font-weight: 700;
  margin-bottom: 2px;
}

.section-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.4;
}

.section-progress-badge {
  position: relative;
  z-index: 1;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(235, 208, 140, 0.42);
  color: #f7e4b2;
  padding: 4px 11px;
  border-radius: 99px;
  font-size: 0.76rem;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}

.section-progress-badge.done {
  background: #1b7e5c;
  border-color: #9be8ca;
  color: #fff;
}

.subgroup-banner {
  background: var(--bg-card);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-gold);
  border-right: 4px solid var(--gold-light);
  border-radius: 13px;
  padding: 8px 13px;
  margin: 14px 0 8px;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--gold);
}

/* ==================== ILLUMINATED FROSTED MANUSCRIPT CARDS ==================== */
.wird-card {
  position: relative;
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-card);
  border-radius: 20px;
  margin-bottom: 13px;
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: border-color 0.25s ease, background-color 0.25s ease, box-shadow 0.25s ease;
}

.wird-card:hover {
  border-color: var(--border-gold);
}

.wird-card.is-completed {
  background: var(--bg-card-done);
  border-color: var(--border-done);
}

.wird-card-accent {
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--gold-light), var(--gold), var(--gold-light), transparent);
  opacity: 0.85;
}

.wird-card.is-sunnah .wird-card-accent {
  background: linear-gradient(90deg, transparent, var(--emerald-bright), var(--gold-light), var(--emerald-bright), transparent);
}

.wird-card-body {
  padding: 14px 15px 15px;
  position: relative;
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.card-title {
  margin: 0;
  font-size: calc(0.95rem * var(--font-scale));
  font-weight: 700;
  color: var(--ink);
  line-height: 1.5;
}

.wird-card.is-completed .card-title {
  color: var(--emerald-bright);
}

.card-head-tools {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.card-mini-icon-btn {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  border: 1px solid var(--border-card);
  background: var(--bg-surface);
  color: var(--muted);
  transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.card-mini-icon-btn:hover {
  color: var(--gold);
  border-color: var(--gold-light);
}

.card-mini-icon-btn svg.icon {
  width: 15px;
  height: 15px;
}

.card-live-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
  background: var(--bg-gold-soft);
  color: var(--gold);
  border: 1px solid var(--border-gold);
}

.wird-card.is-completed .card-live-pill {
  background: var(--sunnah-bg);
  color: var(--sunnah-fg);
  border-color: var(--sunnah-bd);
}

.card-meta-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 8px;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 0.74rem;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

.badge-sunnah {
  background: var(--sunnah-bg);
  color: var(--sunnah-fg);
  border: 1px solid var(--sunnah-bd);
}

.badge-suggested {
  background: var(--sugg-bg);
  color: var(--sugg-fg);
  border: 1px solid var(--sugg-bd);
}

.target-switcher {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 99px;
  background: var(--bg-surface);
  border: 1px solid var(--border-card);
  font-size: 0.74rem;
  color: var(--muted);
}

.target-opt-btn {
  min-width: 24px;
  height: 22px;
  padding: 0 7px;
  border: none;
  border-radius: 99px;
  background: transparent;
  color: var(--ink);
  font-size: 0.74rem;
  font-weight: 700;
}

.target-opt-btn[aria-pressed="true"] {
  background: var(--emerald);
  color: #fff;
}

.collapse-toggle-btn {
  margin-right: auto;
  padding: 4px 11px;
  border-radius: 99px;
  border: 1px solid var(--border-gold);
  background: var(--bg-gold-soft);
  color: var(--gold);
  font-size: 0.76rem;
  font-weight: 700;
}

.card-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-gold), transparent);
  margin: 12px 0;
  opacity: 0.75;
}

/* ==================== ILLUMINATED QURANIC MANUSCRIPT FRAME ==================== */
.quran-manuscript-frame {
  position: relative;
  padding: 15px 15px;
  border-radius: 15px;
  background-color: var(--bg-manuscript);
  border: 1px solid var(--border-gold);
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 22 22'%3E%3Cpath d='M1 12 V3 Q1 1 3 1 H12 M5 9 V5 H9' fill='none' stroke='%23d7ae56' stroke-width='1.1' opacity='0.65'/%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 22 22'%3E%3Cpath d='M21 12 V3 Q21 1 19 1 H10 M17 9 V5 H13' fill='none' stroke='%23d7ae56' stroke-width='1.1' opacity='0.65'/%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 22 22'%3E%3Cpath d='M1 10 V19 Q1 21 3 21 H12 M5 13 V17 H9' fill='none' stroke='%23d7ae56' stroke-width='1.1' opacity='0.65'/%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 22 22'%3E%3Cpath d='M21 10 V19 Q21 21 19 21 H10 M17 13 V17 H13' fill='none' stroke='%23d7ae56' stroke-width='1.1' opacity='0.65'/%3E%3C/svg%3E");
  background-position: top 6px left 6px, top 6px right 6px, bottom 6px left 6px, bottom 6px right 6px;
  background-repeat: no-repeat;
}

.basmalah-line {
  font-family: var(--font-quran);
  font-size: calc(1.42rem * var(--font-scale));
  text-align: center;
  color: var(--gold);
  margin: 0 0 8px;
  line-height: 1.85;
}

.quran-text {
  font-family: var(--font-quran);
  font-size: calc(1.56rem * var(--font-scale));
  line-height: 2.34;
  color: var(--ink);
  text-align: start;
  margin: 0;
  word-spacing: 1px;
  font-feature-settings: "kern" 1, "liga" 1, "calt" 1;
}

@media (min-width: 640px) {
  .quran-text {
    text-align: justify;
    text-justify: inter-word;
  }
}

.quran-ornament {
  color: var(--gold);
  margin-inline: 5px;
  font-weight: 400;
}

.ayah-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 26px;
  padding: 0 5px;
  margin: 0 3px;
  border-radius: 50%;
  font-family: var(--font-ui);
  font-size: calc(0.72rem * var(--font-scale));
  font-weight: 700;
  color: var(--gold);
  background: var(--bg-gold-soft);
  border: 1.2px solid var(--gold-light);
  vertical-align: middle;
  line-height: 1;
}

.dua-diacritic-text {
  font-family: var(--font-dua);
  font-size: calc(1.55rem * var(--font-scale));
  line-height: 2.05;
  color: var(--ink);
  text-align: start;
  margin: 0;
}

.dhikr-card-text {
  font-family: var(--font-dua);
  font-size: calc(1.62rem * var(--font-scale));
  line-height: 2.0;
  font-weight: 700;
  color: var(--ink);
  text-align: start;
  margin: 0;
}

.dua-plain-text,
.guidance-text {
  font-family: var(--font-ui);
  font-size: calc(0.98rem * var(--font-scale));
  line-height: 1.9;
  color: var(--ink);
  text-align: start;
  margin: 0;
}

.secondary-dua-box {
  margin-top: 10px;
  padding: 10px 13px;
  border-radius: 12px;
  background: var(--bg-emerald-soft);
  border: 1px solid var(--border-card);
  font-family: var(--font-dua);
  font-size: calc(1.48rem * var(--font-scale));
  line-height: 1.95;
  font-weight: 700;
}

.card-note-box {
  margin-top: 10px;
  padding: 8px 12px;
  border-radius: 11px;
  background: var(--bg-gold-soft);
  border-right: 3px solid var(--gold-light);
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.65;
}

/* ==================== COUNTER ACTION BAR ==================== */
.counter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
}

.counter-main-btn {
  flex: 1;
  min-height: 50px;
  padding: 8px 14px;
  border-radius: 14px;
  border: 1px solid var(--border-done);
  background: var(--bg-emerald-soft);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  transition: transform 0.12s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.counter-main-btn:hover {
  border-color: var(--gold-light);
}

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

.wird-card.is-completed .counter-main-btn {
  background: linear-gradient(135deg, #105e48, #1a7e63);
  border-color: var(--gold-light);
  color: #fff;
}

.mini-ring {
  position: relative;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
}

.mini-ring svg {
  width: 34px;
  height: 34px;
  transform: rotate(-90deg);
}

.mini-ring-track {
  fill: none;
  stroke: rgba(128, 155, 145, 0.25);
  stroke-width: 3.5;
}

.mini-ring-fill {
  fill: none;
  stroke: var(--gold);
  stroke-width: 3.5;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.25s ease;
}

.wird-card.is-completed .mini-ring-fill {
  stroke: #f4dfaa;
}

.mini-ring-num {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 0.72rem;
  font-weight: 700;
}

.counter-labels {
  flex: 1;
  text-align: right;
  line-height: 1.3;
}

.counter-primary-lbl {
  display: block;
  font-size: 0.88rem;
  font-weight: 700;
}

.counter-sub-lbl {
  display: block;
  font-size: 0.74rem;
  opacity: 0.82;
}

.counter-util-btn {
  width: 46px;
  height: 50px;
  border-radius: 14px;
  border: 1px solid var(--border-card);
  background: var(--bg-surface);
  color: var(--ink);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: border-color 0.2s ease, opacity 0.2s ease;
}

.counter-util-btn:hover:not(:disabled) {
  border-color: var(--gold-light);
  color: var(--gold);
}

.counter-util-btn:disabled {
  opacity: 0.36;
  cursor: not-allowed;
}

.counter-util-btn.tasbih-quick {
  border-color: var(--border-gold);
  background: var(--bg-gold-soft);
  color: var(--gold);
}

/* ==================== MULTI-TASBIH STUDIO WITH 33 PEARL BEADS ==================== */
.tasbih-studio {
  display: grid;
  gap: 14px;
}

.tasbih-stage {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-gold);
  border-radius: 24px;
  padding: 18px 16px 20px;
  text-align: center;
  box-shadow: var(--shadow-card);
}

.tasbih-phrase-box {
  background: var(--bg-manuscript);
  border: 1px solid var(--border-gold);
  border-radius: 16px;
  padding: 14px 15px;
  margin-bottom: 16px;
}

.tasbih-phrase-main {
  font-family: var(--font-dua);
  font-size: calc(1.72rem * var(--font-scale));
  line-height: 1.85;
  color: var(--ink);
  margin: 0;
  font-weight: 700;
}

.tasbih-virtue {
  margin: 6px 0 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.tasbih-fatimi-steps {
  display: flex;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.fatimi-step {
  padding: 4px 11px;
  border-radius: 99px;
  font-size: 0.76rem;
  font-weight: 700;
  border: 1px solid var(--border-card);
  background: var(--bg-surface);
  color: var(--muted);
}

.fatimi-step.active {
  background: var(--emerald);
  border-color: var(--gold-light);
  color: #fff;
}

.fatimi-step.done {
  background: var(--sunnah-bg);
  border-color: var(--sunnah-bd);
  color: var(--sunnah-fg);
}

.tasbih-dome-wrap {
  position: relative;
  width: 244px;
  height: 244px;
  margin: 4px auto 14px;
  display: grid;
  place-items: center;
}

.tasbih-dome-ring {
  position: absolute;
  inset: 0;
  width: 244px;
  height: 244px;
  pointer-events: none;
}

.tasbih-dome-btn {
  width: 170px;
  height: 170px;
  border-radius: 50%;
  border: 2px solid var(--gold-light);
  background: radial-gradient(circle at 35% 28%, #1d7e67 0%, #0a4236 62%, #05221c 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  box-shadow: 0 12px 32px rgba(4, 24, 19, 0.45), inset 0 2px 14px rgba(240, 211, 141, 0.22);
  transition: transform 0.1s ease, box-shadow 0.2s ease;
  user-select: none;
}

.tasbih-dome-btn:active {
  transform: scale(0.95);
}

.tasbih-dome-btn.is-done {
  background: radial-gradient(circle at 35% 28%, #28a074 0%, #0f6246 65%, #073928 100%);
}

.tasbih-big-num {
  font-size: 2.85rem;
  font-weight: 700;
  line-height: 1;
}

.tasbih-target-lbl {
  font-size: 0.8rem;
  color: #f4dfaa;
  font-weight: 600;
}

.tasbih-tap-hint {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.78);
}

.tasbih-controls-row {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.tasbih-stats-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 14px;
}

.stat-tile {
  background: var(--bg-surface);
  border: 1px solid var(--border-card);
  border-radius: 14px;
  padding: 9px 6px;
}

.stat-val {
  display: block;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--gold);
}

.stat-lbl {
  font-size: 0.72rem;
  color: var(--muted);
}

.presets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 9px;
}

.preset-card {
  text-align: right;
  padding: 12px 13px;
  border-radius: 15px;
  border: 1px solid var(--border-card);
  background: var(--bg-card);
  backdrop-filter: blur(8px);
  color: var(--ink);
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: border-color 0.2s ease;
}

.preset-card[aria-pressed="true"] {
  border-color: var(--gold-light);
  background: var(--bg-emerald-soft);
}

.preset-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 0.86rem;
}

.preset-card-count {
  font-size: 0.76rem;
  color: var(--gold);
  white-space: nowrap;
}

.custom-dhikr-form {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  background: var(--bg-card);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-card);
  border-radius: 16px;
  padding: 12px;
}

.text-input {
  flex: 1;
  min-width: 180px;
  padding: 9px 13px;
  border-radius: 11px;
  border: 1px solid var(--border-card);
  background: var(--bg-surface);
  color: var(--ink);
  font-size: 0.88rem;
}

/* ==================== BAQARAH TRACKER & GUIDE ==================== */
.baqarah-tracker-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-done);
  border-radius: 19px;
  padding: 15px 16px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-card);
}

.baqarah-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.baqarah-days {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.baqarah-day-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 13px;
  border: 1px solid var(--border-card);
  background: var(--bg-surface);
  color: var(--ink);
  text-align: right;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.baqarah-day-btn[aria-pressed="true"] {
  background: var(--bg-card-done);
  border-color: var(--emerald-bright);
}

.plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 11px;
  margin-bottom: 14px;
}

.plan-card {
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-card);
  border-radius: 17px;
  padding: 14px 15px;
  box-shadow: var(--shadow-card);
}

.plan-card h3 {
  margin: 0 0 6px;
  font-size: 0.94rem;
  color: var(--gold);
}

.plan-card p {
  margin: 0;
  font-size: 0.84rem;
  color: var(--muted);
  line-height: 1.75;
}

.closing-dua-card {
  margin-top: 16px;
  background: var(--hero-grad);
  color: #f8f2e2;
  border: 1.5px solid rgba(230, 192, 108, 0.55);
  border-radius: 20px;
  padding: 18px 18px;
  text-align: center;
  line-height: 2;
  font-size: 0.95rem;
  box-shadow: var(--shadow-lg);
}

/* ==================== BUTTONS & BOTTOM BAR ==================== */
.btn-primary,
.btn-secondary,
.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 42px;
  padding: 8px 16px;
  border-radius: 12px;
  font-size: 0.84rem;
  font-weight: 700;
  transition: transform 0.12s ease, filter 0.2s ease, border-color 0.2s ease;
}

.btn-primary {
  background: linear-gradient(135deg, #0f5c4b, #1a7e64);
  color: #fff;
  border: 1px solid rgba(235, 208, 140, 0.5);
}

.btn-secondary {
  background: var(--bg-gold-soft);
  color: var(--gold);
  border: 1px solid var(--border-gold);
}

.btn-outline {
  background: var(--bg-surface);
  color: var(--ink);
  border: 1px solid var(--border-card);
}

.btn-primary:hover,
.btn-secondary:hover,
.btn-outline:hover {
  filter: brightness(1.06);
  border-color: var(--gold-light);
}

.bottom-reset-bar {
  margin-top: 18px;
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-card);
  border-radius: 18px;
  padding: 13px 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

/* ==================== NATIVE <dialog> MODALS ==================== */
dialog.app-dialog {
  width: min(94vw, 540px);
  max-height: 86dvh;
  margin: auto;
  padding: 0;
  border: 1.5px solid var(--border-gold);
  border-radius: 22px;
  background: var(--bg-card-solid);
  color: var(--ink);
  box-shadow: var(--shadow-lg);
  overscroll-behavior: contain;
  overflow: hidden;
}

dialog.focus-reader-dialog {
  width: min(95vw, 680px);
}

dialog.app-dialog::backdrop {
  background: rgba(2, 12, 10, 0.68);
  backdrop-filter: blur(5px);
}

.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 18px;
  background: var(--bg-emerald-soft);
  border-bottom: 1px solid var(--border-card);
}

.dialog-head h1 {
  margin: 0;
  font-size: 1rem;
  color: var(--ink);
}

.dialog-close-btn {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--border-card);
  background: var(--bg-surface);
  color: var(--ink);
  display: grid;
  place-items: center;
}

.dialog-body {
  padding: 16px 18px 18px;
  overflow-y: auto;
  max-height: calc(86dvh - 64px);
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

.platform-grid {
  display: grid;
  gap: 10px;
}

.platform-card {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--border-card);
  background: var(--bg-surface);
}

.platform-card h2 {
  margin: 0 0 4px;
  font-size: 0.9rem;
  color: var(--gold);
}

.platform-card p {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.65;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border-card);
  flex-wrap: wrap;
}

.setting-label {
  display: block;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--ink);
}

.setting-sub {
  display: block;
  font-size: 0.76rem;
  color: var(--muted);
}

.segmented {
  display: inline-flex;
  flex-wrap: wrap;
  background: var(--bg-manuscript);
  border: 1px solid var(--border-card);
  border-radius: 11px;
  padding: 3px;
  gap: 2px;
}

.segmented button {
  min-height: 32px;
  padding: 4px 10px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 600;
}

.segmented button[aria-pressed="true"] {
  background: var(--emerald);
  color: #fff;
}

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

.toc-item-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border-card);
  background: var(--bg-surface);
  color: var(--ink);
  text-align: right;
  font-weight: 600;
  font-size: 0.86rem;
}

.toc-item-btn:hover {
  border-color: var(--gold-light);
}

.focus-nav-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border-card);
}

.reminder-schedule-grid {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.reminder-time-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 12px;
  background: var(--bg-manuscript);
  border: 1px solid var(--border-card);
}

.reminder-time-row label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink);
}

.reminder-time-input {
  padding: 5px 8px;
  border-radius: 9px;
  border: 1px solid var(--border-gold);
  background: var(--bg-surface);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 0.85rem;
  font-weight: 600;
}

.share-preview-wrap {
  display: grid;
  place-items: center;
  padding: 8px;
  border-radius: 14px;
  background: var(--bg-manuscript);
  border: 1px solid var(--border-card);
}

.share-preview-img {
  width: 100%;
  max-width: 360px;
  border-radius: 12px;
  box-shadow: var(--shadow-card);
  display: block;
}

/* Toast Notification */
.toast-banner {
  position: fixed;
  bottom: 78px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  max-width: calc(100vw - 28px);
  background: var(--emerald-deep);
  color: #fff;
  border: 1px solid var(--gold-light);
  padding: 9px 16px;
  border-radius: 14px;
  font-size: 0.82rem;
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
  box-shadow: var(--shadow-lg);
}

@media (min-width: 860px) {
  .toast-banner {
    bottom: 24px;
  }
}
