:root {
  /* 숲·흙·모닥불 팔레트 */
  --bg: #f3efe6;
  --surface: #fffdf8;
  --surface-2: #f8f4ea;
  --ink: #1d2a22;
  --muted: #5e6a5f;
  --line: #e2dbca;
  --forest: #2c5a3c;
  --forest-ink: #ffffff;
  --forest-soft: #e2ebdc;
  --forest-deep: #15281e;
  --ember: #d06a30;
  --ember-ink: #ffffff;
  --ember-soft: #fbe7d8;
  --sand: #efe4cd;
  --clay: #a4532c;
  --clay-soft: #f8e7dc;
  --sky: #2d6380;
  --sky-soft: #e1edf3;
  --night: #0f1f2b;
  --shadow: 0 6px 24px rgba(40, 34, 20, .12);
  --radius: 14px;
  --top-h: 64px;
  --chips-h: 48px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111814; --surface: #19211c; --surface-2: #161d19; --ink: #e9ece4; --muted: #a2ada3; --line: #2c3730;
    --forest: #86c094; --forest-ink: #0f1810; --forest-soft: #213226; --forest-deep: #0c1611; --ember: #f0935a; --ember-ink: #1a0f08; --ember-soft: #3a2518;
    --sand: #2b2820; --clay: #e39a72; --clay-soft: #3a261c; --sky: #8cc3df; --sky-soft: #1d3039; --shadow: 0 6px 24px rgba(0,0,0,.45); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #111814; --surface: #19211c; --surface-2: #161d19; --ink: #e9ece4; --muted: #a2ada3; --line: #2c3730;
  --forest: #86c094; --forest-ink: #0f1810; --forest-soft: #213226; --forest-deep: #0c1611; --ember: #f0935a; --ember-ink: #1a0f08; --ember-soft: #3a2518;
  --sand: #2b2820; --clay: #e39a72; --clay-soft: #3a261c; --sky: #8cc3df; --sky-soft: #1d3039; --shadow: 0 6px 24px rgba(0,0,0,.45); color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg); color: var(--ink);
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
  font-size: 15px; line-height: 1.5; word-break: keep-all; overflow-wrap: anywhere;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; color: inherit; }
a { color: var(--forest); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--forest) 60%, transparent); outline-offset: 2px; }

