/* 검색 (Q1~Q4): 지도 가득 + 왼쪽 위 검색창 + 오른쪽 컨트롤 + 바텀시트 3단계. 토큰만 쓴다 */
.search { position: relative; height: 100%; overflow: hidden; background: var(--paper); }
.map { position: absolute; inset: 0; overflow: hidden; touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; }
.map.dragging { cursor: grabbing; }
.map-base { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.map-markers { position: absolute; inset: 0; pointer-events: none; }
.map-marker { position: absolute; left: 0; top: 0; padding: 0; border: 0; background: none; pointer-events: auto; color: var(--ink); }
.map-marker-static { pointer-events: none; }
.marker-visual { display: grid; justify-items: center; gap: 2px; will-change: transform; }
.map-label { color: var(--ink-sub); font-size: var(--fs-caption); line-height: var(--lh-caption); white-space: nowrap; }

/* 핀 (MapPin: 점포·지역·기관 × 기본·선택·흐림) */
.pin { min-width: var(--touch); min-height: var(--touch); }
.pin-dot {
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
  border: 2px solid var(--surface); box-shadow: var(--shadow-card); color: var(--on-color);
  transition: transform var(--t-pin) ease-out;
}
.pin-shop { background: var(--primary); }
.pin-area { background: var(--ink-sub); }
.pin-org { background: var(--sig-green); }
.pin-label {
  max-width: 140px; padding: 2px 8px; border-radius: var(--radius-sm); background: var(--surface); box-shadow: var(--shadow-card);
  font-size: var(--fs-caption); line-height: var(--lh-caption); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pin .marker-visual { transition: opacity var(--t-pin) ease-out; animation: pinIn 0.3s ease-out backwards; animation-delay: calc(var(--i, 0) * 50ms); }
@keyframes pinIn { from { opacity: 0; } }
.pin.is-dim .marker-visual { opacity: 0.4; }
.pin.is-selected { z-index: 2; }
.pin.is-selected .pin-dot { transform: scale(1.35); background: var(--day-sat); }
.pin.is-selected .pin-label { font-weight: 700; margin-top: 6px; }
.pin-dot.pop { animation: pinPop var(--t-pin) ease-out; }
@keyframes pinPop { 0% { transform: scale(1); } 60% { transform: scale(1.5); } 100% { transform: scale(1.35); } }

/* 내 위치: 파란 점 + 펄스 (유일한 반복 애니메이션) / 예시 위치는 속이 빈 고리 */
.me { position: relative; display: grid; place-items: center; width: 48px; height: 48px; }
.me::before { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--day-tue); opacity: 0.18; animation: mePulse 1.6s ease-out infinite; }
.me-dot { width: 16px; height: 16px; border-radius: 50%; background: var(--day-tue); border: 3px solid var(--surface); box-shadow: var(--shadow-card); }
.me-example::before { animation: none; opacity: 0.12; background: var(--ink-sub); }
.me-example .me-dot { background: var(--surface); border-color: var(--ink-sub); }
@keyframes mePulse { from { transform: scale(0.4); opacity: 0.35; } to { transform: scale(1.4); opacity: 0; } }

/* 검색창 (SearchBar) + 자동완성 (Autocomplete) */
.searchbar {
  position: absolute; z-index: 5; top: calc(env(safe-area-inset-top) + var(--s3)); left: var(--s4); right: var(--s4);
  display: flex; align-items: center; gap: var(--s2); height: 48px; padding: 0 var(--s1) 0 var(--s4);
  border: 1px solid var(--line); border-radius: var(--radius-pill); background: var(--surface); box-shadow: var(--shadow-card);
}
.searchbar:focus-within { border: 2px solid var(--primary); }
.search-icon { display: inline-flex; color: var(--ink-sub); }
.search-input { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; font-size: var(--fs-body); outline: none; }
.search-input::-webkit-search-cancel-button { display: none; }
.suggest {
  position: absolute; z-index: 6; top: calc(env(safe-area-inset-top) + var(--s3) + 56px); left: var(--s4); right: var(--s4);
  margin: 0; padding: var(--s1) 0; list-style: none; border: 1px solid var(--line); border-radius: var(--radius-16);
  background: var(--surface); box-shadow: var(--shadow-card); transform-origin: top;
}
.suggest.open { animation: suggestIn var(--t-suggest) ease-out; }
@keyframes suggestIn { from { opacity: 0; transform: translateY(-4px); } }
.suggest-item { display: flex; align-items: center; gap: var(--s3); min-height: 48px; padding: 0 var(--s4); cursor: pointer; }
.suggest-item[aria-selected="true"], .suggest-item:hover { background: var(--primary-soft); }
.suggest-icon { display: inline-flex; color: var(--ink-sub); }
.suggest-name { flex: 1; }
.suggest-name strong { font-weight: 700; }
.suggest-kind { color: var(--ink-sub); font-size: var(--fs-caption); white-space: nowrap; }
.suggest-empty { padding: var(--s3) var(--s4); color: var(--ink-sub); font-size: var(--fs-label); }

/* 시연 도우미는 검색창 아래 (검색창·하단 탭을 가리지 않음) */
html:not([data-real-device="computer"]) body.page-search .demobar { top: calc(env(safe-area-inset-top) + var(--s3) + 56px); }
html:not([data-real-device="computer"]) body.suggest-open .demobar { visibility: hidden; }

/* 지도 컨트롤 */
.map-ctrl { position: absolute; z-index: 4; right: var(--s4); top: calc(env(safe-area-inset-top) + 128px); display: grid; gap: var(--s3); justify-items: end; }
.zoom { display: grid; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-card); overflow: hidden; }
.zoom .map-btn { border: 0; border-radius: 0; box-shadow: none; }
.zoom .map-btn + .map-btn { border-top: 1px solid var(--line); }
.map-btn { display: grid; place-items: center; width: var(--touch); height: var(--touch); border: 1px solid var(--line); border-radius: var(--radius-pill); background: var(--surface); color: var(--ink); box-shadow: var(--shadow-card); }
.loc-badge {
  position: absolute; z-index: 3; left: var(--s4); bottom: calc(96px + var(--s3)); padding: 6px 12px;
  border: 1px solid var(--line); border-radius: var(--radius-pill); background: var(--surface); box-shadow: var(--shadow-card);
  font-size: var(--fs-caption); line-height: var(--lh-caption);
}
.map-note { position: absolute; z-index: 3; left: var(--s4); bottom: calc(96px + 48px); opacity: 0.8; }

