/* 네이버지도 PC/모바일 패턴 근사 */
:root {
  --naver-green: #03c75a;
  --naver-green-hover: #02b350;
  --naver-green-soft: #e8f9ef;
  --text: #111;
  --text-sub: #666;
  --text-muted: #939393;
  --border: #e5e5e5;
  --border-light: #f0f0f0;
  --bg: #fff;
  --bg-hover: #f7f7f7;
  --bg-selected: #f0faf5;
  --sidebar-w: 380px;
  --shadow-panel: 2px 0 8px rgba(0, 0, 0, 0.08);
  --shadow-sheet: 0 -4px 24px rgba(0, 0, 0, 0.12);
  --marker-base: #12874a;
  --marker-pick: #025c31;
  --marker-selected: #101820;
  --marker-shadow: rgba(16, 24, 32, 0.24);
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
}

:focus-visible {
  outline: 2px solid var(--naver-green);
  outline-offset: 2px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
  overflow: hidden;
  overflow-x: clip;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

.app {
  display: flex;
  height: 100%;
  width: 100%;
}

/* ─── 사이드바 (네이버 왼쪽 패널) ─── */
.sidebar {
  position: relative;
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  height: 100%;
  background: var(--bg);
  border-right: 1px solid var(--border);
  box-shadow: var(--shadow-panel);
  display: flex;
  flex-direction: column;
  z-index: 200;
  transition: transform 0.25s ease, margin 0.25s ease, height 0.25s ease;
}

.sidebar.collapsed {
  margin-left: calc(-1 * var(--sidebar-w) + 24px);
}

.sidebar-header {
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--border-light);
  flex-shrink: 0;
}

.sidebar-grabber {
  display: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--naver-green);
  position: relative;
}

.brand-mark::after {
  content: "";
  position: absolute;
  inset: 7px 8px 9px;
  border: 2px solid #fff;
  border-radius: 2px 2px 0 0;
  transform: rotate(-8deg);
}

.brand-title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
}

.env-badge {
  margin-left: auto;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  background: #f3f4f6;
  padding: 3px 8px;
  border-radius: 4px;
}

.search-wrap {
  display: flex;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  background: #fff;
}

.search-input {
  flex: 1;
  border: none;
  padding: 11px 12px;
  font-size: 15px;
  outline: none;
  color: var(--text);
  background: transparent;
}

.search-btn {
  width: 44px;
  border: none;
  border-left: 1px solid var(--border);
  background: var(--naver-green);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-btn:hover {
  background: var(--naver-green-hover);
}

.result-meta {
  margin-top: 10px;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.35;
}

.collapsed-decision-bar {
  display: none;
}

.sidebar-body {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
}

.place-list {
  list-style: none;
  overflow-y: auto;
  flex: 1;
}

.list-section-label {
  list-style: none;
  padding: 10px 14px 7px;
  border-bottom: 1px solid var(--border-light);
  background: #fafafa;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
}

.place-item {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: var(--bg);
  border-bottom: 1px solid var(--border-light);
  padding: 12px 14px;
  cursor: pointer;
  transition: background 0.15s;
}

.place-item:hover {
  background: var(--bg-hover);
}

.place-item.selected {
  background: var(--bg-selected);
  box-shadow: inset 3px 0 0 var(--naver-green);
}

.place-item-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.place-item-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
  flex: 1;
}

.score-stack {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  min-width: 42px;
  font-size: 10px;
  line-height: 1.2;
  color: var(--text-muted);
}

.place-item-meta {
  font-size: 13px;
  color: var(--text-sub);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.place-item-sub {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-muted);
}

.list-empty {
  padding: 24px 16px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-muted);
  list-style: none;
}

.list-empty strong,
.list-empty span {
  display: block;
}

.list-empty strong {
  margin-bottom: 4px;
  color: var(--text);
}

.place-item-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  text-align: left;
}

.place-item-main {
  flex: 1;
  min-width: 0;
}

.thumb-sm {
  width: 58px;
  height: 58px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--border-light);
}

.thumb-lg {
  width: 100%;
  max-width: none;
  height: 188px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--border-light);
}

