/* 전국 맛집 지도 v2.0.0 기본 스타일 및 반응형 UI (360px / 768px / 1280px 대응, 44px 터치 영역 보장) */
*, *::before, *::after {
  box-sizing: border-box;
}

body, html {
  margin: 0;
  padding: 0;
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, sans-serif;
  width: 100%;
  height: 100%;
  overflow: hidden;
  color: #1e293b;
  background: #ffffff;
}

body {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
}

button, input, select, textarea {
  font-family: inherit;
}

/* 포커스 가시성 보장 (키보드 접근성 - Section 10) */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid #ff5722;
  outline-offset: 2px;
}

/* 상단 서비스 워커 업데이트 배너 & 데이터셋 상태 배너 */
.sw-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 8px 16px;
  background: #1e293b;
  color: #ffffff;
  font-size: 13px;
  flex-shrink: 0;
  z-index: 25;
}
.sw-banner[hidden] {
  display: none !important;
}
.sw-banner button {
  min-height: 34px;
  padding: 4px 12px;
  border: none;
  border-radius: 999px;
  background: #ff5722;
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
}

.status-banner {
  padding: 6px 16px;
  font-size: 12px;
  line-height: 1.4;
  flex-shrink: 0;
  border-bottom: 1px solid #e2e8f0;
}
.status-banner[hidden] {
  display: none !important;
}
.status-banner.info {
  background: #f8fafc;
  color: #475569;
}
.status-banner.warn {
  background: #fffbeb;
  color: #b45309;
  border-bottom-color: #fde68a;
  font-weight: 600;
}
.status-banner.error {
  background: #fef2f2;
  color: #b91c1c;
  border-bottom-color: #fecaca;
  font-weight: 600;
}

