:root {
  --bg: #f4f6fb; --card: #fff; --text: #111827; --muted: #6b7280; --line: #e5e8ef;
  --brand: #2563eb; --brand-dark: #1e3a8a; --brand-soft: #eaf1ff;
  --free: #16a34a; --free-soft: #e8f7ee; --unknown: #9ca3af; --target: #dc2626;
  --radius: 16px;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0d1117; --card: #161b22; --text: #e6edf3; --muted: #9aa4b2; --line: #2a313c;
    --brand: #60a5fa; --brand-soft: #16233d; --free: #4ade80; --free-soft: #12291c; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); line-height: 1.55;
  font-family: "Pretendard", -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif; }
a { color: inherit; }
[hidden] { display: none !important; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); font-weight: 500; font-size: 14px; }
h2 { font-size: 19px; margin: 0; letter-spacing: -0.01em; }

/* 헤더·푸터 */
.site-header { background: var(--card); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 18px; text-decoration: none; }
.logo { width: 30px; height: 30px; border-radius: 8px; background: var(--brand); color: #fff; display: grid; place-items: center; font-size: 17px; }
.site-header nav { display: flex; gap: 20px; font-size: 15px; }
.site-header nav a { text-decoration: none; color: var(--muted); }
.site-header nav a:hover { color: var(--brand); }
.sample-banner { background: #fef3c7; color: #78350f; text-align: center; font-size: 13px; padding: 6px 16px; }
.site-footer { border-top: 1px solid var(--line); background: var(--card); font-size: 13px; color: var(--muted); margin-top: 24px; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px; padding: 18px 16px; }

.crumbs { display: flex; flex-wrap: wrap; gap: 6px; font-size: 13px; color: var(--muted); padding: 18px 0 0; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { color: var(--brand); }

/* 히어로 */
.hero { margin-top: 14px; padding: 28px; border-radius: 20px; color: #fff;
  background: linear-gradient(135deg, var(--brand-dark), #2563eb); position: relative; overflow: hidden; }
.hero::after { content: "P"; position: absolute; right: -10px; bottom: -70px; font-size: 260px; font-weight: 900; opacity: .07; line-height: 1; pointer-events: none; }
.hero h1 { margin: 0 0 6px; font-size: 34px; letter-spacing: -0.02em; line-height: 1.25; }
.lead { margin: 0; opacity: .9; font-size: 16px; max-width: 680px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 22px; position: relative; z-index: 1; }
.stat { background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.18); border-radius: 14px; padding: 14px 16px; min-width: 0; }
.stat-num { display: block; font-size: 26px; font-weight: 800; letter-spacing: -0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-num small { font-size: 15px; font-weight: 600; margin-left: 2px; }
.stat-num.is-free { color: #bbf7d0; }
.stat-label { font-size: 13px; opacity: .8; }
.pill { display: inline-block; font-size: 13px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: rgba(255,255,255,.18); margin-right: 6px; }
.lot-hero h1 { margin-top: 10px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; position: relative; z-index: 1; }

/* 버튼 */
.btn { display: inline-block; padding: 10px 18px; border-radius: 10px; background: var(--brand); color: #fff; text-decoration: none; font-weight: 700; font-size: 14px; }
.btn-ghost { background: var(--card); color: var(--text); border: 1px solid var(--line); }
.btn-kakao { background: #fee500; color: #191919; }
.btn-light { background: rgba(255,255,255,.16); color: #fff; border: 1px solid rgba(255,255,255,.3); }

/* 패널 */
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin-top: 14px; }
.panel h2 { margin-bottom: 12px; }

/* 홈 */
.home-hero { margin-top: 18px; padding: 40px 32px; }
.home-hero h1 { font-size: 36px; }
.home-search { position: relative; margin-top: 20px; max-width: 560px; z-index: 2; }
.home-search input { width: 100%; font: inherit; font-size: 17px; padding: 15px 18px; border-radius: 14px; border: 0;
  background: #fff; color: #111827; box-shadow: 0 6px 20px rgba(0,0,0,.18); }
.home-search input:focus { outline: 3px solid #93c5fd; }
.suggest { position: absolute; left: 0; right: 0; top: calc(100% + 6px); list-style: none; margin: 0; padding: 6px; background: #fff; color: #111827;
  border-radius: 14px; box-shadow: 0 12px 30px rgba(0,0,0,.2); max-height: 360px; overflow-y: auto; }
.suggest a { display: flex; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: 10px; text-decoration: none; font-size: 15px; }
.suggest a:hover, .suggest a.is-active { background: #eaf1ff; }
.suggest small { color: #6b7280; white-space: nowrap; }
.suggest .is-region strong::before { content: "📍 "; }
.suggest li.empty { padding: 12px; color: #6b7280; font-size: 14px; }
.regions { margin-top: 28px; }
.regions h2 { font-size: 22px; margin-bottom: 12px; }
.region-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.region-card, .gu-card { display: flex; flex-direction: column; gap: 3px; padding: 16px 18px; background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; text-decoration: none; transition: border-color .15s, transform .15s; }
.region-card:hover, .gu-card:hover { border-color: var(--brand); transform: translateY(-2px); }
.region-card strong { font-size: 18px; }
.region-card span, .gu-meta { font-size: 13px; color: var(--muted); }
.gu-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.gu-card { background: var(--bg); border-color: transparent; }
.gu-card strong { font-size: 16px; }
.gu-count { font-size: 20px; font-weight: 800; color: var(--brand); }
.map-cta { display: flex; flex-direction: column; gap: 4px; margin: 28px 0 16px; padding: 22px 24px; border-radius: var(--radius);
  background: var(--brand-soft); text-decoration: none; border: 1px solid transparent; }
.map-cta:hover { border-color: var(--brand); }
.map-cta strong { font-size: 18px; }
.map-cta span { color: var(--muted); font-size: 14px; }

/* 추천 카드 */
.picks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 14px; }
.pick { display: flex; flex-direction: column; gap: 3px; padding: 16px 18px; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); text-decoration: none; transition: border-color .15s, transform .15s; }
.pick:hover { border-color: var(--brand); transform: translateY(-2px); }
.pick-label { font-size: 13px; color: var(--muted); font-weight: 600; }
.pick-name { font-size: 16px; }
.pick-meta { font-size: 14px; color: var(--brand); font-weight: 700; }

/* 지도 + 목록 */
.layout { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; align-items: start; }
.lot-layout { grid-template-columns: 1.2fr 1fr; }
.lot-layout .panel:first-child { margin-top: 0; }
.map-card, .list-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.map-card { position: sticky; top: 14px; overflow: hidden; }
#map { height: 580px; }
#map.map-sm { height: 420px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--muted); padding: 10px 14px; border-top: 1px solid var(--line); }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot.paid { background: var(--brand); } .dot.free { background: var(--free); } .dot.unknown { background: var(--unknown); } .dot.target { background: var(--target); }

.list-card { padding: 18px 18px 8px; }
.list-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.sort, .filters { display: flex; gap: 6px; flex-wrap: wrap; }
.filters { margin: 12px 0 10px; }
.sort button, .filters button { font: inherit; font-size: 13px; padding: 6px 12px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: var(--card); color: var(--text); }
.sort button[aria-pressed="true"] { background: var(--text); color: var(--card); border-color: var(--text); }
.filters button[aria-pressed="true"] { background: var(--brand-soft); color: var(--brand); border-color: var(--brand); font-weight: 700; }
.list-search { width: 100%; font: inherit; font-size: 14px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg); color: var(--text); margin-bottom: 4px; }
.list-card .lots { max-height: 1100px; overflow-y: auto; }

.lots { list-style: none; margin: 0; padding: 0; }
.lot { display: flex; gap: 12px; padding: 14px 4px; border-top: 1px solid var(--line); scroll-margin-top: 20px; cursor: pointer; }
.lot:first-child { border-top: 0; }
.lot.is-active { background: var(--brand-soft); border-radius: 10px; }
.lot-rank { flex: none; width: 26px; height: 26px; border-radius: 8px; background: var(--brand-soft); color: var(--brand);
  font-size: 13px; font-weight: 800; display: grid; place-items: center; margin-top: 2px; }
.lot-body { flex: 1; min-width: 0; }
.lot-top { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.lot-name { margin: 0; font-size: 16px; }
.lot-name a { text-decoration: none; }
.lot-name a:hover { color: var(--brand); text-decoration: underline; }
.lot-price { flex: none; font-size: 17px; font-weight: 800; }
.lot-price small { font-size: 12px; color: var(--muted); font-weight: 500; margin-left: 2px; }
.lot-price.is-free { color: var(--free); }
.lot-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 13px; color: var(--muted); margin-top: 4px; }
.lot-tags { display: flex; gap: 5px; margin-top: 8px; flex-wrap: wrap; }
.tag { font-size: 12px; padding: 2px 8px; border-radius: 6px; background: var(--bg); color: var(--muted); }
.tag-public { background: var(--brand-soft); color: var(--brand); }
.tag-24 { background: #fdf2e3; color: #b45309; }

/* 상세 표 */
.info { width: 100%; border-collapse: collapse; font-size: 15px; }
.info th, .info td { text-align: left; padding: 10px 0; border-top: 1px solid var(--line); vertical-align: top; }
.info tr:first-child th, .info tr:first-child td { border-top: 0; }
.info th { width: 120px; color: var(--muted); font-weight: 500; }
.info a { color: var(--brand); }
.callout { margin: 12px 0 0; padding: 12px 14px; border-radius: 10px; background: var(--free-soft); font-size: 14px; }

/* 지도 라벨 */
.price-pin { background: var(--card); color: var(--text); border: 2px solid var(--brand); border-radius: 999px; padding: 2px 9px;
  font-size: 12px; font-weight: 800; white-space: nowrap; box-shadow: 0 2px 6px rgba(0,0,0,.18); transform: translate(-50%, -50%);
  display: inline-block; cursor: pointer; font-family: inherit; }
.price-pin.free { border-color: var(--free); color: var(--free); }
.price-pin.unknown { border-color: var(--unknown); color: var(--muted); }
.price-pin.is-active { background: var(--brand); color: #fff; border-color: var(--brand); }
.price-pin.is-target { background: var(--target); color: #fff; border-color: var(--target); font-size: 13px; padding: 4px 11px; }
.leaflet-div-icon { background: none; border: 0; }
.marker-cluster { background: rgba(37,99,235,.18); border-radius: 50%; }
.marker-cluster div { width: 32px; height: 32px; margin: 4px; border-radius: 50%; background: var(--brand); color: #fff;
  display: grid; place-items: center; font-weight: 800; font-size: 13px; font-family: inherit; }

/* FAQ / 링크 */
.faq details { border-top: 1px solid var(--line); padding: 12px 0; }
.faq details:first-of-type { border-top: 0; }
.faq summary { cursor: pointer; font-weight: 700; font-size: 15px; }
.faq p { margin: 8px 0 0; color: var(--muted); font-size: 15px; }
.chip-links { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-links a { padding: 8px 14px; border-radius: 999px; background: var(--bg); text-decoration: none; font-size: 14px; }
.chip-links a:hover { color: var(--brand); }
.chip-links span { color: var(--muted); font-size: 12px; margin-left: 2px; }
.note { font-size: 13px; color: var(--muted); margin: 16px 2px 8px; }

/* 404 */
.nf { text-align: center; padding: 80px 0 100px; }
.nf h1 { font-size: 28px; }
.nf p { color: var(--muted); }

@media (max-width: 860px) {
  .layout, .lot-layout { grid-template-columns: 1fr; }
  .map-card { position: static; }
  .lot-layout .map-card { order: -1; }
  #map, #map.map-sm { height: 320px; }
  .list-card .lots { max-height: none; }
}
@media (max-width: 600px) {
  .hero, .home-hero { padding: 22px 18px; border-radius: 16px; }
  .hero h1, .home-hero h1 { font-size: 26px; }
  .lead { font-size: 15px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat-num { font-size: 22px; }
  .picks { grid-template-columns: 1fr; gap: 8px; }
  .pick { padding: 12px 14px; }
  .region-grid, .gu-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .panel { padding: 18px 16px; }
  .info th { width: 96px; }
  .site-header nav { gap: 14px; font-size: 14px; }
}

.page-dates { font-size: 13px; color: var(--muted); margin: 4px 2px 24px; }
.lot-summary { margin-top: 12px; line-height: 1.7; position: relative; z-index: 1; }
