/* ===== FONTS ===== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Noto+Sans+Arabic:wght@400;500;600;700&display=swap');

/* ===== TOKENS ===== */
:root {
  /* Logo palette */
  --teal: #1A9BA8;
  --teal-dark: #0F6B78;
  --teal-light: #5DC8D4;
  --blue: #1A5FA8;
  --blue-light: #3A87D4;
  --green: #2E8B3A;
  --green-light: #4DB856;
  --orange: #E8760A;
  --yellow: #F5C518;

  /* App colors */
  --bg: #F5F6F8;
  --surface: #FFFFFF;
  --border: #E4E7EC;
  --text-h: #111827;
  --text-body: #374151;
  --text-muted: #6B7280;
  --text-light: #9CA3AF;

  /* Nav */
  --nav-h: 64px;
  --nav-active: var(--teal);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.10);
}

/* ===== RESET ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  height: 100%;
}

body {
  margin: 0;
  padding: 10px;
  padding-top: calc(10px + env(safe-area-inset-top, 0px));
  padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text-body);
  min-height: 100%;
  min-height: 100dvh;
  line-height: 1.5;
  overflow-x: hidden;
  width: 100%;
}

[dir="rtl"] {
  font-family: 'Noto Sans Arabic', 'Inter', sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

/* ===== LANGUAGE SELECTOR SPLASH ===== */
.lang-splash {
  position: fixed;
  top: calc(10px + env(safe-area-inset-top, 0px));
  left: 10px;
  right: 10px;
  bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  min-height: 100dvh;
  background: linear-gradient(160deg, var(--teal-dark) 0%, var(--teal) 50%, var(--blue) 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 32px;
  border-radius: var(--radius-md);
}

.lang-splash-logo {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: white;
  padding: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}

.lang-splash-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 50%;
}

.lang-splash-title {
  font-size: 22px;
  font-weight: 700;
  color: white;
  text-align: center;
  margin-bottom: 6px;
}

.lang-splash-sub {
  font-size: 18px;
  font-weight: 700;
  color: white;
  margin-bottom: 24px;
  text-align: center;
}

.lang-options {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  max-width: 300px;
}

.lang-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  background: white;
  border-radius: var(--radius-md);
  padding: 16px 20px;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: transform 0.15s ease, opacity 0.15s ease;
  border: 2px solid transparent;
}

.lang-btn:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.5);
}

.lang-btn:active {
  transform: scale(0.97);
}

.lang-flag {
  font-size: 28px;
  flex-shrink: 0;
}

.lang-label {
  display: flex;
  flex-direction: column;
}

.lang-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-h);
}

.lang-native {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-h);
}



/* ===== APP SHELL ===== */
.app-shell {
  display: none;
  /* shown after lang selection */
  flex-direction: column;
  position: fixed;
  top: calc(10px + env(safe-area-inset-top, 0px));
  left: 10px;
  right: 10px;
  bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  width: calc(100% - 20px);
  height: calc(100% - 20px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
  max-width: 1000px;
  margin: 0 auto;
  background: var(--surface);
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  border-radius: var(--radius-md);
  z-index: 100;
}

.app-shell.visible {
  display: flex;
}

/* ===== TOP BAR ===== */
.top-bar {
  flex-shrink: 0;
  height: 56px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 10px;
  position: relative;
  z-index: 50;
}

.top-bar-logo {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
}

.top-bar-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.top-bar-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--teal-dark);
  flex: 1;
}

.top-bar-lang-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg);
  cursor: pointer;
  transition: border-color 0.2s;
}

.top-bar-lang-btn:hover {
  border-color: var(--teal);
  color: var(--teal);
}

/* ===== SCROLLABLE PAGE AREA ===== */
.page-area {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--teal-light) transparent;
}

.page-area::-webkit-scrollbar {
  width: 4px;
}

.page-area::-webkit-scrollbar-thumb {
  background: var(--teal-light);
  border-radius: 4px;
}

/* Individual pages */
.page {
  display: none;
  min-height: 100%;
  padding-bottom: 16px;
}

.page.active {
  display: block;
}

/* ===== BOTTOM NAV ===== */
.bottom-nav {
  flex-shrink: 0;
  position: sticky;
  bottom: 0;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom, 0));
  padding-bottom: env(safe-area-inset-bottom, 0);
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.06);
  z-index: 50;
}

.nav-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  position: relative;
  color: var(--text-light);
  font-size: 11px;
  font-weight: 500;
  transition: color 0.2s;
  padding: 0 4px;
  border: none;
  background: none;
  text-align: center;
}

.nav-tab svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

.nav-tab.active svg {
  transform: scale(1.15);
}

