:root {
  --accent: #2F8F5B;
  --accent-dark: #1F6B41;
  --bg: #F5FAF6;
  --card: #FFFFFF;
  --ink: #20261F;
  --ink-soft: #6E7A6C;
  --border: #E1EAE0;
  --sheet-collapsed: 42vh;
  --sheet-expanded: 80vh;
  --content-top: 168px;
  --sidebar-width: 380px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  background: var(--bg);
  color: var(--ink);
}

.topbar {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff;
  padding: 14px 16px 10px;
}

.brand {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.tagline {
  font-size: 12.5px;
  opacity: 0.92;
  margin-top: 2px;
}

.searchbar {
  position: relative;
  padding: 10px 12px 0;
  background: var(--accent-dark);
}

.searchbar input {
  width: 100%;
  padding: 11px 38px 11px 14px;
  border: none;
  border-radius: 12px;
  font-size: 14.5px;
  outline: none;
  background: #fff;
}

.clear-btn {
  position: absolute;
  right: 24px;
  top: 20px;
  border: none;
  background: transparent;
  color: var(--ink-soft);
  font-size: 14px;
  cursor: pointer;
}

.chips {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  overflow-x: auto;
  background: var(--accent-dark);
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }

.chip {
  flex: 0 0 auto;
  padding: 7px 14px;
  border-radius: 999px;
  border: none;
  background: rgba(255,255,255,0.25);
  color: #fff;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.chip.active {
  background: #fff;
  color: var(--accent-dark);
}

.chip-toggle {
  background: rgba(255,214,0,0.25);
}
.chip-toggle.active {
  background: #FFD600;
  color: #4A3B00;
}

.notice {
  background: #FFF6DC;
  color: #6B5300;
  font-size: 11px;
  line-height: 1.4;
  padding: 6px 12px;
  border-bottom: 1px solid #F0DFA0;
}

#map {
  position: absolute;
  top: var(--content-top);
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
}

.marker-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
}

.marker-label {
  display: none;
  background: rgba(255,255,255,0.94);
  color: var(--ink);
  font-size: 10.5px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 6px;
  white-space: nowrap;
  margin-bottom: 3px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.25);
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* 일정 배율 이상 확대했을 때만 라벨 표시 (전국 뷰에서는 핀만) */
#map.labels-visible .marker-label {
  display: block;
}
.marker-wrap.selected .marker-label {
  display: block;
  background: var(--accent-dark);
  color: #fff;
  font-size: 11.5px;
}

.marker-pin {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  background: var(--accent);
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}
.marker-pin span {
  transform: rotate(45deg);
  font-size: 16px;
}
.marker-wrap.selected .marker-pin {
  background: var(--accent-dark);
  width: 42px;
  height: 42px;
}
.marker-wrap.selected .marker-pin span { font-size: 20px; }

.sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--sheet-collapsed);
  background: var(--card);
  border-radius: 18px 18px 0 0;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.12);
  z-index: 2;
  display: flex;
  flex-direction: column;
  transition: height 0.25s ease;
  touch-action: none;
}
.sheet.expanded { height: var(--sheet-expanded); }

.sheet-handle {
  width: 40px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin: 10px auto 4px;
  cursor: grab;
}

.sheet-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 16px 10px;
  font-weight: 700;
  font-size: 15px;
  border-bottom: 1px solid var(--border);
}

.count {
  color: var(--accent-dark);
  background: #E4F5EA;
  padding: 1px 9px;
  border-radius: 999px;
  font-size: 12.5px;
}

.list {
  overflow-y: auto;
  padding: 8px 12px 24px;
  flex: 1;
}

.card {
  padding: 14px 10px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.card:last-child { border-bottom: none; }
.card.highlight { background: #EEF8F0; border-radius: 14px; }

.card-title-row {
  display: flex;
  align-items: baseline;
  gap: 7px;
  flex-wrap: wrap;
}
.card-title {
  font-size: 16px;
  font-weight: 800;
}

.tag-category {
  font-size: 11.5px;
  color: var(--accent-dark);
  background: #E4F5EA;
  padding: 1px 7px;
  border-radius: 6px;
  font-weight: 600;
}

.badges {
  margin-top: 6px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
}
.badge-free { background: #E4F5EA; color: var(--accent-dark); }
.badge-paid { background: #FDE7E7; color: #B23A3A; }
.badge-cook-yes { background: #FFF1DA; color: #B4700A; }
.badge-cook-no { background: #EDEDED; color: #777; }

.card-address {
  margin-top: 8px;
  font-size: 12.5px;
  color: var(--ink-soft);
}
.card-address::before { content: "📍 "; }

.actions-toggle {
  margin-top: 10px;
  border: none;
  background: none;
  padding: 4px 0;
  color: var(--accent-dark);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 3px;
}
.actions-toggle .chevron {
  display: inline-block;
  transition: transform 0.2s ease;
}
.actions-toggle.open .chevron {
  transform: rotate(180deg);
}

.card-actions {
  margin-top: 10px;
  display: none;
  gap: 8px;
}
.card-actions.show {
  display: flex;
}

.btn-video, .btn-info {
  flex: 1;
  text-align: center;
  padding: 10px 8px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 700;
  text-decoration: none;
}
.btn-video {
  background: #FEE500;
  color: #3C1E1E;
}
.btn-video:active { background: #F4D900; }

.btn-info {
  background: var(--accent);
  color: #fff;
}
.btn-info:active { background: var(--accent-dark); }

.empty-state {
  padding: 40px 16px;
  text-align: center;
  color: var(--ink-soft);
  font-size: 13.5px;
}

/* PC 화면에서는 스팟 리스트를 하단 시트 대신 우측 사이드바로 배치 */
@media (min-width: 900px) {
  #map {
    right: var(--sidebar-width);
  }

  .sheet {
    top: var(--content-top);
    left: auto;
    right: 0;
    bottom: 0;
    width: var(--sidebar-width);
    height: auto;
    border-radius: 0;
    box-shadow: -4px 0 20px rgba(0,0,0,0.12);
    touch-action: auto;
  }
  .sheet.expanded {
    height: auto;
  }

  .sheet-handle {
    display: none;
  }
}
