:root {
  --bg: #f3f2ee;
  --bg-elevated: rgba(255, 255, 255, 0.72);
  --text: #1f2a24;
  --muted: #5f6a63;
  --accent: #2f6b58;
  --border: rgba(47, 107, 88, 0.2);
  --shadow: 0 18px 48px rgba(23, 44, 35, 0.12);
  --arabic-size: 2.2rem;
}

body.dark {
  --bg: #121916;
  --bg-elevated: rgba(29, 38, 33, 0.72);
  --text: #edf4ef;
  --muted: #a9b8af;
  --accent: #93d6b7;
  --border: rgba(147, 214, 183, 0.26);
  --shadow: 0 22px 48px rgba(0, 0, 0, 0.36);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  position: relative;
  font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: var(--text);
  background: radial-gradient(circle at top left, #fff8eb 0%, var(--bg) 36%, #eaf2ee 100%);
  transition: background 180ms ease, color 180ms ease;
}

body.dark {
  background: radial-gradient(circle at top left, #243029 0%, var(--bg) 36%, #0f1412 100%);
}

.background-glow {
  position: fixed;
  inset: -24vh -12vw auto;
  height: 48vh;
  background: radial-gradient(circle, rgba(201, 180, 113, 0.24) 0%, transparent 66%);
  pointer-events: none;
  z-index: 0;
}

.topbar,
.content,
.attribution {
  position: relative;
  z-index: 1;
}

.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin: 0.85rem auto 0;
  padding: 1rem;
  width: min(1100px, 94vw);
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--bg-elevated);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
  position: sticky;
  top: calc(env(safe-area-inset-top, 0px) + 5.7rem);
  z-index: 25;
}

.brand h1 {
  margin: 0;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.brand p {
  margin: 0.3rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.page-switch {
  display: inline-flex;
  margin-top: 0.55rem;
  gap: 0.4rem;
}

.page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 2rem;
  padding: 0 0.72rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.42);
}

body.dark .page-link {
  background: rgba(24, 32, 28, 0.72);
}

.page-link.is-active {
  border-color: var(--accent);
}

.controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.7rem;
}

.surah-jump-group {
  margin-left: -0.2rem;
}

.control-group,
.control-group-inline {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.control-group span {
  font-size: 0.9rem;
  color: var(--muted);
}

select,
.ghost-btn {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.5);
  color: var(--text);
  height: 2.25rem;
  padding: 0 0.75rem;
  font-size: 0.9rem;
}

body.dark select,
body.dark .ghost-btn {
  background: rgba(24, 32, 28, 0.74);
}

select {
  min-width: 250px;
}

.ghost-btn {
  cursor: pointer;
  font-weight: 600;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease, box-shadow 140ms ease;
}

.ghost-btn:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(47, 107, 88, 0.14);
}

.ghost-btn:active {
  transform: translateY(0);
}

.ghost-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.arrow-btn {
  width: 2.25rem;
  padding: 0;
  font-size: 1.08rem;
  font-weight: 700;
}

.compact-btn {
  height: 2rem;
  font-size: 0.84rem;
  border-radius: 10px;
}

.quick-strip {
  width: 100%;
  margin-top: 0.55rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 0.9rem;
}

.quick-ayah-nav {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.quick-progress {
  flex: 1;
  min-width: 220px;
}

.compact-track {
  width: 100%;
  height: 6px;
}

.compact-progress-text {
  margin-top: 0.3rem;
  font-size: 0.78rem;
}

.content {
  width: min(1100px, 94vw);
  margin: 1.25rem auto;
}

.status-message {
  margin-bottom: 1rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.surah-header {
  margin-bottom: 1rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--bg-elevated);
  box-shadow: var(--shadow);
}

.surah-header h2 {
  margin: 0;
  font-weight: 600;
  font-size: 1.35rem;
}

.surah-header p {
  margin: 0.5rem 0 0;
  color: var(--muted);
}

.ayah-nav {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.9rem;
}

.reading-progress {
  margin-top: 0.85rem;
}

.reading-progress-track {
  width: min(460px, 100%);
  height: 8px;
  border-radius: 999px;
  background: rgba(47, 107, 88, 0.16);
  overflow: hidden;
}

.reading-progress-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2f6b58 0%, #6aa987 100%);
  transition: width 220ms ease;
}

