/* 흙길 v2.1 — 조용한 지도, 큰 숫자. 화면마다 초점(검정 카드) 하나, 나머지는 회색 한 줄.
   토큰은 디자인 캔버스 04 디자인 시스템 · 06 핸드오프 기준. */
:root {
  --bg: #ffffff;
  --bg-page: #f6f5f0;            /* 글 페이지 바탕: 따뜻한 종이색 */
  --bg-subtle: #fafaf8;
  --surface: #ffffff;
  --surface-solid: #ffffff;
  --surface-2: #f4f4f2;          /* 세그먼트 · 아이콘 버튼 바탕 */
  --line: #e8e8e6;
  --line-soft: #f0f0ee;
  --text: #0a0b0a;               /* 잉크: 글자 · 주 버튼 */
  --muted: #5c5f5c;              /* 설명 */
  --faint: #6b6e6b;              /* 라벨 · 단위 (이보다 옅은 글자 금지) */
  --signal: #c4f54a;             /* 라임: 선택 · 새 (위 글자는 항상 잉크) */
  --ok: #137a43;
  --warn: #c8321e;
  --warn-soft: #fcedea;
  --live: #1fa855;
  --accent: var(--text);
  --accent-ink: #ffffff;
  --accent-soft: var(--surface-2);
  --danger: var(--warn);
  --run: var(--text);
  --focus-bg: #0a0b0a;           /* 초점 카드 */
  --focus-text: #ffffff;
  --focus-muted: #a1a4a1;
  --shadow: 0 0 0 1px rgba(10, 11, 10, .06), 0 16px 40px -12px rgba(10, 11, 10, .28);
  --shadow-tool: 0 0 0 1px rgba(10, 11, 10, .08), 0 2px 8px rgba(10, 11, 10, .08);
  --rail: 64px;
  --tabbar: calc(56px + env(safe-area-inset-bottom));
  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0b0a;
    --bg-page: #0e0f0e;
    --bg-subtle: #111211;
    --surface: #141514;
    --surface-solid: #141514;
    --surface-2: #1c1d1c;
    --line: #2a2b2a;
    --line-soft: #202120;
    --text: #f4f4f2;
    --muted: #a1a4a1;
    --faint: #8e918e;
    --ok: #4ade80;
    --warn: #ff7a66;
    --warn-soft: rgba(255, 122, 102, .14);
    --accent-ink: #0a0b0a;
    --focus-bg: #f4f4f2;
    --focus-text: #0a0b0a;
    --focus-muted: #5c5f5c;
    --shadow: 0 0 0 1px rgba(255, 255, 255, .06), 0 16px 40px -12px rgba(0, 0, 0, .7);
    --shadow-tool: 0 0 0 1px rgba(255, 255, 255, .08), 0 2px 8px rgba(0, 0, 0, .5);
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--font);
  font-feature-settings: "tnum" 1;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.005em;
  overflow: hidden;
}
b, strong, h1, h2, h3 { font-weight: 600; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; fill: none; flex: none; }