.detail-hero {
  display: grid;
  gap: 12px;
  margin: 10px 0 12px;
}

.detail-hero-text {
  flex: 1;
  min-width: 0;
}

.sig-line,
.sig-menu {
  font-size: 14px;
  color: var(--text-sub);
}

.sig-menu strong {
  color: var(--naver-green);
  font-weight: 700;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 6px 0 4px;
}

.chip {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  background: var(--naver-green-soft);
  color: #0a7a3e;
  border: 1px solid #c8edd8;
}

.chip-coating {
  background: #fff4e6;
  color: #b45309;
  border-color: #fde0b3;
}

.chip-row-stacked {
  align-items: flex-start;
}

.chip-stack {
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-width: 100%;
  flex: 1 1 140px;
}

.chip-source {
  align-self: flex-start;
  max-width: 100%;
  padding: 2px 6px;
  border-radius: 999px;
  background: #f4f6f8;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.block-evidence summary {
  cursor: pointer;
  font-weight: 800;
}

.evidence-list {
  display: grid;
  gap: 12px;
  margin-top: 10px;
}

.evidence-item {
  display: grid;
  gap: 6px;
}

.evidence-item h4 {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: 13px;
}

.evidence-item h4 small {
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--naver-green-soft);
  color: var(--naver-green-dark);
  font-size: 10px;
}

.evidence-item ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.evidence-item li {
  display: grid;
  gap: 2px;
  color: var(--text-sub);
  font-size: 12px;
  line-height: 1.35;
}

.evidence-item a {
  color: var(--text);
  font-weight: 800;
  text-decoration: none;
}

.evidence-item q {
  color: var(--text-muted);
  quotes: none;
}

.evidence-item q::before,
.evidence-item q::after {
  content: "";
}

.source-mini-row {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 2px 2px 8px;
  scrollbar-width: none;
}

.source-mini-row::-webkit-scrollbar {
  display: none;
}

.source-mini-chip {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  max-width: 78vw;
  padding: 7px 9px;
  border: 1px solid var(--border-light);
  border-radius: 999px;
  background: #fff;
  color: var(--text-sub);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.1;
}

.source-mini-chip span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.caution-mini-row {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding: 0 2px 10px;
  color: var(--text-muted);
  scrollbar-width: none;
}

.caution-mini-row::-webkit-scrollbar {
  display: none;
}

.caution-mini-label {
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 800;
}

.caution-mini-chip {
  flex: 0 0 auto;
  max-width: 72vw;
  padding: 5px 8px;
  border: 1px solid var(--border-light);
  border-radius: 999px;
  background: #f7f8f9;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.15;
}

.filter-preset.active {
  border-color: var(--naver-green);
  background: var(--naver-green-soft);
}

.badge-open {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  background: var(--naver-green);
  color: #fff;
}

.badge-closed {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  background: #eee;
  color: var(--text-muted);
}

.badge-check {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  background: #fff7ed;
  color: #9a3412;
}

.status-badge {
  white-space: nowrap;
}

.status-open {
  background: var(--naver-green);
  color: #fff;
}

.status-closed {
  background: #f1f1f1;
  color: #777;
}

.status-check {
  background: #fff7ed;
  color: #9a3412;
}

.score-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  max-width: 58px;
  padding: 4px 7px;
  border-radius: 4px;
  background: var(--naver-green);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  flex-shrink: 0;
}

.score-badge.lg {
  min-width: 44px;
  padding: 4px 12px;
  font-size: 18px;
}

.score-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-left: 4px;
}

.score-context {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}

.decision-badges {
  margin-bottom: 8px;
}

.decision-headline {
  margin: 4px 48px 12px 0;
  color: var(--text);
  font-size: 15px;
  font-weight: 900;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.decision-reason {
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-sub);
}

.detail-meta-muted {
  margin-top: 8px;
  margin-bottom: 0;
}

.feature-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 8px;
}

