:root {
  --bg: #eef6ff;
  --bg-strong: #dbe9ff;
  --surface: rgba(246, 251, 255, 0.78);
  --surface-strong: rgba(255, 255, 255, 0.95);
  --surface-line: rgba(0, 72, 168, 0.14);
  --text: #06234d;
  --muted: #4e678d;
  --accent: #0048a8;
  --accent-strong: #003090;
  --accent-soft: rgba(0, 120, 192, 0.16);
  --highlight: #0090d8;
  --highlight-soft: rgba(0, 144, 216, 0.18);
  --idle: #c7daf5;
  --line-soft: rgba(0, 72, 168, 0.12);
  --white-soft: rgba(255, 255, 255, 0.72);
  --white-strong: rgba(255, 255, 255, 0.92);
  --shadow: 0 28px 72px rgba(0, 48, 144, 0.18);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 14px;
  --transition: 240ms ease;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(0, 144, 216, 0.22), transparent 30%),
    radial-gradient(circle at 85% 18%, rgba(0, 120, 192, 0.16), transparent 24%),
    linear-gradient(145deg, #f7fbff, #eaf3ff 48%, #d7e8ff);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Sora", sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.35;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.22) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 72, 168, 0.05) 1px, transparent 1px);
  background-size: 56px 56px;
}

button,
a {
  font: inherit;
}
/* screen screen-detail active */
.page-shell {
  height: 100vh;
  position: relative;
  padding: 14px;
}

.app-shell {
  height: 100%;
  max-width: 1380px;
  margin: 0 auto;
}

.screen {
  gap: 10px;
}

.screen.active {
  display: grid;
}

.screen-map {
  grid-template-columns: minmax(300px, 420px) minmax(0, 1fr);
  align-items: stretch;
  height: 100%;
}

.screen-detail {
  display: none;
}

.hero-panel,
.card-surface,
.map-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--surface-line);
  border-radius: var(--radius-xl);
  background: var(--surface);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.hero-panel {
  min-height: 100%;
  padding: clamp(30px, 4vw, 46px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  background:
    radial-gradient(circle at top, rgba(0, 144, 216, 0.18), transparent 32%),
    linear-gradient(180deg, rgba(251, 254, 255, 0.97), rgba(232, 242, 255, 0.88));
}

.hero-panel h1,
.map-card h1,
.map-card h2,
.detail-overview h2,
.church-detail-header h3,
.panel-heading h3 {
  margin: 0;
  font-family: "Cormorant Garamond", serif;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.hero-panel h1,
.map-card h1 {
  font-size: clamp(3.3rem, 7vw, 5.4rem);
  line-height: 0.88;
}

.hero-copy,
.detail-summary,
.map-hint,
.church-location,
#church-count {
  color: var(--muted);
  line-height: 1.7;
}

.hero-copy {
  max-width: 32ch;
  margin-top: 20px;
  font-size: 1.02rem;
}

.nearest-church-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  padding: 10px 18px;
  background: transparent;
  border: 1.5px solid var(--accent);
  border-radius: var(--radius-sm);
  color: var(--accent);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background 0.18s, color 0.18s, box-shadow 0.18s, opacity 0.18s;
  text-decoration: none;
  white-space: normal;
  text-align: left;
  line-height: 1.4;
}

.nearest-church-link-mobile {
  display: none;
}

.nearest-church-link:hover {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 18px -4px color-mix(in srgb, var(--accent) 50%, transparent);
}

.nearest-church-link:active {
  opacity: 0.8;
}

.nearest-church-link:disabled,
.nearest-church-link.is-loading {
  opacity: 0.55;
  cursor: wait;
}

.nearest-church-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.eyebrow,
.province-kicker,
.label {
  margin: 0 0 10px;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--accent);
}

#church-count {
  font-size: 0.94rem;
  font-weight: 600;
}

.legend {
  display: grid;
  gap: 14px;
  margin-top: 34px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
}

.legend-swatch {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 1px solid var(--line-soft);
}

.legend-swatch-active {
  background: var(--accent);
}

.legend-swatch-idle {
  background: var(--idle);
}

.map-card {
  padding: 22px;
  min-height: calc(100vh - 64px);
}

