:root {
      --bg:        #ffffff;
      --text:      #202124;
      --muted:     #5f6368;
      --primary:   #c8392b;
      --shadow-sm: 0 4px 10px rgba(0,0,0,.08);
      --shadow-lg: 0 8px 24px rgba(0,0,0,.14);
      --header-h: 108px;
      --z-header:  200;
      --z-float:   150;
      --c-food:    #E8542A;
      --c-place:   #2E86AB;
      --c-history: #6B4226;
      --c-festival:#F4A261;
    }

    *, *::before, *::after { box-sizing: border-box; }

    html, body {
      margin: 0; padding: 0;
      width: 100%; height: 100%;
      overflow: hidden;
      font-family: "Pretendard Variable", "Pretendard", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
      background: #eef0f3;
    }
.site-header {
  --ink: #24201a;
  --muted: #6f675c;
  --line: rgba(72, 55, 34, 0.18);
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(246, 241, 232, 0.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 0 12px;
  width: min(1240px, calc(100% - 40px));
  margin: 0 auto;
}

.site-logo {
  display: flex;
  align-items: baseline;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
}

.logo-ko {
  font-size: 34px;
  font-weight: 950;
  line-height: 1;
  letter-spacing: -0.01em;
}

.logo-en {
  font-family: "JetBrains Mono", "SF Mono", ui-monospace, monospace;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 32px;
}

.site-nav a {
  font-size: 15px;
  font-weight: 800;
  color: var(--muted);
  text-decoration: none;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.site-nav a:hover {
  color: var(--ink);
}

.mobile-menu {
  display: none;
}

.mobile-menu summary {
  display: inline-flex;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 250, 240, 0.82);
  cursor: pointer;
  list-style: none;
}

.mobile-menu summary::-webkit-details-marker {
  display: none;
}

.hamburger {
  position: relative;
  width: 18px;
  height: 12px;
  border-top: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
}

.hamburger::before {
  content: "";
  position: absolute;
  left: 0;
  top: 3px;
  width: 18px;
  border-top: 2px solid var(--ink);
}

.mobile-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: min(200px, calc(100vw - 24px));
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: rgba(255, 250, 240, 0.98);
  box-shadow: 0 16px 36px rgba(54, 39, 20, 0.16);
}

.mobile-menu-panel a {
  display: flex;
  min-height: 44px;
  align-items: center;
  padding: 0 12px;
  border-radius: 6px;
  font-weight: 900;
  text-decoration: none;
  color: var(--ink);
}

.mobile-menu-panel a:hover {
  background: rgba(47, 81, 65, 0.08);
}

@media (max-width: 640px) {
  .header-inner {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    height: 64px;
    padding: 0;
    gap: 0;
  }

  .logo-ko {
    font-size: 26px;
  }

  .logo-en {
    display: none;
  }

  .site-nav {
    display: none;
  }

  .mobile-menu {
    display: block;
    position: relative;
  }
}
/* 지도 */
    #map {
      width: 100%;
      height: calc(100vh - 108px);
      position: absolute;
      top: 108px;
      left: 0;
      z-index: 1;
    }
    .filter-panel {
      --line: rgba(72, 55, 34, 0.18);
      --ink: #24201a;
      position: fixed;
      top: calc(108px + 16px);
      left: 16px;
      transform: none;
      z-index: 80;
      display: flex;
      flex-direction: column;
      align-items: flex-start;
      gap: 0;
      padding: 0;
      background: transparent;
      border: none;
      backdrop-filter: none;
    }

    .filter-btn {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      height: 36px;
      padding: 0 16px;
      border: 1.5px solid #ddd;
      border-radius: 999px;
      font-size: 13px;
      font-weight: 400;
      color: #999;
      background: white;
      cursor: pointer;
      white-space: nowrap;
      box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
      transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.1s;
    }

    .filter-btn:hover {
      border-color: #bbb;
      color: #666;
    }

    .filter-btn.active {
      color: white;
      font-weight: 600;
      transform: scale(1.06);
      box-shadow: 0 4px 16px rgba(0, 0, 0, 0.24);
    }

    /* 카테고리별 색상 */
    .filter-btn[data-layer="food"].active {
      background: #E8542A;
      border-color: #E8542A;
    }

    .filter-btn[data-layer="market"].active {
      background: #E8542A;
      border-color: #E8542A;
    }

    .filter-btn[data-layer="place"].active {
      background: #2E86AB;
      border-color: #2E86AB;
    }

    .filter-btn[data-layer="festival"].active {
      background: #9b59b6;
      border-color: #9b59b6;
    }

    @media (max-width: 640px) {
      .filter-panel {
        top: calc(64px + 12px);
        left: 12px;
        transform: none;
        gap: 6px;
      }

      #map {
        height: calc(100vh - 64px);
        top: 64px;
      }
    }/* 필터 패널 */