.feature-chip {
  min-width: 0;
  max-width: 100%;
  padding: 7px 9px;
  border: 1px solid var(--border-light);
  border-radius: 999px;
  background: #fff;
  color: var(--text-sub);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.feature-chip small {
  display: inline-flex;
  margin-left: 6px;
  padding: 1px 5px;
  border-radius: 999px;
  background: #f4f6f8;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 800;
  vertical-align: 1px;
}

/* 패널 내 상세 (데스크톱) */
.panel-detail {
  position: absolute;
  inset: 0;
  background: var(--bg);
  padding: 0 16px 20px;
  overflow-y: auto;
  z-index: 5;
}

.panel-detail.hidden {
  display: none;
}

.btn-back {
  position: sticky;
  top: 0;
  z-index: 2;
  width: 100%;
  border: none;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(4px);
  color: var(--text-sub);
  font-size: 14px;
  cursor: pointer;
  padding: 12px 0;
  text-align: left;
}

.btn-back:hover {
  color: var(--naver-green);
}

.detail-header {
  margin-bottom: 16px;
}

.detail-name {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.detail-meta-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 6px;
}

.detail-category {
  font-size: 13px;
  color: var(--text-muted);
}

.pill {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  background: var(--naver-green-soft);
  color: var(--naver-green-hover);
}

.pill-soft {
  background: #f3f4f6;
  color: var(--text-sub);
}

.block {
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-light);
}

.block h3 {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
}

.text-block {
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-sub);
}

.block-trust {
  border-bottom: none;
  padding-bottom: 0;
}

.block-trust summary,
.block-attributes summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-sub);
  margin-bottom: 10px;
}

.block-attributes {
  padding-bottom: 12px;
}

.attribute-groups {
  display: grid;
  gap: 12px;
  padding-top: 2px;
}

.attribute-group {
  display: grid;
  gap: 6px;
}

.attribute-group h4 {
  font-size: 12px;
  font-weight: 800;
  color: var(--text);
}

.attribute-group ul {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.attribute-group li {
  padding: 5px 8px;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  background: #fff;
  color: var(--text-sub);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
}

.trust-grid {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}

.trust-grid div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  color: var(--text-sub);
}

.trust-grid .label {
  flex: 0 0 auto;
  color: var(--text-muted);
}

.text-muted {
  font-size: 13px;
  color: var(--text-muted);
}

.info-row {
  display: flex;
  gap: 10px;
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 8px;
}

.info-row .label {
  flex: 0 0 52px;
  color: var(--text-muted);
  font-size: 12px;
}

.info-row a {
  color: var(--naver-green-hover);
}

.menu-table {
  list-style: none;
}

.menu-table li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--border-light);
  font-size: 14px;
}

.menu-name {
  flex: 1;
}

.menu-price {
  color: var(--text-muted);
  font-size: 13px;
}

.menu-note {
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

.hours-list {
  list-style: none;
}

.hours-list li {
  font-size: 13px;
  color: var(--text-sub);
  padding: 4px 0;
}

.btn-naver {
  display: block;
  width: 100%;
  text-align: center;
  padding: 14px;
  border-radius: 6px;
  background: var(--naver-green);
  color: #fff !important;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  border: none;
}

.btn-naver:hover {
  background: var(--naver-green-hover);
}

.panel-collapse {
  position: absolute;
  right: -20px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 48px;
  border: 1px solid var(--border);
  border-left: none;
  border-radius: 0 4px 4px 0;
  background: #fff;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  z-index: 210;
  box-shadow: 2px 0 4px rgba(0, 0, 0, 0.06);
}

/* ─── 지도 ─── */
.map-panel {
  flex: 1;
  position: relative;
  min-width: 0;
  height: 100%;
}

.map-top-bar {
  position: absolute;
  top: 8px;
  left: 16px;
  right: 8px;
  z-index: 450;
  display: flex;
  flex-direction: column;
  gap: 6px;
  pointer-events: none;
  max-width: min(360px, calc(100% - 16px));
}

.map-search-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
  pointer-events: auto;
}

.map-search-wrap {
  display: flex;
  gap: 0;
  flex: 1;
  min-width: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.map-filter-btn {
  flex-shrink: 0;
  display: none;
  align-items: center;
  gap: 6px;
  padding: 0 14px;
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}

.map-filter-btn:hover {
  border-color: var(--naver-green);
  color: var(--naver-green-hover);
}

.map-filter-btn[aria-expanded="true"] {
  border-color: var(--naver-green);
  background: var(--naver-green-soft);
  color: var(--naver-green-hover);
}

.filter-btn-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--naver-green);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