/* 상단 헤더 */
header {
  background-color: #ff5722;
  color: white;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  position: relative;
  z-index: 15;
  flex-shrink: 0;
  flex-wrap: wrap;
}
header h1 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}
header .head-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}
header .head-action-btn,
header .head-qr,
header .head-install button {
  min-height: 36px;
  font: inherit;
  cursor: pointer;
  text-decoration: none;
  background: rgba(255,255,255,0.2);
  border: 1px solid rgba(255,255,255,0.55);
  border-radius: 999px;
  padding: 5px 11px;
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
header .head-action-btn:hover,
header .head-qr:hover,
header .head-install button:hover {
  background: rgba(255,255,255,0.32);
}
header .head-action-btn.active {
  background: #ffffff;
  color: #d84315;
  border-color: #ffffff;
}

/* 이용 모드 탭 & 프리셋 & 기준점 바 */
.mode-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 16px;
  background: #fff8f6;
  border-bottom: 1px solid #fed7aa;
  flex-shrink: 0;
  flex-wrap: wrap;
}
.mode-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.mode-tab {
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid #fdba74;
  border-radius: 10px;
  background: #ffffff;
  color: #9a3412;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}
.mode-tab.active {
  background: #ea580c;
  color: #ffffff;
  border-color: #ea580c;
}
.mode-Selectors {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.mode-select {
  min-height: 40px;
  padding: 6px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  color: #1e293b;
  font-size: 13px;
  font-weight: 600;
}
.preset-guide-note {
  width: 100%;
  font-size: 12px;
  color: #9a3412;
  background: #ffedd5;
  padding: 6px 10px;
  border-radius: 6px;
}
.preset-guide-note[hidden] {
  display: none !important;
}

/* 단체 조건 입력 바 (학교·선수단 모드 시 활성화) */
.group-criteria-bar {
  padding: 8px 16px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  flex-shrink: 0;
}
.group-criteria-bar[hidden] {
  display: none !important;
}
.gc-grid {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.gc-field {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  color: #334155;
}
.gc-field input[type="number"],
.gc-field input[type="date"],
.gc-field input[type="time"],
.gc-field select {
  min-height: 36px;
  padding: 4px 8px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 12px;
  background: #ffffff;
}
.gc-field input[type="number"] {
  width: 76px;
}
.gc-field.budget input[type="number"] {
  width: 96px;
}
.gc-check {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  padding: 4px 6px;
}
.gc-reset-btn {
  min-height: 36px;
  padding: 4px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #ffffff;
  color: #475569;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

/* 검색창 및 지역 선택 바 */
.search-box {
  padding: 8px 16px 0;
  background: white;
  flex-shrink: 0;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.search-box input[type="search"] {
  flex: 1;
  min-width: 180px;
  min-height: 44px;
  padding: 9px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  font-size: 15px;
  background: #f8fafc;
  outline: none;
}
.search-box input[type="search"]:focus {
  border-color: #ff5722;
  background: white;
}

/* 지역·종류 필터 버튼 영역 */
.filter-container {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: white;
  overflow-x: auto;
  position: relative;
  z-index: 10;
  flex-shrink: 0;
  border-bottom: 1px solid #eee;
}
.filter-container::-webkit-scrollbar {
  display: none;
}
.filter-group {
  display: flex;
  gap: 6px;
  align-items: center;
}
.filter-divider {
  flex-shrink: 0;
  width: 1px;
  height: 24px;
  background: #e0e0e0;
}
.filter-btn {
  min-height: 40px;
  padding: 7px 14px;
  border: 1px solid #e0e0e0;
  background: white;
  color: #333;
  border-radius: 20px;
  font-size: 0.86rem;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.18s;
}
.filter-btn.active {
  background-color: #ff5722;
  color: white;
  border-color: #ff5722;
  font-weight: 700;
}
.filter-btn.category.active {
  background-color: #1e293b;
  border-color: #1e293b;
  color: #ffffff;
}
.filter-btn.toggle.active {
  background-color: #fff8e1;
  color: #e65100;
  border-color: #ffb300;
  font-weight: 700;
}

/* 본문: 목록 + 지도 */
main {
  flex: 1;
  min-height: 0;
  display: flex;
}
.map-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}
#map {
  width: 100%;
  height: 100%;
  position: relative;
}

/* 내 위치 버튼 & 기준점 마커 */
.locate-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 5;
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid #ddd;
  border-radius: 20px;
  background: white;
  font-size: 13px;
  font-weight: bold;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  cursor: pointer;
}
.locate-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}
.my-pos {
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border-radius: 50%;
  background: #1e88e5;
  border: 3px solid white;
  box-shadow: 0 0 0 6px rgba(30,136,229,0.25);
}
.ref-point-pin {
  padding: 5px 10px;
  border-radius: 999px;
  background: #0f172a;
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  border: 2px solid #ffffff;
  box-shadow: 0 3px 10px rgba(0,0,0,0.25);
  white-space: nowrap;
}

/* 지역별 마커 색 안내 */
.legend {
  position: absolute;
  left: 12px;
  top: 12px;
  z-index: 5;
  display: flex;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 16px;
  background: rgba(255,255,255,0.92);
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
  font-size: 12px;
}
.legend span::before {
  content: '';
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 4px;
  border-radius: 50%;
  background: var(--c);
}

/* 알림 토스트 */
.toast {
  position: fixed;
  left: 50%;
  bottom: 36px;
  transform: translateX(-50%);
  z-index: 2500;
  max-width: calc(100% - 32px);
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.92);
  color: white;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  box-shadow: 0 8px 20px rgba(0,0,0,0.25);
}
.toast.show {
  opacity: 1;
}