body.dark .reading-progress-track {
  background: rgba(147, 214, 183, 0.2);
}

body.dark .reading-progress-fill {
  background: linear-gradient(90deg, #7abfa1 0%, #a9e4c9 100%);
}

.reading-progress-text {
  margin: 0.42rem 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.ayah-list {
  display: grid;
  gap: 1rem;
}

.ayah-card {
  padding: 1.2rem;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  box-shadow: var(--shadow);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.ayah-card.is-active {
  border-color: var(--accent);
  box-shadow: 0 18px 36px rgba(47, 107, 88, 0.18);
}

.ayah-number {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 0.7rem;
}

.ayah-arabic {
  margin: 0;
  text-align: center;
  line-height: 2.2;
  font-family: "Amiri Quran", serif;
  font-size: var(--arabic-size);
  direction: rtl;
}

.ayah-transliteration {
  margin: 1rem 0 0;
  color: var(--muted);
  text-align: center;
  font-family: "Lora", serif;
  font-style: italic;
  font-size: 1rem;
  line-height: 1.8;
}

.ayah-translation {
  margin: 1rem 0 0;
  max-width: 70ch;
  line-height: 1.8;
  font-size: 1rem;
}

.ayah-translation sup {
  font-size: 0.7em;
}

.attribution {
  width: min(1100px, 94vw);
  margin: 0 auto 1.4rem;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.6;
}

.legal-links {
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
  margin-top: 0.45rem;
}

.legal-links a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.legal-links a:hover {
  text-decoration: underline;
}

.legal-content {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--bg-elevated);
  box-shadow: var(--shadow);
  padding: 1.05rem 1.15rem;
  margin-bottom: 1rem;
}

.legal-content h2 {
  margin: 0 0 0.5rem;
  font-size: 1.15rem;
}

.legal-content p,
.legal-content li {
  color: var(--text);
  line-height: 1.72;
}

.legal-content ul {
  margin: 0.45rem 0 0;
  padding-left: 1.1rem;
}

.dua-controls {
  align-items: end;
}

.search-input {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.5);
  color: var(--text);
  height: 2.25rem;
  width: min(380px, 100%);
  padding: 0 0.75rem;
  font-size: 0.9rem;
}

body.dark .search-input {
  background: rgba(24, 32, 28, 0.74);
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.95rem;
}

.chip {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.5);
  color: var(--text);
  height: 1.95rem;
  padding: 0 0.75rem;
  font-size: 0.82rem;
  cursor: pointer;
}

body.dark .chip {
  background: rgba(24, 32, 28, 0.72);
}

.chip.is-active {
  border-color: var(--accent);
}

.dua-card {
  position: relative;
}

.dua-category-badge {
  position: absolute;
  right: 0.9rem;
  top: 0.9rem;
  font-size: 0.72rem;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.16rem 0.5rem;
}

.dua-theme-badge {
  position: absolute;
  right: 0.9rem;
  top: 2.45rem;
  font-size: 0.7rem;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.14rem 0.48rem;
}

.dua-context-note {
  margin: 0.9rem 0 0;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.55;
  background: rgba(255, 255, 255, 0.28);
}

body.dark .dua-context-note {
  background: rgba(24, 32, 28, 0.45);
}

.home-page {
  width: min(1120px, 94vw);
  margin: 1.15rem auto 1.6rem;
  position: relative;
  z-index: 1;
}

.home-section {
  margin-bottom: 1.45rem;
  padding: 0.25rem 0;
}

.home-section-soft {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--bg-elevated);
  box-shadow: var(--shadow);
  padding: 1.05rem;
}

.hero-section {
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 1.2rem;
  background:
    radial-gradient(circle at top right, rgba(201, 180, 113, 0.18) 0%, transparent 52%),
    var(--bg-elevated);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 1rem;
}

.eyebrow {
  margin: 0 0 0.35rem;
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.76rem;
  font-weight: 600;
}

.hero-section h1 {
  margin: 0;
  font-size: clamp(1.45rem, 2.5vw, 2.1rem);
}

