/* Bugar — soft wellness design tokens */
:root {
  --bg: #f0faf7;
  --bg-accent: #d8f3ec;
  --surface: #ffffff;
  --surface-2: #e8f7f2;
  --text: #0f2f2a;
  --text-muted: #5a7a74;
  --border: #c5e4db;
  --primary: #0f766e;
  --primary-hover: #0d9488;
  --primary-soft: #ccfbf1;
  --accent: #059669;
  --danger: #e11d48;
  --warn: #d97706;
  --nav-bg: rgba(255, 255, 255, 0.92);
  --shadow: 0 1px 2px rgb(15 47 42 / 0.06), 0 8px 24px rgb(15 118 110 / 0.08);
  --ring: rgb(15 118 110 / 0.35);
  --pattern: radial-gradient(ellipse 80% 50% at 50% -20%, rgb(45 212 191 / 0.28), transparent),
    radial-gradient(ellipse 60% 40% at 100% 0%, rgb(16 185 129 / 0.12), transparent);
  color-scheme: light;
}

html.dark {
  --bg: #0a1f1c;
  --bg-accent: #12332e;
  --surface: #122925;
  --surface-2: #1a3530;
  --text: #e7f6f2;
  --text-muted: #8fb3ab;
  --border: #234840;
  --primary: #2dd4bf;
  --primary-hover: #5eead4;
  --primary-soft: #134e4a;
  --accent: #34d399;
  --danger: #fb7185;
  --warn: #fbbf24;
  --nav-bg: rgba(10, 31, 28, 0.94);
  --shadow: 0 1px 2px rgb(0 0 0 / 0.35), 0 8px 28px rgb(0 0 0 / 0.35);
  --ring: rgb(45 212 191 / 0.4);
  --pattern: radial-gradient(ellipse 80% 50% at 50% -20%, rgb(45 212 191 / 0.12), transparent),
    radial-gradient(ellipse 60% 40% at 100% 0%, rgb(16 185 129 / 0.08), transparent);
  color-scheme: dark;
}

body {
  font-family: "Outfit", ui-sans-serif, system-ui, sans-serif;
  background-color: var(--bg);
  background-image: var(--pattern);
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
}

.font-display {
  font-family: "Fraunces", Georgia, serif;
}

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

.page-shell {
  margin-left: auto;
  margin-right: auto;
  display: flex;
  min-height: 100vh;
  max-width: 32rem;
  flex-direction: column;
  padding: 1rem 1rem 6rem;
}

@media (min-width: 640px) {
  .page-shell {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}

.surface {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1.25rem;
  box-shadow: var(--shadow);
}

.field {
  width: 100%;
  border-radius: 0.875rem;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  padding: 0.625rem 0.75rem;
  font-size: 1rem;
  min-height: 2.75rem;
  line-height: 1.25;
  transition: border-color 0.15s, box-shadow 0.15s;
}

select.field {
  appearance: auto;
  -webkit-appearance: menulist;
}

/* Keep native date picker usable on mobile (do not set appearance:none). */
input[type="date"].field {
  display: block;
  min-height: 2.75rem;
  padding-inline-end: 0.5rem;
}

input[type="date"].field::-webkit-calendar-picker-indicator {
  opacity: 1;
  cursor: pointer;
  width: 1.25rem;
  height: 1.25rem;
  padding: 0.15rem;
  margin-inline-start: 0.25rem;
}

.field:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--ring);
}

.field-readonly {
  background: var(--surface-2);
  color: var(--text-muted);
}

.password-field {
  position: relative;
}

.password-field .field {
  padding-right: 2.75rem;
}

.password-toggle {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: none;
  border-radius: 0.5rem;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}

.password-toggle:hover {
  color: var(--text);
  background: var(--surface-2);
}

.password-toggle:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--ring);
}

.password-toggle svg {
  width: 1.125rem;
  height: 1.125rem;
}