.filter-btn-badge.hidden {
  display: none;
}

.map-active-chips {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  overflow-x: auto;
  pointer-events: auto;
  padding: 2px 0;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.map-active-chips::-webkit-scrollbar {
  display: none;
}

.map-active-chips.hidden {
  display: none;
}

body.filter-open .map-active-chips,
body.filter-open .map-filter-btn .filter-btn-badge {
  display: none !important;
}

.active-chip {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 36px;
  padding: 7px 10px;
  border: 1px solid var(--naver-green);
  border-radius: 999px;
  background: var(--naver-green-soft);
  color: var(--naver-green-hover);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

.active-chip:hover {
  background: #d8f5e4;
}

.active-chip-x {
  font-size: 14px;
  line-height: 1;
  opacity: 0.7;
}

.mobile-only {
  display: none !important;
}

.desktop-only {
  display: block;
}

.map-search-input {
  flex: 1;
  border: none;
  padding: 9px 11px;
  min-height: 44px;
  font-size: 14px;
  outline: none;
  min-width: 0;
}

.map-search-btn {
  flex-shrink: 0;
  width: 38px;
  border: none;
  border-left: 1px solid var(--border);
  background: var(--naver-green);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.map-search-btn:hover {
  background: var(--naver-green-hover);
}

.sidebar-filter-panel {
  pointer-events: auto;
  flex-shrink: 0;
  background: var(--bg);
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
  padding: 8px 12px 6px;
  max-height: 36vh;
  overflow-y: auto;
}

.filter-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 4px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border-light);
}

.filter-panel-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.filter-more-btn {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-sub);
  font-size: 11px;
  font-weight: 600;
  min-height: 32px;
  padding: 6px 10px;
  border-radius: 4px;
  cursor: pointer;
}

.filter-more-btn:hover,
.filter-more-btn[aria-expanded="true"] {
  border-color: var(--naver-green);
  color: var(--naver-green-hover);
  background: var(--naver-green-soft);
}

.filter-more-btn.sheet {
  display: block;
  width: calc(100% - 32px);
  margin: 0 16px 12px;
  padding: 10px;
  font-size: 14px;
}

.filter-primary {
  margin-bottom: 4px;
}

.filter-scroll-primary {
  flex-wrap: nowrap;
}

.filter-groups-more {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--border-light);
}

.filter-groups-more.hidden {
  display: none;
}

.filter-panel-count {
  font-size: 11px;
  font-weight: 700;
  color: var(--text);
}

.filter-clear-btn {
  border: none;
  background: none;
  color: var(--naver-green);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  min-height: 36px;
  padding: 8px 8px;
}

.filter-clear-btn:hover {
  text-decoration: underline;
}

.filter-clear-btn.hidden {
  display: none;
}

.filter-group {
  margin-bottom: 6px;
}

.filter-group:last-child {
  margin-bottom: 0;
}

.filter-group-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.02em;
  margin-bottom: 4px;
}

.filter-scroll {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.filter-scroll::-webkit-scrollbar {
  display: none;
}

.filter-pill {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 36px;
  padding: 7px 11px;
  border-radius: 999px;
  border: 1px solid #e8e8e8;
  background: #fafafa;
  font-size: 11px;
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.filter-pill:hover {
  border-color: #b8e6cb;
  background: #f5fdf8;
}

.filter-pill.active {
  border-color: var(--naver-green);
  background: var(--naver-green-soft);
  color: #0a7a3e;
  box-shadow: 0 0 0 1px rgba(3, 199, 90, 0.2);
}

.filter-pill-label {
  font-weight: 600;
  white-space: nowrap;
}

.filter-pill-count {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  min-width: 1ch;
}

.filter-pill.active .filter-pill-count {
  color: #0a7a3e;
}

/* ─── 필터 바텀시트 (모바일) ─── */
.filter-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 550;
}

.filter-backdrop.hidden {
  display: none;
}

.filter-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 560;
  background: var(--bg);
  border-radius: 16px 16px 0 0;
  box-shadow: var(--shadow-sheet);
  height: min(58vh, 520px);
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  transform: translateY(0);
  transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1);
  padding-bottom: env(safe-area-inset-bottom);
}