/* 지도 로딩 실패 안내 */
.map-error {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px;
  text-align: center;
  color: #475569;
  background: #f8fafc;
  font-size: 14px;
  line-height: 1.55;
}
.map-error strong {
  font-size: 17px;
  color: #0f172a;
}
.map-error button {
  margin-top: 8px;
  min-height: 44px;
  padding: 10px 22px;
  border: none;
  border-radius: 999px;
  background: #ff5722;
  color: white;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

/* 맛집 목록 패널 */
.panel {
  display: flex;
  flex-direction: column;
  background: white;
  min-height: 0;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 16px;
  border-bottom: 1px solid #eee;
  background: white;
  font-size: 14px;
  font-weight: bold;
  color: #1e293b;
  flex-shrink: 0;
}
.panel-head .sort-note {
  font-size: 12px;
  font-weight: 600;
  color: #1e88e5;
  margin-left: 6px;
}
.view-switch {
  display: none;
  flex-shrink: 0;
  padding: 3px;
  border-radius: 18px;
  background: #f1f5f9;
}
.view-switch button {
  min-height: 34px;
  padding: 5px 11px;
  border: none;
  border-radius: 15px;
  background: none;
  color: #475569;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
}
.view-switch button[aria-pressed="true"] {
  background: #ff5722;
  color: white;
}

.place-list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  flex: 1;
}
.place-list li {
  border-bottom: 1px solid #f1f5f9;
}
.place-list li.selected {
  background: #fff3ee;
}
.group-filter-summary {
  padding: 10px 16px;
  background: #f8fafc;
  color: #334155;
  font-size: 12px;
  line-height: 1.45;
  border-bottom: 1px solid #e2e8f0;
}
.list-section-divider {
  padding: 8px 16px;
  background: #f1f5f9;
  color: #0f172a;
  font-size: 12px;
  font-weight: 800;
}

.place-main {
  display: block;
  width: 100%;
  padding: 12px 16px 6px;
  border: none;
  background: none;
  text-align: left;
  cursor: pointer;
  color: inherit;
}
.place-name {
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
}
.place-name::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  margin: 0 6px 2px 0;
  border-radius: 50%;
  background: var(--c, #999);
}
.place-dist {
  float: right;
  font-size: 12px;
  font-weight: 700;
  color: #1e88e5;
}
.place-meta {
  margin-top: 2px;
  font-size: 12px;
  color: #64748b;
}
.place-menu {
  margin-top: 4px;
  font-size: 13px;
  color: #334155;
}
.place-hours {
  margin-top: 3px;
  font-size: 12px;
  color: #475569;
}
.place-group-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}
.place-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 2px 16px 12px;
}
.empty {
  padding: 32px 16px;
  text-align: center;
  color: #64748b;
  font-size: 14px;
  line-height: 1.5;
}
.hours-note {
  padding: 14px 16px 18px;
  font-size: 12px;
  line-height: 1.5;
  color: #64748b;
}
.more-item-wrap {
  padding: 12px 16px;
  text-align: center;
}
.more-btn {
  width: 100%;
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #f8fafc;
  color: #0f172a;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.more-btn:hover {
  background: #e2e8f0;
}

/* 상태 및 단체 조건 배지 */
.badge {
  display: inline-block;
  margin-left: 4px;
  padding: 2px 7px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
}
.place-group-badges .badge,
.detail-badge-row .badge {
  margin-left: 0;
}
.badge.open,
.badge.group-met {
  background: #dcfce7;
  color: #166534;
}
.badge.closed,
.badge.group-unset,
.badge.visit-none {
  background: #f1f5f9;
  color: #475569;
}
.badge.group-check,
.badge.warn {
  background: #fef3c7;
  color: #92400e;
}
.badge.group-unmet {
  background: #fee2e2;
  color: #991b1b;
}
.badge.visit-repeat {
  background: #dbeafe;
  color: #1e40af;
}

/* 공통 링크·작은 액션 버튼 */
.link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 6px 11px;
  border: none;
  background: #fee500;
  color: #0f172a;
  text-decoration: none;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.link.sub {
  background: #f1f5f9;
  color: #334155;
}
.link.fav.on,
.link.compare.on {
  background: #fff8e1;
  color: #e65100;
  border: 1px solid #ffb300;
}