.nav-tab.active::after {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 32px;
  height: 2.5px;
  background: var(--teal);
  border-radius: 0 0 3px 3px;
}

/* ===== PAGE HEADER STRIP ===== */
.page-header {
  background: linear-gradient(135deg, var(--teal-dark), var(--teal));
  padding: 20px 16px 18px;
  color: white;
}

.page-header h1 {
  font-size: 20px;
  font-weight: 700;
}

.page-header p {
  font-size: 13px;
  opacity: 0.8;
  margin-top: 3px;
}

/* ===== HOME PAGE ===== */
.home-hero {
  background: linear-gradient(160deg, var(--teal-dark) 0%, var(--teal) 55%, var(--blue) 100%);
  padding: 36px 20px 32px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.home-hero-logo {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: white;
  padding: 4px;
  margin: 0 auto 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.home-hero-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 50%;
}

.home-hero h1 {
  font-size: 24px;
  font-weight: 700;
  color: white;
  margin-bottom: 6px;
}

.home-hero p {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.75);
}

/* Stats strip */
.stats-strip {
  display: flex;
  background: white;
  border-bottom: 1px solid var(--border);
}

.stat {
  flex: 1;
  text-align: center;
  padding: 14px 8px;
  border-right: 1px solid var(--border);
}

.stat:last-child {
  border-right: none;
}

.stat-num {
  font-size: 22px;
  font-weight: 700;
  color: var(--teal-dark);
  line-height: 1;
}

.stat-lbl {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 3px;
  font-weight: 500;
}

/* Quick nav cards */
.home-cards {
  padding: 16px 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.home-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: pointer;
  transition: box-shadow 0.2s, transform 0.2s;
  position: relative;
  overflow: hidden;
}

.home-card::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
}

.home-card.teal::before {
  background: linear-gradient(90deg, var(--teal), var(--teal-light));
}

.home-card.blue::before {
  background: linear-gradient(90deg, var(--blue), var(--blue-light));
}

.home-card.green::before {
  background: linear-gradient(90deg, var(--green), var(--green-light));
}

.home-card.orange::before {
  background: linear-gradient(90deg, var(--orange), var(--yellow));
}

.home-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.home-card:active {
  transform: scale(0.97);
}

.hc-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.hc-icon.teal {
  background: rgba(26, 155, 168, 0.12);
  color: var(--teal);
}

.hc-icon.blue {
  background: rgba(26, 95, 168, 0.12);
  color: var(--blue);
}

.hc-icon.green {
  background: rgba(46, 139, 58, 0.12);
  color: var(--green);
}

.hc-icon.orange {
  background: rgba(232, 118, 10, 0.12);
  color: var(--orange);
}

.hc-icon svg {
  width: 20px;
  height: 20px;
}

.hc-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-h);
}

.hc-desc {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Verse */
.home-verse {
  margin: 0 12px 16px;
  background: linear-gradient(135deg, var(--teal-dark), var(--blue));
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.home-verse::before {
  content: '\201C';
  position: absolute;
  top: -8px;
  left: 12px;
  font-size: 72px;
  color: rgba(255, 255, 255, 0.1);
  font-family: serif;
  line-height: 1;
}

.verse-text {
  font-size: 14px;
  font-style: italic;
  color: white;
  line-height: 1.65;
}

.verse-ref {
  font-size: 11px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.65);
  margin-top: 10px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

/* ===== SECTION LABEL ===== */
.section-lbl {
  padding: 16px 14px 8px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--teal-dark);
}

/* ===== CHURCH LIST ===== */
.search-bar {
  padding: 10px 12px 4px;
  position: relative;
}

.search-bar svg {
  position: absolute;
  left: 22px;
  top: 50%;
  transform: translateY(-30%);
  width: 15px;
  height: 15px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-bar input {
  width: 100%;
  padding: 10px 12px 10px 36px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: white;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: var(--text-body);
  outline: none;
}

.search-bar input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(26, 155, 168, 0.12);
}

/* Filter chips */
.filter-row {
  padding: 6px 12px 4px;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}

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

.chip {
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  border: 1.5px solid var(--border);
  background: white;
  color: var(--text-muted);
  transition: all 0.15s;
  flex-shrink: 0;
}

.chip:hover {
  border-color: var(--teal);
  color: var(--teal);
}

.chip.active {
  background: var(--teal-dark);
  border-color: var(--teal-dark);
  color: white;
}

/* Church card */
.church-list {
  padding: 4px 12px 8px;
}

.church-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 13px 14px;
  margin-bottom: 8px;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.2s, border-color 0.2s;
  position: relative;
  overflow: hidden;
}

.church-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--teal);
  opacity: 0;
  transition: opacity 0.2s;
}