.filter-sheet.hidden {
  transform: translateY(100%);
  pointer-events: none;
}

.filter-grabber {
  width: 40px;
  min-height: 24px;
  border: 0;
  background: transparent;
  border-radius: 999px;
  margin: 2px auto 0;
  flex-shrink: 0;
  cursor: grab;
  touch-action: none;
}

.filter-grabber::before {
  content: "";
  display: block;
  width: 40px;
  height: 4px;
  background: #d9d9d9;
  border-radius: 2px;
  margin: 10px auto;
}

.filter-grabber:active {
  cursor: grabbing;
}

.filter-sheet-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  padding: 12px 16px 10px;
  border-bottom: 1px solid var(--border-light);
  flex-shrink: 0;
}

.filter-sheet-title {
  font-size: 17px;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.02em;
}

.filter-sheet-count {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  flex: 1;
}

.filter-sheet-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.filter-sheet-close {
  border: none;
  background: var(--naver-green);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  min-height: 44px;
  padding: 10px 14px;
  border-radius: 8px;
  cursor: pointer;
}

.filter-sheet-close:hover {
  background: var(--naver-green-hover);
}

.filter-primary-sheet {
  padding: 0 16px 8px;
  flex-shrink: 0;
}

.filter-groups-sheet {
  overflow-y: auto;
  padding: 0 16px 20px;
  flex: 1;
  min-height: 0;
}

.filter-groups-sheet .filter-scroll,
.filter-primary-sheet .filter-scroll {
  flex-wrap: wrap;
}

.chip-vibe {
  background: #f0f4ff;
  color: #3b5bdb;
  border-color: #d0d9ff;
}

.chip-facility {
  background: #f8f0ff;
  color: #7048b6;
  border-color: #e5d4ff;
}

.map-controls {
  position: absolute;
  right: 16px;
  bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 100;
}

.map-ctrl {
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 2px;
  background: #fff;
  color: var(--text);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.map-ctrl:hover {
  background: var(--bg-hover);
}

.zoom-group {
  display: flex;
  flex-direction: column;
  border-radius: 2px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.zoom-group .map-ctrl {
  border-radius: 0;
  border-bottom: none;
  box-shadow: none;
}

.zoom-group .map-ctrl:last-child {
  border-bottom: 1px solid var(--border);
}

.mobile-list-toggle {
  display: none;
}

#map {
  width: 100%;
  height: 100%;
}

.map-controls.hidden {
  display: none;
}

.map-pin {
  --pin-color: var(--marker-base);
  --pin-fill: color-mix(in srgb, var(--pin-color) 70%, transparent);
  --pin-shadow: rgba(16, 24, 32, 0.18);
  width: 40px;
  height: 40px;
  position: relative;
  filter: drop-shadow(0 3px 8px var(--pin-shadow));
}

.map-pin-body {
  position: relative;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(255, 255, 255, 0.86);
  border-radius: 14px;
  background: var(--pin-fill);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--pin-color) 48%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.34);
  backdrop-filter: blur(3px);
}

.map-pin-icon {
  position: relative;
  width: 18px;
  height: 18px;
  display: block;
}

.map-pin-icon::before,
.map-pin-icon::after {
  content: "";
  position: absolute;
  display: block;
}

.map-pin-taste {
  --pin-color: #0ea35b;
}

.map-pin-taste .map-pin-icon::before {
  inset: 2px 1px 5px;
  border: 2px solid rgba(255, 255, 255, 0.96);
  border-top-left-radius: 10px;
  border-bottom-right-radius: 10px;
  transform: rotate(-22deg);
}

.map-pin-taste .map-pin-icon::after {
  width: 6px;
  height: 6px;
  right: 0;
  bottom: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.96);
}

.map-pin-context {
  --pin-color: #2563eb;
}

.map-pin-context .map-pin-icon::before {
  inset: 2px;
  border: 2px solid rgba(255, 255, 255, 0.96);
  border-radius: 50%;
}