.map-card-header,
.detail-topbar,
.panel-heading,
.church-detail-header,
.pastor-card,
.detail-actions {
  display: flex;
  align-items: center;
}

.map-card-header,
.detail-topbar,
.panel-heading,
.church-detail-header {
  justify-content: space-between;
  gap: 16px;
}

.church-detail-header {
  flex-wrap: wrap;
  align-items: flex-start;
}

.church-detail-header .eyebrow {
  margin-bottom: 2px;
}

.church-detail-header h2 {
  margin: 0;
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(2rem, 2.6vw, 2.9rem);
  font-weight: 700;
  line-height: 0.92;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.church-location {
  margin: 0;
  max-width: 34ch;
  font-size: 0.98rem;
}

.map-stage {
  position: relative;
  min-height: 0;
  height: 100%;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(0, 72, 168, 0.1);
  background:
    radial-gradient(circle at top, rgba(0, 144, 216, 0.12), transparent 34%),
    linear-gradient(180deg, rgba(253, 255, 255, 0.98), rgba(232, 242, 255, 0.94));
}

.map-stage::before {
  content: "";
  position: absolute;
  inset: 16px;
  border-radius: calc(var(--radius-lg) - 6px);
  border: 1px dashed rgba(0, 72, 168, 0.08);
  pointer-events: none;
}

#argentina-map {
  display: block;
  width: 100%;
  height: 100%;
}

.province {
  fill: #ddeeff;
  stroke: rgba(0, 30, 100, 0.55);
  stroke-width: 1.5;
  transition:
    fill var(--transition),
    opacity var(--transition),
    transform var(--transition),
    filter var(--transition);
  transform-origin: center;
}

.province--available {
  fill: var(--accent);
  cursor: pointer;
}

.province--available:hover,
.province--available:focus {
  fill: #0078c0;
  filter: drop-shadow(0 10px 20px rgba(0, 120, 192, 0.18));
}

.province--active {
  fill: var(--highlight);
  stroke: rgba(0, 48, 144, 0.4);
}

.province--spotlight {
  animation: province-spotlight 520ms cubic-bezier(0.22, 1, 0.36, 1);
}

.province-label {
  fill: rgba(6, 35, 77, 0.72);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.01em;
  pointer-events: none;
  text-anchor: middle;
  transition: fill var(--transition), font-size var(--transition), filter var(--transition);
}

.province-label--available {
  fill: lightblue;
}

.province-label--hovered {
  fill: var(--accent-strong);
  font-size: 11px;
  filter: none;
}

.province-label--hidden {
  display: none;
}


.filter-field {
  display: grid;
  gap: 10px;
  width: 100%;
}

.filter-field input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid rgba(0, 72, 168, 0.16);
  border-radius: var(--radius-md);
  background: var(--white-soft);
  color: var(--text);
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

.filter-field input::placeholder {
  color: color-mix(in srgb, var(--muted) 72%, white);
}

.filter-field input:focus {
  outline: none;
  border-color: rgba(0, 144, 216, 0.48);
  box-shadow: 0 0 0 4px rgba(0, 144, 216, 0.14);
  background: var(--white-strong);
}

.back-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border: 1px solid rgba(0, 72, 168, 0.18);
  border-radius: 999px;
  background: rgba(250, 253, 255, 0.78);
  color: var(--accent-strong);
  cursor: pointer;
  transition: transform var(--transition), background var(--transition), border-color var(--transition);
}

.back-button:hover,
.back-button:focus-visible,
.action-button:hover,
.action-button:focus-visible,
.church-list-item:hover,
.church-list-item:focus-visible {
  transform: translateY(-1px);
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(0, 2fr);
  gap: 24px;
}

.church-picker-backdrop {
  display: none;
}

.card-surface {
  padding: clamp(24px, 3vw, 32px);
}

.detail-overview {
  display: flex;
  flex-direction: column;
}

.detail-overview-mobile-bar {
  display: none;
}