/* ---------- 사이트 메뉴: 데스크톱 왼쪽 레일 · 모바일 아래 탭바 (nav.js) ---------- */
.rail {
  position: fixed; z-index: 800; left: 0; top: 0; bottom: 0; width: var(--rail);
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 14px 0;
  background: var(--surface-solid); border-right: 1px solid var(--line);
}
.rail .home { width: 36px; height: 36px; border-radius: 9px; background: #0a0b0a; display: grid; place-items: center; margin-bottom: 14px; }
.rail .home svg { width: 22px; height: 22px; stroke: none; }
.rail a.item { width: 52px; padding: 8px 0 6px; border-radius: 8px; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 10.5px; font-weight: 500; color: var(--faint); text-decoration: none; white-space: nowrap; }
.rail a.item svg { width: 20px; height: 20px; stroke-width: 1.7; }
.rail a.item:hover { color: var(--text); }
.rail a.item.on { background: var(--surface-2); color: var(--text); }
.rail a.ext { margin-top: auto; }
body:not(.page) #map { left: var(--rail); }

/* ---------- 지도 ---------- */
#map { position: fixed; inset: 0; background: #eceae2; }
@media (prefers-color-scheme: dark) { #map { background: #1a1b1a; } }
.leaflet-container { font-family: var(--font); background: #eceae2; }
/* 바탕 지도는 채도만 낮춘 자연색: 논밭 초록 · 물 파랑은 남기고 핀이 더 또렷하게 */
.leaflet-tile-pane { filter: saturate(.62) sepia(.06) brightness(1.02); }
@media (prefers-color-scheme: dark) {
  .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) saturate(.4) brightness(.8) contrast(.9); }
}
#map.sky .leaflet-tile-pane { filter: none; }
/* 카카오 일반 지도일 때 타일만 채도를 낮춘다 (위성 · 핀 · 내 위치는 그대로). data-base 는 app.js setBase */
#map[data-base="map"] img[src*="/tile/"] { filter: saturate(.62) sepia(.06) brightness(1.02); }
.leaflet-control-attribution { font-size: 10px; background: rgba(255, 255, 255, .8) !important; color: var(--faint); }
.leaflet-control-attribution a { color: var(--faint); }
.leaflet-control-zoom { display: none; }

/* 가격 핀: 반경 안 = 잉크, 밖 = 흰 바탕, 고른 것 = 라임. 알약은 여기에만 */
.pin { position: relative; width: max-content; transform: translate(-50%, calc(-100% - 5px)); cursor: pointer; white-space: nowrap; }
.leaflet-marker-icon .pin { transform: translate(-50%, calc(-100% - 5px)); }
.pin span { display: block; padding: 3px 8px; border-radius: 999px; background: #fff; color: #5c5f5c; font-size: 11px; font-weight: 600; line-height: 16px; box-shadow: 0 0 0 1px rgba(10, 11, 10, .14), 0 2px 6px rgba(10, 11, 10, .16); }
.pin::after { content: ""; position: absolute; left: 50%; bottom: -4px; width: 8px; height: 8px; margin-left: -4px; transform: rotate(45deg); background: #fff; box-shadow: 1px 1px 0 0 rgba(10, 11, 10, .14); }
.pin.in span { background: #0a0b0a; color: #fff; font-size: 12px; box-shadow: 0 0 0 1px #0a0b0a, 0 2px 6px rgba(10, 11, 10, .2); }
.pin.in::after { background: #0a0b0a; box-shadow: none; }
.pin.fav span::before { content: "★ "; }
/* 기한 있는데 아직 신청 0명: 핀 오른쪽 위 라임 점 */
.pin.zero span { position: relative; }
.pin.zero span::after { content: ""; position: absolute; right: -3px; top: -3px; width: 9px; height: 9px; border-radius: 50%; background: var(--signal); box-shadow: 0 0 0 2px #fff; }
.pin.sel span { background: var(--signal); color: #0a0b0a; font-size: 13px; padding: 4px 10px; box-shadow: 0 0 0 1.5px #0a0b0a, 0 4px 12px rgba(10, 11, 10, .25); }
.pin.sel::after { background: var(--signal); box-shadow: 1.5px 1.5px 0 0 #0a0b0a; }
.pin.hov span { transform: scale(1.12); box-shadow: 0 0 0 1.5px #0a0b0a, 0 4px 12px rgba(10, 11, 10, .3); }
.pin span { transition: transform .12s ease; }
.pin.off { display: none; }
/* 멀리서 볼 때(OSM): 숫자 대신 점 */
.far .pin span { width: 10px; height: 10px; padding: 0; font-size: 0; }
.far .pin::after { display: none; }
.far .pin { transform: translate(-50%, -50%); }

.me-hint { position: relative; display: inline-flex; align-items: center; gap: 6px; padding: 7px 11px; border: 0; border-radius: 9px; background: #0a0b0a; color: #fff; font-family: inherit; font-size: 12.5px; font-weight: 500; line-height: 1.2; white-space: nowrap; box-shadow: 0 6px 16px -6px rgba(10, 11, 10, .45); cursor: pointer; pointer-events: auto; }
.me-hint::after { content: ""; position: absolute; left: 50%; bottom: -4px; width: 9px; height: 9px; margin-left: -4.5px; transform: rotate(45deg); background: #0a0b0a; }
.me-hint svg { width: 14px; height: 14px; fill: none; stroke: var(--signal, #C4F54A); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.me-hint-wrap { padding-bottom: 22px; pointer-events: none; }
.me-hint-anchor .me-hint-wrap { position: absolute; left: 0; bottom: 0; transform: translateX(-50%); }
.me-marker { width: 18px; height: 18px; border-radius: 50%; background: #0a0b0a; border: 3px solid #fff; box-shadow: 0 0 0 7px rgba(10, 11, 10, .14), 0 2px 6px rgba(0, 0, 0, .25); }

/* ---------- 목록 패널: 레일 옆에 붙임 ---------- */
.panel {
  position: fixed; z-index: 500;
  top: 0; bottom: 0; left: var(--rail); width: 400px;
  display: flex; flex-direction: column;
  background: var(--surface-solid);
  border-right: 1px solid var(--line);
  overflow: hidden;
}
.grabber { display: none; }

/* 하위 메뉴: 밑줄 탭 */
.subtabs { display: flex; gap: 20px; margin: 20px 24px 0; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.subtabs::-webkit-scrollbar { display: none; }
.subtabs a { flex: none; padding-bottom: 10px; font-size: 14px; font-weight: 500; color: var(--faint); text-decoration: none; }
.subtabs a:hover { color: var(--text); }
.subtabs a.on { color: var(--text); font-weight: 600; box-shadow: inset 0 -2px 0 var(--text); }

.phead { padding: 22px 24px 0; display: grid; gap: 6px; }
.phead-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.phead h1 { margin: 0; font-size: 34px; line-height: 1.1; letter-spacing: -0.035em; }
.phead h1 small { font-size: 16px; font-weight: 500; color: var(--faint); margin-left: 2px; letter-spacing: 0; }
.pdesc { margin: 0; font-size: 14px; line-height: 1.5; color: var(--muted); }
.icon-btns { display: flex; gap: 6px; }
.icon-btn { position: relative; width: 36px; height: 36px; border: 0; border-radius: 9px; background: var(--surface-2); display: grid; place-items: center; cursor: pointer; }
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn.on { background: var(--text); color: var(--bg); }
.icon-btn .badge { position: absolute; top: 5px; right: 5px; width: 7px; height: 7px; border-radius: 50%; background: var(--signal); box-shadow: 0 0 0 1.5px var(--text); }
.icon-btn:disabled { cursor: default; }
.icon-btn.running svg { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.link-u { border: 0; background: none; padding: 0; color: var(--text); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-size: inherit; }

/* 공유 상태: 평소엔 숨기고 수집 중 · 실패일 때만 띠 */
.status { display: flex; align-items: center; gap: 8px; margin: 14px 24px 0; padding: 0 12px; height: 34px; border-radius: 8px; font-size: 12.5px; }
.status .dot { width: 6px; height: 6px; border-radius: 50%; flex: none; }
.status.running { background: #0a0b0a; color: #fff; }
.status.running .dot { background: var(--signal); animation: pulse 1.2s ease-in-out infinite; }
.status.error { background: var(--warn-soft); color: var(--warn); font-weight: 500; }
.status.error .dot { background: var(--warn); }
@keyframes pulse { 50% { transform: scale(1.6); opacity: .45; } }

.history-banner { margin: 10px 24px 0; padding: 8px 12px; border-radius: 8px; background: var(--surface-2); font-size: 13px; display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.history-banner button { border: 0; background: none; color: inherit; font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

.search { display: flex; align-items: center; gap: 10px; padding: 0 12px; height: 40px; border-radius: 8px; background: var(--bg-subtle); box-shadow: inset 0 0 0 1px var(--line); color: var(--faint); }
.search input { flex: 1; border: 0; background: none; outline: none; font-size: 14px; color: var(--text); min-width: 0; }
.panel .search { margin: 16px 24px 0; }

.kind-seg { display: grid; grid-template-columns: 1fr 1fr; margin: 18px 24px 0; padding: 3px; border-radius: 10px; background: var(--surface-2); }
.kind-seg button { border: 0; background: none; height: 34px; border-radius: 8px; font-size: 14px; font-weight: 500; color: var(--muted); cursor: pointer; }
.kind-seg button b { font-weight: 500; font-size: 12.5px; margin-left: 3px; color: var(--faint); }
.kind-seg button.on { background: var(--surface-solid); color: var(--text); font-weight: 600; box-shadow: 0 1px 2px rgba(10, 11, 10, .12); }

/* 필터: 필터 버튼을 눌렀을 때만 펼침 */
.filters { margin: 14px 24px 0; padding: 14px 0 4px; border-top: 1px solid var(--line-soft); display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.filters .lbl { font-size: 12px; color: var(--faint); margin-bottom: -4px; }
.row { display: flex; gap: 6px; }
.row.between { justify-content: space-between; align-items: center; }
select {
  flex: 1; min-width: 0; height: 36px; padding: 0 28px 0 10px; border-radius: 8px; border: 0;
  background: var(--surface-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b6e6b' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M7 10l5 5 5-5'/%3E%3C/svg%3E") no-repeat right 8px center / 14px;
  appearance: none; -webkit-appearance: none; font-size: 13px; cursor: pointer;
}
select.ghost { flex: none; background-color: transparent; font-weight: 500; }
.switch { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; user-select: none; }
.switch input { display: none; }
.switch .track { width: 34px; height: 20px; border-radius: 999px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); position: relative; transition: background .2s; }
.switch .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s; }
.switch input:checked + .track { background: var(--text); }
.switch input:checked + .track::after { transform: translateX(14px); }
.switch.disabled { opacity: .4; pointer-events: none; }
.radius { display: flex; gap: 2px; padding: 2px; border-radius: 8px; background: var(--surface-2); }
.radius button { flex: 1; border: 0; height: 28px; border-radius: 6px; background: none; font-size: 12.5px; font-weight: 500; cursor: pointer; color: var(--faint); }
.radius button.on { background: var(--surface-solid); color: var(--text); font-weight: 600; box-shadow: 0 1px 2px rgba(10, 11, 10, .12); }
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips button { flex: none; border: 0; height: 28px; border-radius: 6px; padding: 0 10px; font-size: 12.5px; font-weight: 500; cursor: pointer; background: var(--surface-solid); box-shadow: inset 0 0 0 1px var(--line); }
.chips button b { margin-left: 3px; font-weight: 500; color: var(--faint); }
.chips button.on { background: var(--text); color: var(--bg); box-shadow: none; }
.chips button.on b { color: inherit; opacity: .7; }

.count { padding: 12px 24px 0; font-size: 12.5px; color: var(--faint); }
.count:empty { display: none; }
.count b { color: var(--text); font-weight: 600; }
.count .gone { color: var(--warn); }

/* ---------- 목록: 주소 한 줄 + 회색 한 줄, 굵은 숫자는 오른쪽 거리 하나 ---------- */
.list { list-style: none; margin: 8px 0 0; padding: 0 24px 10px; overflow-y: auto; flex: 1; overscroll-behavior: contain; }
.item { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line-soft); cursor: pointer; }
.item .th, .peek .th { position: relative; overflow: hidden; }
.item .th svg, .peek .th svg { position: absolute; inset: 0; width: 100%; height: 100%; stroke: none; }
.item .th { flex: none; width: 52px; height: 52px; border-radius: 8px; background: #d9dccf center / cover no-repeat; box-shadow: inset 0 0 0 1px rgba(10, 11, 10, .06); }
.item .txt { flex: 1; min-width: 0; display: grid; gap: 3px; }
.item .addr { font-size: 15px; font-weight: 500; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .meta i { display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 5px; vertical-align: 1px; }
.item .meta { font-size: 13px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* 경쟁 칩: 아직 0명은 라임, 경쟁 낮음은 진한 회색 바탕, 1·2순위가 찬 곳은 흐리게 */
.item .cmp { justify-self: start; font-size: 11.5px; font-weight: 600; line-height: 1.5; padding: 1px 7px; border-radius: 5px; background: var(--surface-2); color: var(--muted); }
.item .cmp.zero { background: var(--signal); color: #0a0b0a; }
.item .cmp.low { color: var(--text); }
.item .cmp.none { background: none; padding: 0; font-weight: 500; color: var(--faint); }
.item .dist { flex: none; font-size: 16px; font-weight: 600; letter-spacing: -0.02em; text-align: right; }
.item .dist small { font-size: 12px; font-weight: 500; color: var(--faint); margin-left: 2px; }
.item .dist.out { color: var(--faint); font-weight: 500; }
.item:hover .addr { text-decoration: underline; text-underline-offset: 3px; }
.item.active .addr { font-weight: 600; }
.item.active .addr::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: var(--signal); box-shadow: 0 0 0 1.5px #0a0b0a; vertical-align: 1px; }
.item .fav { color: var(--text); margin-right: 4px; }
.more { display: block; width: 100%; margin: 12px 0; height: 40px; border-radius: 8px; border: 0; background: var(--surface-2); font-weight: 500; cursor: pointer; }
.empty { list-style: none; text-align: center; color: var(--muted); padding: 40px 10px; font-size: 14px; }
.empty b { display: block; color: var(--text); font-size: 15px; margin-bottom: 4px; }

/* 광고 (카카오 애드핏): 목록과 바닥 사이 고정 자리 */
/* 광고: 지도 아래에 띄운 카드 하나. 패널 오른쪽 20 · 지도 도구 왼쪽 20 사이를 채우고, 안에 728×90 (좁으면 320×50) */
.ad { position: fixed; z-index: 400; left: calc(var(--rail) + 420px); right: 84px; bottom: 20px; box-sizing: border-box; padding: 8px; display: flex; align-items: center; border-radius: 14px; background: var(--surface-solid); box-shadow: 0 0 0 1px rgba(10, 11, 10, .06), 0 10px 28px -10px rgba(10, 11, 10, .3); }
.ad[hidden] { display: none; }
.ad.placeholder::before { content: "광고 자리 · " attr(data-size); display: grid; place-items: center; width: var(--ad-w, 728px); height: var(--ad-h, 90px); border-radius: 8px; border: 1px dashed var(--line); color: var(--faint); font-size: 12px; }
.foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 24px 12px; font-size: 11.5px; color: var(--faint); }
.foot label { display: flex; align-items: center; gap: 6px; }
.foot select { height: 28px; font-size: 11.5px; max-width: 96px; background-color: transparent; padding-left: 0; }
.foot a { color: var(--faint); }

/* ---------- 지도 도구: 오른쪽 아래 한 묶음 ---------- */
.map-tools { position: fixed; z-index: 450; right: 20px; bottom: 20px; display: flex; flex-direction: column; border-radius: 10px; background: var(--surface-solid); box-shadow: var(--shadow-tool); overflow: hidden; }
.map-tools button { width: 44px; height: 40px; border: 0; background: none; display: grid; place-items: center; cursor: pointer; font-size: 11.5px; font-weight: 500; color: var(--muted); }
.map-tools button + button { border-top: 1px solid var(--line-soft); }
.map-tools button svg { width: 18px; height: 18px; stroke-width: 1.8; color: var(--text); }
.map-tools button.on { background: var(--text); color: var(--bg); }
.map-tools svg circle[r="2"] { fill: currentColor; }

.pick-banner { position: fixed; z-index: 700; top: 16px; left: 50%; transform: translateX(-50%); padding: 8px 8px 8px 16px; border-radius: 10px; background: #0a0b0a; color: #fff; font-weight: 500; font-size: 14px; box-shadow: var(--shadow); display: flex; gap: 12px; align-items: center; }
.pick-banner button { border: 0; border-radius: 7px; padding: 6px 12px; background: #fff; color: #0a0b0a; font-weight: 600; cursor: pointer; }
body.picking #map { cursor: crosshair; }
body.picking .panel, body.picking .detail { opacity: .35; pointer-events: none; }

/* ---------- 초점 카드 (.focus): 화면마다 하나 ---------- */
.focus { background: var(--focus-bg); color: var(--focus-text); border-radius: 16px; }
.focus .muted, .focus small { color: var(--focus-muted); }
.focus .num { color: var(--signal); }
@media (prefers-color-scheme: dark) { .focus .num { color: #0a0b0a; background: var(--signal); padding: 0 6px; border-radius: 6px; } }
.btn-on-focus { display: grid; place-items: center; height: 44px; padding: 0 14px; border-radius: 10px; background: var(--focus-text); color: var(--focus-bg) !important; font-size: 14px; font-weight: 600; text-decoration: none; border: 0; cursor: pointer; }
.btn-ghost-focus { display: grid; place-items: center; height: 44px; padding: 0 14px; border-radius: 10px; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--focus-text) 24%, transparent); color: var(--focus-text) !important; font-size: 14px; font-weight: 500; text-decoration: none; border: 0; background: none; cursor: pointer; }

/* 매물 상세 카드 (지도 오른쪽 위에 뜸) */
.detail { position: fixed; z-index: 600; right: 20px; top: 20px; width: 360px; max-height: calc(100vh - 40px); overflow: auto; overflow-x: hidden; padding: 18px 20px 20px; display: grid; gap: 14px; box-shadow: 0 20px 48px -16px rgba(10, 11, 10, .5); }
.detail .d-thumb { position: relative; margin: -18px -20px 0; height: 150px; border-radius: 16px 16px 0 0; background: #55633d center / cover no-repeat; overflow: hidden; }
.detail .d-thumb svg { position: absolute; inset: 0; width: 100%; height: 100%; stroke: none; }
.detail .d-thumb .tag { position: absolute; left: 12px; bottom: 10px; font-size: 11px; font-weight: 500; color: #fff; background: rgba(10, 11, 10, .6); padding: 3px 8px; border-radius: 6px; }
.detail .d-x { z-index: 1; }
.detail .d-top { display: flex; align-items: center; gap: 6px; padding-right: 34px; font-size: 12.5px; }
.detail .d-x { position: absolute; top: 10px; right: 10px; width: 30px; height: 30px; border: 0; border-radius: 8px; background: rgba(10, 11, 10, .55); color: #fff; display: grid; place-items: center; cursor: pointer; }
.detail .d-x svg { width: 14px; height: 14px; }
.detail h3 { margin: 0; font-size: 20px; line-height: 1.3; letter-spacing: -0.02em; word-break: keep-all; }
.detail .d-sub { margin: 4px 0 0; font-size: 13px; line-height: 1.5; }
.detail .d-price { display: flex; align-items: baseline; gap: 6px; font-size: 13px; }
.detail .d-price .num { font-size: 36px; line-height: 1; font-weight: 600; letter-spacing: -0.04em; }
.detail .d-price .u { font-size: 15px; }
.detail .d-actions { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.detail .d-actions .d-page { grid-column: 1 / -1; }
.detail h3 a { color: inherit; text-decoration: none; }
.detail h3 a span { color: var(--focus-muted); font-weight: 500; }
.detail h3 a:hover span { color: var(--focus-text); }
.detail .d-more { display: grid; gap: 4px; font-size: 12.5px; line-height: 1.5; }
.detail .d-more p { margin: 0; }
.detail .d-more a, .detail .d-more button { color: var(--focus-muted); background: none; border: 0; padding: 0; font-size: 12.5px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.detail .pay-est b { color: var(--focus-text); font-weight: 600; }
.detail .due { color: #ff7a66; font-weight: 600; }
.detail .d-cmp b { color: var(--focus-text); font-weight: 600; }
@media (prefers-color-scheme: dark) { .detail .due { color: var(--warn); } }
.detail .note { font-size: 12px; }
.star { border: 0; background: none; padding: 0; cursor: pointer; }
.detail .d-share { margin-left: auto; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 7px; background: color-mix(in srgb, var(--focus-text) 12%, transparent); color: var(--focus-text); display: grid; place-items: center; cursor: pointer; }
.detail .d-share svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.detail .star { height: 28px; padding: 0 10px; border-radius: 7px; background: color-mix(in srgb, var(--focus-text) 12%, transparent); color: var(--focus-text); font-size: 12px; font-weight: 500; }
.detail .star.on { background: var(--signal); color: #0a0b0a; }

body.no-outline .detail .d-thumb svg { display: none; }

/* 핀에 마우스를 올리면 뜨는 미리보기 */
.peek { position: fixed; z-index: 650; pointer-events: none; transform: translate(-50%, calc(-100% - 12px)); width: 250px; display: flex; gap: 10px; padding: 8px; border-radius: 12px; background: var(--surface-solid); box-shadow: var(--shadow); }
.peek .th { flex: none; width: 64px; height: 64px; border-radius: 8px; background: #d9dccf center / cover no-repeat; }
.peek .t { min-width: 0; display: grid; align-content: center; gap: 2px; }
.peek b { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.peek span { font-size: 12px; color: var(--faint); }
.peek .p { font-size: 14px; color: var(--text); font-weight: 600; }

/* ---------- 대화상자 ---------- */
dialog { border: 0; padding: 0; border-radius: 16px; background: var(--surface-solid); color: var(--text); box-shadow: var(--shadow); width: min(440px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(10, 11, 10, .35); }
.loc { padding: 22px; display: grid; gap: 10px; }
.loc h2 { margin: 0; font-size: 20px; letter-spacing: -0.02em; }
.loc .hint { margin: -4px 0 4px; font-size: 13px; color: var(--muted); }
.loc .lbl { font-size: 12px; color: var(--faint); margin-top: 4px; }
.opt { display: flex; align-items: center; gap: 10px; padding: 14px; border-radius: 10px; border: 0; background: var(--surface-2); font-size: 14.5px; font-weight: 500; cursor: pointer; text-align: left; }
.opt:hover { box-shadow: inset 0 0 0 1px var(--text); }
.opt svg circle[r="3.2"] { fill: currentColor; }
.addr { display: flex; gap: 6px; }
.addr input { flex: 1; min-width: 0; height: 44px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg-subtle); outline: none; }
.addr input:focus { border-color: var(--text); }
.addr button { border: 0; border-radius: 8px; padding: 0 16px; background: var(--text); color: var(--bg); font-weight: 600; cursor: pointer; }
.results { list-style: none; margin: 0; padding: 0; max-height: 220px; overflow: auto; }
.results li { padding: 10px 12px; border-radius: 8px; cursor: pointer; font-size: 13.5px; }
.results li:hover { background: var(--surface-2); }
.results li.msg { color: var(--muted); cursor: default; }
.actions { display: flex; justify-content: space-between; margin-top: 4px; }
.link { border: 0; background: none; padding: 8px 4px; font-weight: 500; color: var(--muted); cursor: pointer; }
.link.danger { color: var(--warn); }

.toast { position: fixed; z-index: 900; left: 50%; bottom: 28px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; padding: 11px 18px; border-radius: 10px; background: #0a0b0a; color: #fff; font-size: 14px; font-weight: 500; box-shadow: var(--shadow); transition: all .25s ease; max-width: calc(100vw - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 모바일: 아래 탭바 + 그 위 목록 시트 ---------- */
@media (max-width: 760px) {
  .rail {
    top: auto; right: 0; bottom: 0; width: auto; height: var(--tabbar);
    flex-direction: row; justify-content: space-around; align-items: stretch; gap: 0;
    padding: 0 0 env(safe-area-inset-bottom); border-right: 0; border-top: 1px solid var(--line);
  }
  .rail .home, .rail a.ext { display: none; }
  .rail a.item { flex: 1; width: auto; border-radius: 0; justify-content: center; padding: 0; }
  .rail a.item.on { background: none; font-weight: 600; }
  body:not(.page) #map { left: 0; bottom: var(--tabbar); }

  .panel {
    top: auto; left: 0; right: 0; bottom: var(--tabbar); width: auto;
    border-right: 0; border-radius: 20px 20px 0 0;
    box-shadow: 0 -10px 30px -10px rgba(10, 11, 10, .2);
    height: calc(88dvh - var(--tabbar));
    transform: translateY(calc(100% - var(--peek, 150px)));
    transition: transform .28s cubic-bezier(.2, .8, .2, 1);
  }
  .panel[data-state="half"] { transform: translateY(calc(100% - 55dvh)); }
  .panel[data-state="full"] { transform: translateY(0); }
  .grabber { display: block; width: 100%; height: 22px; border: 0; background: none; padding: 0; cursor: pointer; flex: none; }
  .grabber span { display: block; width: 36px; height: 4px; border-radius: 2px; background: var(--line); margin: 8px auto 0; }
  .subtabs { margin: 4px 20px 0; }
  .phead { padding: 16px 20px 0; }
  .phead h1 { font-size: 28px; }
  .status, .history-banner, .panel .search, .kind-seg, .filters { margin-left: 20px; margin-right: 20px; }
  .count { padding-left: 20px; padding-right: 20px; }
  .list { padding: 0 20px 10px; }
  .foot { padding-left: 20px; padding-right: 20px; }
  .map-tools { right: 12px; bottom: auto; top: max(12px, env(safe-area-inset-top)); }
  .toast { bottom: auto; top: max(16px, env(safe-area-inset-top)); }
  /* 목록 시트(peek) 바로 위에 띄운다. 시트를 끌어올리면 시트가 덮는다 */
  .ad { left: 12px; right: 12px; bottom: calc(var(--tabbar) + var(--peek, 150px) + 12px); border-radius: 12px; }
  .pick-banner { top: max(12px, env(safe-area-inset-top)); }
  .detail { left: 12px; right: 12px; top: auto; bottom: calc(var(--tabbar) + 12px); width: auto; max-height: 70dvh; }
}