.label {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.btn-primary {
  display: block;
  width: 100%;
  border-radius: 0.875rem;
  background: var(--primary);
  color: #042f2e;
  font-weight: 700;
  font-size: 0.875rem;
  padding: 0.75rem 1rem;
  text-align: center;
  transition: background 0.15s, transform 0.15s;
}

html:not(.dark) .btn-primary {
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
}

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

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

.btn-ghost {
  display: block;
  width: 100%;
  border-radius: 0.875rem;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.75rem 1rem;
  text-align: center;
}

.btn-ghost:hover {
  background: var(--surface-2);
}

.btn-google {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  border-radius: 0.875rem;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.8rem 1rem;
  text-decoration: none;
  box-shadow: 0 1px 2px color-mix(in srgb, var(--text) 6%, transparent);
  transition: background 0.15s, border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}

.btn-google:hover {
  background: var(--surface-2);
  border-color: color-mix(in srgb, var(--text) 22%, var(--border));
  box-shadow: 0 2px 8px color-mix(in srgb, var(--text) 8%, transparent);
}

.btn-google:active {
  transform: scale(0.985);
  box-shadow: none;
}

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

.auth-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.15rem 0 0.9rem;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: lowercase;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.turnstile-wrap {
  display: flex;
  justify-content: center;
}

.link-muted {
  display: block;
  margin-top: 1rem;
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.link-muted:hover {
  color: var(--primary);
}

.result-panel {
  margin-top: 1.25rem;
  border-radius: 1rem;
  background: var(--primary-soft);
  border: 1px solid var(--border);
  padding: 1rem;
}

.intro-layout {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 28rem;
  margin-left: auto;
  margin-right: auto;
}

.intro-hero {
  text-align: center;
}

.intro-hero-icon {
  width: 5rem;
  height: 5rem;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 0.75rem;
  border-radius: 1.5rem;
  font-size: 1.875rem;
}

.intro-info {
  padding: 1.15rem 1.2rem;
  text-align: left;
}

.intro-section + .intro-section {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.intro-section-title {
  margin: 0 0 0.4rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--primary);
}

.intro-section-body {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--text);
}

.intro-steps {
  margin: 0;
  padding-left: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--text);
}

.intro-steps li::marker {
  color: var(--primary);
  font-weight: 700;
}

.check-row {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  border-radius: 0.875rem;
  border: 1px solid var(--border);
  background: var(--surface-2);
  padding: 0.75rem 0.875rem;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.check-row:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.check-row input {
  margin-top: 0.15rem;
  width: 1.1rem;
  height: 1.1rem;
  accent-color: var(--primary);
  flex-shrink: 0;
}

.choice-pill {
  display: block;
  cursor: pointer;
  border-radius: 0.75rem;
  border: 1px solid var(--border);
  padding: 0.625rem 0.75rem;
  text-align: center;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.choice-pill:has(input:checked) {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-soft);
}

.choice-pill-orange:has(input:checked) {
  border-color: #f97316;
  color: #ea580c;
  background: rgb(255 237 213 / 0.35);
}

html.dark .choice-pill-orange:has(input:checked) {
  color: #fdba74;
  background: rgb(124 45 18 / 0.35);
}

.menu-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 1.1rem 0.75rem;
  border-radius: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: transform 0.2s, border-color 0.2s;
}

.menu-tile:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
}

.menu-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3.25rem;
  height: 3.25rem;
  margin-bottom: 0.75rem;
  border-radius: 1rem;
}