/* ---------- 버튼 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); cursor: pointer; white-space: nowrap; font-weight: 600; text-decoration: none; color: var(--ink);
}
.btn:hover { border-color: var(--forest); }
.btn.primary { background: var(--forest); color: var(--forest-ink); border-color: var(--forest); }
.btn.ember { background: var(--ember); color: var(--ember-ink); border-color: var(--ember); }
.btn.ember:hover { filter: brightness(1.05); }
.btn.ghost { background: transparent; }
.btn.icon { width: 40px; padding: 0; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--forest); color: var(--forest-ink); font-size: 12px; }

/* ---------- 상단 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 1000; height: var(--top-h);
  display: flex; align-items: center; gap: 16px; padding: 0 20px;
  background: var(--forest-deep); color: #eef2ea; border-bottom: 1px solid rgba(255,255,255,.06);
}
.brand { display: flex; align-items: center; gap: 8px; color: var(--forest); text-decoration: none; font-weight: 800; font-size: 20px; letter-spacing: -.02em; flex: none; }
.topbar .brand, .brand.light { color: #f6efe0; }
.topbar .brand svg, .brand.light svg { color: #9fd0a8; }
.topbar .search input, .topbar .pill { background: rgba(255,255,255,.09); border-color: rgba(255,255,255,.16); color: #f4f1e8; }
.topbar .search input::placeholder { color: rgba(244,241,232,.6); }
.topbar .search input:focus { background: rgba(255,255,255,.14); border-color: #9fd0a8; }
.topbar .pill.set { background: rgba(159,208,168,.18); border-color: #9fd0a8; color: #f4f1e8; }
.topbar .btn.ghost { color: #eef2ea; border-color: rgba(255,255,255,.18); }
.topbar .btn.ghost:hover { border-color: #9fd0a8; }
.topbar .btn.primary { background: var(--ember); border-color: var(--ember); color: var(--ember-ink); }
.topbar .badge { background: var(--ember); color: var(--ember-ink); }
.brand svg { width: 26px; height: 26px; }
.search { flex: 1; display: flex; align-items: center; gap: 8px; max-width: 760px; min-width: 0; }
.search input {
  flex: 1; min-width: 0; height: 42px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2);
}
.search input:focus { border-color: var(--forest); outline: none; background: var(--surface); }
.pill { height: 42px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); cursor: pointer; white-space: nowrap; max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.pill.set { border-color: var(--forest); background: var(--forest-soft); color: var(--ink); font-weight: 600; }
.top-actions { display: flex; gap: 6px; margin-left: auto; }

.chips {
  height: var(--chips-h); display: flex; gap: 8px; align-items: center; padding: 0 20px;
  overflow-x: auto; scrollbar-width: none; background: var(--surface-2); border-bottom: 1px solid var(--line);
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
  cursor: pointer; font-size: 14px;
}
.chip[aria-pressed="true"] { background: var(--forest); color: var(--forest-ink); border-color: var(--forest); font-weight: 600; }

/* ---------- 본문 레이아웃 (PC: 목록 + 지도) ---------- */
.layout { display: grid; grid-template-columns: minmax(360px, 440px) 1fr; height: calc(100dvh - var(--top-h) - var(--chips-h)); }
.list-pane { overflow-y: auto; border-right: 1px solid var(--line); background: var(--bg); }
.map-pane { position: relative; }
#map { position: absolute; inset: 0; background: #e8eadf; }
.list-head { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 12px 16px; background: var(--bg); border-bottom: 1px solid var(--line); }
.result-count { margin: 0; font-weight: 700; }
.sort select { height: 34px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); padding: 0 8px; }