.detail-overview-header {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.picker-toggle-button,
.picker-close-button {
  border: 1px solid rgba(0, 72, 168, 0.16);
  border-radius: 999px;
  background: rgba(250, 253, 255, 0.92);
  color: var(--accent-strong);
  cursor: pointer;
  transition: transform var(--transition), background var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.picker-toggle-button {
  margin-top: 8px;
  padding: 10px 16px;
  font-size: 0.88rem;
  font-weight: 600;
}

.picker-toggle-button-topbar {
  margin-top: 0;
}

.picker-close-button {
  padding: 8px 14px;
  font-size: 0.8rem;
  font-weight: 600;
}

.church-list {
  display: grid;
  gap: 12px;
  margin-top: 18px;
  max-height: min(56vh, 620px);
  padding-right: 8px;
  overflow-y: auto;
  overflow-x: hidden;
}

.church-list::-webkit-scrollbar {
  width: 10px;
}

.church-list::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: rgba(0, 72, 168, 0.28);
  background-clip: padding-box;
}

.church-list::-webkit-scrollbar-track {
  background: rgba(0, 72, 168, 0.06);
  border-radius: 999px;
}

.church-empty-card {
  margin: 0;
  padding: 24px 22px;
  border: 1px solid rgba(0, 144, 216, 0.18);
  border-radius: calc(var(--radius-md) + 2px);
  background:
    radial-gradient(circle at top, rgba(0, 144, 216, 0.18), transparent 45%),
    linear-gradient(180deg, rgba(251, 254, 255, 0.98), rgba(231, 242, 255, 0.9));
  color: var(--muted);
  line-height: 1.6;
  text-align: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.church-empty-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  border-radius: 18px;
  background: rgba(0, 144, 216, 0.14);
  color: var(--highlight);
  font-size: 1.8rem;
  font-weight: 600;
  transform: rotate(45deg);
}

.church-empty-eyebrow {
  margin: 0 0 8px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
}

.church-empty-card h4 {
  margin: 0 0 10px;
  font-family: "Cormorant Garamond", serif;
  font-size: 1.7rem;
  line-height: 1;
  color: var(--text);
}

.church-empty-card p:last-child {
  margin: 0;
}

.church-empty-state {
  display: grid;
  align-content: center;
  min-height: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: clamp(28px, 5vw, 52px);
  text-align: center;
}

.church-empty-state .church-empty-icon {
  margin-bottom: 18px;
}

.church-empty-state h4 {
  margin: 0 0 12px;
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(2rem, 4vw, 2.8rem);
  line-height: 0.95;
  color: var(--text);
}

.church-empty-state p:last-child {
  max-width: 36ch;
  margin: 0 auto;
}

.church-list-item {
  position: relative;
  width: 100%;
  text-align: left;
  padding: 16px 18px 44px;
  border: 1px solid rgba(0, 72, 168, 0.12);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.58);
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition), transform var(--transition), box-shadow var(--transition);
  animation: list-item-slide-in 460ms cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: calc(var(--stagger-index, 0) * 45ms + 80ms);
}

.church-list-item strong,
.church-list-item span {
  display: block;
}

.church-list-item strong {
  margin-bottom: 6px;
  font-size: 1rem;
  letter-spacing: -0.01em;
}

.church-list-item span {
  color: var(--muted);
  font-size: 0.9rem;
}

.church-distance-badge {
  position: absolute;
  right: 14px;
  bottom: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  padding: 5px 10px;
  border: 2px solid #b8860b;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 245, 179, 0.94) 0%, rgba(255, 225, 112, 0.98) 52%, rgba(255, 241, 168, 0.94) 100%);
  box-shadow: 0 8px 16px rgba(184, 134, 11, 0.16);
  color: #b8860b;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.church-list-item.is-selected {
  border-color: rgba(0, 144, 216, 0.34);
  background: rgba(0, 144, 216, 0.12);
  box-shadow: inset 0 0 0 1px rgba(0, 144, 216, 0.14), 0 14px 24px rgba(0, 72, 168, 0.08);
  animation: selected-church-pulse 320ms cubic-bezier(0.22, 1, 0.36, 1);
}

.church-detail-panel.is-animating {
  animation: church-detail-reveal 360ms cubic-bezier(0.22, 1, 0.36, 1);
}

