.app--map {
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding-bottom: 0;
  overflow: hidden;
}

/* 위치 권한 거부/실패처럼 조용히 실패하던 상황을 알려주는 토스트.
   #map 안쪽에 position:relative 컨테이너가 따로 없어서 뷰포트 기준
   fixed로 두고, 내 위치 버튼(우측 하단) 바로 위에 겹치지 않게 띄운다. */
.map-toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tabbar-height) + 76px);
  transform: translateX(-50%);
  z-index: 30;
  background: rgba(58, 67, 99, 0.92);
  color: #fff;
  font-size: 12.5px;
  font-weight: 600;
  padding: 9px 16px;
  border-radius: 999px;
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s;
  white-space: nowrap;
  pointer-events: none;
  max-width: calc(100% - 32px);
  text-align: center;
}

.map-toast.is-visible {
  opacity: 1;
  visibility: visible;
}

.map-toolbar {
  padding: 10px 0;
  border-bottom: 1px solid var(--color-border);
  flex: none;
}

.map-toolbar__regions {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 16px;
  scrollbar-width: none;
}

.map-toolbar__regions::-webkit-scrollbar {
  display: none;
}

.map-chip {
  flex: none;
  padding: 7px 15px;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  color: #7B84A3;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  background: var(--color-white);
}

.map-chip.is-active {
  background: var(--color-primary);
  color: var(--color-white);
}

.map-canvas {
  flex: 1;
  width: 100%;
  min-height: 0;
}

/* 내 위치 기준 가까운 순 가로 스크롤 카드 */
.map-nearby {
  flex: none;
  padding: 10px 0;
  border-bottom: 1px solid var(--color-border);
}

.map-nearby__title {
  margin: 0 16px 8px;
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--color-primary);
}

.map-nearby__hint {
  font-size: 10px;
  font-weight: 500;
  color: var(--color-text-secondary);
}

.map-nearby__track {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 16px;
  scrollbar-width: none;
}

.map-nearby__track::-webkit-scrollbar {
  display: none;
}

.map-nearby__card {
  flex: none;
  width: 84px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 0;
  border: none;
  background: none;
  text-align: left;
  cursor: pointer;
}

.map-nearby__thumb-wrap {
  position: relative;
  display: block;
  width: 84px;
  height: 64px;
}

/* 이 장소에 수유실이 있다는 표시. 지도의 파란 🍼 핀(공공 수유실)과 같은
   기호를 써서 "아이 데리고 갈 수 있나"를 목록에서도 바로 읽게 한다. */
.map-nearby__badge {
  position: absolute;
  left: 4px;
  bottom: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 1px 4px rgba(58, 67, 99, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  line-height: 1;
}

.map-nearby__thumb {
  width: 84px;
  height: 64px;
  border-radius: 10px;
  object-fit: cover;
  background: var(--color-bg);
  display: block;
}

.map-nearby__name {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text);
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-nearby__dist {
  font-size: 10px;
  font-weight: 700;
  color: var(--color-primary);
}

.map-track-btn {
  position: fixed;
  right: 16px;
  bottom: calc(var(--tabbar-height) + 16px);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  background: var(--color-white);
  box-shadow: 0 2px 8px rgba(58, 67, 99, 0.15);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
}

.map-track-btn svg {
  width: 21px;
  height: 21px;
}

.map-track-btn.is-active {
  background: #1E88FF;
  border-color: #1E88FF;
  color: #fff;
}

.map-layer-btn {
  position: fixed;
  right: 16px;
  bottom: calc(var(--tabbar-height) + 68px);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  background: var(--color-white);
  box-shadow: 0 2px 8px rgba(58, 67, 99, 0.15);
  font-size: 19px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
}

/* 수유실 버튼 바로 위. 둘은 짝이라 같은 기둥에 세로로 세운다. */
.map-layer-btn--toilet {
  bottom: calc(var(--tabbar-height) + 120px);
}

.map-layer-btn.is-active {
  background: var(--color-primary);
  border-color: var(--color-primary);
}

/* 켜졌다는 것을 레이어의 색으로 보여준다 — 초록 핀이 뿌려지는 버튼이다. */
.map-layer-btn--toilet.is-active {
  background: #2F9E63;
  border-color: #2F9E63;
}

.map-sheet {
  position: fixed;
  left: 50%;
  bottom: var(--tabbar-height);
  transform: translate(-50%, 100%);
  visibility: hidden;
  width: 100%;
  max-width: var(--max-width);
  background: var(--color-white);
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -4px 16px rgba(58, 67, 99, 0.12);
  transition: transform 0.2s ease, visibility 0.2s;
  z-index: 6;
  max-height: 60vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
}

.map-sheet.is-open {
  transform: translate(-50%, 0);
  visibility: visible;
}

.map-sheet__handle {
  width: 36px;
  height: 4px;
  background: var(--color-border);
  border-radius: 999px;
  margin: 10px auto;
}

.map-sheet__card {
  padding: 0 16px 20px;
}

.map-sheet__thumb-wrap {
  position: relative;
  margin-bottom: 10px;
}

.map-sheet__img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-radius: 12px;
  background: var(--color-bg);
  display: block;
}

