.congregation-map__controls {
  display: grid;
  gap: 0.65rem;
}

@media (min-width: 1024px) {
  .congregation-map__controls {
    grid-template-columns: minmax(220px, 1fr) auto auto;
    align-items: center;
    gap: 0.75rem;
  }
}

.congregation-map__search-label {
  display: flex;
  min-height: 2.75rem;
  align-items: center;
  gap: 0.5rem;
  border-radius: 9999px;
  border: 1px solid rgba(32, 51, 81, 0.16);
  background: #fff;
  padding: 0 0.85rem;
  color: #203351;
}

.congregation-map__search-label input {
  width: 100%;
  border: 0;
  background: transparent;
  color: #203351;
  font: inherit;
  font-size: 1rem;
  outline: none;
}

.congregation-map__search-label input::placeholder {
  color: rgba(32, 51, 81, 0.58);
}

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

.congregation-map__filter {
  border: 1px solid rgba(32, 51, 81, 0.16);
  border-radius: 9999px;
  background: #fff;
  color: #203351;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.2;
  min-height: 2.75rem;
  padding: 0.55rem 0.75rem;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.congregation-map__filter:hover,
.congregation-map__filter.is-active {
  background: #203351;
  border-color: #203351;
  color: #fff;
}

@media (min-width: 640px) {
  .congregation-map__filters {
    display: flex;
    flex-wrap: wrap;
  }

  .congregation-map__filter {
    min-height: 3rem;
    padding: 0.65rem 1rem;
  }
}

.congregation-map__nearby {
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.9rem;
  padding: 0.65rem 1rem;
  white-space: nowrap;
  width: 100%;
}

.congregation-map__nearby.is-active {
  box-shadow: 0 0 0 2px rgba(32, 51, 81, 0.12);
}

.congregation-map__nearby[aria-busy="true"] {
  cursor: wait;
  opacity: 0.72;
}

@media (min-width: 1024px) {
  .congregation-map__nearby {
    width: auto;
  }
}

.congregation-map__status {
  color: rgba(32, 51, 81, 0.72);
  font-size: 0.95rem;
  margin: 1rem 0 0.75rem;
}

.congregation-map__layout {
  display: grid;
  gap: 1rem;
  isolation: isolate;
}

@media (min-width: 1024px) {
  .congregation-map__layout {
    grid-template-columns: minmax(0, 1fr) 360px;
  }
}

.congregation-map__canvas {
  position: relative;
  z-index: 1;
  min-width: 0;
  min-height: clamp(260px, 42vh, 340px);
  overflow: hidden;
  border-radius: 1rem;
  background: #aad3df;
}

.congregation-map__canvas .leaflet-container {
  border-radius: 1rem;
}

.congregation-map__marker-icon {
  background: transparent;
  border: 0;
}

.congregation-map__map-tooltip {
  position: absolute;
  z-index: 650;
  transform: translate(-50%, -100%);
  border: 1px solid rgba(32, 51, 81, 0.14);
  border-radius: 1rem;
  background: #fff;
  box-shadow: 0 18px 45px rgba(32, 51, 81, 0.2);
  color: #203351;
  padding: 1rem;
  pointer-events: auto;
}

.congregation-map__map-tooltip::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -9px;
  width: 18px;
  height: 18px;
  transform: translateX(-50%) rotate(45deg);
  border-right: 1px solid rgba(32, 51, 81, 0.14);
  border-bottom: 1px solid rgba(32, 51, 81, 0.14);
  background: #fff;
}

.congregation-map__map-tooltip[hidden] {
  display: none;
}

.congregation-map__map-tooltip strong,
.congregation-map__map-tooltip span {
  display: block;
}

.congregation-map__map-tooltip strong {
  padding-right: 1.5rem;
  font-weight: 800;
  line-height: 1.2;
}

.congregation-map__map-tooltip span,
.congregation-map__map-tooltip p {
  color: rgba(32, 51, 81, 0.74);
  margin: 0.25rem 0 0;
}

.congregation-map__map-tooltip div {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.7rem;
}

.congregation-map__map-tooltip a {
  color: #17428b;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.congregation-map__map-tooltip-close {
  position: absolute;
  top: 0.5rem;
  right: 0.6rem;
  border: 0;
  background: transparent;
  color: rgba(32, 51, 81, 0.65);
  cursor: pointer;
  font-size: 1.4rem;
  line-height: 1;
  padding: 0.1rem;
}

@media (min-width: 768px) {
  .congregation-map__canvas {
    min-height: 620px;
  }
}