.hero-lead {
  margin: 0.75rem 0 0;
  line-height: 1.72;
  max-width: 62ch;
}

.hero-actions {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 11px;
  height: 2.3rem;
  padding: 0 0.8rem;
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
}

.action-btn.primary {
  border-color: var(--accent);
}

.hero-aside {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.9rem;
}

.hero-aside h2 {
  margin: 0;
  font-size: 1.05rem;
}

.hero-aside p {
  margin: 0.6rem 0 0;
  color: var(--muted);
  line-height: 1.64;
}

.section-heading {
  margin-bottom: 0.8rem;
}

.section-heading h2 {
  margin: 0;
  font-size: 1.32rem;
}

.section-heading p {
  margin: 0.42rem 0 0;
  color: var(--muted);
}

.home-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
}


.support-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 2.5fr;
  gap: 1.25rem;
}

.home-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.28);
  padding: 0.88rem;
}

body.dark .home-card {
  background: rgba(24, 32, 28, 0.45);
}

.home-card h3 {
  margin: 0.25rem 0 0;
  font-size: 1.02rem;
}

.home-card p {
  margin: 0.45rem 0 0;
  line-height: 1.65;
}

.home-label {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 600;
}

.inline-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.inline-link:hover {
  text-decoration: underline;
}

.prayer-grid {
  display: grid;
  grid-template-columns: 0.85fr 1.4fr 0.75fr;
  gap: 0.8rem;
}

/* 3-col grid for Option B (no stacking) */
.prayer-grid-3col {
  grid-template-columns: 1fr 1fr 1.6fr;
}

/* Left column: stacks current + next cards vertically */
.prayer-left-stack {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.prayer-left-stack .home-card {
  flex: 1;
}

/* Jummah card in main layout */
.prayer-jummah-main {
  display: flex;
  flex-direction: column;
}


.prayer-highlight h3 {
  font-size: 1.3rem;
}

.prayer-highlight p:last-child {
  font-size: 1.12rem;
  font-weight: 600;
}

.prayer-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.5rem;
}

.prayer-table th,
.prayer-table td {
  border-bottom: 1px solid var(--border);
  text-align: left;
  padding: 0.55rem 0;
}

.prayer-table td {
  font-size: 1.02rem;
}

.prayer-table th {
  font-size: 0.83rem;
  color: var(--muted);
  font-weight: 600;
}

.table-note {
  color: var(--muted);
  font-size: 0.78rem;
}

/* ── Variant label badge ── */
.variant-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  background: var(--accent);
  color: #fff;
  border-radius: 6px;
  padding: 0.15rem 0.5rem;
  vertical-align: middle;
  margin-left: 0.4rem;
  opacity: 0.8;
}

.variant-note {
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 0.2rem;
}

.pv-variant {
  border-top: 1px dashed var(--border);
}

/* ── Layout B ── */
.pv-b-grid {
  display: grid;
  grid-template-columns: 1fr 0.42fr;
  gap: 1rem;
}

.pv-b-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.pv-b-current {
  font-size: 1.9rem;
  font-weight: 600;
  margin: 0.1rem 0 0.05rem;
}

.pv-b-time {
  font-size: 1.25rem;
  color: var(--muted);
}

.pv-b-next-box {
  text-align: right;
}

.pv-b-next-name {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0.1rem 0 0;
}

.pv-b-next-time {
  font-size: 1rem;
  color: var(--muted);
}

.pv-b-divider {
  height: 1px;
  background: var(--border);
  margin: 0.75rem 0;
}

.pv-b-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.pv-b-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.92rem;
  padding: 0.2rem 0;
}

.pv-b-row.active {
  font-weight: 700;
  color: var(--accent);
}

.pv-b-jummah {
  display: flex;
  flex-direction: column;
}

.jummah-slots {
  display: flex;
  flex-direction: column;
  gap: 0.38rem;
  margin-top: 0.15rem;
}

.jummah-slot {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  padding: 0.38rem 0.6rem;
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 20%, transparent);
}

.jummah-ord {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  width: 2rem;
}

.jummah-t {
  font-size: 1.08rem;
  font-weight: 600;
}