.church-card:hover {
  box-shadow: var(--shadow-md);
  border-color: rgba(26, 155, 168, 0.3);
}

.church-card:hover::before {
  opacity: 1;
}

.church-card:active {
  transform: scale(0.98);
}

.cc-icon {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-sm);
  background: rgba(26, 155, 168, 0.1);
  border: 1px solid rgba(26, 155, 168, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--teal-dark);
}

.cc-icon svg {
  width: 22px;
  height: 22px;
}

.cc-body {
  flex: 1;
  min-width: 0;
}

.cc-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-h);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cc-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Status badge */
.badge {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 7px;
  border-radius: 4px;
  flex-shrink: 0;
}

.badge-done {
  background: #ECFDF5;
  color: #065F46;
  border: 1px solid #A7F3D0;
}

.badge-wait {
  background: #FFFBEB;
  color: #92400E;
  border: 1px solid #FCD34D;
}

.badge-other {
  background: #FEF2F2;
  color: #991B1B;
  border: 1px solid #FCA5A5;
}

.cc-arrow {
  color: var(--text-light);
  flex-shrink: 0;
  width: 16px;
  height: 16px;
}

/* ===== AREA GROUP HEADER ===== */
.area-group-header {
  padding: 14px 14px 6px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.agh-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-h);
}

.agh-count {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

/* ===== DETAIL PAGE ===== */
.detail-hero {
  background: linear-gradient(135deg, var(--teal-dark), var(--teal));
  padding: 16px 16px 24px;
  position: relative;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  margin-bottom: 14px;
  background: none;
  border: none;
  padding: 0;
}

.back-btn:hover {
  color: white;
}

.back-btn svg {
  width: 16px;
  height: 16px;
}

.detail-church-name {
  font-size: 22px;
  font-weight: 700;
  color: white;
  line-height: 1.2;
  margin-bottom: 8px;
}

.detail-area-tag {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.75);
}

/* Info card */
.info-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin: 0 12px 12px;
  overflow: hidden;
}

.info-card-head {
  padding: 12px 14px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--teal-dark);
  border-bottom: 1px solid var(--border);
  background: rgba(26, 155, 168, 0.04);
}

.info-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}

.info-row:last-child {
  border-bottom: none;
}

.info-row-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--teal);
  margin-top: 1px;
}

.info-row-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

.info-row-value {
  font-size: 14px;
  color: var(--text-body);
  font-weight: 500;
  margin-top: 2px;
}

/* Mass row */
.mass-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}

.mass-row:last-child {
  border-bottom: none;
}

.mass-day {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-body);
  min-width: 130px;
  flex-shrink: 0;
}

.mass-times {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.time-tag {
  background: rgba(26, 155, 168, 0.1);
  color: var(--teal-dark);
  border: 1px solid rgba(26, 155, 168, 0.2);
  border-radius: 4px;
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 600;
}

/* Action buttons */
.action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: calc(100% - 24px);
  margin: 0 12px 10px;
  padding: 13px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.2s, transform 0.2s;
  border: none;
}

.action-btn:hover {
  opacity: 0.88;
  transform: translateY(-1px);
}

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

.action-btn svg {
  width: 16px;
  height: 16px;
}

.btn-teal {
  background: var(--teal-dark);
  color: white;
}

.btn-outline {
  background: white;
  color: var(--text-body);
  border: 1.5px solid var(--border);
}

.btn-disabled {
  background: var(--bg);
  color: var(--text-muted);
  border: 1px solid var(--border);
  cursor: not-allowed;
  pointer-events: none;
}

/* History paragraph */
.history-text {
  font-size: 14px;
  line-height: 1.75;
  color: var(--text-body);
  padding: 14px;
}

/* ===== MAPS PAGE ===== */
.maps-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: box-shadow 0.2s;
  position: relative;
  overflow: hidden;
}

.maps-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--teal);
  opacity: 0;
  transition: opacity 0.2s;
}

.maps-card:hover {
  box-shadow: var(--shadow-md);
}

.maps-card:hover::before {
  opacity: 1;
}

.maps-body {
  flex: 1;
  min-width: 0;
}

.maps-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-h);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.maps-area {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.maps-open {
  flex-shrink: 0;
  background: var(--teal-dark);
  color: white;
  border-radius: var(--radius-sm);
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
  text-decoration: none;
  transition: opacity 0.2s;
}

.maps-open:hover {
  opacity: 0.85;
}

.maps-open svg {
  width: 12px;
  height: 12px;
}

.maps-no-loc {
  flex-shrink: 0;
  background: var(--bg);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--border);
}

/* ===== PRAYERS PAGE ===== */
.prayers-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 72px 24px;
  text-align: center;
}