/* 푸터 */
.site-footer {
  flex-shrink: 0;
  padding: 5px 16px;
  background: #fafafa;
  border-top: 1px solid #eee;
  color: #64748b;
  font-size: 11px;
  text-align: center;
}
.site-footer button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* 카카오 지도 커스텀 오버레이 */
.wrap {
  position: absolute;
  left: 0;
  bottom: 40px;
  width: 268px;
  margin-left: -134px;
  text-align: left;
  font-size: 13px;
  background: white;
  border-radius: 10px;
  box-shadow: 0 6px 16px rgba(0,0,0,0.22);
  white-space: normal;
}
.wrap .photo {
  display: block;
  width: 100%;
  height: 116px;
  object-fit: cover;
  border-radius: 10px 10px 0 0;
}
.wrap .info {
  padding: 14px;
  position: relative;
}
.wrap .title {
  font-weight: 800;
  font-size: 15px;
  margin-bottom: 4px;
  padding-right: 26px;
  color: #0f172a;
}
.wrap .close {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 30px;
  height: 30px;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  color: #64748b;
  font-size: 16px;
}
.wrap .photo + .info .close {
  top: -110px;
  border-radius: 50%;
  background: rgba(0,0,0,0.55);
  color: white;
}
.wrap .meta {
  color: #64748b;
  font-size: 12px;
  margin-bottom: 4px;
}
.wrap .desc {
  color: #334155;
  font-size: 12.5px;
  margin-bottom: 4px;
}
.wrap .hours,
.wrap .note {
  color: #475569;
  font-size: 12px;
  margin-bottom: 4px;
}
.wrap .links {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}
.wrap::after {
  content: '';
  position: absolute;
  margin-left: -10px;
  left: 50%;
  bottom: -10px;
  border-top: 10px solid white;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
}

/* 모달 공통 다이얼로그 (상세 / 후보 비교 / 내 행사 / 기록·제보 / 운영 도구 / QR) */
.ysk-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(15, 23, 42, 0.62);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
}
.ysk-modal-dialog {
  width: min(100%, 880px);
  max-height: calc(100dvh - 28px);
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.35);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.ysk-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}
.ysk-modal-head h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  color: #0f172a;
}
.ysk-modal-close {
  min-height: 40px;
  padding: 6px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  color: #334155;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.ysk-modal-content {
  padding: 18px;
  overflow-y: auto;
  flex: 1;
  font-size: 14px;
  line-height: 1.55;
}
.ysk-modal-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 18px;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  flex-wrap: wrap;
}

/* 상세 모달 내부 구성 */
.detail-section {
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid #f1f5f9;
}
.detail-section h4 {
  margin: 0 0 8px;
  font-size: 14px;
  color: #0f172a;
}
.detail-badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}
.detail-kv-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 6px 14px;
  margin: 0;
}
.detail-kv-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 8px;
  background: #f8fafc;
  border-radius: 6px;
  font-size: 13px;
}
.detail-kv-row dt {
  color: #64748b;
  font-weight: 600;
}
.detail-kv-row dd {
  margin: 0;
  color: #0f172a;
  font-weight: 700;
  text-align: right;
}
.detail-safety-note,
.detail-disclaimer {
  margin: 8px 0;
  padding: 8px 12px;
  background: #fffbeb;
  color: #92400e;
  border-radius: 8px;
  font-size: 12.5px;
}

/* 후보 비교 표 */
.compare-table-wrap {
  overflow-x: auto;
}
.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.compare-table th,
.compare-table td {
  border: 1px solid #e2e8f0;
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
}
.compare-table th {
  background: #f8fafc;
  font-weight: 700;
}