.pv-jummah-note {
  margin-top: auto;
  padding-top: 0.7rem;
  font-size: 0.76rem;
  color: var(--muted);
}

/* ── Layout C ── */
.pv-c-card {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.pv-c-timeline {
  display: flex;
  align-items: center;
  overflow-x: auto;
  padding: 0.8rem 0;
}

.pv-c-prayer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  flex: 0 0 auto;
  min-width: 70px;
}

.pv-c-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--border);
  border: 2px solid var(--border);
}

.pv-c-prayer.active .pv-c-dot {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 20%, transparent);
}

.pv-c-prayer.past .pv-c-dot {
  background: color-mix(in srgb, var(--accent) 50%, transparent);
  border-color: color-mix(in srgb, var(--accent) 50%, transparent);
}

.pv-c-line {
  flex: 1;
  min-width: 24px;
  height: 2px;
  background: var(--border);
  align-self: center;
}

.pv-c-name {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  text-align: center;
}

.pv-c-prayer.active .pv-c-name {
  color: var(--accent);
}

.pv-c-t {
  font-size: 0.88rem;
  font-weight: 500;
  text-align: center;
}

.pv-c-prayer.active .pv-c-t {
  font-weight: 700;
  color: var(--accent);
}

.pv-c-jummah {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.7rem 1.5rem;
  padding: 0.7rem 1rem;
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 18%, transparent);
}

.pv-c-jummah-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent);
}

.pv-c-jummah-times {
  display: flex;
  gap: 1.2rem;
  flex-wrap: wrap;
  font-size: 0.9rem;
}

.pv-c-jummah-times strong {
  font-weight: 700;
}

/* ── Sun phase indicator ── */
.sun-phase {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: auto;
  padding-top: 0.6rem;
  font-size: 0.82rem;
  color: var(--muted);
  opacity: 0.85;
}

.sun-phase span:first-child {
  font-size: 1.2rem;
}

/* ── Tomorrow hint ── */
.prayer-day-hint {
  margin-top: auto;
  padding-top: 0.4rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  opacity: 0.8;
}

.service-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.service-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: 14px;
  font-size: 1.6rem;
  margin-bottom: 0.6rem;
  line-height: 1;
}

.service-card[data-accent="teal"] .service-icon {
  background: rgba(56, 178, 140, 0.12);
}

.service-card[data-accent="gold"] .service-icon {
  background: rgba(212, 175, 55, 0.12);
}

.service-card[data-accent="blue"] .service-icon {
  background: rgba(59, 130, 246, 0.12);
}

.service-card[data-accent="purple"] .service-icon {
  background: rgba(139, 92, 246, 0.12);
}

.service-card[data-accent="teal"] {
  border-top: 2px solid rgba(56, 178, 140, 0.35);
}

.service-card[data-accent="gold"] {
  border-top: 2px solid rgba(212, 175, 55, 0.35);
}

.service-card[data-accent="blue"] {
  border-top: 2px solid rgba(59, 130, 246, 0.35);
}

.service-card[data-accent="purple"] {
  border-top: 2px solid rgba(139, 92, 246, 0.35);
}

.support-section {
  background:
    radial-gradient(circle at top right, rgba(147, 214, 183, 0.16) 0%, transparent 58%),
    var(--bg-elevated);
}

.support-section .home-card p+p,
.support-section .home-card p+ul {
  margin-top: 0.5rem;
}

.support-grid .home-card,
.contact-grid .home-card {
  display: flex;
  flex-direction: column;
}

.bank-info {
  font-size: 1.08rem;
  line-height: 1.7;
  margin: 0.4rem 0 0 !important;
}

.bank-ref {
  margin-top: 1rem !important;
  font-size: 0.98rem;
}

.bank-details-card {
  justify-content: center;
}

.donation-benefits {
  margin: 0.6rem 0 0;
  padding-left: 1.2rem;
  line-height: 1.75;
}

.donation-benefits li {
  margin-bottom: 0.5rem;
}

.donation-benefits li:last-child {
  margin-bottom: 0;
}

.map-card {
  padding: 0;
  overflow: hidden;
  border-radius: 14px;
  /* Landscape map: aspect-ratio sets height from width */
  aspect-ratio: 16 / 9;
  min-height: 0;
}