.church-detail-panel.is-animating .church-detail-header > *,
.church-detail-panel.is-animating .pastor-card,
.church-detail-panel.is-animating .info-stack > *,
.church-detail-panel.is-animating .nearest-church-badge,
.church-detail-panel.is-animating .church-empty-state > * {
  opacity: 0;
  animation: detail-stagger-in 520ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.church-detail-panel.is-animating .church-detail-header > *:nth-child(1) { animation-delay: 40ms; }
.church-detail-panel.is-animating .church-detail-header > *:nth-child(2) { animation-delay: 90ms; }
.church-detail-panel.is-animating .church-detail-header > *:nth-child(3) { animation-delay: 140ms; }

.church-detail-panel.is-animating .pastor-card { animation-delay: 120ms; }

.church-detail-panel.is-animating .info-stack > *:nth-child(1) { animation-delay: 170ms; }
.church-detail-panel.is-animating .info-stack > *:nth-child(2) { animation-delay: 220ms; }
.church-detail-panel.is-animating .info-stack > *:nth-child(3) { animation-delay: 270ms; }
.church-detail-panel.is-animating .info-stack > *:nth-child(4) { animation-delay: 320ms; }

.church-detail-panel.is-animating .nearest-church-badge { animation-delay: 360ms; }

.church-detail-panel.is-animating .church-empty-state > *:nth-child(1) { animation-delay: 90ms; }
.church-detail-panel.is-animating .church-empty-state > *:nth-child(2) { animation-delay: 150ms; }
.church-detail-panel.is-animating .church-empty-state > *:nth-child(3) { animation-delay: 210ms; }
.church-detail-panel.is-animating .church-empty-state > *:nth-child(4) { animation-delay: 270ms; }

.church-detail-grid {
  display: grid;
  grid-template-columns: minmax(240px, 360px) minmax(0, 1fr);
  align-items: start;
  gap: 28px;
  margin-top: 35px;
}

.pastor-card {
  align-items: flex-start;
}

.pastor-card img {
  width: 100%;
  aspect-ratio: 1 / 1.1;
  object-fit: cover;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(0, 72, 168, 0.16), rgba(0, 144, 216, 0.18));
}

.nearest-church-badge {
  display: flex;
  align-items: center;
  gap: 9px;
  grid-column: 1 / -1;
  margin-top: -4px;
  width: fit-content;
  max-width: min(100%, 620px);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, rgba(0, 72, 168, 0.1), rgba(0, 144, 216, 0.13));
  border: 1px solid rgba(0, 144, 216, 0.22);
  color: var(--accent-strong);
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.4;
  opacity: 1;
  transition: opacity 1.1s ease;
}

.nearest-church-badge svg {
  flex-shrink: 0;
  color: var(--highlight);
  width: 16px;
  height: 16px;
}

.nearest-church-badge.is-fading {
  opacity: 0;
}

.nearest-church-badge[hidden] {
  display: none;
}

@keyframes nearest-badge-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.nearest-church-badge.is-visible {
  animation: nearest-badge-in 0.35s ease both;
}

.value {
  margin: 0;
  font-size: 1.02rem;
  line-height: 1.7;
}

.info-stack {
  display: grid;
  gap: 18px;
  max-width: 560px;
}

.info-block-plain {
  padding-bottom: 0;
  border-bottom: 0;
}

.info-block {
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(0, 72, 168, 0.1);
}

.info-block:last-of-type {
  border-bottom: 0;
  padding-bottom: 0;
}

.link-inline,
.action-button {
  color: var(--accent-strong);
  text-decoration: none;
}

.detail-actions {
  flex-wrap: wrap;
  gap: 12px;
}

.action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 18px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--highlight));
  color: #f7fbff;
  box-shadow: 0 14px 28px rgba(0, 72, 168, 0.18);
  transition: transform var(--transition), background var(--transition), opacity var(--transition), box-shadow var(--transition);
}

.action-button:hover,
.action-button:focus-visible {
  box-shadow: 0 18px 34px rgba(0, 72, 168, 0.22);
}

.action-button-secondary {
  background: rgba(0, 72, 168, 0.1);
  color: var(--accent-strong);
}

.action-button.is-disabled {
  pointer-events: none;
  opacity: 0.45;
}

.church-list-item:focus-visible,
.back-button:focus-visible,
.action-button:focus-visible,
.province--available:focus {
  outline: 3px solid rgba(0, 144, 216, 0.36);
  outline-offset: 2px;
}

/* ── View Transitions ─────────────────────────────────────────── */
::view-transition-old(active-screen),
::view-transition-new(active-screen) {
  animation-duration: 480ms;
  animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
}