.prayers-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(26, 155, 168, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--teal);
  margin-bottom: 20px;
}

.prayers-icon svg {
  width: 34px;
  height: 34px;
}

.prayers-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-h);
  margin-bottom: 10px;
}

.prayers-sub {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 280px;
}

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
  font-size: 14px;
}

/* ===== RTL direction ===== */
[dir="rtl"] .church-card::before,
[dir="rtl"] .maps-card::before {
  left: auto;
  right: 0;
}

[dir="rtl"] .cc-arrow {
  transform: scaleX(-1);
}

[dir="rtl"] .back-btn svg {
  transform: scaleX(-1);
}

/* ===== UNIVERSAL MOBILE TWEAKS (PROPORTIONAL SCALE) ===== */
@media (max-width: 480px) {
  :root {
    --nav-h: 58px;
  }

  .app-shell,
  .lang-splash {
    zoom: 0.85;
    /* Similar to Ctrl - (Zoom Out) */
  }

  /* Stabilize layout since zoom can affect fixed/abs */
  .app-shell {
    max-width: none;
    top: calc(10px + env(safe-area-inset-top, 0px)) !important;
    left: 10px !important;
    right: 10px !important;
    /* Increase bottom inset to 18px for more clearance */
    bottom: calc(18px + env(safe-area-inset-bottom, 0px)) !important;
    width: calc(100vw - 20px) !important;
    /* 100svh is key for iOS - it's the visible area when the bottom bar is shown */
    height: calc(100svh - 28px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)) !important;
  }

  .lang-splash {
    top: calc(10px + env(safe-area-inset-top, 0px)) !important;
    left: 10px !important;
    right: 10px !important;
    /* Increase bottom inset to 18px */
    bottom: calc(18px + env(safe-area-inset-bottom, 0px)) !important;
    width: calc(100vw - 20px) !important;
    height: calc(100svh - 28px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)) !important;
    padding: 20px 12px;
    border-radius: var(--radius-md);
    z-index: 200;
  }

  .lang-splash-logo {
    width: 60px;
    height: 60px;
  }

  .lang-options {
    flex-direction: column;
    width: 100%;
    max-width: 320px;
  }

  /* User's requested h1 and button rules for smaller screens */
  h1 {
    font-size: 20px !important;
  }

  /* Only make large action/selection buttons 100% width */
  .lang-btn,
  .action-btn {
    width: 100% !important;
  }

  .home-hero {
    padding: 20px 16px;
  }

  .home-hero h1 {
    font-size: 20px;
  }

  .bottom-nav {
    height: calc(var(--nav-h) + 6px + env(safe-area-inset-bottom, 0));
    padding-bottom: env(safe-area-inset-bottom, 0);
  }
}

/* ===== DESKTOP RESPONSIVE LAYOUT ===== */
@media (min-width: 768px) {
  .home-cards {
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    padding: 24px 20px;
  }

  .church-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  /* Make map items grid as well */
  #mapsListContainer {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .section-lbl {
    grid-column: 1 / -1;
  }

  .home-hero {
    padding: 56px 32px 48px;
  }

  .home-hero h1 {
    font-size: 32px;
  }

  .stats-strip {
    padding: 8px 0;
  }

  .stat-num {
    font-size: 28px;
  }

  .stat-lbl {
    font-size: 13px;
  }
}

@media (min-width: 1024px) {

  .church-list,
  #mapsListContainer {
    grid-template-columns: repeat(3, 1fr);
  }

  .home-cards {
    gap: 24px;
    padding: 32px 24px;
  }
}

/* ===== INTERACTIVE MAP ===== */
.map-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background-color: #f7f9fc;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
}

.map-image {
  display: block;
  width: 100%;
  height: auto;
}

.map-pin {
  position: absolute;
  transform: translate(-50%, -100%);
  z-index: 10;
  cursor: pointer;
}

.pin-icon {
  background-color: var(--teal);
  color: white;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  border: 1.5px solid white;
}

.pin-tooltip {
  position: absolute;
  top: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
  background: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-h);
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.map-pin:hover .pin-tooltip {
  opacity: 1;
  visibility: visible;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.church-card {
  animation: fadeUp 0.25s ease both;
}

.church-card:nth-child(1) {
  animation-delay: 0.03s;
}

.church-card:nth-child(2) {
  animation-delay: 0.06s;
}

.church-card:nth-child(3) {
  animation-delay: 0.09s;
}

.church-card:nth-child(4) {
  animation-delay: 0.12s;
}

.church-card:nth-child(5) {
  animation-delay: 0.15s;
}

.church-card:nth-child(6) {
  animation-delay: 0.18s;
}