.list { list-style: none; margin: 0; padding: 8px 12px; display: grid; gap: 10px; }
.card {
  display: grid; grid-template-columns: 92px 1fr; gap: 12px; padding: 10px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line); cursor: pointer; text-align: left; width: 100%;
}
.card:hover, .card.hl { border-color: var(--forest); box-shadow: var(--shadow); }
.thumb { width: 92px; height: 92px; border-radius: 10px; object-fit: cover; background: var(--forest-soft); display: grid; place-items: center; color: var(--forest); }
.thumb svg { width: 36px; height: 36px; opacity: .7; }
.card h3 { margin: 0 0 2px; font-size: 16px; line-height: 1.35; }
.card .loc { margin: 0; color: var(--muted); font-size: 13px; }
.card .intro { margin: 4px 0 0; font-size: 13px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.tag { font-size: 12px; padding: 1px 8px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); }
.tag.price-need { background: var(--sand); border-color: transparent; color: var(--ink); }
.tag.price-ok { background: var(--forest-soft); border-color: transparent; color: var(--forest); font-weight: 600; }
.tag.warn { background: var(--clay-soft); border-color: transparent; color: var(--clay); font-weight: 600; }
.tag.online { background: var(--sky-soft); border-color: transparent; color: var(--sky); }
.more { display: flex; margin: 4px auto 16px; }
.notice { margin: 12px; padding: 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.notice.error { border-color: var(--clay); background: var(--clay-soft); }
.notice h3 { margin: 0 0 4px; font-size: 16px; }
.notice p { margin: 0 0 10px; color: var(--muted); }
.notice .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.source-foot { padding: 8px 16px 24px; font-size: 12px; color: var(--muted); }

.float { position: absolute; z-index: 500; box-shadow: var(--shadow); }
.research { top: 14px; left: 50%; transform: translateX(-50%); background: var(--surface); }
.locate { right: 12px; bottom: 28px; width: 44px; height: 44px; padding: 0; border-radius: 12px; }
.locate svg { width: 22px; height: 22px; }
.locate.busy { opacity: .6; }

/* 지도 마커 */
.pin { width: 30px; height: 30px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--forest); border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.3); display: grid; place-items: center; }
.pin::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: #fff; }
.pin.active { background: var(--ember); transform: rotate(-45deg) scale(1.2); }
.pin.osm { background: #5b7c65; }
.marker-cluster { background: color-mix(in srgb, #2f5d3a 30%, transparent); border-radius: 50%; }
.marker-cluster div { width: 32px; height: 32px; margin: 4px; border-radius: 50%; background: #2f5d3a; color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.marker-cluster span { line-height: 1; }
.me-dot { width: 16px; height: 16px; border-radius: 50%; background: #2d6aa6; border: 3px solid #fff; box-shadow: 0 0 0 6px rgba(45,106,166,.25); }
.leaflet-popup-content { margin: 12px 14px; font-family: inherit; }
.popup h4 { margin: 0 0 2px; font-size: 15px; }
.popup p { margin: 0 0 8px; color: #5b685e; font-size: 13px; }
.popup .btn { min-height: 32px; font-size: 13px; }

/* ---------- 상세 ---------- */
.detail {
  position: fixed; z-index: 1100; top: calc(var(--top-h) + var(--chips-h)); left: 0; bottom: 0; width: min(440px, 100%);
  background: var(--surface); border-right: 1px solid var(--line); box-shadow: var(--shadow); overflow-y: auto;
}
.detail-inner { padding: 0 0 32px; outline: none; }
.d-hero { position: relative; height: 200px; background: var(--forest-soft); display: grid; place-items: center; color: var(--forest); }
.d-hero img { width: 100%; height: 100%; object-fit: cover; }
.d-hero svg { width: 56px; height: 56px; opacity: .6; }
.d-close { position: absolute; top: 10px; left: 10px; background: var(--surface); box-shadow: var(--shadow); }
.d-actions { position: absolute; top: 10px; right: 10px; display: flex; gap: 6px; }
.d-actions .btn { background: var(--surface); box-shadow: var(--shadow); }
.d-body { padding: 16px 18px; display: grid; gap: 18px; }
.d-title h2 { margin: 0; font-size: 22px; letter-spacing: -.02em; line-height: 1.3; }
.d-title p { margin: 4px 0 0; color: var(--muted); }
.d-section h3 { margin: 0 0 8px; font-size: 15px; }
.d-section p { margin: 0; }
.info-types { display: grid; gap: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.info-row { display: grid; grid-template-columns: 96px 1fr; gap: 10px; padding: 10px 12px; border-top: 1px solid var(--line); font-size: 14px; }
.info-row:first-child { border-top: 0; }
.info-row dt { font-weight: 700; }
.info-row dd { margin: 0; }
.info-row .meta { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.status { display: inline-block; font-size: 12px; font-weight: 700; padding: 1px 8px; border-radius: 6px; }
.status.ok { background: var(--forest-soft); color: var(--forest); }
.status.need { background: var(--sand); color: var(--ink); }
.status.none { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.status.warn { background: var(--clay-soft); color: var(--clay); }
.price-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.price-table th, .price-table td { text-align: left; padding: 8px 6px; border-top: 1px solid var(--line); vertical-align: top; }
.price-table .amt { font-weight: 800; white-space: nowrap; }
.book { display: grid; gap: 8px; }
.book .btn { width: 100%; justify-content: space-between; min-height: 48px; border-radius: 12px; }
.book .btn small { font-weight: 500; opacity: .8; }
.book-note { font-size: 13px; color: var(--muted); background: var(--surface-2); border: 1px dashed var(--line); border-radius: 10px; padding: 10px 12px; }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 6px 10px; margin: 0; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.prose { white-space: pre-line; font-size: 14px; color: var(--ink); }
.prose.clamp { display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.linkish { background: none; border: 0; padding: 0; color: var(--forest); cursor: pointer; font-weight: 600; text-decoration: underline; }
.skeleton { height: 14px; border-radius: 6px; background: linear-gradient(90deg, var(--surface-2), var(--line), var(--surface-2)); background-size: 200% 100%; animation: sk 1.2s infinite; }
@keyframes sk { to { background-position: -200% 0; } }

/* ---------- 추천 점수·후기 ---------- */
.score-line { margin: 0 0 2px; font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 2px; }
.score-line .star { color: var(--ember); }
.score-line b { color: var(--ink); }
.score-box { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; background: var(--surface-2); display: grid; gap: 10px; }
.score-big { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.score-big b { font-size: 34px; line-height: 1; letter-spacing: -.02em; }
.score-big > span:not(.stars) { color: var(--muted); font-weight: 600; }
.stars { position: relative; display: inline-block; font-size: 20px; line-height: 1; letter-spacing: 2px; margin-left: 6px; }
.stars-bg { color: var(--line); }
.stars-fg { position: absolute; inset: 0 auto 0 0; overflow: hidden; white-space: nowrap; color: var(--ember); }
.score-note { margin: 0; font-size: 13px; color: var(--muted); }
.score-parts { margin: 0; display: grid; gap: 6px; }
.sp-row { display: grid; grid-template-columns: 150px 1fr; align-items: center; gap: 8px; font-size: 14px; }
.sp-row dt { white-space: nowrap; }
.sp-row dt small { color: var(--muted); font-size: 11px; }
.sp-row dd { margin: 0; display: flex; align-items: center; gap: 8px; }
.sp-bar { flex: 1; height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; }
.sp-bar span { display: block; height: 100%; background: var(--forest); border-radius: 99px; }
.sp-val { width: 28px; text-align: right; font-weight: 700; font-size: 13px; }
.sp-none { color: var(--muted); font-size: 13px; }
.score-how summary { cursor: pointer; font-weight: 600; color: var(--forest); font-size: 14px; }
.score-how ul { margin: 8px 0 0; padding-left: 18px; font-size: 13px; color: var(--muted); display: grid; gap: 4px; }
.score-how p { margin: 6px 0 0; font-size: 12px; color: var(--muted); }
.review-links { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 8px; }
.review-links .btn { border-radius: 12px; font-size: 14px; padding: 0 8px; }
@media (max-width: 380px) { .review-links { grid-template-columns: 1fr; } }

/* ---------- 내 기준 ---------- */
.crit-bar { padding: 0 16px 10px; background: var(--bg); border-bottom: 1px solid var(--line); }
.list-pane .list-head { border-bottom: 0; }
.crit-btn { width: 100%; height: 38px; border-radius: 10px; border: 1px dashed var(--forest); background: var(--forest-soft); color: var(--forest); font-weight: 700; cursor: pointer; }
.crit-btn.set { border-style: solid; background: var(--surface); }
.crit-banner { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; padding: 14px; border-radius: var(--radius); background: var(--ember-soft); border: 1px solid color-mix(in srgb, var(--ember) 30%, var(--line)); }
.crit-banner b { font-size: 15px; }
.crit-banner p { margin: 4px 0 0; font-size: 13px; color: var(--muted); }
.crit-cta { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; }
.crit-cta p { margin: 0; font-size: 14px; }
.crit-presets { display: flex; gap: 6px; flex-wrap: wrap; }
.crit-rows { display: grid; gap: 8px; }
.crit-row { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin: 0; display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; }
.crit-row legend { float: left; padding: 0; display: grid; gap: 2px; }
.crit-row legend small { color: var(--muted); font-size: 12px; font-weight: 400; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.seg label { cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: inline-block; padding: 7px 10px; font-size: 13px; font-weight: 600; color: var(--muted); }
.seg label + label span { border-left: 1px solid var(--line); }
.seg input:checked + span { background: var(--forest); color: var(--forest-ink); }
.seg input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--forest) 50%, transparent); outline-offset: -3px; }
.lv { font-size: 11px; font-weight: 700; padding: 0 6px; border-radius: 6px; margin-left: 2px; white-space: nowrap; }
.lv2 { background: var(--ember-soft); color: var(--ember); }
.lv1 { background: var(--forest-soft); color: var(--forest); }
.lv0 { background: var(--surface-2); color: var(--muted); }
.sp-row.off { opacity: .55; }
@media (max-width: 480px) { .crit-row { grid-template-columns: 1fr; } .crit-banner, .crit-cta { grid-template-columns: 1fr; } }

/* ---------- 찜·최근 본 ---------- */
.mode-tabs { display: flex; gap: 4px; padding: 10px 16px 0; background: var(--bg); }
.mode-tab { flex: 1; height: 36px; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; cursor: pointer; font-weight: 600; color: var(--muted); }
.mode-tab[aria-selected="true"] { background: var(--forest); border-color: var(--forest); color: var(--forest-ink); }
.mode-tab .cnt { font-weight: 700; opacity: .85; }
.list-pane .list-head { top: 0; }
.btn.small { min-height: 32px; padding: 0 10px; font-size: 13px; }
.card-wrap { position: relative; }
.card-wrap .card { padding-right: 48px; }
.fav-btn { display: inline-flex; align-items: center; justify-content: center; gap: 4px; cursor: pointer; border: 1px solid var(--line); background: var(--surface); color: var(--muted); }
.fav-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.fav-btn[aria-pressed="true"] { color: #d64545; border-color: color-mix(in srgb, #d64545 40%, var(--line)); }
.fav-btn[aria-pressed="true"] svg { fill: currentColor; }
.fav-btn.on-card { position: absolute; z-index: 1; top: 8px; right: 8px; width: 36px; height: 36px; border-radius: 50%; }
.fav-btn.in-detail { min-height: 40px; padding: 0 12px; border-radius: 999px; font-weight: 600; box-shadow: var(--shadow); }
.hd-heart { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.toast { position: fixed; z-index: 1300; left: 50%; bottom: calc(80px + env(safe-area-inset-bottom)); transform: translateX(-50%); max-width: calc(100% - 32px);
  padding: 10px 16px; border-radius: 12px; background: var(--ink); color: var(--bg); font-size: 14px; font-weight: 600; box-shadow: var(--shadow); text-align: center; }

/* ---------- 시트(다이얼로그) ---------- */
.sheet { border: 0; padding: 0; border-radius: 18px; width: min(520px, calc(100% - 32px)); max-height: 86dvh; background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.sheet::backdrop { background: rgba(20, 26, 22, .45); }
.sheet form { padding: 20px; display: grid; gap: 14px; }
.sheet h2 { margin: 0; font-size: 19px; }
.sheet .hint { margin: 0; color: var(--muted); font-size: 13px; }
.sheet .err { margin: 0; color: var(--clay); font-weight: 600; font-size: 14px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row2 label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.row2 input { height: 44px; border-radius: 10px; border: 1px solid var(--line); padding: 0 10px; background: var(--surface-2); }
.stepper { display: grid; grid-template-columns: 1fr 40px 40px 40px; align-items: center; gap: 6px; }
.stepper button { height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-size: 18px; }
.stepper output { text-align: center; font-weight: 700; }
.sheet-actions { display: flex; justify-content: space-between; gap: 8px; position: sticky; bottom: 0; background: var(--surface); padding-top: 8px; }
.fgroup { border: 0; padding: 0; margin: 0; }
.fgroup legend { font-weight: 700; margin-bottom: 8px; }
.fgroup .opts { display: flex; flex-wrap: wrap; gap: 8px; }
.fgroup label.opt { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); cursor: pointer; font-size: 14px; }
.fgroup label.opt:has(input:checked) { background: var(--forest-soft); border-color: var(--forest); font-weight: 600; }
.fgroup input { accent-color: var(--forest); }
.fgroup .desc { margin: 6px 0 0; color: var(--muted); font-size: 12px; }
#aboutBody { display: grid; gap: 10px; font-size: 14px; }
#aboutBody h3 { margin: 8px 0 0; font-size: 15px; }
#aboutBody p, #aboutBody ul { margin: 0; }
#aboutBody ul { padding-left: 18px; }

.view-toggle { display: none; }

/* ---------- 모바일 ---------- */
@media (max-width: 860px) {
  :root { --top-h: 112px; }
  .topbar { flex-wrap: wrap; height: auto; min-height: var(--top-h); padding: 8px 16px; gap: 8px; align-content: center; }
  .brand { font-size: 18px; }
  .top-actions { order: 2; }
  .search { order: 3; flex-basis: 100%; max-width: none; }
  .search input { height: 40px; }
  .pill { height: 40px; max-width: 42%; padding: 0 10px; font-size: 13px; }
  .search .btn.primary { min-height: 40px; padding: 0 12px; }
  .top-actions .hd-label { display: none; }
  .top-actions .btn { padding: 0 10px; }
  .chips { padding: 0 16px; }
  .layout { grid-template-columns: 1fr; }
  .layout[data-view="map"] .list-pane { display: none; }
  .layout[data-view="list"] .map-pane { display: none; }
  .list-pane { border-right: 0; padding-bottom: 80px; }
  .list { padding: 8px 16px; }
  .view-toggle {
    display: inline-flex; position: fixed; z-index: 1050; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); transform: translateX(-50%);
    height: 46px; padding: 0 22px; align-items: center; border-radius: 999px; border: 0; background: var(--ink); color: var(--bg);
    font-weight: 700; box-shadow: var(--shadow); cursor: pointer;
  }
  .detail { top: 0; width: 100%; border-right: 0; z-index: 1200; padding-bottom: env(safe-area-inset-bottom); }
  .locate { bottom: 84px; }
  .sheet { width: 100%; max-width: none; margin: auto 0 0; border-radius: 18px 18px 0 0; }
  .sheet form { padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
}
@media (max-width: 380px) {
  .card { grid-template-columns: 72px 1fr; }
  .thumb { width: 72px; height: 72px; }
}


/* ================= 페이지 전환 ================= */
body[data-page="home"] .topbar, body[data-page="home"] .chips, body[data-page="home"] .layout,
body[data-page="home"] .view-toggle, body[data-page="home"] .detail { display: none !important; }
body[data-page="map"] .home { display: none; }
body[data-page="home"] { height: auto; }

/* ================= 메인 화면 ================= */
.home { min-height: 100dvh; background: var(--bg); }
.hero { position: relative; isolation: isolate; min-height: min(720px, 92dvh); display: flex; flex-direction: column; color: #f6efe0; overflow: hidden; background: var(--night); }
.hero-art { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; }
.hero::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(11,24,35,.25) 0%, rgba(11,24,35,0) 40%, rgba(14,26,23,.55) 100%); }
.stars circle { animation: twinkle 4s ease-in-out infinite; }
.stars circle:nth-child(3n) { animation-delay: 1.3s; } .stars circle:nth-child(3n+1) { animation-delay: 2.6s; }
@keyframes twinkle { 50% { opacity: .35; } }
.flame { transform-box: fill-box; transform-origin: 50% 100%; animation: flicker 1.6s ease-in-out infinite; }
.flame.f2 { animation-duration: 1.1s; animation-delay: .3s; }
.fire-glow { animation: glow 3s ease-in-out infinite; }
@keyframes flicker { 50% { transform: scaleY(.82) skewX(4deg); } }
@keyframes glow { 50% { opacity: .75; } }
@media (prefers-reduced-motion: reduce) { .stars circle, .flame, .fire-glow { animation: none; } }

.home-nav { display: flex; align-items: center; justify-content: space-between; padding: 18px clamp(16px, 4vw, 48px); }
.home-nav-actions { display: flex; gap: 6px; align-items: center; }
.nav-link { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 14px; border-radius: 999px; border: 1px solid rgba(255,255,255,.2); background: rgba(255,255,255,.06);
  color: #f6efe0; text-decoration: none; font-weight: 600; cursor: pointer; backdrop-filter: blur(6px); }
.nav-link:hover { background: rgba(255,255,255,.14); }
.nav-link.icon { width: 38px; padding: 0; justify-content: center; }
.nav-link .badge { background: var(--ember); color: var(--ember-ink); }

.hero-inner { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 14px; padding: 24px clamp(16px, 6vw, 96px) 180px; max-width: 980px; }
.eyebrow { margin: 0; display: inline-flex; width: fit-content; padding: 4px 12px; border-radius: 999px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.16); font-size: 13px; font-weight: 600; letter-spacing: .01em; }
.hero h1 { margin: 0; font-size: clamp(32px, 5.4vw, 60px); line-height: 1.15; letter-spacing: -.035em; font-weight: 800; text-wrap: balance; text-shadow: 0 2px 24px rgba(0,0,0,.35); }
.lede { margin: 0; max-width: 560px; font-size: clamp(15px, 1.6vw, 18px); color: rgba(246,239,224,.85); }

.home-search { margin-top: 10px; display: grid; grid-template-columns: 1.6fr 1fr auto; gap: 6px; padding: 6px; max-width: 820px;
  background: var(--surface); color: var(--ink); border-radius: 20px; box-shadow: 0 18px 50px rgba(0,0,0,.35); }
.hs-field { display: grid; gap: 2px; padding: 10px 16px; border-radius: 14px; text-align: left; border: 0; background: transparent; cursor: text; min-width: 0; }
.hs-field:hover, .hs-field:focus-within { background: var(--surface-2); }
.hs-field > span { font-size: 12px; font-weight: 700; color: var(--muted); }
.hs-field input { border: 0; outline: none; background: transparent; padding: 0; font-size: 16px; min-width: 0; }
.hs-trip { cursor: pointer; border-left: 1px solid var(--line); border-radius: 0 14px 14px 0; }
.hs-trip b { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hs-go { min-height: 56px; padding: 0 26px; border-radius: 14px; font-size: 16px; }
.hero-links { display: flex; gap: 8px; flex-wrap: wrap; }
.hero-link { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid rgba(255,255,255,.22);
  background: rgba(15,31,43,.35); color: #f6efe0; text-decoration: none; font-size: 14px; font-weight: 600; cursor: pointer; backdrop-filter: blur(6px); }
.hero-link:hover { background: rgba(15,31,43,.6); }

.home-sec { max-width: 1160px; margin: 0 auto; padding: 40px clamp(16px, 4vw, 40px) 8px; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.sec-head h2 { margin: 0; font-size: clamp(19px, 2.2vw, 24px); letter-spacing: -.02em; }

.theme-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.theme { display: grid; gap: 4px; padding: 16px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); text-align: left; cursor: pointer; transition: transform .15s, box-shadow .15s; }
.theme:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--forest); }
.theme .ico { font-size: 26px; line-height: 1; }
.theme b { font-size: 16px; }
.theme small { color: var(--muted); }

.sec-lede { margin: -6px 0 14px; color: var(--muted); font-size: 14px; }
.preset-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.preset-card { position: relative; display: grid; gap: 4px; align-content: start; padding: 16px; border-radius: 16px; text-align: left; cursor: pointer;
  border: 1px solid color-mix(in srgb, var(--ember) 25%, var(--line)); background: linear-gradient(160deg, var(--surface), var(--ember-soft)); transition: transform .15s, box-shadow .15s; }
.preset-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--ember); }
.preset-card.on { border: 2px solid var(--ember); }
.preset-card.custom { background: var(--surface); border-style: dashed; border-color: var(--forest); }
.preset-card.custom:hover { border-style: solid; }
.preset-card .ico { font-size: 26px; line-height: 1; }
.preset-card b { font-size: 16px; margin-top: 2px; }
.preset-card small { color: var(--muted); font-size: 12.5px; line-height: 1.4; }
.preset-card em { font-style: normal; font-weight: 700; color: var(--ember); }
.preset-card .now { position: absolute; top: 12px; right: 12px; font-size: 11px; font-weight: 700; color: var(--ember-ink); background: var(--ember); padding: 2px 8px; border-radius: 99px; }
.top-tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: -4px 0 10px; padding-bottom: 2px; }
.top-tabs::-webkit-scrollbar { display: none; }
.top-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.top-card { display: grid; grid-template-rows: auto 1fr; align-content: start; padding: 0; overflow: hidden; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); text-align: left; cursor: pointer; transition: transform .15s, box-shadow .15s; }
.top-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--forest); }
.top-img { position: relative; display: grid; place-items: center; aspect-ratio: 16 / 10; min-height: 0; overflow: hidden; background: var(--forest-soft); color: var(--forest); }
.top-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.top-img svg { width: 44px; height: 44px; opacity: .6; }
.top-img .rank { position: absolute; top: 8px; left: 8px; min-width: 26px; height: 26px; padding: 0 8px; border-radius: 99px; display: grid; place-items: center; background: rgba(15,31,43,.75); color: #fff; font-weight: 800; font-size: 13px; }
.top-body { display: grid; align-content: start; gap: 2px; padding: 10px 12px 12px; }
.top-score { font-size: 14px; color: var(--muted); }
.top-score .star { color: var(--ember); }
.top-score b { color: var(--ink); font-size: 16px; }
.top-score small { font-size: 11.5px; }
.top-name { font-size: 15px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.top-body > small { color: var(--muted); font-size: 12.5px; }
.region-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.region { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; min-height: 104px; padding: 14px 16px; border-radius: 16px; border: 0; cursor: pointer; text-align: left;
  color: #f6efe0; background: linear-gradient(160deg, var(--r1, #2c5a3c), var(--r2, #15281e)); transition: transform .15s, box-shadow .15s; }
.region::before { content: ""; position: absolute; inset: auto -10% -30% -10%; height: 70%; background: radial-gradient(60% 60% at 30% 100%, rgba(255,255,255,.12), transparent); }
.region:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.region b { font-size: 18px; letter-spacing: -.01em; position: relative; }
.region small { opacity: .85; position: relative; }
.region .tagline { position: absolute; top: 12px; left: 16px; font-size: 12px; opacity: .8; }

.hscroll { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(240px, 280px); gap: 10px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
.mini { display: grid; grid-template-columns: 64px 1fr; gap: 10px; align-items: center; padding: 10px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); text-align: left; cursor: pointer; }
.mini:hover { border-color: var(--forest); }
.mini .thumb { width: 64px; height: 64px; }
.mini b { display: block; font-size: 15px; line-height: 1.3; }
.mini small { color: var(--muted); }
.mini .kind { font-size: 11px; font-weight: 700; color: var(--ember); }

.trust-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.trust-item { padding: 18px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--line); }
.trust-item b { font-size: 16px; }
.trust-item p { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.trust-item em { font-style: normal; font-weight: 700; color: var(--ink); background: var(--sand); padding: 0 4px; border-radius: 4px; }
.home-foot { max-width: 1160px; margin: 40px auto 0; padding: 24px clamp(16px, 4vw, 40px) 40px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.home-foot p { margin: 0 0 4px; }

@media (max-width: 720px) {
  .hero { min-height: auto; }
  .hero-inner { padding: 8px 16px 150px; }
  .home-search { grid-template-columns: 1fr; border-radius: 18px; }
  .hs-trip { border-left: 0; border-top: 1px solid var(--line); border-radius: 0; }
  .hs-go { width: 100%; }
  .home-nav-actions .nav-link:not(.icon):first-child { display: none; }
  .theme-grid { grid-template-columns: repeat(2, 1fr); }
  .preset-grid { grid-template-columns: repeat(2, 1fr); }
  .top-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .region-grid { grid-template-columns: repeat(2, 1fr); }
}
