/* ============================================================
   뉴보배 부동산 - 지도 매물검색
   모바일 우선. 브랜드: 보배 블루 #2440C9 + 보배 골드 #FFC942
   ============================================================ */
:root {
  /* 로고 컬러톤: 스카이블루 + 옐로 */
  --sky: #3CB9F2;         /* 로고 원톤 (아이콘·장식) */
  --blue: #0E93DC;        /* 포인트 (버튼·마커·강조, 흰 글자 대비 확보용 진한 스카이블루) */
  --blue-deep: #0A76B4;
  --blue-soft: #E4F4FE;
  --gold: #FFD24A;
  --gold-ink: #5C4300;
  --jeonse: #0E9A76;
  --sale: #232C55;
  --ink: #14182B;
  --sub: #565D73;
  --mut: #9096A8;
  --line: #E4E7F0;
  --bg: #F2F4F9;
  --card: #FFFFFF;
  --r: 12px;
  --hd-h: 58px;
  --panel-w: 400px;
  --cat-h: 0px;      /* 모바일에서만 카테고리 메뉴가 별도 줄(44px) */
  --fbar-h: 54px;
  --shadow: 0 2px 10px rgba(20, 24, 43, .07);
  --shadow-lg: 0 8px 30px rgba(20, 24, 43, .16);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }
html { height: 100%; }
body {
  font-family: "Pretendard Variable", Pretendard, -apple-system, "Malgun Gothic", sans-serif;
  color: var(--ink);
  background: var(--bg);
  word-break: keep-all;
  overflow-wrap: break-word;
  height: 100dvh;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
select {
  font: inherit; color: var(--sub); border: 1px solid var(--line); border-radius: 8px;
  background: #fff; padding: 5px 8px;
}
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 4px; }

