/* ─────────────────────────────────────────────────────────
   지도·장소 화면. 판정 색은 common.css 의 --judge-* 변수만 쓴다 (빨간색 없음).
   색만으로 구분하지 않도록: 미확인 = 점선 테두리, 조건부 = 손 아이콘 (기획 v2 3.1)
   ───────────────────────────────────────────────────────── */

/* ── 판정 표시 (마커·목록·상세 공통) ── */
.judge-dot, .map-marker {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; flex-shrink: 0;
  border-radius: 50%; border: 2px solid #fff;
  font-size: 12px; line-height: 1;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15);
}
.judge-ACCESSIBLE  { background: var(--judge-accessible); }
.judge-CONDITIONAL { background: var(--judge-conditional); }
.judge-DIFFICULT   { background: var(--judge-difficult); }
.judge-UNKNOWN     { background: var(--judge-unknown); border: 2px dashed var(--judge-unknown-border); box-shadow: none; }
.judge-NONE        { background: var(--color-primary); }

.map-marker { width: 28px; height: 28px; cursor: pointer; padding: 0; font-size: 14px; }
.map-marker:focus-visible { outline: 3px solid var(--color-text); outline-offset: 2px; }
.my-location {
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--color-primary); border: 3px solid #fff; box-shadow: 0 0 0 6px rgba(59, 108, 246, 0.25);
}