/* 내 행사 모달 & 폼 */
.event-toolbar,
.event-share-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 14px;
  padding: 10px;
  background: #f8fafc;
  border-radius: 10px;
}
.event-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.event-form-grid label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  font-weight: 700;
  color: #334155;
}
.event-form-grid input,
.event-form-grid select,
.event-form-grid textarea {
  min-height: 38px;
  padding: 6px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 13px;
}
.meal-plan-card {
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 14px;
  background: #ffffff;
}
.meal-plan-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.candidate-card {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px;
  margin-top: 8px;
  background: #f8fafc;
}
.candidate-card.selected {
  border-color: #ea580c;
  background: #fff7ed;
}

/* 첫 화면 (홈 화면) */
.home {
  position: fixed;
  inset: 0;
  z-index: 1000;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: #fafbfc;
  color: #1d2330;
}
.home[hidden] {
  display: none !important;
}
.home-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px 28px;
}
.home-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  gap: 10px;
  flex-wrap: wrap;
}
.home-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -0.02em;
}
.home-brand .pin {
  width: 26px;
  height: 26px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  background: #ff5722;
  display: grid;
  place-items: center;
}
.home-brand .pin::after {
  content: '';
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: white;
}
.home-icons {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.home-icon {
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid #eceff3;
  border-radius: 18px;
  background: white;
  color: #1d2330;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.home-layout {
  display: grid;
  gap: 22px;
  padding-bottom: 8px;
}
.home-layout > * {
  min-width: 0;
}
.home-map {
  position: relative;
  border-radius: 22px;
  overflow: hidden;
  background: #cfe3f7;
  box-shadow: 0 12px 30px rgba(29,35,48,0.08);
}
.home-map svg {
  display: block;
  width: 100%;
  height: auto;
}
.home-map .city-pin {
  cursor: pointer;
}
.home-live {
  position: absolute;
  left: 14px;
  top: 14px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  border: none;
  border-radius: 20px;
  background: white;
  color: #1d2330;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  cursor: pointer;
}
.home-live i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 4px rgba(34,197,94,0.2);
}
.home-live[hidden] {
  display: none !important;
}
.home-map-open {
  position: absolute;
  right: 14px;
  bottom: 14px;
  min-height: 40px;
  padding: 10px 14px;
  border: none;
  border-radius: 12px;
  background: #1d2330;
  color: white;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.home h1 {
  margin: 4px 0 8px;
  font-size: 28px;
  line-height: 1.25;
  letter-spacing: -0.035em;
  font-weight: 800;
}
.home h1 span {
  color: #ff5722;
}
.home-lead {
  margin: 0 0 14px;
  color: #6b7280;
  font-size: 14px;
  line-height: 1.55;
}
.home-mode-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}
.home-mode-card {
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid #fed7aa;
  border-radius: 12px;
  background: #fff7ed;
  color: #9a3412;
  font-size: 13px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  /* 한글이 낱말 중간(예: 수학여/행)에서 끊기지 않게 띄어쓰기 단위로만 줄바꿈 */
  word-break: keep-all;
}
.home-mode-card .nowrap {
  white-space: nowrap;
}
.home-search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 6px 6px 14px;
  border: 2px solid #ff5722;
  border-radius: 14px;
  background: white;
}
.home-search input {
  flex: 1;
  min-width: 0;
  padding: 8px 0;
  border: none;
  outline: none;
  background: none;
  font-size: 16px;
}
.home-search button {
  min-height: 42px;
  padding: 10px 14px;
  border: none;
  border-radius: 10px;
  background: #ff5722;
  color: white;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.home h2 {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 0 0 12px;
  font-size: 17px;
  letter-spacing: -0.02em;
}
.home h2 small {
  color: #6b7280;
  font-size: 12px;
  font-weight: 500;
}
.home-cats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.home-cat {
  min-height: 68px;
  padding: 12px 4px 10px;
  border: 1px solid #eceff3;
  border-radius: 14px;
  background: white;
  color: #1d2330;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
}
.home-cat b {
  display: block;
  margin-bottom: 4px;
  font-size: 24px;
}
.home-cat span {
  display: block;
  color: #6b7280;
  font-size: 10px;
  font-weight: 500;
}
.home-picks {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.home-pick {
  flex: 0 0 150px;
  padding: 0;
  border: 1px solid #eceff3;
  border-radius: 16px;
  overflow: hidden;
  background: white;
  text-align: left;
  cursor: pointer;
  color: #1d2330;
}
.home-pick .art {
  height: 84px;
  display: grid;
  place-items: center;
  font-size: 38px;
  background: var(--bg);
}
.home-pick .body {
  display: block;
  padding: 10px 12px 12px;
}
.home-pick em {
  display: block;
  font-style: normal;
  color: var(--c);
  font-size: 11px;
  font-weight: 700;
}
.home-pick strong {
  font-size: 14px;
}
.home-cta {
  margin-top: 14px;
}
.home-cta button {
  display: block;
  width: 100%;
  min-height: 50px;
  padding: 14px;
  border: none;
  border-radius: 14px;
  background: #ff5722;
  color: white;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(255,87,34,0.3);
}
.home-foot {
  padding: 12px 0 18px;
  color: #64748b;
  font-size: 11px;
  text-align: center;
}
.home-foot a {
  color: inherit;
}

/* 설치 버튼 표시 제어 */
.install-btn {
  display: none;
}
html.can-install .install-btn {
  display: inline-flex;
}

/* 반응형 미디어 쿼리: 모바일 (<768px) — 화면 정리 규칙은 파일 끝에 이어짐 */
@media (max-width: 767px) {
  header {
    padding: 8px 12px;
  }
  header h1 {
    font-size: 1.05rem;
  }
  .mode-bar {
    padding: 6px 12px;
  }
  .mode-tab {
    padding: 6px 10px;
    font-size: 12px;
  }
  .search-box {
    padding: 6px 12px 0;
  }
  .filter-container {
    padding: 6px 12px;
  }
  main {
    flex-direction: column;
  }
  .panel {
    order: 2;
    flex-shrink: 0;
    height: 62%;
    overflow: hidden;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.12);
    border-radius: 14px 14px 0 0;
    transition: height 0.25s;
  }
  .panel.mode-map {
    height: 49px;
  }
  .panel.mode-list {
    height: 100%;
    border-radius: 0;
  }
  .view-switch {
    display: flex;
  }
  .map-wrap.overlay-open .legend,
  .map-wrap.overlay-open .locate-btn {
    opacity: 0;
    pointer-events: none;
  }
  .wrap {
    width: 240px;
    margin-left: -120px;
  }
  .wrap .info {
    padding: 12px 12px 10px;
  }
}

/* 반응형 미디어 쿼리: 태블릿 및 데스크톱 (>=768px) */
@media (min-width: 768px) {
  .filter-container,
  .filter-group {
    flex-wrap: wrap;
  }
  .filter-container {
    overflow-x: visible;
  }
  .panel {
    width: 380px;
    flex-shrink: 0;
    border-right: 1px solid #e2e8f0;
  }
}

@media (min-width: 1280px) {
  .panel {
    width: 420px;
  }
}

@media (min-width: 900px) {
  .home-top {
    padding: 22px 0;
  }
  .home-layout {
    grid-template-columns: 1.15fr 1fr;
    gap: 40px;
    align-items: start;
    padding-bottom: 32px;
  }
  .home-map {
    grid-row: span 3;
    position: sticky;
    top: 20px;
  }
  .home h1 {
    font-size: 40px;
  }
}

/* ==========================================================================
   화면 정리 (휴대폰에서 지도·목록 공간 확보, 하단 버튼 가림 해결)
   ========================================================================== */

/* 휴대폰 전용 접기 버튼과 목록 끝 저작권 문구는 PC에서 숨김 */
.head-menu-btn,
.setup-toggle,
.filter-toggle,
.panel-foot {
  display: none;
}

/* 자료점검은 운영자용: ?admin 으로 들어온 기기에서만 보임 */
#open-op-tool-btn {
  display: none;
}
html.op-mode #open-op-tool-btn {
  display: inline-flex;
}