/* 팝업 스타일 */
    .maplibregl-popup {
      z-index: 1000;
    }

    .maplibregl-popup-content {
      padding: 12px 14px;
      border-radius: 14px;
      box-shadow: var(--shadow-lg);
      border: 1px solid rgba(0,0,0,.07);
      max-width: 300px;
      color: var(--text);
      font-size: 13px;
    }
    .maplibregl-popup-tip { display: none; }
    .maplibregl-popup-close-button {
      font-size: 16px; padding: 4px 8px; color: var(--muted);
    }

    .pop-top {
      display: flex; align-items: flex-start;
      gap: 8px; margin: 0 0 8px 0;
    }
    .pop-badge {
      display: inline-flex; align-items: center;
      padding: 3px 9px; border-radius: 999px;
      font-size: 11px; font-weight: 900;
      border: 1px solid; flex-shrink: 0;
      white-space: nowrap;
    }
    .pop-badge.food    { background: rgba(232,84,42,.10);  border-color: rgba(232,84,42,.25);  color: #b53412; }
    .pop-badge.place   { background: rgba(46,134,171,.10); border-color: rgba(46,134,171,.25); color: #1a5f7a; }
    .pop-badge.history { background: rgba(107,66,38,.10);  border-color: rgba(107,66,38,.25);  color: #5a2d0c; }
    .pop-badge.festival{ background: rgba(244,162,97,.10); border-color: rgba(244,162,97,.25); color: #b35f00; }

    .pop-title {
      font-weight: 900; font-size: 14px;
      margin: 0; line-height: 1.3; flex: 1;
    }
    .pop-thumb {
      width: 100%; height: 120px;
      border-radius: 10px; overflow: hidden;
      background: #eee; margin: 0 0 8px 0;
    }
    .pop-thumb img {
      width: 100%; height: 100%;
      object-fit: cover; display: block;
    }
    .pop-desc {
      font-size: 12px; color: var(--muted);
      margin: 0 0 10px 0; line-height: 1.5;
    }
    .pop-actions { display: flex; gap: 6px; flex-wrap: wrap; }
    .pop-actions a {
      display: inline-flex; align-items: center; justify-content: center;
      padding: 7px 11px; border-radius: 999px;
      border: 1px solid rgba(0,0,0,.10);
      text-decoration: none; font-weight: 800;
      font-size: 12px; color: var(--text);
      background: #fff; transition: opacity .12s;
      white-space: nowrap;
    }
    .pop-actions a.primary {
      background: var(--text); color: #fff; border-color: var(--text);
    }
    .pop-actions a:hover { opacity: .82; }
    .pop-actions a:active { transform: translateY(1px); }

    .food-image-marker {
      width: 48px;
      height: 48px;
      padding: 0;
      appearance: none;
      border: 2px solid #fff;
      border-radius: 50%;
      background: #fff center / cover no-repeat;
      box-shadow: 0 8px 18px rgba(32, 33, 36, 0.24), 0 0 0 1px rgba(32, 33, 36, 0.08);
      cursor: pointer;
      transform: translateZ(0);
    }

    .food-image-marker:focus-visible {
      outline: 3px solid rgba(200, 57, 43, 0.45);
      outline-offset: 3px;
    }

    @media (max-width: 640px) {
      .food-image-marker {
        width: 42px;
        height: 42px;
      }
    }

    /* zoom 게이지 */
    #zoom-gauge {
      position: absolute;
      bottom: 36px; right: 10px;
      z-index: 10;
      background: rgba(0,0,0,.65);
      border-radius: 8px;
      padding: 8px 12px;
      display: flex; align-items: center; gap: 4px;
      color: #fff;
      font-size: 12px; font-weight: 700;
      pointer-events: none;
      user-select: none;
    }
    #zoom-gauge .dot {
      display: inline-block;
      width: 8px; height: 8px; border-radius: 50%;
      background: rgba(255,255,255,.28);
    }
    #zoom-gauge .dot.active { background: #fff; }
    #zoom-gauge .gauge-label { margin-left: 6px; }
/* ── 서브필터 패널 ── */
.filter-main {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.sub-panel {
  position: absolute;
  top: 108px;
  left: 12px;
  width: 280px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
  padding: 12px;
  z-index: 20;
}

.sub-panel[hidden] {
  display: none;
}

.sub-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.sub-panel-title {
  font-size: 13px;
  font-weight: 600;
  color: #333;
}

.sub-panel-header-btns {
  display: flex;
  gap: 6px;
}

.place-chip-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.chip-divider {
  grid-column: 1 / -1;
  height: 1px;
  background: #eee;
  margin: 2px 0;
}

.place-chip {
  padding: 6px 8px;
  border-radius: 8px;
  border: 1.5px solid #ddd;
  background: white;
  font-size: 11px;
  color: #999;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.place-chip.on {
  border-color: #2E86AB;
  background: #e8f4f8;
  color: #1a6a8a;
  font-weight: 600;
}

.ctrl-btn {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,0.15);
  background: #f0f0f0;
  color: #555;
  cursor: pointer;
}

.ctrl-btn.ctrl-hide {
  background: transparent;
  border-color: transparent;
  font-size: 13px;
  color: #888;
}

@media (max-width: 768px) {
  .sub-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    top: auto;
    width: 100%;
    max-height: 55vh;
    border-radius: 16px 16px 0 0;
    overflow-y: auto;
    padding: 16px;
  }

  .place-chip-grid {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

.place-icon-marker {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  background-size: cover;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}