/* ── 지도 화면: 데스크톱 [패널 | 지도], 모바일 [지도 위 / 패널 아래] ── */
.map-layout { padding: 0; }
#map-app { display: flex; height: calc(100dvh - var(--topbar-height)); }
.map-panel {
  width: 360px; flex-shrink: 0; display: flex; flex-direction: column; overflow: hidden; padding: 16px;
  background: var(--color-surface); border-right: 1px solid var(--color-border);
}
/* 목록 스크롤바가 이동 조건 칩의 너비를 줄이거나 검색·조건 영역을 밀어내지 않게 분리 */
.map-panel > * { flex-shrink: 0; }
.map-panel > .map-results {
  flex: 1; min-height: 0; overflow-y: auto; scrollbar-gutter: stable; overscroll-behavior-y: contain;
}
#profile-chips .chip { flex-shrink: 0; white-space: nowrap; }
.map-unavailable, .map:empty { display: flex; align-items: center; justify-content: center; padding: 16px; color: var(--color-muted); background: #eef1f5; text-align: center; }

.panel-label { margin: 0 0 8px; font-weight: 600; }
.toggle { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 8px 0 12px; }
.toggle .toggle-label { white-space: nowrap; }  /* "모든 장소 보기"가 글자 중간에서 줄바꿈되지 않게 */

.legend { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 6px; font-size: 13px; }
.legend li { display: flex; align-items: center; gap: 8px; }

.place-list { list-style: none; padding: 0; margin: 0; }
.place-item {
  display: flex; gap: 12px; align-items: flex-start; padding: 12px 4px;
  border-bottom: 1px solid var(--color-border); color: var(--color-text);
}
.place-item:hover, .place-item:focus-visible { background: #f0f4ff; }
.place-item-body { display: flex; flex-direction: column; gap: 2px; }

@media (max-width: 768px) {
  #map-app { flex-direction: column-reverse; height: auto; }
  .map-panel { width: 100%; border-right: 0; border-top: 1px solid var(--color-border); }
  .map-panel > .map-results { flex: none; max-height: 50dvh; }
}

/* ── 장소 상세 ── */
.place-detail { display: grid; gap: 16px; max-width: 720px; margin: 0 auto; }
.place-detail h1 { margin: 4px 0; }
.place-detail h2 { margin: 0 0 12px; font-size: 18px; }
.place-detail h3 { margin: 12px 0 4px; font-size: 15px; }
.judgment-list { list-style: none; padding: 0; margin: 0 0 8px; display: grid; gap: 10px; }
.judgment-list li { display: flex; gap: 10px; align-items: flex-start; }
.section-building { background: #fafbfc; }
.fields { margin: 0; display: grid; gap: 4px; }
.field-row { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px dashed var(--color-border); }
.field-row dt { color: var(--color-muted); }
.field-row dd { margin: 0; text-align: right; }
.entrance + .entrance { margin-top: 12px; }
/* 입구 사진: 세로 사진도 잘리지 않게 전체를 보여 줌 (문턱·계단이 사진 아래쪽에 있는 경우가 많음). 누르면 원본 크기 */
.entrance-photo { display: block; width: 100%; max-height: 420px; object-fit: contain; background: var(--color-bg); border-radius: 8px; margin: 4px 0 8px; }
.notice { padding: 12px; border-top: 1px solid var(--color-border); }
.link-disabled { color: var(--color-muted); pointer-events: none; }

/* ── 지도 홈: 검색·요약·빈 상태·오류·팝업 (와이어프레임 1·2·3·6번) ── */
.search-bar { display: flex; gap: 8px; margin-bottom: 12px; }
.search-bar input[type="search"] { flex: 1; min-width: 0; }
.search-bar select { padding: 10px; border: 1px solid var(--color-border); border-radius: 8px; font: inherit; }
.summary { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 6px; font-size: 14px; }
.summary li { display: flex; align-items: center; gap: 8px; }
.summary strong { margin-left: auto; }
.empty-state { display: grid; gap: 8px; margin-bottom: 12px; }
.empty-state .actions { justify-content: flex-start; }
.map-wrap { flex: 1; min-width: 0; position: relative; }
.map-wrap .map { position: absolute; inset: 0; }
.map-error, .popup { position: absolute; left: 16px; right: 16px; z-index: 5; }
.map-error { top: 16px; padding: 16px; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); display: grid; gap: 8px; }
.popup { bottom: 16px; max-width: 420px; margin: 0 auto; padding: 16px; }
.popup p { margin: 6px 0; }
.popup-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding-right: 28px; }
.popup-close { position: absolute; top: 8px; right: 8px; border: 0; background: none; font-size: 20px; cursor: pointer; }
@media (max-width: 768px) {
  .map-wrap { height: 50dvh; flex: none; }
}

/* ── 검색 결과 (와이어프레임 4·5번). 카드 목록 기본은 common.css ── */
.result-status { display: flex; align-items: center; gap: 6px; font-size: 14px; }

/* ── 상세: 판단 근거·확인 중 제보 (와이어프레임 7번) ── */
.judge-status { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 12px 0 4px; }
.pending-report { padding: 12px 0; border-top: 1px dashed var(--color-border); }

/* ── 큰 글씨 모드 (common.css 의 html.large-text 와 짝) ── */
html.large-text .legend,
html.large-text .summary,
html.large-text .result-status { font-size: 18px; }
html.large-text .place-detail h2 { font-size: 23px; }
html.large-text .place-detail h3 { font-size: 20px; }
html.large-text .judge-dot { width: 26px; height: 26px; }

/* 개인화: 기본 화면은 간단하게, 세부 입력은 기존 field/btn를 사용하는 dialog에 분리 */
.mobility-toolbar { display: flex; flex-wrap: wrap; gap: 8px; }
.mobility-toolbar select { min-width: 0; max-width: 100%; padding: 8px; border: 1px solid var(--color-border); border-radius: 8px; font: inherit; }
.mobility-settings > p:empty { display: none; }
.mobility-settings > p { margin: 4px 0; }
.map-condition-tools { display: grid; grid-template-columns: max-content minmax(0, 1fr) max-content; gap: 4px 8px; align-items: center; margin-bottom: 8px; }
.map-condition-tools .panel-label { margin: 0; }
.map-condition-tools .mobility-settings, .map-condition-tools .mobility-toolbar { display: contents; }
.map-condition-tools .mobility-settings > p, .map-condition-tools .mobility-result { grid-column: 1 / -1; }
.map-condition-tools .btn { padding: 8px; white-space: nowrap; }
html.large-text .map-condition-tools .btn { padding: 10px 8px; }
.mobility-dialog { width: min(580px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); padding: 24px; overflow-y: auto; border: 1px solid var(--color-border); border-radius: var(--radius); background: var(--color-surface); color: var(--color-text); }
.mobility-dialog::backdrop { background: rgba(0, 0, 0, 0.35); }
.mobility-dialog h2 { margin-top: 0; }
.mobility-dialog select { width: 100%; padding: 10px 12px; border: 1px solid var(--color-border); border-radius: 8px; font: inherit; }
.mobility-field { margin: 12px 0; }
.mobility-multiple { margin: 16px 0; }
.mobility-multiple-choice { display: flex; gap: 8px; align-items: center; padding: 8px 0; }
.mobility-actions { justify-content: flex-end; }
@media (max-width: 768px) {
  .mobility-dialog { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; padding: 16px 16px 32px; }
}