.map-wrapper {
  width: 100%;
  height: 100%;
  border-radius: 14px;
  overflow: hidden;
}

.map-wrapper iframe {
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
}

.contact-details p {
  margin: 0.35rem 0 0;
}

.contact-details p+p {
  margin-top: 0.5rem;
}

.contact-details .home-label+p,
.contact-details strong+p {
  margin-top: 0.25rem;
}


/* ── Timetable cards ─────────────────────────────────────── */
.timetable-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.timetable-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.1rem;
}

.timetable-card-body {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  flex: 1;
}

.timetable-icon {
  font-size: 1.7rem;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.timetable-card h3 {
  margin: 0.2rem 0 0;
  font-size: 1.05rem;
}

.timetable-card p {
  margin: 0.45rem 0 0;
  line-height: 1.62;
  color: var(--muted);
  font-size: 0.93rem;
}

.timetable-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
  border: 1px solid var(--border);
  border-radius: 10px;
  height: 2.3rem;
  padding: 0 1rem;
  text-decoration: none;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 600;
  transition: border-color 140ms ease, transform 140ms ease, box-shadow 140ms ease;
}

.timetable-btn:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(47, 107, 88, 0.14);
}

.timetable-btn-download {
  border-color: var(--accent);
  color: var(--accent);
}

.timetable-download-card {
  background:
    radial-gradient(circle at top right, rgba(201, 180, 113, 0.14) 0%, transparent 60%),
    rgba(255, 255, 255, 0.28);
}

body.dark .timetable-download-card {
  background:
    radial-gradient(circle at top right, rgba(201, 180, 113, 0.10) 0%, transparent 60%),
    rgba(24, 32, 28, 0.45);
}

.supporter-strip {

  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7rem;
}

.supporter-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.78rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}

.map-placeholder {
  display: grid;
  place-items: center;
  min-height: 180px;
  text-align: center;
}

.site-header {
  position: sticky;
  top: calc(env(safe-area-inset-top, 0px) + 0.7rem);
  z-index: 26;
  width: min(1120px, 94vw);
  margin: 1rem auto 0;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--bg-elevated);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
}

.site-header-inner {
  padding: 0.78rem 0.86rem;
  display: flex;
  align-items: center;
  gap: 0.95rem;
  justify-content: space-between;
  flex-wrap: wrap;
}

.site-brand {
  display: grid;
  color: var(--text);
  text-decoration: none;
}

.site-brand-title {
  font-weight: 700;
}

.site-brand-sub {
  color: var(--muted);
  font-size: 0.79rem;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.38rem;
}

.site-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
}

.site-nav a {
  border: 1px solid transparent;
  border-radius: 9px;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  padding: 0 0.62rem;
  color: var(--text);
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 600;
}

.site-nav a:hover,
.site-nav a.is-current {
  border-color: var(--border);
}

.site-nav-toggle {
  display: none;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: transparent;
  color: var(--text);
  height: 2rem;
  padding: 0 0.68rem;
  font-size: 0.84rem;
}

.about-page {
  margin-top: 1rem;
}

.about-lead h1 {
  margin: 0;
  font-size: clamp(1.4rem, 2.4vw, 2rem);
}