/* 바텀시트 (드로어): peek 96px / half 45% / full 90%. 높이가 아니라 translateY로 움직인다 */
.sheet {
  position: absolute; z-index: 7; left: 0; right: 0; bottom: 0; height: 90%;
  display: flex; flex-direction: column; border-radius: var(--radius) var(--radius) 0 0;
  background: var(--surface); box-shadow: 0 -4px 16px rgba(31, 41, 46, 0.10);
  transform: translateY(calc(100% - 112px)); transition: transform var(--t-sheet) ease-out;
  overflow: hidden;
}
.sheet[data-state="half"] { transform: translateY(50%); }
.sheet[data-state="full"] { transform: translateY(0); }
.sheet.is-full { overflow-y: auto; overscroll-behavior: contain; }
.sheet-handle { flex: none; display: grid; place-items: center; width: 100%; height: 44px; padding: 0; border: 0; background: transparent; }
.sheet-handle span { width: 40px; height: 4px; border-radius: var(--radius-pill); background: var(--line); }
.sheet-peek { flex: none; display: grid; gap: 2px; min-height: 68px; margin-top: -8px; padding: 0 var(--s4) var(--s3); }
.peek-title { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }
.peek-title h2 { font-size: var(--fs-h2); line-height: var(--lh-h2); }
.sheet-half { display: grid; gap: var(--s3); padding: 0 var(--s4) var(--s4); align-content: start; }
.sheet-full { display: grid; gap: var(--s3); padding: var(--s3) var(--s4) var(--s8); border-top: 1px solid var(--line); align-content: start; }
.sheet .daychips { gap: 4px; }
.sheet .daychip { min-height: 52px; }
.index-line { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }
.sheet-actions { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2); }
.others-head, .full-head { font-size: var(--fs-label); line-height: var(--lh-label); color: var(--ink-sub); font-weight: 500; }
.chip-row { display: flex; gap: var(--s2); flex-wrap: wrap; justify-content: center; }
.sheet .empty { padding: var(--s4) 0 0; box-shadow: none; }

/* 다른 결과: 가로 카드 + 스크롤 스냅 */
.rcard-row { display: flex; gap: var(--s2); overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: var(--s1); margin: 0 calc(-1 * var(--s4)); padding-left: var(--s4); padding-right: var(--s4); }
.rcard-row > div { scroll-snap-align: start; flex: none; }
.rcard-mini {
  display: grid; gap: var(--s1); width: 200px; min-height: 88px; padding: var(--s3); text-align: left;
  border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface);
}
.rcard-list { display: grid; gap: var(--s2); }
.rcard {
  display: flex; align-items: center; gap: var(--s3); width: 100%; min-height: 64px; padding: var(--s3); text-align: left;
  border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface);
}
.rcard[aria-pressed="true"], .rcard-mini[aria-pressed="true"] { border: 2px solid var(--primary); background: var(--primary-soft); }
.rcard-icon { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 50%; color: var(--on-color); }
.rcard-text { display: grid; gap: 2px; flex: 1; }
.rcard-name { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; font-weight: 700; }
.sheet-note { padding: var(--s3); border-radius: var(--radius-md); background: var(--paper); color: var(--ink-sub); font-size: var(--fs-caption); line-height: var(--lh-caption); }
.org-note { padding: var(--s2) var(--s3); border-radius: var(--radius-sm); background: var(--primary-soft); }
.map:focus-visible { outline: 3px solid var(--primary); outline-offset: -3px; }