/* 선택창이 화면 폭을 넘지 않게 */
.mode-select {
  max-width: 100%;
}

@media (max-width: 767px) {
  /* 화면 위에서부터: 헤더 → 자료 안내 한 줄 → 검색줄 → (펼친 설정) → 지역 버튼줄 → 지도·목록 */
  .sw-banner { order: 0; }
  header { order: 1; }
  .status-banner { order: 2; }
  .search-box { order: 3; }
  .mode-bar { order: 4; }
  .group-criteria-bar { order: 5; }
  .filter-container { order: 6; }
  main { order: 7; }
  .site-footer { display: none; }

  /* 헤더: 제목 + 메뉴 버튼 한 줄 */
  header {
    flex-wrap: nowrap;
  }
  header .head-menu-btn {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 6px 14px;
    border: 1px solid rgba(255,255,255,0.6);
    border-radius: 999px;
    background: rgba(255,255,255,0.2);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
  }
  html.menu-open header .head-menu-btn {
    background: #fff;
    color: #d84315;
  }
  header .head-actions {
    display: none;
  }
  html.menu-open header .head-actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    position: absolute;
    top: calc(100% - 4px);
    right: 8px;
    min-width: 210px;
    padding: 8px;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 10px 28px rgba(15,23,42,0.22);
  }
  html.menu-open header .head-action-btn,
  html.menu-open header .head-qr,
  html.menu-open header .head-install button {
    width: 100%;
    min-height: 44px;
    justify-content: flex-start;
    padding: 8px 14px;
    border: 1px solid #fed7aa;
    border-radius: 10px;
    background: #fff8f6;
    color: #9a3412;
    font-size: 14px;
  }
  html.menu-open header .head-action-btn.active {
    background: #ea580c;
    color: #fff;
    border-color: #ea580c;
  }
  html.can-install header .head-install {
    display: flex;
  }
  html:not(.op-mode) #open-op-tool-btn {
    display: none;
  }

  /* 자료 안내: 한 줄로 줄이고 누르면 펼침 */
  .status-banner.info {
    padding: 4px 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
  }
  .status-banner.info.expanded {
    white-space: normal;
  }

  /* 검색줄: [이용 목적 ▾] [검색창] [필터] */
  .search-box {
    flex-wrap: wrap;
    gap: 6px;
    padding: 6px 12px 0;
  }
  .setup-toggle,
  .filter-toggle {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
    min-height: 44px;
    padding: 0 10px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
  }
  .setup-toggle {
    order: 1;
    border: 1px solid #fdba74;
    background: #fff8f6;
    color: #9a3412;
  }
  .search-box input[type="search"] {
    order: 2;
    flex: 1 1 0;
    min-width: 0;
  }
  .filter-toggle {
    order: 3;
    border: 1px solid #cbd5e1;
    background: #fff;
    color: #334155;
  }
  html.setup-open .setup-toggle,
  html.filters-open .filter-toggle {
    background: #ea580c;
    border-color: #ea580c;
    color: #fff;
  }
  /* 세부 지역 선택창은 필터를 펼쳤을 때만 */
  .search-box #region-select {
    display: none;
  }
  html.filters-open .search-box #region-select {
    display: block;
    order: 4;
    flex: 1 1 100%;
    width: 100%;
  }

  /* 이용 목적·행사 프리셋·기준점·단체 조건은 접어 둠 */
  html:not(.setup-open) .mode-bar,
  html:not(.setup-open) .group-criteria-bar {
    display: none;
  }
  .mode-bar {
    padding: 8px 12px;
  }
  .mode-Selectors {
    width: 100%;
  }
  .mode-Selectors .mode-select {
    flex: 1 1 100%;
    width: 100%;
  }
  .group-criteria-bar {
    max-height: 38dvh;
    overflow-y: auto;
  }

  /* 지역 버튼은 한 줄(옆으로 넘김), 즐겨찾기·영업 중·종류는 필터를 펼쳤을 때만 */
  .filter-container {
    flex-wrap: wrap;
    row-gap: 8px;
    overflow: visible;
  }
  .filter-container > .filter-divider {
    display: none;
  }
  .filter-container > .filter-group {
    flex: 0 0 100%;
    flex-wrap: wrap;
  }
  .filter-container > .filter-group:first-child {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .filter-container > .filter-group:first-child::-webkit-scrollbar {
    display: none;
  }
  html:not(.filters-open) .filter-container > .filter-group:not(:first-child) {
    display: none;
  }

  /* 지도 위 버튼: 범례는 접고, 내 주변은 오른쪽 아래로 */
  .legend {
    cursor: pointer;
    flex-wrap: wrap;
    max-width: calc(100% - 24px);
  }
  .legend:not(.open) span {
    display: none;
  }
  .legend:not(.open)::after {
    content: '🎨 범례';
    font-weight: 700;
    color: #334155;
  }
  .locate-btn {
    top: auto;
    bottom: 12px;
  }

  /* 목록: 패널 전체가 스크롤되고 저작권 문구는 목록 맨 끝에 */
  .panel {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .panel.mode-map {
    overflow: hidden;
  }
  .panel-head {
    position: sticky;
    top: 0;
    z-index: 3;
  }
  .place-list {
    flex: none;
    overflow: visible;
  }
  .place-list li {
    scroll-margin-top: 64px;
  }
  .panel-foot {
    display: block;
    padding: 14px 16px calc(16px + env(safe-area-inset-bottom));
    color: #64748b;
    font-size: 12px;
    line-height: 1.6;
    text-align: center;
    background: #fafafa;
    border-top: 1px solid #eee;
  }
  .panel-foot a,
  .panel-foot button {
    display: inline-block;
    padding: 10px 4px;
    font: inherit;
    color: inherit;
    background: none;
    border: none;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
  }

  /* 손가락으로 누르기 좋은 버튼 크기 */
  .place-links {
    gap: 8px;
  }
  .link {
    min-height: 44px;
    padding: 8px 12px;
    font-size: 13px;
  }
  .view-switch button {
    min-height: 40px;
  }

  /* 바텀시트: 목록 위주 단계와 끌기 손잡이 */
  .panel.mode-tall {
    height: 80%;
  }
  .panel.dragging {
    transition: none;
  }
  .panel-head {
    padding-top: 16px;
    touch-action: none;
    cursor: grab;
  }
  .panel-head::before {
    content: '';
    position: absolute;
    top: 6px;
    left: 50%;
    width: 40px;
    height: 5px;
    margin-left: -20px;
    border-radius: 3px;
    background: #cbd5e1;
  }
  .panel.mode-map {
    height: 58px;
  }
}

/* 홈 대표 이미지: 전국 권역 타일 */
.home-map.tiles {
  background: #fff4ee;
}
.home-map .region-tile {
  transition: transform 0.15s;
  transform-box: fill-box;
  transform-origin: center;
}
.home-map .region-tile:hover,
.home-map .region-tile:focus-visible {
  transform: scale(1.04);
  outline: none;
}
/* 빈 왼쪽 위·오른쪽 아래 칸에 맞춰 작게 배치 */
.home-map.tiles .home-live {
  left: 2.5%;
  top: 4%;
  max-width: 24%;
  padding: 6px 9px;
  font-size: 11.5px;
  line-height: 1.25;
  text-align: left;
}
.home-map.tiles .home-live i {
  flex-shrink: 0;
}
.home-map.tiles .home-map-open {
  right: 2.5%;
  bottom: 4%;
  min-height: 36px;
  padding: 8px 11px;
  font-size: 12px;
}