/* ------------------------------------------------ header */
#hd {
  position: fixed; inset: 0 0 auto 0; z-index: 60;
  background: #fff; border-bottom: 1px solid var(--line);
}
.hd-inner {
  height: var(--hd-h); display: flex; align-items: center; gap: 10px; padding: 0 14px;
}
.logo { display: flex; align-items: center; gap: 7px; flex-shrink: 0; }
.logo-icon { width: 36px; height: 36px; flex-shrink: 0; }
.logo-img { height: 40px; width: auto; }
.logo-stack { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.1; }
.logo-word {
  font-size: 19px; font-weight: 900; letter-spacing: .01em; color: var(--sky);
  -webkit-text-stroke: 1px var(--gold); paint-order: stroke fill;
}
.logo-sub { font-size: 10px; font-weight: 700; color: var(--sub); letter-spacing: .06em; margin-top: 1px; }
.catmenu {
  display: flex; align-items: center; gap: 2px; margin-left: 14px; min-width: 0;
  overflow-x: auto; scrollbar-width: none;
}
.catmenu::-webkit-scrollbar { display: none; }
.cat-b {
  font-size: 15px; font-weight: 700; color: var(--ink); padding: 8px 11px;
  white-space: nowrap; border-radius: 8px;
}
.cat-b:hover { color: var(--blue); background: var(--blue-soft); }
.cat-b.is-on { color: var(--blue); font-weight: 800; }
.hd-sp { flex: 1; }
/* 로그인/마이페이지 — 매물 종류 메뉴와 같은 글자 크기·굵기 */
.hd-member {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; flex-shrink: 0;
  font-size: 15px; font-weight: 700; color: var(--blue);
  padding: 8px 11px; border-radius: 8px; transition: background .2s;
}
.hd-member:hover { background: var(--blue-soft); }
.hd-member.is-here { background: var(--blue-soft); }
.hd-member svg path { fill: currentColor; }
.hd-blog { display: flex; align-items: center; padding: 3px; border-radius: 9px; line-height: 0; }
.hd-blog:hover { background: var(--bg); }
.hd-btn {
  font-size: 13.5px; font-weight: 700; color: var(--blue);
  border: 1.5px solid var(--blue); border-radius: 9px; padding: 7px 12px; white-space: nowrap;
}
.hd-btn:hover { background: var(--blue-soft); }
.hd-call {
  display: flex; align-items: center; gap: 6px; background: var(--blue); color: #fff;
  font-weight: 800; font-size: 14px; border-radius: 9px; padding: 8px 13px; white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.hd-call:hover { background: var(--blue-deep); }

/* ------------------------------------------------ filter bar */
.fbar {
  height: var(--fbar-h); display: flex; align-items: center; gap: 10px;
  padding: 0 14px 10px; overflow-x: auto; scrollbar-width: none;
}
.fbar::-webkit-scrollbar { display: none; }
.seg {
  display: flex; background: var(--bg); border-radius: 10px; padding: 3px; flex-shrink: 0;
}
.seg-b {
  font-size: 13.5px; font-weight: 600; color: var(--sub); padding: 6px 13px; border-radius: 8px;
  white-space: nowrap;
}
.seg-b.is-on { background: #fff; color: var(--blue); font-weight: 800; box-shadow: var(--shadow); }
.chips { display: flex; gap: 7px; align-items: center; }
.chip {
  display: inline-flex; align-items: center; gap: 4px; white-space: nowrap;
  font-size: 13px; font-weight: 600; color: var(--sub);
  border: 1px solid var(--line); background: #fff; border-radius: 20px; padding: 7px 12px;
}
.chip:hover { border-color: var(--mut); }
.chip.has-v { border-color: var(--blue); color: var(--blue); background: var(--blue-soft); }
.chip-v:not(:empty) { font-style: normal; font-weight: 800; }
.chip-c { opacity: .6; }
.chip-toggle.is-on { border-color: var(--blue); color: var(--blue); background: var(--blue-soft); }
.chip-toggle.is-on::before { content: "✓ "; font-weight: 800; }
.chip-ghost { border-style: dashed; color: var(--mut); }
.chip-sm { display: none; }

/* ------------------------------------------------ layout */
#main { position: fixed; inset: calc(var(--hd-h) + var(--cat-h) + var(--fbar-h)) 0 0 0; display: flex; }
#mapwrap { position: relative; flex: 1; }
/* 주의: 네이버지도가 #map inline position을 relative로 덮어쓰므로
   absolute-inset 대신 명시적 100% 크기로 잡아야 한다 */
#map { position: absolute; inset: 0; width: 100%; height: 100%; background: #DFE5EF; }
.map-note {
  position: absolute; left: 10px; bottom: 10px; z-index: 30;
  font-size: 11.5px; color: var(--sub); background: rgba(255,255,255,.92);
  border-radius: 8px; padding: 5px 9px; box-shadow: var(--shadow); max-width: 75%;
}
.map-listbtn {
  display: none; position: absolute; left: 50%; transform: translateX(-50%); bottom: 22px; z-index: 30;
  background: var(--ink); color: #fff; font-size: 14px; font-weight: 700;
  border-radius: 24px; padding: 11px 20px; box-shadow: var(--shadow-lg);
}
.map-listbtn b { color: var(--gold); }

/* ------------------------------------------------ list panel */
#panel {
  width: var(--panel-w); flex-shrink: 0; background: #fff; border-right: 1px solid var(--line);
  display: flex; flex-direction: column; z-index: 40;
}
.sheet-handle { display: none; }
.panel-top {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 16px; border-bottom: 1px solid var(--line);
}
.panel-top select { margin-left: auto; }
.count { font-size: 14px; color: var(--sub); white-space: nowrap; }
.cluster-tag {
  font-size: 12.5px; font-weight: 700; color: var(--blue); background: var(--blue-soft);
  border-radius: 14px; padding: 5px 10px; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; max-width: 45%;
}
.cluster-tag .x2 { font-weight: 800; margin-left: 2px; }
.count b { color: var(--blue); font-size: 16px; }
.list { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding-bottom: 30px; }

.card {
  display: flex; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line);
  cursor: pointer; text-align: left; width: 100%; background: #fff;
}
.card:hover { background: #FAFBFE; }
.card.is-hl { background: var(--blue-soft); }
.card-img {
  width: 124px; height: 106px; border-radius: 10px; object-fit: cover; flex-shrink: 0;
  background: var(--bg);
}
.card-info { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 3px; }
.card-price { font-size: 16.5px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.card-price .deal { font-size: 12.5px; font-weight: 700; margin-right: 5px; padding: 2px 6px; border-radius: 6px; vertical-align: 2px; }
.deal-월세 { color: var(--blue); background: var(--blue-soft); }
.deal-전세 { color: var(--jeonse); background: #E4F5F0; }
.deal-매매 { color: var(--sale); background: #E9EBF4; }
.card-price .fee { font-size: 11.5px; font-weight: 500; color: var(--mut); margin-left: 6px; }
.card-title { font-size: 13px; font-weight: 500; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-meta { font-size: 13px; color: var(--sub); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-loc { font-size: 12.5px; color: var(--mut); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-loc b { color: var(--sub); font-weight: 600; }
.card-badges { display: flex; gap: 4px; margin-top: 3px; flex-wrap: wrap; }
.bdg {
  font-size: 11px; font-weight: 600; color: var(--sub); background: var(--bg);
  border-radius: 5px; padding: 2.5px 6px; white-space: nowrap;
}
.bdg.hot { color: var(--gold-ink); background: #FFF3D6; }
.list-empty { padding: 60px 30px; text-align: center; color: var(--mut); font-size: 14px; line-height: 1.8; }
.list-empty b { display: block; font-size: 16px; color: var(--sub); margin-bottom: 6px; }

/* ------------------------------------------------ 지도 마커 */
.mk {
  position: absolute; left: 0; top: 0; transform: translate(-50%, -50%);
  cursor: pointer; width: max-content;
}
.mk-pill {
  display: inline-flex; align-items: baseline; gap: 3px;
  background: var(--blue); color: #fff; font-weight: 800; font-size: 12.5px;
  font-variant-numeric: tabular-nums; letter-spacing: -.01em;
  border-radius: 16px; padding: 5px 10px; border: 2px solid #fff;
  box-shadow: 0 3px 8px rgba(20,24,43,.3); white-space: nowrap;
  font-family: "Pretendard Variable", Pretendard, sans-serif;
  transition: transform .12s;
}
.mk-pill .t { font-size: 10.5px; font-weight: 600; opacity: .85; }
.mk:hover .mk-pill { transform: scale(1.12); }
.mk.is-on { z-index: 30; }
.mk.is-on .mk-pill {
  box-shadow: 0 0 0 2.5px var(--gold), 0 6px 14px rgba(20, 24, 43, .35);
  animation: mk-bob .8s ease-in-out infinite;
}
@keyframes mk-bob {
  0%, 100% { transform: translateY(0) scale(1.14); }
  50% { transform: translateY(-8px) scale(1.14); }
}
.mk-월세 .mk-pill { background: var(--blue); }
.mk-전세 .mk-pill { background: var(--jeonse); }
.mk-매매 .mk-pill { background: var(--sale); }
.mk-cl {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 62px; height: 62px; border-radius: 50%;
  background: rgba(14, 147, 220, .92); color: #fff; border: 2.5px solid #fff;
  box-shadow: 0 4px 12px rgba(20,24,43,.3); cursor: pointer;
  font-family: "Pretendard Variable", Pretendard, sans-serif;
  transition: transform .12s;
}
.mk-cl:hover { transform: scale(1.08); }
.mk-cl .n { font-size: 17px; font-weight: 800; line-height: 1.1; }
.mk-cl .d { font-size: 10.5px; font-weight: 600; opacity: .9; max-width: 54px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 겹침 묶음(확대 구간): 동 클러스터보다 작은 숫자 원 */
.mk-cl.mini { width: 44px; height: 44px; }
.mk-cl.mini .n { font-size: 15.5px; }
.mk.is-on .mk-cl { box-shadow: 0 0 0 2.5px var(--gold), 0 6px 14px rgba(20, 24, 43, .35); }
.leaflet-marker-icon.mk-wrap { background: none; border: 0; }

/* ------------------------------------------------ 필터 팝오버 */
.pop-dim { position: fixed; inset: 0; z-index: 70; background: rgba(16,20,38,.35); }
.pop {
  position: fixed; z-index: 71; background: #fff; border-radius: 16px; box-shadow: var(--shadow-lg);
  width: 360px; max-width: calc(100vw - 24px);
  top: calc(var(--hd-h) + var(--cat-h) + var(--fbar-h) + 6px); left: 14px;
  display: flex; flex-direction: column; max-height: 70dvh;
}
.pop-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 6px; font-size: 16px; }
.x { font-size: 22px; color: var(--mut); line-height: 1; padding: 4px 8px; }
.x:hover { color: var(--ink); }
.pop-body { padding: 10px 18px; overflow-y: auto; }
.pop-foot { display: flex; gap: 8px; padding: 12px 18px 16px; border-top: 1px solid var(--line); }
.btn-ghost {
  flex: 1; font-size: 14px; font-weight: 600; color: var(--sub);
  border: 1px solid var(--line); border-radius: 10px; padding: 11px 0;
}
.btn-main {
  flex: 2; font-size: 14px; font-weight: 800; color: #fff; background: var(--blue);
  border-radius: 10px; padding: 11px 0;
}
.btn-main:hover { background: var(--blue-deep); }
.pop-sec { margin: 8px 0 14px; }
.pop-sec > b { display: block; font-size: 13px; color: var(--sub); margin-bottom: 8px; font-weight: 600; }
.opt-grid { display: flex; flex-wrap: wrap; gap: 7px; }
.opt {
  font-size: 13.5px; font-weight: 600; color: var(--sub);
  border: 1px solid var(--line); border-radius: 20px; padding: 8px 13px; background: #fff;
}
.opt.is-on { border-color: var(--blue); color: var(--blue); background: var(--blue-soft); font-weight: 700; }

/* ------------------------------------------------ 상세 */
.detail {
  position: fixed; z-index: 80; background: #fff;
  top: calc(var(--hd-h) + var(--fbar-h)); left: var(--panel-w); bottom: 0;
  width: 480px; max-width: calc(100vw - var(--panel-w));
  border-right: 1px solid var(--line);
  box-shadow: 12px 0 40px rgba(20,24,43,.14);
  display: flex; flex-direction: column;
  animation: dt-in .22s ease;
}
@keyframes dt-in { from { transform: translateX(-24px); opacity: 0; } to { transform: none; opacity: 1; } }
.dt-head {
  display: flex; align-items: center; gap: 8px; padding: 10px 14px;
  border-bottom: 1px solid var(--line); flex-shrink: 0;
}
.dt-back { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; }
.dt-back:hover { background: var(--bg); }
.dt-headtitle { flex: 1; font-size: 14px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dt-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; }

.g-wrap { position: relative; background: #0f1220; }
.g-track {
  display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
  aspect-ratio: 4 / 3; max-height: 380px; width: 100%;
}
.g-track::-webkit-scrollbar { display: none; }
.g-slide {
  position: relative; width: 100%; height: 100%; flex-shrink: 0; scroll-snap-align: center;
}
.g-slide img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in; }
.g-slide-video video { width: 100%; height: 100%; object-fit: contain; background: #0f1220; display: block; }
.g-play {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  color: #fff; filter: drop-shadow(0 2px 9px rgba(0,0,0,.55)); pointer-events: none; line-height: 0;
}
.g-tag {
  position: absolute; left: 10px; top: 10px; font-size: 11.5px; font-weight: 700;
  color: #fff; background: rgba(15,18,32,.62); border-radius: 6px; padding: 3px 9px;
}
.g-cnt {
  position: absolute; right: 10px; bottom: 10px; font-size: 12px; font-weight: 600;
  color: #fff; background: rgba(15,18,32,.6); border-radius: 14px; padding: 4px 10px;
  font-variant-numeric: tabular-nums;
}
/* 배경 없는 사진 넘김 화살표 */
.g-nav {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
  color: #fff; padding: 10px 6px; line-height: 0;
  filter: drop-shadow(0 1px 5px rgba(0,0,0,.55));
}
.g-nav:hover { color: #fff; transform: translateY(-50%) scale(1.12); }
.g-prev { left: 4px; }
.g-next { right: 4px; }
.viewer-nav {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
  color: #fff; padding: 14px 10px; line-height: 0;
  filter: drop-shadow(0 1px 6px rgba(0,0,0,.6));
}
.viewer-nav svg { width: 38px; height: 38px; }
.v-prev { left: 8px; }
.v-next { right: 8px; }

.dt-sec { padding: 18px 20px; border-bottom: 8px solid var(--bg); }
.dt-sec:last-of-type { border-bottom: 0; }
.dt-pricebox .deal { font-size: 13px; padding: 3px 8px; border-radius: 7px; font-weight: 800; }
.dt-price { font-size: 27px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; margin-top: 7px; }
.dt-price small { font-size: 15px; font-weight: 600; color: var(--sub); }
.dt-fee { font-size: 13.5px; color: var(--sub); margin-top: 5px; }
.dt-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.dt-badges .bdg { font-size: 12.5px; padding: 5px 10px; border-radius: 8px; }
.dt-title { font-size: 17px; font-weight: 700; line-height: 1.45; }
.dt-sum { margin-top: 10px; font-size: 14.5px; color: var(--sub); line-height: 1.75; }
.dt-locline { display: flex; align-items: center; gap: 6px; margin-top: 12px; font-size: 13.5px; color: var(--sub); flex-wrap: wrap; }
.loc-pill {
  font-weight: 700; color: var(--blue); background: var(--blue-soft); border-radius: 8px; padding: 4px 9px;
}
.dt-h { font-size: 16px; font-weight: 800; margin-bottom: 14px; }
.spec { width: 100%; border-collapse: collapse; font-size: 14px; }
.spec th {
  text-align: left; font-weight: 600; color: var(--mut); width: 96px;
  padding: 8.5px 0; vertical-align: top; white-space: nowrap;
}
.spec td { color: var(--ink); padding: 8.5px 0; line-height: 1.55; }
.spec tr + tr { border-top: 1px solid #F0F2F7; }
/* 옵션 아이콘 목록 */
.opt-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 16px 10px; }
.opt-item {
  display: flex; align-items: center; gap: 11px;
  font-size: 14px; color: var(--ink); min-width: 0;
}
.opt-item svg { flex-shrink: 0; color: var(--ink); }
.opt-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 상세 설명 (더보기 접기) */
.desc-box { position: relative; }
.desc-box.is-clamp { max-height: 320px; overflow: hidden; }
.desc-box.is-clamp::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 64px;
  background: linear-gradient(rgba(255,255,255,0), #fff);
}
.desc-text {
  white-space: pre-line; font-size: 14.5px; line-height: 1.85; color: var(--ink);
  overflow-wrap: break-word;
}
.desc-more {
  display: block; margin: 12px auto 0; padding: 6px 14px;
  font-size: 14px; font-weight: 600; color: var(--ink); text-decoration: underline; text-underline-offset: 3px;
}
.desc-more:hover { color: var(--blue); }
.geo-box {
  background: var(--bg); border-radius: var(--r); padding: 14px 16px; font-size: 13.5px;
  color: var(--sub); line-height: 1.7;
}
.geo-box b { color: var(--ink); }
.btn-line {
  display: block; width: 100%; text-align: center; margin-top: 12px;
  font-size: 14px; font-weight: 700; color: var(--blue);
  border: 1.5px solid var(--blue); border-radius: 10px; padding: 11px 0; background: #fff;
}
.btn-line:hover { background: var(--blue-soft); }

/* 명함 (실물 명함 이미지, 누르면 전화) */
.namecard {
  display: block; width: 100%; border-radius: 14px; overflow: hidden;
  border: 1px solid var(--line); background: #fff; line-height: 0;
  transition: box-shadow .15s, transform .15s;
}
.namecard img { width: 100%; height: auto; }
.namecard:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.namecard:active { transform: translateY(0); }
.nc-hint {
  margin-top: 10px; text-align: center; font-size: 12.5px; font-weight: 600; color: var(--sub);
  line-height: 1.6;
}
.dt-date { padding: 14px 20px 90px; font-size: 12px; color: var(--mut); }

.dt-cta {
  flex-shrink: 0; display: flex; gap: 8px; padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line); background: #fff;
}
.cta-call {
  flex: 1.5; display: flex; align-items: center; justify-content: center; gap: 7px;
  background: var(--blue); color: #fff; font-size: 15px; font-weight: 800;
  border-radius: 12px; padding: 14px 0;
}
.cta-call:hover { background: var(--blue-deep); }
.cta-sms svg { flex-shrink: 0; }
.cta-sms {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px;
  border: 1.5px solid var(--blue); color: var(--blue); font-size: 15px; font-weight: 700;
  border-radius: 12px; padding: 14px 0;
}
.cta-sms:hover { background: var(--blue-soft); }
.cta-kakao {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px;
  background: #FEE500; color: #3A2929; font-size: 15px; font-weight: 700;
  border-radius: 12px; padding: 14px 0;
}
.cta-kakao svg, .md-btn.kakao svg { flex-shrink: 0; }
.cta-kakao:hover { filter: brightness(.96); }

/* ------------------------------------------------ 사진 뷰어 */
.viewer { position: fixed; inset: 0; z-index: 95; background: #0c0e18; display: flex; flex-direction: column; }
.viewer-x {
  position: absolute; top: 14px; right: 14px; z-index: 2; width: 40px; height: 40px;
  color: #fff; font-size: 26px; background: rgba(255,255,255,.12); border-radius: 50%;
}
.viewer-track {
  flex: 1; display: flex; overflow-x: auto; scroll-snap-type: x mandatory; align-items: center; scrollbar-width: none;
}
.viewer-track::-webkit-scrollbar { display: none; }
.viewer-track img {
  width: 100%; height: 100%; object-fit: contain; flex-shrink: 0; scroll-snap-align: center;
}
.viewer-cnt { position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%); color: #fff; font-size: 13px; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------ 모달 / 토스트 */
.modal-dim { position: fixed; inset: 0; z-index: 90; background: rgba(16,20,38,.45); }
.modal {
  position: fixed; z-index: 91; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 400px; max-width: calc(100vw - 28px); max-height: 84dvh; overflow-y: auto;
  background: #fff; border-radius: 18px; padding: 26px 22px 22px; box-shadow: var(--shadow-lg);
}
.modal-x { position: absolute; top: 12px; right: 12px; }
.md-h { font-size: 18px; font-weight: 800; margin-bottom: 6px; }
.md-p { font-size: 14px; color: var(--sub); line-height: 1.75; margin-bottom: 16px; }
.md-btns { display: flex; flex-direction: column; gap: 8px; }
.md-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 15px; font-weight: 700; border-radius: 12px; padding: 14px 0;
}
.md-btn.call { background: var(--blue); color: #fff; }
.md-btn.sms { border: 1.5px solid var(--blue); color: var(--blue); }
.md-btn.kakao { background: #FEE500; color: #3A2929; }
.md-info { font-size: 13.5px; color: var(--sub); line-height: 2; }
.md-info b { color: var(--ink); }
.md-note { margin-top: 12px; font-size: 12px; color: var(--mut); line-height: 1.7; }
.toast {
  position: fixed; z-index: 99; left: 50%; bottom: 34px; transform: translateX(-50%);
  background: rgba(16,20,38,.92); color: #fff; font-size: 13.5px; border-radius: 12px;
  padding: 12px 18px; box-shadow: var(--shadow-lg); max-width: calc(100vw - 40px); text-align: center;
}

/* ------------------------------------------------ 모바일 */
@media (max-width: 1023px) {
  :root { --cat-h: 44px; --fbar-h: 92px; }
  /* 8개 메뉴가 어떤 화면 폭에서도 한 줄에 다 들어오도록 글자·여백을 화면에 맞춰 줄인다 */
  .catmenu {
    width: 100%; height: var(--cat-h); margin-left: 0; padding: 0 6px;
    border-bottom: 1px solid var(--line);
    justify-content: center; gap: 0; overflow: visible;
  }
  .cat-b {
    font-size: clamp(11.5px, 3.3vw, 14px);
    padding: 0 clamp(3px, 1.5vw, 9px);
    letter-spacing: -.02em;
    display: flex; align-items: center; height: 100%; border-radius: 0;
  }
  .hd-member { font-size: clamp(11.5px, 3.3vw, 15px); padding: 7px 8px; }  /* 매물 종류 메뉴와 동일 */
  .hd-call-no { display: none; }
  .hd-call { padding: 9px; border-radius: 50%; min-width: 40px; min-height: 40px; justify-content: center; }
  .hd-btn, .hd-member { min-height: 40px; }
  .hd-btn { display: inline-flex; align-items: center; justify-content: center; }
  /* ── 전화 버튼 상시 주목 효과(모바일): 주기적 벨울림 흔들림 (transform만 써서 레이아웃을 밀지 않는다) ── */
  .hd-call svg {
    transform-origin: 50% 42%;
    animation: callShake 2.8s ease-in-out infinite;
  }

  .hd-inner { gap: 8px; }
  .map-listbtn { display: block; }
  .map-note { display: none; }   /* 모바일에서는 지도 안내 배너 숨김 (상세 위치 섹션에 동일 문구 유지) */

  /* 목록 = 바텀시트 */
  #panel {
    position: fixed; left: 0; right: 0; bottom: 0; width: auto; z-index: 55;
    border-right: 0; border-radius: 18px 18px 0 0; box-shadow: var(--shadow-lg);
    top: calc(var(--hd-h) + var(--cat-h) + var(--fbar-h) + 8px);
    transform: translateY(calc(100% + 10px));
    transition: transform .28s cubic-bezier(.3,.9,.3,1);
    touch-action: none;
  }
  body.sheet-half #panel { transform: translateY(46%); }
  body.sheet-full #panel { transform: translateY(0); }
  body.sheet-half .map-listbtn, body.sheet-full .map-listbtn { display: none; }
  .sheet-handle {
    display: block; width: 100%; padding: 9px 0 5px; flex-shrink: 0;
  }
  .sheet-handle span {
    display: block; width: 42px; height: 4.5px; border-radius: 3px; background: var(--line); margin: 0 auto;
  }
  .panel-top { padding: 4px 16px 10px; }
  .list { touch-action: pan-y; }
  .card-img { width: 108px; height: 94px; }

  .detail { top: 0; left: 0; width: 100vw; max-width: 100vw; animation: dt-up .24s ease; }
  @keyframes dt-up { from { transform: translateY(6%); opacity: .4; } to { transform: none; opacity: 1; } }

  .pop {
    top: auto; left: 0; right: 0; bottom: 0; width: auto; max-width: none; max-height: 76dvh;
    border-radius: 18px 18px 0 0;
  }
  /* 필터바 2줄: 거래유형 한 줄, 필터 칩 한 줄 — 옆으로 밀지 않고 전부 보이게 한다 */
  .fbar {
    height: var(--fbar-h); flex-wrap: wrap; align-content: center;
    gap: 8px; padding: 0 12px 8px; overflow: visible;
  }
  .seg { width: 100%; }
  .seg-b { flex: 1; padding: 10px 0; font-size: 13px; text-align: center; }
  .chips {
    width: 100%; gap: clamp(4px, 1.4vw, 7px); justify-content: space-between;
  }
  .chip {
    font-size: clamp(11px, 3.05vw, 13px);
    padding: 7px clamp(6px, 2.1vw, 12px); gap: 3px;
    min-height: 34px;
  }
  .chip-toggle.is-on::before { content: none; }   /* 파란 배경으로 이미 켜짐을 보여준다 */
  .chip-ghost .chip-lb { display: none; }         /* 초기화는 아이콘만 */
  .chip-ghost { padding: 7px 9px; }
}

/* 좁은 화면: 긴 라벨은 짧은 말로 바꿔 한 줄을 지킨다 */
@media (max-width: 380px) {
  #chipBounds .chip-lb { display: none; }
  #chipBounds .chip-sm { display: inline; }
}

/* 초소형 화면: 줄여도 한 줄에 안 들어오면 자르지 말고 두 줄로 내린다 */
@media (max-width: 344px) {
  :root { --fbar-h: 134px; }
  .chips { flex-wrap: wrap; row-gap: 6px; justify-content: flex-start; }
}

@media (max-width: 380px) {
  .hd-btn { padding: 7px 9px; font-size: 12.5px; }
  .logo-word { font-size: 17px; }
  .logo-sub { display: none; }
  .dt-price { font-size: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ================= 관심매물 (하트) ================= */
.card { position: relative; }
.fav-b {
  position: absolute; top: 8px; left: 8px; z-index: 2;
  width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer;
  background: rgba(255,255,255,.92); color: #B9C0D0;
  box-shadow: var(--shadow); border: 0; padding: 0;
  transition: color .15s, transform .15s;
}
.fav-b:hover { transform: scale(1.1); color: #FF5A76; }
.fav-b.is-on { color: #FF3B5C; }
.fav-b svg { width: 16px; height: 16px; display: block; }
.fav-b.is-on svg path { fill: currentColor; }
.fav-b:not(.is-on) svg path { fill: none; stroke: currentColor; stroke-width: 1.6; }

.dt-pricebox { position: relative; }
.fav-b.dt-fav { top: 50%; left: auto; right: 14px; transform: translateY(-50%); width: 42px; height: 42px; }
.fav-b.dt-fav svg { width: 21px; height: 21px; }
.fav-b.dt-fav:hover { transform: translateY(-50%) scale(1.08); }

.chip-fav { display: inline-flex; align-items: center; gap: 5px; }
.chip-fav svg path { fill: none; stroke: currentColor; stroke-width: 2; }
.chip-fav.is-on { color: #E52D4E; border-color: #FF3B5C; background: #FFF0F3; }
.chip-fav.is-on svg path { fill: #FF3B5C; stroke: #FF3B5C; }

/* 가입 유도 모달 (member.js — 목록 페이지와 동일 모양) */
.dim { position: fixed; inset: 0; z-index: 90; background: rgba(14, 18, 33, .5); }
.mb-modal { width: min(92vw, 380px); text-align: center; padding: 28px 24px 20px; }
.mb-modal .x { position: absolute; top: 10px; right: 14px; font-size: 22px; color: var(--mut); padding: 6px; background: none; border: 0; cursor: pointer; }
.mb-modal h3 { font-size: 19px; font-weight: 800; }
.mb-modal p { margin-top: 10px; font-size: 14px; color: var(--sub); line-height: 1.75; }
.mb-btns { margin-top: 18px; display: flex; flex-direction: column; gap: 8px; }
.mb-modal .btn-main {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px;
  background: var(--blue); color: #fff; font-size: 15px; font-weight: 800; border-radius: 12px; text-decoration: none;
}
.mb-modal .btn-main:hover { background: var(--blue-deep); }
.mb-modal .btn-ghost2 {
  display: inline-flex; align-items: center; justify-content: center; min-height: 46px;
  border: 1.5px solid var(--line); color: var(--ink); font-size: 14.5px; font-weight: 700; border-radius: 12px; text-decoration: none;
}
.mb-modal .btn-ghost2:hover { border-color: var(--blue); color: var(--blue); }
.mb-later { margin-top: 12px; font-size: 13px; color: var(--mut); text-decoration: underline; text-underline-offset: 3px; background: none; border: 0; cursor: pointer; }

@keyframes callShake {
  0%, 55%, 88%, 100% { transform: none; }
  62% { transform: rotate(-13deg); }
  68% { transform: rotate(10deg); }
  74% { transform: rotate(-8deg); }
  80% { transform: rotate(5deg); }
}

@media (prefers-reduced-motion: reduce) {
  .hd-call svg { animation: none; }
}