.map-sheet__favorite-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 2px 6px rgba(58, 67, 99, 0.18);
  font-size: 14px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.map-sheet__favorite-btn.is-active {
  background: var(--color-white);
}

.map-sheet__favorite-btn--inline {
  position: static;
  flex-shrink: 0;
  box-shadow: none;
  background: var(--color-bg);
}

.map-sheet__name-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.map-sheet__name {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-text);
  margin: 0 0 4px;
}

.map-sheet__meta {
  font-size: 12px;
  color: var(--color-text-secondary);
  margin: 0 0 8px;
}

.map-sheet__row {
  font-size: 13px;
  color: var(--color-text);
  margin: 0 0 4px;
}

.map-sheet__actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.map-sheet__actions a {
  flex: 1;
  text-align: center;
  padding: 10px;
  border-radius: 10px;
  font-size: 13px;
  text-decoration: none;
}

.map-sheet__actions .btn-primary {
  background: var(--color-primary);
  color: var(--color-white);
  font-weight: 700;
}

.map-sheet__actions .btn-secondary {
  background: var(--color-bg);
  color: var(--color-text);
  border: 1px solid var(--color-border);
}

/* 내 위치 마커: 파란 점 + 은은하게 퍼지는 원 */
.map-my-location {
  position: relative;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.map-my-location__halo {
  position: absolute;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(30, 136, 255, 0.18);
  animation: map-my-location-pulse 2.2s ease-out infinite;
}

.map-my-location__dot {
  position: relative;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #1E88FF;
  border: 3px solid #fff;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.3);
}

@keyframes map-my-location-pulse {
  0% {
    transform: scale(0.55);
    opacity: 0.9;
  }
  70%,
  100% {
    transform: scale(1.4);
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .map-my-location__halo {
    animation: none;
    opacity: 0.5;
  }
}

/* 지도에 없는 수유실을 알려주는 버튼. 🍼 레이어를 켰을 때만 나온다 —
   수유실을 보고 있을 때라야 "여기 없네" 하는 생각이 든다.
   글자가 들어가서 동그란 레이어 버튼과 달리 알약 모양으로 두고, 겹치지 않게
   그 왼쪽에 붙인다. */
.map-add-btn {
  position: fixed;
  right: 68px;
  bottom: calc(var(--tabbar-height) + 68px);
  height: 44px;
  padding: 0 15px;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background: var(--color-white);
  color: var(--color-text);
  box-shadow: 0 2px 8px rgba(58, 67, 99, 0.15);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  z-index: 5;
}

.map-add-btn[hidden] {
  display: none;
}

/* 수유실 상세 아래의 "정보가 달라요". 길찾기 버튼들과 무게를 다르게 두어
   눌러야 할 것과 알려줄 수 있는 것을 구분한다. */
.map-sheet__report {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 9px;
  border: 0;
  background: none;
  color: var(--color-text-secondary);
  font-size: 12.5px;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

/* 아빠가 들어갈 수 있는지. 이 앱에서 수유실을 볼 때 가장 먼저 알아야 하는 것이라
   주소나 전화번호보다 위에 두고 색으로 구분한다. 아이를 안고 갔다가 문 앞에서
   돌아서는 일이 없도록. */
.nursing-father {
  margin: 8px 0 10px;
  padding: 8px 12px;
  border-radius: 9px;
  font-size: 13.5px;
  font-weight: 700;
}

.nursing-father--yes {
  background: #E7F0EA;
  color: #2F6B4A;
}

.nursing-father--no {
  background: #F6F0E2;
  color: #7A5C23;
}

.map-sheet__row a {
  color: var(--color-primary);
  text-decoration: none;
}