/* ── Mid-size: 2-col service grid still works nicely at tablet width ── */
@media (max-width: 860px) {
  .service-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ── Mobile breakpoint ─────────────────────────────────────────────── */
@media (max-width: 700px) {

  /* ─ Quran topbar: keep sticky but compact ─ */
  .topbar {
    align-items: start;
    top: calc(env(safe-area-inset-top, 0px) + 4.9rem);
    padding: 0.65rem 0.8rem;
    gap: 0.5rem;
  }

  /* Duas topbar: NOT sticky on mobile — pick filters then scroll to read */
  .duas-topbar {
    position: relative;
    top: auto;
    margin-top: 0.5rem;
    margin-bottom: 0;
  }

  /* Hide label text — selects have aria-labels, saves vertical space */
  .control-group span {
    display: none;
  }

  /* Controls: stay horizontal, let items wrap naturally */
  .controls {
    gap: 0.45rem;
    flex-wrap: wrap;
  }

  /* Quran: surah select takes remaining width */
  .control-group {
    flex: 1;
    min-width: 0;
  }

  select {
    min-width: 0;
    width: 100%;
  }

  /* Dua controls: 2-column grid — Collection | Theme, then Search full width */
  .dua-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.45rem;
    width: 100%;
  }

  .dua-controls .control-group {
    width: 100%;
    flex: none;
  }

  /* Search input spans full width */
  .dua-controls .control-group:nth-child(3) {
    grid-column: 1 / -1;
  }

  /* Font buttons span full width row */
  .dua-controls .font-controls {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  /* Bigger tap targets for font size buttons */
  .ghost-btn.arrow-btn,
  #increaseFontBtn,
  #decreaseFontBtn {
    min-width: 2.75rem;
    height: 2.75rem;
    font-size: 1.05rem;
  }

  .search-input {
    width: 100%;
  }

  .dua-category-badge,
  .dua-theme-badge {
    position: static;
    display: inline-flex;
    margin-right: 0.35rem;
    margin-top: 0.45rem;
  }

  .ayah-card {
    padding: 1rem;
  }

  .surah-jump-group {
    margin-left: 0;
  }

  .quick-strip {
    align-items: stretch;
    gap: 0.55rem;
  }

  .quick-progress {
    min-width: 0;
    width: 100%;
  }

  /* ─ Homepage wrapper ─ */
  .home-page {
    margin-top: 0.75rem;
    width: 96vw;
  }

  /* ─ Section padding ─ */
  .home-section-soft {
    padding: 0.85rem;
  }

  /* ─ All grids → single column ─ */
  .hero-grid,
  .prayer-grid,
  .home-card-grid,
  .timetable-grid,
  .support-grid,
  .contact-grid,
  .service-grid,
  .supporter-strip {
    grid-template-columns: 1fr;
  }

  /* Current + Next side by side on mobile */
  .prayer-left-stack {
    flex-direction: row;
  }

  /* ─ Hero section ─ */
  .hero-section {
    padding: 1rem;
  }

  /* Hero aside becomes a compact inline strip */
  .hero-aside {
    padding: 0.65rem 0.8rem;
    border-radius: 10px;
  }

  .hero-aside h2 {
    font-size: 0.95rem;
  }

  .hero-aside p {
    font-size: 0.88rem;
    margin-top: 0.35rem;
  }

  /* Bigger tap targets for action buttons */
  .action-btn {
    height: 2.75rem;
    border-radius: 13px;
    font-size: 0.95rem;
  }

  /* ─ Contact map: taller on mobile ─ */
  .map-card {
    aspect-ratio: 4 / 3;
  }

  /* ─ Site header ─ */
  .site-header {
    width: 96vw;
    top: calc(env(safe-area-inset-top, 0px) + 0.5rem);
  }

  /* Header inner: brand + menu button share a row */
  .site-header-inner {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.8rem;
  }

  /* Hide the long subtitle on mobile to keep header compact */
  .site-brand-sub {
    display: none;
  }

  .site-brand-title {
    font-size: 0.96rem;
  }

  /* Dark mode button: full width below brand row */
  .site-actions {
    width: 100%;
    margin-left: 0;
  }

  .site-actions .ghost-btn {
    width: 100%;
    height: 2.4rem;
  }

  /* Mobile nav toggle visible */
  .site-nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
  }

  /* Nav hidden by default, shown when open */
  .site-nav {
    display: none;
    width: 100%;
    gap: 0.32rem;
  }

  .site-nav.is-open,
  .site-nav.is-static {
    display: flex;
    flex-direction: column;
  }

  .site-nav a {
    width: 100%;
    border-color: var(--border);
    height: 2.4rem;
    font-size: 0.9rem;
  }

  /* ─ Arabic font size ─ */
  :root {
    --arabic-size: 1.95rem;
  }
}

/* ── Very small screens (375px and below) ──────────────────────────── */
@media (max-width: 400px) {
  .home-page {
    width: 97vw;
  }

  .site-header {
    width: 97vw;
  }

  .hero-section h1 {
    font-size: 1.35rem;
  }

  .home-card {
    padding: 0.75rem;
  }
}