/* Forward: map exits left, detail enters from right */
[data-route-transition="forward"]::view-transition-old(active-screen) {
  animation-name: screen-exit-left;
}
[data-route-transition="forward"]::view-transition-new(active-screen) {
  animation-name: screen-enter-right;
}

/* Back: detail exits right, map enters from left */
[data-route-transition="back"]::view-transition-old(active-screen) {
  animation-duration: 340ms;
  animation-name: screen-exit-right;
}
[data-route-transition="back"]::view-transition-new(active-screen) {
  animation-duration: 780ms;
  animation-timing-function: cubic-bezier(0.12, 0.9, 0.22, 1);
  animation-name: screen-enter-left;
}

/* Fallback when no direction attribute is set */
::view-transition-old(active-screen) {
  animation-name: screen-exit-left;
}
::view-transition-new(active-screen) {
  animation-name: screen-enter-right;
}

::view-transition-old(selected-province-chip),
::view-transition-new(selected-province-chip) {
  animation-duration: 420ms;
  animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes selected-church-pulse {
  0% {
    transform: translateY(0) scale(1);
    box-shadow: inset 0 0 0 1px rgba(0, 144, 216, 0.14);
  }
  50% {
    transform: translateY(-2px) scale(1.01);
    box-shadow: inset 0 0 0 1px rgba(0, 144, 216, 0.18), 0 14px 28px rgba(0, 72, 168, 0.14);
  }
  100% {
    transform: translateY(0) scale(1);
    box-shadow: inset 0 0 0 1px rgba(0, 144, 216, 0.14);
  }
}

@keyframes church-detail-reveal {
  0% {
    opacity: 0;
    transform: translateY(14px) scale(0.985);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes detail-stagger-in {
  0% {
    opacity: 0;
    transform: translateY(16px) scale(0.985);
    filter: blur(8px);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

@keyframes list-item-slide-in {
  0% {
    opacity: 0;
    transform: translateX(-18px) translateY(10px) scale(0.985);
  }
  100% {
    opacity: 1;
    transform: translateX(0) translateY(0) scale(1);
  }
}

@keyframes screen-exit-left {
  from { opacity: 1; transform: translateX(0) scale(1); filter: blur(0px); }
  to   { opacity: 0; transform: translateX(-52px) scale(0.97); filter: blur(3px); }
}

@keyframes screen-enter-right {
  from { opacity: 0; transform: translateX(52px) scale(0.97); filter: blur(3px); }
  to   { opacity: 1; transform: translateX(0) scale(1); filter: blur(0px); }
}

@keyframes screen-exit-right {
  from { opacity: 1; transform: translateX(0) scale(1); filter: blur(0px); }
  to   { opacity: 0; transform: translateX(52px) scale(0.97); filter: blur(3px); }
}

@keyframes screen-enter-left {
  0%   { opacity: 0; transform: scale(1.12); filter: blur(14px); }
  60%  { opacity: 1; filter: blur(0px); }
  100% { opacity: 1; transform: scale(1);    filter: blur(0px); }
}

@keyframes province-spotlight {
  0% {
    transform: scale(1);
    filter: drop-shadow(0 0 0 rgba(0, 144, 216, 0));
  }
  45% {
    transform: scale(1.015);
    filter: drop-shadow(0 12px 20px rgba(0, 144, 216, 0.26));
  }
  100% {
    transform: scale(1);
    filter: drop-shadow(0 0 0 rgba(0, 144, 216, 0));
  }
}

@media (max-width: 1080px) {
  .screen-map,
  .detail-layout,
  .church-detail-grid {
    grid-template-columns: 1fr;
  }

  .church-list {
    max-height: 42vh;
  }

  .screen-map {
    min-height: auto;
  }

  .map-stage {
    min-height: 70vh;
  }
}

@media (max-width: 760px) {
  .page-shell {
    padding: 16px;
  }

  .screen-detail {
    position: relative;
  }

  .app-shell,
  .screen-map.active {
    height: calc(100dvh - 32px);
  }

  .screen-map {
    position: relative;
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 14px;
    align-items: stretch;
  }

  
  .detail-actions {
    justify-content: center;
  }

  .hero-panel,
  .map-card,
  .card-surface {
    padding: 22px;
    border-radius: 24px;
  }

  .hero-panel {
    min-height: 0;
    justify-content: flex-start;
    gap: 12px;
    padding: 20px 20px 18px;
  }

  .hero-panel h1,
  .map-card h1 {
    font-size: clamp(2.35rem, 11vw, 3.2rem);
  }

  .hero-copy {
    margin-top: 0;
    font-size: 0.94rem;
    line-height: 1.55;
    max-width: none;
  }

  .nearest-church-link {
    margin-top: 2px;
    padding: 10px 14px;
    font-size: 0.84rem;
  }

  .nearest-church-link-desktop {
    display: none;
  }

  .nearest-church-link-mobile {
    display: inline-flex;
    position: absolute;
    right: 28px;
    bottom: 28px;
    z-index: 4;
    margin: 0;
    max-width: min(280px, calc(100% - 56px));
    background: rgba(250, 253, 255, 0.94);
    backdrop-filter: blur(12px);
    box-shadow: 0 16px 30px rgba(0, 48, 144, 0.18);
    overflow: hidden;
    white-space: nowrap;
    justify-content: flex-start;
  }

  .nearest-church-link-mobile span {
    display: inline-block;
  }


  .nearest-church-link-mobile .nearest-church-icon {
    width: 18px;
    height: 18px;
  }


  .map-card-header,
  .detail-topbar,
  .panel-heading,
  .church-detail-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .detail-topbar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .church-detail-header {
    gap: 10px;
    padding: 18px 18px 16px;
    border: 1px solid rgba(0, 144, 216, 0.16);
    border-radius: calc(var(--radius-md) + 2px);
    background:
      radial-gradient(circle at top left, rgba(0, 144, 216, 0.18), transparent 60%),
      linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(239, 247, 255, 0.92));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
  }

  .church-detail-header h2 {
    font-size: clamp(2.3rem, 11vw, 3.1rem);
  }

  .church-location {
    max-width: none;
    font-size: 0.94rem;
    line-height: 1.55;
  }

  .picker-toggle-button-topbar {
    margin-left: auto;
  }

  .map-stage {
    height: 100%;
  }

  .map-card {
    height: 100%;
    padding: 16px;
  }

  .detail-layout {
    display: block;
  }

  .detail-overview {
    display: none;
  }

  .detail-overview.is-mobile-modal-open {
    display: flex;
    position: fixed;
    inset: auto 16px 16px;
    z-index: 25;
    max-height: min(72dvh, 640px);
    overflow: hidden;
    box-shadow: 0 24px 48px rgba(0, 48, 144, 0.2);
  }

  .detail-overview-mobile-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }

  .detail-overview-mobile-bar .label {
    margin-bottom: 0;
  }

  .church-picker-backdrop {
    position: fixed;
    inset: 0;
    z-index: 20;
    display: block;
    background: rgba(6, 35, 77, 0.38);
    backdrop-filter: blur(8px);
  }

  .church-list {
    max-height: none;
    padding-right: 2px;
  }

  #church-list-title {
    display: none;
  }

  .church-detail-panel {
    min-height: calc(100dvh - 124px);
  }

  .picker-toggle-button[hidden] {
    display: none;
  }

  .map-stage::before {
    inset: 10px;
  }

  .province-label {
    font-size: 9px;
  }
}

@keyframes mobile-nearest-button-collapse {
  0% {
    gap: 8px;
    padding: 10px 14px;
    max-width: min(280px, calc(100% - 56px));
    border-radius: var(--radius-sm);
    justify-content: flex-start;
  }
  100% {
    gap: 0;
    padding: 0;
    width: 52px;
    height: 52px;
    max-width: 52px;
    border-radius: 999px;
    justify-content: center;
  }
}

@keyframes mobile-nearest-label-fade {
  0% {
    opacity: 1;
    max-width: 180px;
    transform: scaleX(1);
  }
  100% {
    opacity: 0;
    max-width: 0;
    transform: scaleX(0.72);
  }
}
  .nearest-church-link-mobile.is-in-view {
    animation: mobile-nearest-button-collapse 560ms cubic-bezier(0.4, 0, 0.2, 1) 1.4s forwards;
  }

  .nearest-church-link-mobile.is-in-view span {
    animation: mobile-nearest-label-fade 220ms ease 1.22s forwards;
  }