.map-pin-context .map-pin-icon::after {
  width: 12px;
  height: 2px;
  left: 3px;
  top: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 5px 0 rgba(255, 255, 255, 0.96);
}

.map-pin-convenience {
  --pin-color: #7c3aed;
}

.map-pin-convenience .map-pin-icon::before {
  width: 14px;
  height: 10px;
  left: 2px;
  top: 6px;
  border: 2px solid rgba(255, 255, 255, 0.96);
  border-radius: 3px;
}

.map-pin-convenience .map-pin-icon::after {
  width: 8px;
  height: 2px;
  left: 5px;
  top: 3px;
  background: rgba(255, 255, 255, 0.96);
}

.map-pin-caution {
  --pin-color: #e11d48;
}

.map-pin-caution .map-pin-icon::before {
  width: 0;
  height: 0;
  left: 1px;
  top: 2px;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-bottom: 15px solid rgba(255, 255, 255, 0.96);
}

.map-pin-caution .map-pin-icon::after {
  width: 2px;
  height: 7px;
  left: 8px;
  top: 7px;
  background: var(--pin-color);
  box-shadow: 0 9px 0 var(--pin-color);
}

.map-pin-menu {
  --pin-color: #475569;
}

.map-pin-menu .map-pin-icon::before {
  width: 14px;
  height: 14px;
  left: 2px;
  top: 2px;
  border: 2px solid rgba(255, 255, 255, 0.96);
  border-radius: 4px;
}

.map-pin-menu .map-pin-icon::after {
  width: 8px;
  height: 2px;
  left: 5px;
  top: 7px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 4px 0 rgba(255, 255, 255, 0.96);
}

.map-pin.selected {
  width: 50px;
  height: 50px;
  z-index: 2;
  filter: drop-shadow(0 5px 12px rgba(16, 24, 32, 0.28));
}

.map-pin.selected .map-pin-body {
  width: 50px;
  height: 50px;
  border-radius: 16px;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--pin-color) 42%, transparent),
    0 4px 10px rgba(16, 24, 32, 0.24);
}

.map-mini-card {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: calc(min(48vh, 440px) + 18px);
  z-index: 470;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 88px;
  gap: 8px;
  align-items: stretch;
  padding: 10px;
  padding-right: 56px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.18);
}

.map-mini-card.hidden {
  display: none;
}

.map-mini-main {
  min-width: 0;
  border: 0;
  background: transparent;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  text-align: left;
  cursor: pointer;
}

.map-mini-main .status-badge {
  grid-column: 2;
  justify-self: start;
}

.map-mini-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.map-mini-copy strong {
  font-size: 14px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.map-mini-copy span,
.map-mini-copy em {
  font-size: 12px;
  line-height: 1.3;
  color: var(--text-sub);
  font-style: normal;
  white-space: normal;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
}

.map-mini-copy em {
  color: var(--text-muted);
}

.map-mini-feature,
.collapsed-feature {
  color: var(--naver-green-dark) !important;
  font-weight: 800;
}

.map-mini-go,
.map-mini-close {
  min-height: 44px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 800;
}

.map-mini-go {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 13px;
  background: var(--naver-green);
  color: #fff;
  text-decoration: none;
}

.map-mini-close {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-sub);
}

/* ─── 모바일 peek 바텀시트 ─── */
.peek-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 500;
}

.peek-backdrop.hidden {
  display: none;
}

.peek-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 600;
  background: var(--bg);
  border-radius: 16px 16px 0 0;
  box-shadow: var(--shadow-sheet);
  max-height: 78vh;
  transform: translateY(0);
  transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1);
  padding-bottom: env(safe-area-inset-bottom);
}

.peek-sheet.hidden {
  transform: translateY(100%);
  pointer-events: none;
}

.peek-grabber {
  width: 40px;
  min-height: 24px;
  background: transparent;
  border-radius: 999px;
  margin: 2px auto 2px;
  cursor: grab;
  touch-action: none;
}

.peek-grabber::before {
  content: "";
  display: block;
  width: 40px;
  height: 4px;
  background: #d9d9d9;
  border-radius: 2px;
  margin: 10px auto;
}