.congregation-map__panel {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  min-width: 0;
  max-height: min(420px, 70vh);
  overflow: hidden;
  border: 1px solid rgba(32, 51, 81, 0.12);
  border-radius: 1rem;
  background: #f6f4f2;
}

@media (min-width: 768px) {
  .congregation-map__panel {
    max-height: 620px;
  }
}

.congregation-map__empty,
.congregation-map__detail {
  border-bottom: 1px solid rgba(32, 51, 81, 0.1);
  padding: 1rem;
}

.congregation-map__empty {
  color: #203351;
  text-align: center;
}

.congregation-map__empty img {
  height: 4.5rem;
  margin: 0 auto 0.75rem;
  object-fit: contain;
  width: 4.5rem;
}

@media (min-width: 768px) {
  .congregation-map__empty,
  .congregation-map__detail {
    padding: 1.25rem;
  }

  .congregation-map__empty img {
    height: 6rem;
    width: 6rem;
  }
}

.congregation-map__empty h3,
.congregation-map__detail h3,
.congregation-map__results h3 {
  color: #203351;
  font-size: 1.125rem;
  font-weight: 800;
  line-height: 1.25;
  margin: 0;
}

.congregation-map__empty p,
.congregation-map__detail p {
  color: rgba(32, 51, 81, 0.76);
  line-height: 1.55;
  margin: 0.5rem 0 0;
}

.congregation-map__detail-header {
  align-items: center;
  display: flex;
  gap: 0.875rem;
}

.congregation-map__detail-header img {
  background: #fff;
  border-radius: 9999px;
  height: 4rem;
  object-fit: contain;
  padding: 0.35rem;
  width: 4rem;
}

.congregation-map__type {
  border-radius: 9999px;
  display: inline-flex;
  font-size: 0.8rem;
  font-weight: 800;
  margin-top: 0.5rem;
  padding: 0.25rem 0.65rem;
}

.congregation-map__type--church {
  background: #83d0f5;
  color: #203351;
}

.congregation-map__type--group {
  background: #ee7766;
  color: #203351;
}

.congregation-map__type--other {
  background: #ffec8d;
  color: #203351;
}

.congregation-map__meta {
  display: grid;
  gap: 0.75rem;
  margin-top: 1rem;
}

.congregation-map__meta div {
  color: rgba(32, 51, 81, 0.82);
  line-height: 1.45;
}

.congregation-map__meta strong {
  color: #203351;
  display: block;
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  margin-bottom: 0.15rem;
  text-transform: uppercase;
}

.congregation-map__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.congregation-map__action {
  align-items: center;
  border-radius: 9999px;
  display: inline-flex;
  font-weight: 800;
  gap: 0.35rem;
  padding: 0.65rem 0.9rem;
  text-decoration: none;
}

.congregation-map__action--primary {
  background: #17428b;
  color: #fff;
}

.congregation-map__action--secondary {
  background: #fff;
  color: #203351;
}

.congregation-map__results[hidden] {
  display: none;
}

.congregation-map__results {
  min-height: 0;
  max-height: 18rem;
  overflow: auto;
  padding: 1rem;
}

@media (min-width: 768px) {
  .congregation-map__results {
    max-height: none;
    padding: 1.25rem;
  }
}

.congregation-map__results ol {
  display: grid;
  gap: 0.5rem;
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
}

.congregation-map__result {
  border: 1px solid rgba(32, 51, 81, 0.1);
  border-radius: 0.9rem;
  background: #fff;
  color: #203351;
  cursor: pointer;
  display: block;
  padding: 0.75rem;
  text-align: left;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  width: 100%;
}

.congregation-map__result:hover,
.congregation-map__result.is-active {
  border-color: #17428b;
  box-shadow: 0 8px 24px rgba(32, 51, 81, 0.1);
}

.congregation-map__result-name {
  display: block;
  font-weight: 800;
  line-height: 1.25;
}

.congregation-map__result-meta {
  color: rgba(32, 51, 81, 0.68);
  display: block;
  font-size: 0.88rem;
  margin-top: 0.25rem;
}

.congregation-map__marker {
  align-items: center;
  border: 3px solid #fff;
  border-radius: 9999px;
  box-shadow: 0 8px 24px rgba(32, 51, 81, 0.22);
  display: flex;
  height: 42px;
  justify-content: center;
  width: 42px;
}

.congregation-map__marker img {
  height: 30px;
  object-fit: contain;
  width: 30px;
}

.congregation-map__marker--church {
  background: #83d0f5;
}

.congregation-map__marker--group {
  background: #ee7766;
}

.congregation-map__marker--other {
  background: #ffec8d;
}

.leaflet-popup-content-wrapper {
  border-radius: 0.9rem;
  color: #203351;
}