.icon-cardio { background: #ffe4e6; color: #e11d48; }
.icon-bmi { background: #d1fae5; color: #059669; }
.icon-walk { background: #ccfbf1; color: #0f766e; }
.icon-rock { background: #ffedd5; color: #ea580c; }
.icon-bp { background: #e0e7ff; color: #4338ca; }
.icon-sugar { background: #fce7f3; color: #be185d; }
.icon-chol { background: #fef3c7; color: #b45309; }
.icon-waist { background: #e0f2fe; color: #0369a1; }
.icon-spo2 { background: #ecfdf5; color: #047857; }
.icon-matsurat { background: #f0fdf4; color: #15803d; }
.icon-tasbih { background: #ecfdf5; color: #0f766e; }

html.dark .icon-cardio { background: #4c0519; color: #fb7185; }
html.dark .icon-bmi { background: #064e3b; color: #34d399; }
html.dark .icon-walk { background: #134e4a; color: #2dd4bf; }
html.dark .icon-rock { background: #7c2d12; color: #fb923c; }
html.dark .icon-bp { background: #312e81; color: #a5b4fc; }
html.dark .icon-sugar { background: #831843; color: #f9a8d4; }
html.dark .icon-chol { background: #78350f; color: #fcd34d; }
html.dark .icon-waist { background: #0c4a6e; color: #7dd3fc; }
html.dark .icon-spo2 { background: #064e3b; color: #6ee7b7; }
html.dark .icon-matsurat { background: #14532d; color: #86efac; }
html.dark .icon-tasbih { background: #134e4a; color: #5eead4; }

.choice-pill-active,
button.choice-pill.choice-pill-active {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-soft);
}

.tasbih-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.25rem 0.5rem 0.5rem;
}

.tasbih-bead {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: min(72vw, 16.5rem);
  height: min(72vw, 16.5rem);
  border: none;
  border-radius: 999px;
  background:
    radial-gradient(circle at 35% 28%, color-mix(in srgb, var(--primary-soft) 80%, white), transparent 55%),
    linear-gradient(160deg, color-mix(in srgb, var(--primary) 88%, #0f766e), color-mix(in srgb, var(--accent) 70%, #047857));
  color: #ecfdf5;
  box-shadow:
    0 18px 40px color-mix(in srgb, var(--primary) 28%, transparent),
    inset 0 1px 0 rgb(255 255 255 / 0.25);
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.tasbih-bead:active,
.tasbih-bead-pulse {
  transform: scale(0.94);
  box-shadow:
    0 10px 24px color-mix(in srgb, var(--primary) 35%, transparent),
    inset 0 1px 0 rgb(255 255 255 / 0.2);
}

.tasbih-bead-done {
  background:
    radial-gradient(circle at 35% 28%, color-mix(in srgb, var(--accent) 35%, white), transparent 55%),
    linear-gradient(160deg, #059669, #047857);
}

.tasbih-ring {
  position: absolute;
  inset: 0.55rem;
  width: calc(100% - 1.1rem);
  height: calc(100% - 1.1rem);
  transform: rotate(-90deg);
  pointer-events: none;
}

.tasbih-ring-track {
  fill: none;
  stroke: rgb(255 255 255 / 0.22);
  stroke-width: 6;
}

.tasbih-ring-progress {
  fill: none;
  stroke: #ecfdf5;
  stroke-width: 6;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.2s ease;
}

.tasbih-count {
  position: relative;
  z-index: 1;
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(2.75rem, 12vw, 3.75rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.03em;
}

.tasbih-of {
  position: relative;
  z-index: 1;
  margin-top: 0.2rem;
  font-size: 0.95rem;
  font-weight: 600;
  opacity: 0.85;
}

html.dark .tasbih-bead {
  box-shadow:
    0 18px 40px rgb(0 0 0 / 0.45),
    inset 0 1px 0 rgb(255 255 255 / 0.12);
}

.matsurat-sticky {
  position: sticky;
  top: 3.65rem;
  z-index: 20;
  padding: 0.75rem 0.85rem;
  border-radius: 1rem;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  border: 1px solid var(--border);
  backdrop-filter: blur(8px);
  transition: padding 0.2s ease;
}

.matsurat-sticky-locked {
  transition: none !important;
}

.matsurat-sticky-compact {
  padding: 0.45rem 0.7rem;
}

.matsurat-sticky-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.matsurat-sticky-count {
  flex-shrink: 0;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.matsurat-sticky-expand {
  overflow: hidden;
}

.matsurat-progress-track {
  height: 0.45rem;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}

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

.matsurat-sticky-compact .matsurat-progress-track {
  height: 0.35rem;
}

.matsurat-progress-bar {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: width 0.25s ease;
}

.matsurat-surah {
  border-radius: 1.15rem;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.matsurat-surah-focus {
  animation: matsurat-surah-focus 0.85s ease;
}

@keyframes matsurat-surah-focus {
  0% {
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--primary) 0%, transparent);
    border-color: var(--border);
  }
  35% {
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 28%, transparent);
    border-color: color-mix(in srgb, var(--primary) 55%, var(--border));
  }
  100% {
    box-shadow: var(--shadow);
    border-color: var(--border);
  }
}

.matsurat-surah-done {
  border-color: color-mix(in srgb, var(--accent) 50%, var(--border));
}

.matsurat-surah-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  background: color-mix(in srgb, var(--primary-soft) 55%, var(--surface));
  border-bottom: 1px solid var(--border);
}

.matsurat-surah-title {
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}

.matsurat-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 3.25rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  background: #c4a484;
  color: #3b2a1a;
}

html.dark .matsurat-badge {
  background: #8b6914;
  color: #fef3c7;
}

.matsurat-mark-surah {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--primary);
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 0.28rem 0.65rem;
  white-space: nowrap;
}

.matsurat-surah-foot {
  padding: 0.85rem 1rem 1rem;
  border-top: 1px solid var(--border);
  background: color-mix(in srgb, var(--primary-soft) 35%, var(--surface));
}

.matsurat-mark-surah-foot {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  border-radius: 0.85rem;
  padding: 0.65rem 1rem;
  font-size: 0.8rem;
  white-space: nowrap;
  text-align: center;
}

.matsurat-mark-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.6rem;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  background: color-mix(in srgb, var(--primary) 12%, var(--surface));
  color: var(--primary);
  border: 1px solid color-mix(in srgb, var(--primary) 28%, var(--border));
}

.matsurat-surah-done .matsurat-mark-surah-foot {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
}

.matsurat-surah-done .matsurat-mark-count {
  background: color-mix(in srgb, var(--accent) 14%, var(--surface));
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
}

.matsurat-verses {
  display: flex;
  flex-direction: column;
}

.matsurat-verse {
  width: 100%;
  text-align: left;
  padding: 1rem 1.05rem;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: inherit;
  transition: background 0.15s ease;
}

.matsurat-verse:last-child {
  border-bottom: 0;
}

.matsurat-verse:active {
  background: var(--surface-2);
}

.matsurat-verse-read {
  background: color-mix(in srgb, var(--primary-soft) 45%, transparent);
}

.matsurat-ayat-label {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  background: var(--surface-2);
  border-radius: 0.35rem;
  padding: 0.15rem 0.45rem;
}

.matsurat-verse-check {
  color: var(--accent);
  font-weight: 700;
}

.matsurat-arabic {
  font-family: "Amiri", "Traditional Arabic", serif;
  font-size: var(--matsurat-arabic-size, 1.5rem);
  line-height: 2.15;
  color: var(--text);
  text-align: right;
  white-space: pre-line;
}

.matsurat-translation {
  margin-top: 0.65rem;
  font-size: var(--matsurat-translation-size, 0.875rem);
  line-height: 1.55;
  color: var(--text-muted);
  text-align: left;
  white-space: pre-line;
}

.matsurat-settings-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: 1px solid var(--border);
  border-radius: 0.65rem;
  background: var(--surface-2);
  color: var(--text-muted);
  flex-shrink: 0;
}

.matsurat-settings-btn:active {
  background: var(--surface);
  color: var(--text);
}

.matsurat-sheet-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(15, 23, 42, 0.45);
}

.matsurat-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 61;
  max-width: 28rem;
  margin: 0 auto;
  border-radius: 1.25rem 1.25rem 0 0;
  border: 1px solid var(--border);
  border-bottom: 0;
  background: var(--surface);
  box-shadow: 0 -8px 28px rgba(15, 23, 42, 0.18);
  padding: 1rem 1.1rem calc(1.25rem + env(safe-area-inset-bottom, 0px));
}

.matsurat-sheet-handle {
  width: 2.5rem;
  height: 0.28rem;
  margin: 0 auto 0.85rem;
  border-radius: 999px;
  background: var(--border);
}

.matsurat-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.matsurat-sheet-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.matsurat-sheet-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 0.55rem;
  background: var(--surface-2);
  color: var(--text-muted);
}

.matsurat-sheet-field {
  margin-bottom: 1rem;
}

.matsurat-sheet-field:last-child {
  margin-bottom: 0;
}

.matsurat-sheet-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.45rem;
}

.matsurat-sheet-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
}

.matsurat-sheet-value {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.matsurat-sheet-range {
  width: 100%;
  accent-color: var(--primary);
  height: 1.25rem;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.9rem;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  padding: 0.7rem 1rem;
  font-weight: 600;
  text-decoration: none;
}

.quote-banner {
  border-radius: 1.25rem;
  background: linear-gradient(135deg, #0f766e 0%, #059669 55%, #14b8a6 100%);
  color: #ecfdf5;
  padding: 1.1rem 1.15rem;
  box-shadow: var(--shadow);
}

html.dark .quote-banner {
  background: linear-gradient(135deg, #134e4a 0%, #0f766e 50%, #115e59 100%);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.page-header {
  display: grid;
  grid-template-columns: 2.75rem 1fr 2.75rem;
  align-items: center;
  gap: 0.5rem;
  margin: -0.25rem 0 1.25rem;
  padding: 0.15rem 0 0.75rem;
  position: sticky;
  top: 0;
  z-index: 30;
  background: linear-gradient(to bottom, var(--bg) 70%, transparent);
}

.page-header-title {
  margin: 0;
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 9999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

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

.menu-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.menu-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  border-radius: 0.875rem;
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 0.85rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  text-align: left;
  transition: border-color 0.15s, background 0.15s;
}

.menu-list-item:hover {
  border-color: var(--primary);
  background: var(--surface-2);
}

.menu-list-item .chevron {
  color: var(--text-muted);
  flex-shrink: 0;
}

.success-banner {
  margin-bottom: 0.75rem;
  border-radius: 0.75rem;
  border: 1px solid var(--border);
  background: var(--primary-soft);
  padding: 0.65rem 0.85rem;
  font-size: 0.875rem;
  color: var(--text);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 9999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.theme-toggle:hover {
  color: var(--primary);
  border-color: var(--primary);
}

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 40;
  border-top: 1px solid var(--border);
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
}

.pwa-install-banner {
  position: fixed;
  left: 0.75rem;
  right: 0.75rem;
  bottom: calc(4.5rem + env(safe-area-inset-bottom, 0px));
  z-index: 45;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  max-width: 32rem;
  margin-left: auto;
  margin-right: auto;
  padding: 0.85rem 0.95rem;
  border-radius: 1rem;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
  color: var(--text);
  animation: fade-up 0.35s ease-out both;
}

body:not(:has(.bottom-nav)) .pwa-install-banner {
  bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
}

.pwa-install-text {
  flex: 1;
  min-width: 0;
}

.pwa-install-title {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--text);
}

.pwa-install-body {
  margin: 0.2rem 0 0;
  font-size: 0.75rem;
  line-height: 1.35;
  color: var(--text-muted);
}

.pwa-install-actions {
  display: flex;
  flex-shrink: 0;
  flex-direction: column;
  align-items: stretch;
  gap: 0.35rem;
}

.pwa-install-btn {
  border-radius: 0.75rem;
  background: var(--primary);
  color: #042f2e;
  font-weight: 700;
  font-size: 0.75rem;
  padding: 0.45rem 0.85rem;
  white-space: nowrap;
  transition: background 0.15s, transform 0.15s;
}

html:not(.dark) .pwa-install-btn {
  color: #fff;
}

.pwa-install-btn:hover {
  background: var(--primary-hover);
}

.pwa-install-btn:active {
  transform: scale(0.98);
}

.pwa-install-dismiss {
  border-radius: 0.75rem;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 500;
  padding: 0.2rem 0.35rem;
  white-space: nowrap;
}

.pwa-install-dismiss:hover {
  color: var(--text);
}

.nav-link {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  gap: 0.125rem;
  border-radius: 0.75rem;
  padding: 0.4rem 0.5rem;
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-muted);
}

.nav-link.active {
  color: var(--primary);
}

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

@keyframes soft-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}

.animate-fade-up {
  animation: fade-up 0.45s ease-out both;
}

.animate-fade-up-delay {
  animation: fade-up 0.5s ease-out 0.08s both;
}

.animate-soft-pulse {
  animation: soft-pulse 2.8s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  .animate-fade-up,
  .animate-fade-up-delay,
  .animate-soft-pulse,
  .matsurat-surah-focus,
  .menu-tile,
  .pwa-install-banner {
    animation: none;
    transition: none;
  }
}