.peek-grabber:active {
  cursor: grabbing;
}

.peek-close {
  position: absolute;
  top: 8px;
  right: 14px;
  z-index: 5;
  min-width: 44px;
  width: 44px;
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  font-size: 22px;
  line-height: 1;
  font-weight: 700;
  cursor: pointer;
}

.peek-content {
  padding: 4px 16px 24px;
  overflow-y: auto;
  max-height: calc(78vh - 24px);
}

.peek-action-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  padding: 10px 0 0;
  margin: 2px 0 14px;
  border-top: 1px solid var(--border-light);
  background: transparent;
}

.peek-action-bar a,
.peek-secondary-actions a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.peek-action-primary {
  border-color: var(--naver-green);
  background: var(--naver-green);
  color: #fff !important;
  font-size: 13px !important;
  font-weight: 900 !important;
}

.peek-secondary-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(54px, 1fr));
  gap: 6px;
}

.peek-action-secondary {
  background: #fff;
  color: var(--text-sub) !important;
}

body.detail-open .map-top-bar,
body.detail-open .map-controls {
  display: none;
}

.peek-name {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.peek-menu {
  font-size: 14px;
  color: var(--text-sub);
  margin-bottom: 12px;
  line-height: 1.45;
}

.peek-score-row {
  margin-bottom: 16px;
}

.peek-cta {
  margin-top: 4px;
}

.loading {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 900;
  background: rgba(255, 255, 255, 0.95);
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 14px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
  border: 1px solid var(--border);
}

.loading.hidden {
  display: none;
}

/* 데스크톱: peek 숨김, 패널 상세 사용 */
@media (min-width: 769px) {
  .peek-sheet,
  .peek-backdrop,
  .filter-sheet,
  .filter-backdrop {
    display: none !important;
  }

  .mobile-list-toggle,
  .map-filter-btn {
    display: none !important;
  }

  .map-active-chips {
    display: none !important;
  }

}

/* 모바일: 사이드바 오버레이 + 바텀시트 */
@media (max-width: 768px) {
  :root {
    --sidebar-w: 100%;
  }

  .sidebar {
    position: fixed;
    left: 0;
    right: 0;
    top: auto;
    bottom: 0;
    transform: translateY(0);
    width: 100%;
    max-width: 100%;
    height: calc(176px + env(safe-area-inset-bottom));
    min-width: 0;
    border-right: none;
    border-radius: 18px 18px 0 0;
    box-shadow: var(--shadow-sheet);
    z-index: 360;
    padding-bottom: env(safe-area-inset-bottom);
  }

  .sidebar.sheet-collapsed {
    height: calc(104px + env(safe-area-inset-bottom));
  }

  .sidebar.sheet-expanded {
    height: min(76vh, 660px);
  }

  .sidebar.list-open {
    transform: translateY(0);
  }

  .sidebar.collapsed {
    margin-left: 0;
  }

  .sidebar-grabber {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 24px;
    border: 0;
    background: transparent;
    cursor: grab;
    touch-action: none;
    flex-shrink: 0;
  }

  .sidebar-grabber:active {
    cursor: grabbing;
  }

  .sidebar-grabber span {
    width: 42px;
    height: 4px;
    border-radius: 2px;
    background: #d9d9d9;
  }

  .sidebar.sheet-collapsed .sidebar-grabber::after {
    content: "목록 열기";
    position: absolute;
    right: 16px;
    top: 7px;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 700;
  }

  .sidebar-header {
    padding: 4px 16px 8px;
  }

  .collapsed-decision-bar {
    display: none;
  }

  .sidebar.sheet-collapsed .collapsed-decision-bar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    padding: 0 12px 10px;
    background: #fff;
  }

  .collapsed-decision-bar.hidden {
    display: none !important;
  }

  .collapsed-decision-main {
    min-width: 0;
    min-height: 64px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    padding: 8px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    text-align: left;
  }

  .collapsed-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
  }

  .collapsed-copy strong {
    font-size: 14px;
    line-height: 1.25;
    overflow-wrap: anywhere;
  }

  .collapsed-copy span {
    font-size: 12px;
    color: var(--text-sub);
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .collapsed-go {
    min-width: 68px;
    min-height: 64px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--naver-green);
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    font-weight: 900;
  }

  .sidebar.sheet-collapsed .sidebar-body {
    display: none;
  }

  .brand {
    display: none;
  }

  .result-meta {
    margin-top: 0;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .panel-detail {
    display: none !important;
  }

  .panel-collapse {
    display: none;
  }

  .map-top-bar {
    left: 8px;
    right: 8px;
    max-width: none;
    z-index: 430;
  }

  .map-search-wrap {
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.09);
  }

  .map-search-input {
    min-height: 40px;
    padding: 8px 10px;
    font-size: 13px;
  }

  .map-filter-btn.mobile-only {
    display: flex !important;
    min-height: 40px;
    padding: 0 12px;
  }

  .desktop-only {
    display: none !important;
  }

  .mobile-list-toggle {
    display: none;
  }

  .map-controls {
    right: 12px;
    bottom: calc(176px + env(safe-area-inset-bottom) + 18px);
  }

  body.mobile-sheet-collapsed .map-controls {
    bottom: calc(104px + env(safe-area-inset-bottom) + 18px);
  }

  body.mobile-sheet-expanded .map-controls {
    bottom: calc(min(76vh, 660px) + 18px);
  }

  .map-mini-card {
    bottom: calc(176px + env(safe-area-inset-bottom) + 18px);
  }

  body.mobile-sheet-collapsed .map-mini-card {
    bottom: calc(104px + env(safe-area-inset-bottom) + 18px);
  }

  body.mobile-sheet-expanded .map-mini-card {
    bottom: calc(min(76vh, 660px) + 18px);
  }

  body.detail-open .map-mini-card,
  body.filter-open .map-mini-card {
    display: none !important;
  }

  .map-pin {
    width: 42px;
    height: 42px;
  }

  .map-pin-body {
    width: 42px;
    height: 42px;
  }

  .map-pin.selected {
    width: 48px;
    height: 48px;
  }

  .map-pin.selected .map-pin-body {
    width: 48px;
    height: 48px;
  }

  .place-list {
    padding-bottom: env(safe-area-inset-bottom);
  }

  .place-item {
    padding: 10px 14px;
  }

  .place-item-row {
    gap: 8px;
  }

  .place-list .thumb-sm {
    display: none;
  }

  .place-item-top {
    align-items: center;
    margin-bottom: 3px;
  }

  .place-item-name {
    font-size: 14px;
    line-height: 1.25;
  }

  .place-item-meta {
    font-size: 12px;
    line-height: 1.3;
    -webkit-line-clamp: 1;
  }

  .place-item-sub {
    display: none;
  }

  .thumb-sm {
    width: 54px;
    height: 54px;
  }

  .peek-sheet .detail-hero {
    grid-template-columns: 92px minmax(0, 1fr);
    align-items: start;
    gap: 10px;
  }

  .peek-sheet .thumb-lg {
    height: 92px;
  }

  .peek-sheet .detail-meta-row {
    align-content: flex-start;
  }

  .peek-sheet {
    max-height: 84vh;
  }

  .peek-content {
    max-height: calc(84vh - 24px);
  }

  .peek-sheet .detail-name {
    font-size: 21px;
    line-height: 1.25;
    overflow-wrap: anywhere;
  }

  .peek-sheet .decision-headline {
    margin: 4px 48px 12px 0;
    font-size: 16px;
  }

  .peek-sheet .peek-action-bar {
    grid-template-columns: minmax(0, 1fr);
    margin-top: 10px;
    padding-top: 12px;
  }

  .peek-sheet .peek-secondary-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .peek-sheet .peek-action-secondary {
    min-height: 36px;
    font-size: 12px;
    color: var(--text-muted) !important;
  }

  .peek-sheet .detail-header {
    margin-bottom: 12px;
  }

  .peek-sheet .decision-reason,
  .peek-sheet .detail-meta-muted {
    display: flex;
  }

  .peek-sheet .block {
    margin-bottom: 14px;
    padding-bottom: 12px;
  }

}
