/* =========================================================
   LH 전세임대 매물 지도 — 토스 디자인 시스템(TDS) 방식, 라이트 모드 고정
   근거: TDS Colors·Typography (tossmini-docs.toss.im/tds-mobile/foundation) — tech_blog/DESIGN.md 와 같은 값
   규칙
   - 글자 크기는 TDS 토큰 4개만: t3 22 · t5 17 · t6 15 · t7 13. 굵기는 400·700만.
   - 굵게: 가격·제목·항목 이름·버튼·작은 라벨. 문장 안에서는 쓰지 않는다.
   - 파랑(blue500)은 누를 수 있는 것과 선택된 상태에만. 빨강(red500)은 NEW와 관심 하트에만. 끝난 것은 회색.
   - 간격은 4px 격자, 모서리는 8 · 12 · 16 · 20. 선보다 면(회색 채움·굵은 구분 띠)으로 나눈다.
   ========================================================= */
:root {
  color-scheme: light;
  --grey-50: #f9fafb; --grey-100: #f2f4f6; --grey-200: #e5e8eb; --grey-300: #d1d6db; --grey-400: #b0b8c1;
  --grey-500: #8b95a1; --grey-600: #6b7684; --grey-700: #4e5968; --grey-800: #333d4b; --grey-900: #191f28;
  --blue-50: #e8f3ff; --blue-500: #3182f6; --blue-600: #2272eb;
  /* 강조색: 화면은 --accent-* 만 쓴다(지금은 토스 파랑). 바꿀 때는 이 네 값만 고친다 */
  --accent-50: var(--blue-50); --accent-500: var(--blue-500); --accent-600: var(--blue-600); --accent-rgb: 49, 130, 246;
  --red-50: #ffeeee; --red-500: #f04452;
  --white: #ffffff;
  --t3: 22px; --t3-lh: 31px;    /* 상세 가격 · 창 제목 */
  --t5: 17px; --t5-lh: 25.5px;  /* 패널 제목 · 목록 가격 · 상세 제목 · 섹션 제목 · 브랜드 */
  --t6: 15px; --t6-lh: 22.5px;  /* 본문 · 목록 제목 · 입력 · 버튼 · 정보 행 */
  --t7: 13px; --t7-lh: 19.5px;  /* 보조 정보 · 칩 · 배지 · 지도 표시 · 라벨 */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px; --s8: 32px;
  --r-sm: 8px; --r-md: 12px; --r-lg: 16px; --r-xl: 20px;
  --shadow-sm: 0 1px 3px rgba(0, 27, 55, .1);
  --shadow: 0 0 0 1px rgba(0, 27, 55, .06), 0 8px 24px -6px rgba(0, 25, 54, .18);
  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", system-ui, sans-serif;
  --top: 64px; --panel-w: 400px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--white); color: var(--grey-900); font-family: var(--font);
  font-size: var(--t6); line-height: var(--t6-lh); -webkit-font-smoothing: antialiased; word-break: keep-all; overflow-wrap: break-word; }
body { overflow: hidden; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
h2, h3, h4, p { margin: 0; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.sub { font-size: var(--t7); line-height: var(--t7-lh); color: var(--grey-500); }
body.mode-public .local-only { display: none !important; }
body:not(.mode-public) .public-only { display: none !important; }
.i { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- 버튼 (TDS Button: primary · weak · tertiary) ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--s1); height: 40px; padding: 0 var(--s4); border: 0; border-radius: 10px;
  font-size: var(--t6); font-weight: 700; white-space: nowrap; transition: background-color .12s; }
.btn.small { height: 32px; padding: 0 var(--s3); border-radius: var(--r-sm); font-size: var(--t7); }
.btn.small .i { width: 16px; height: 16px; }
.btn.large { height: 52px; border-radius: var(--r-md); font-size: var(--t5); }
.btn.block { width: 100%; }
.btn.primary { background: var(--accent-500); color: var(--white); }
.btn.primary:hover { background: var(--accent-600); }
.btn.weak { background: var(--accent-50); color: var(--accent-600); }
.btn.tertiary { background: var(--grey-100); color: var(--grey-700); }
.btn.tertiary:hover { background: var(--grey-200); }
.btn:disabled { opacity: .4; cursor: default; }
.iconbtn { width: 40px; height: 40px; border: 0; border-radius: 10px; background: transparent; color: var(--grey-600); display: inline-flex; align-items: center; justify-content: center; }
.iconbtn:hover { background: var(--grey-100); }
.iconbtn .i { width: 24px; height: 24px; }
.iconbtn.on { color: var(--red-500); }
.iconbtn.on .i, .fav.on .i { fill: currentColor; }

/* 세그먼트 (TDS SegmentedControl) */
.seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--grey-100); }
.seg button { height: 30px; padding: 0 var(--s3); border: 0; border-radius: var(--r-sm); background: transparent; color: var(--grey-600); font-size: var(--t7); font-weight: 700; white-space: nowrap; }
.seg button.on { background: var(--white); color: var(--grey-900); box-shadow: var(--shadow-sm); }
.seg.wide { display: flex; } .seg.wide button { flex: 1; height: 36px; font-size: var(--t6); }

/* ---------- 위쪽 막대 ---------- */
.topbar { position: fixed; inset: 0 0 auto 0; height: var(--top); z-index: 30; display: flex; align-items: center; gap: var(--s4); padding: 0 var(--s5);
  background: var(--white); border-bottom: 1px solid var(--grey-100); }
.brand { display: inline-flex; align-items: center; gap: var(--s2); font-size: var(--t5); line-height: var(--t5-lh); font-weight: 700; white-space: nowrap; color: var(--grey-900); }
.logo { width: 24px; height: 24px; border-radius: 7px; background: var(--accent-500) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.5l6-5.2 6 5.2V18H6z' fill='white'/%3E%3C/svg%3E") center / 24px no-repeat; }
.search { position: relative; flex: 0 1 360px; min-width: 200px; display: flex; align-items: center; gap: var(--s2); height: 44px; padding: 0 var(--s3);
  border-radius: var(--r-md); background: var(--grey-100); color: var(--grey-500); }
.search:focus-within { background: var(--grey-50); box-shadow: inset 0 0 0 1.5px var(--accent-500); }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--grey-900); font-size: var(--t6); }
.search input::placeholder { color: var(--grey-500); }
.search.small { height: 40px; flex: 1; }
.suggest { position: absolute; top: 52px; left: 0; right: 0; z-index: 50; padding: var(--s2) 0; max-height: 60vh; overflow: auto;
  background: var(--white); border-radius: var(--r-lg); box-shadow: var(--shadow); color: var(--grey-900); }
.suggest .grp { padding: var(--s3) var(--s5) var(--s1); font-size: var(--t7); line-height: var(--t7-lh); font-weight: 700; color: var(--grey-500); }
.suggest .opt { display: flex; align-items: center; gap: var(--s3); min-height: 48px; padding: 0 var(--s5); cursor: pointer; }
.suggest .opt .nm { font-size: var(--t6); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suggest .opt .mt { margin-left: auto; font-size: var(--t7); color: var(--grey-500); white-space: nowrap; }
.suggest .opt.on, .suggest .opt:hover { background: var(--grey-50); }
.suggest .none { padding: var(--s4) var(--s5); font-size: var(--t7); color: var(--grey-500); }
.chips { display: flex; gap: var(--s2); flex: 1 1 auto; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { display: inline-flex; align-items: center; gap: 2px; height: 36px; padding: 0 var(--s2) 0 var(--s3); border: 0; border-radius: 18px; background: var(--grey-100);
  color: var(--grey-700); font-size: var(--t7); font-weight: 700; white-space: nowrap; }
.chip .i { width: 16px; height: 16px; color: var(--grey-500); }
.chip:hover { background: var(--grey-200); }
.chip.on { background: var(--accent-50); color: var(--accent-600); }
.chip.on .i { color: var(--accent-500); }
.chip.open .i { transform: rotate(180deg); }
/* 로컬 테스트판 도구 띠 (서비스판에는 없다) — 왼쪽 패널 맨 위 */
.admin { display: flex; align-items: center; gap: var(--s2); padding: var(--s3) var(--s5); background: var(--grey-50); box-shadow: inset 0 -1px 0 var(--grey-100); flex: none; }
.admin-label { margin-right: auto; font-size: var(--t7); font-weight: 700; color: var(--grey-500); }
.admin .seg button { height: 26px; padding: 0 var(--s2); }
@media (max-width: 1100px) { .brand { font-size: 0; gap: 0; } .search { flex-basis: 300px; } }

/* ---------- 필터 팝오버 ---------- */
.pop { position: fixed; z-index: 40; width: 320px; padding: var(--s5); display: flex; flex-direction: column; gap: var(--s3);
  background: var(--white); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.pop-title { font-size: var(--t7); line-height: var(--t7-lh); font-weight: 700; color: var(--grey-500); }
.pop-title + .pop-title, .check + .pop-title { margin-top: var(--s2); }
.pop-title .val { margin-left: var(--s1); color: var(--accent-600); }
.pop input[type=range] { width: 100%; accent-color: var(--accent-500); }
.presets { display: flex; flex-wrap: wrap; gap: var(--s2); }
.presets button { height: 32px; padding: 0 var(--s3); border: 0; border-radius: 16px; background: var(--grey-100); color: var(--grey-700); font-size: var(--t7); font-weight: 700; }
.presets button.on { background: var(--accent-50); color: var(--accent-600); }
.check { display: flex; align-items: center; gap: var(--s3); min-height: 32px; font-size: var(--t6); color: var(--grey-800); cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 0; accent-color: var(--accent-500); }
.pop .btn.block { margin-top: var(--s2); }

/* ---------- 무대: 왼쪽 패널 + 지도 ---------- */
.stage { position: fixed; top: var(--top); bottom: 0; left: 0; right: 0; display: flex; }
.panel { position: relative; width: var(--panel-w); flex: none; z-index: 10; display: flex; flex-direction: column; min-height: 0;
  background: var(--white); box-shadow: 1px 0 0 var(--grey-100); }
.grab { display: none; }
body.panel-closed .panel { display: none; }
.panel-toggle { position: absolute; top: 50%; left: var(--panel-w); z-index: 11; transform: translateY(-50%); width: 24px; height: 56px; padding: 0;
  border: 0; border-radius: 0 var(--r-sm) var(--r-sm) 0; background: var(--white); color: var(--grey-500); box-shadow: 2px 0 6px rgba(0, 27, 55, .08);
  display: flex; align-items: center; justify-content: center; }
.panel-toggle .i { width: 18px; height: 18px; }
body.panel-closed .panel-toggle { left: 0; }
.view { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.panel-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s3); padding: var(--s5) var(--s5) var(--s3); }
.count { font-size: var(--t5); line-height: var(--t5-lh); font-weight: 700; }
.ph-acts { display: flex; align-items: center; gap: var(--s2); }
.sort { position: relative; display: inline-flex; align-items: center; height: 32px; border-radius: var(--r-sm); background: var(--grey-100); color: var(--grey-700); }
.sort select { appearance: none; -webkit-appearance: none; height: 32px; padding: 0 28px 0 var(--s3); border: 0; outline: 0; background: transparent; font-size: var(--t7); font-weight: 700; color: var(--grey-700); cursor: pointer; }
.sort .i { position: absolute; right: 8px; width: 16px; height: 16px; pointer-events: none; color: var(--grey-500); }
.sheet-close { display: none; }
.notice a { color: var(--accent-600); font-weight: 700; white-space: nowrap; }
.notice { margin: 0 var(--s5) var(--s3); padding: var(--s3) var(--s4); border-radius: var(--r-md); background: var(--grey-50); font-size: var(--t7); line-height: var(--t7-lh); color: var(--grey-600); }
.list { list-style: none; margin: 0; padding: 0 0 var(--s4); overflow-y: auto; flex: 1; border-top: 1px solid var(--grey-100); }
.list-end { padding: var(--s6) var(--s5); text-align: center; font-size: var(--t7); color: var(--grey-500); }

/* 목록 행 (TDS ListRow) */
.item { position: relative; display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: var(--s4); padding: var(--s4) var(--s5); cursor: pointer; transition: background-color .12s; }
.item + .item::before { content: ''; position: absolute; top: 0; left: var(--s5); right: var(--s5); height: 1px; background: var(--grey-100); }
.item:hover { background: var(--grey-50); }
.item.on { background: var(--accent-50); }
.item.ended .price, .item.ended .ttl { color: var(--grey-400); }
.thumb { position: relative; width: 88px; height: 88px; border-radius: var(--r-md); overflow: hidden; background: var(--grey-100); display: flex; align-items: center; justify-content: center; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb::after { content: ''; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px rgba(0, 27, 55, .05); pointer-events: none; }
.thumb .ph { padding: 0 var(--s2); font-size: var(--t7); line-height: var(--t7-lh); color: var(--grey-400); text-align: center; }
.thumb .n { position: absolute; right: 6px; bottom: 6px; padding: 0 6px; border-radius: 10px; background: rgba(0, 0, 0, .5); color: var(--white); font-size: var(--t7); line-height: 20px; }
.item .body { min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 2px; padding-right: 28px; }
.price { font-size: var(--t5); line-height: var(--t5-lh); font-weight: 700; color: var(--grey-900); }
.ttl { font-size: var(--t6); line-height: var(--t6-lh); color: var(--grey-800); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meta { font-size: var(--t7); line-height: var(--t7-lh); color: var(--grey-600); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tags { display: flex; align-items: center; gap: 6px; margin-top: 2px; font-size: var(--t7); line-height: var(--t7-lh); color: var(--grey-500); }
.badge { display: inline-flex; align-items: center; height: 20px; padding: 0 6px; border-radius: 6px; font-size: var(--t7); font-weight: 700; line-height: 1; }
.badge.red { background: var(--red-50); color: var(--red-500); }
.badge.grey { background: var(--grey-100); color: var(--grey-500); }
.fav { position: absolute; top: 12px; right: 12px; width: 36px; height: 36px; border: 0; border-radius: 10px; background: transparent; color: var(--grey-300); display: flex; align-items: center; justify-content: center; }
.fav:hover { background: var(--grey-100); }
.fav.on { color: var(--red-500); }

/* 상세 */
.dnav { display: flex; align-items: center; justify-content: space-between; height: 56px; padding: 0 var(--s2); flex: none; }
.dnav .left { display: flex; align-items: center; }
.dnav .back { display: inline-flex; align-items: center; gap: 2px; height: 40px; padding: 0 var(--s3) 0 var(--s1); border: 0; border-radius: 10px; background: transparent; color: var(--grey-900); font-size: var(--t6); font-weight: 700; }
.dnav .back:hover { background: var(--grey-100); }
.dnav .back .i { width: 24px; height: 24px; }
.dnav .right { display: flex; gap: 2px; }
.dscroll { flex: 1; overflow-y: auto; }
.gallery { position: relative; aspect-ratio: 4 / 3; background: var(--grey-100); display: flex; align-items: center; justify-content: center; }
.gallery img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in; }
.gallery .ph { padding: 0 var(--s6); text-align: center; font-size: var(--t6); color: var(--grey-500); }
.gallery .ph a { color: var(--accent-600); font-weight: 700; }
.gnav { position: absolute; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .92); color: var(--grey-800); box-shadow: var(--shadow-sm); display: flex; align-items: center; justify-content: center; }
.gprev { left: var(--s3); } .gnext { right: var(--s3); }
.gcount { position: absolute; right: var(--s3); bottom: var(--s3); padding: 0 var(--s2); border-radius: 12px; background: rgba(0, 0, 0, .5); color: var(--white); font-size: var(--t7); line-height: 24px; }
.dhead { padding: var(--s5) var(--s5) var(--s6); display: flex; flex-direction: column; gap: var(--s1); }
.dprice { font-size: var(--t3); line-height: var(--t3-lh); font-weight: 700; color: var(--grey-900); }
.dtitle { font-size: var(--t5); line-height: var(--t5-lh); font-weight: 700; color: var(--grey-800); }
.daddr { font-size: var(--t6); line-height: var(--t6-lh); color: var(--grey-600); }
.dhead .tags { margin-top: var(--s2); }
.band { height: 8px; background: var(--grey-100); }
.sec { padding: var(--s6) var(--s5); }
.sec-title { margin-bottom: var(--s3); font-size: var(--t5); line-height: var(--t5-lh); font-weight: 700; color: var(--grey-900); }
.rows { display: flex; flex-direction: column; }
.row { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--s4); padding: 10px 0; font-size: var(--t6); line-height: var(--t6-lh); }
.row .k { flex: none; color: var(--grey-600); }
.row .v { text-align: right; color: var(--grey-900); }
.desc { font-size: var(--t6); line-height: 1.7; color: var(--grey-800); white-space: pre-wrap; max-height: 230px; overflow: hidden; }
.desc.open { max-height: none; }
.more-btn { margin-top: var(--s3); padding: 0; border: 0; background: transparent; color: var(--accent-600); font-size: var(--t6); font-weight: 700; }
.agent .office { font-size: var(--t6); font-weight: 700; color: var(--grey-900); }
.agent .sub { margin-top: 2px; }
.agent .btn { margin-top: var(--s3); }
.linkrows { display: flex; flex-direction: column; margin: 0 calc(-1 * var(--s5)); }
.linkrow { display: flex; align-items: center; justify-content: space-between; min-height: 52px; padding: 0 var(--s5); font-size: var(--t6); color: var(--grey-900); }
.linkrow:hover { background: var(--grey-50); }
.linkrow .i { color: var(--grey-400); }
.srcnote { padding: 0 var(--s5) var(--s6); font-size: var(--t7); line-height: var(--t7-lh); color: var(--grey-500); }
.cta { flex: none; display: flex; gap: var(--s2); padding: var(--s3) var(--s5) calc(var(--s3) + env(safe-area-inset-bottom)); background: var(--white); box-shadow: 0 -1px 0 var(--grey-100); }
.cta .btn.large { flex: 1; }
.cta .heart { width: 52px; height: 52px; border-radius: var(--r-md); background: var(--grey-100); color: var(--grey-500); }
.cta .heart.on { background: var(--red-50); color: var(--red-500); }

/* ---------- 지도 ---------- */
.mapwrap { position: relative; flex: 1; min-width: 0; isolation: isolate; z-index: 0; }
#map { position: absolute; inset: 0; background: #eceae4; }
.leaflet-container { font-family: var(--font); }
.leaflet-control-attribution { font-size: 11px; }
.leaflet-div-icon.mk { background: transparent; border: 0; }
.map-tools { position: absolute; right: var(--s4); top: var(--s4); z-index: 1000; display: flex; flex-direction: column; border-radius: var(--r-md); background: var(--white); box-shadow: var(--shadow); overflow: hidden; }
.tool { width: 44px; height: 44px; border: 0; background: var(--white); color: var(--grey-700); display: flex; align-items: center; justify-content: center; }
.tool + .tool { box-shadow: inset 0 1px 0 var(--grey-100); }
.tool:hover { background: var(--grey-50); }
.map-hint { position: absolute; top: var(--s4); left: 50%; transform: translateX(-50%); z-index: 1000; padding: var(--s2) var(--s4); border-radius: 18px;
  background: rgba(25, 31, 40, .82); color: var(--white); font-size: var(--t7); line-height: var(--t7-lh); white-space: nowrap; pointer-events: none; }
.toast { position: absolute; left: 50%; bottom: var(--s6); transform: translateX(-50%); z-index: 1001; max-width: min(520px, calc(100% - 32px)); padding: var(--s3) var(--s5);
  border-radius: var(--r-md); background: var(--grey-800); color: var(--white); font-size: var(--t6); line-height: var(--t6-lh); box-shadow: var(--shadow); }

/* 지도 표시: 묶음(누르면 확대) · 가격 말풍선(누르면 상세) */
.mk-group { display: inline-flex; align-items: center; gap: 6px; transform: translate(-50%, -50%); padding: 7px 14px; border-radius: 18px; white-space: nowrap;
  background: var(--accent-500); color: var(--white); font-size: var(--t7); line-height: var(--t7-lh); box-shadow: 0 2px 8px rgba(var(--accent-rgb), .35); cursor: pointer; }
.mk-group b { font-weight: 700; }
.mk-pill { position: relative; display: inline-flex; align-items: center; gap: 4px; transform: translate(-50%, calc(-100% - 8px)); padding: 5px 10px; border-radius: var(--r-sm);
  white-space: nowrap; background: var(--white); color: var(--grey-900); font-size: var(--t7); line-height: var(--t7-lh); font-weight: 700;
  box-shadow: 0 0 0 1px rgba(0, 27, 55, .08), 0 2px 6px rgba(0, 27, 55, .16); cursor: pointer; }
.mk-pill::after { content: ''; position: absolute; left: 50%; bottom: -6px; margin-left: -6px; border: 6px solid transparent; border-top-color: var(--white); border-bottom: 0; }
.mk-pill .more { font-weight: 400; color: var(--grey-500); }
.mk-pill .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--red-500); }
.mk-pill.on, .mk-pill.hl { background: var(--accent-500); color: var(--white); box-shadow: 0 2px 8px rgba(var(--accent-rgb), .4); }
.mk-pill.on::after, .mk-pill.hl::after { border-top-color: var(--accent-500); }
.mk-pill.on .more, .mk-pill.hl .more { color: rgba(255, 255, 255, .8); }

/* ---------- 휴대폰: 지도 + 아래에서 올라오는 목록(바텀시트) ---------- */
.sheet-handle { display: none; }
@media (max-width: 900px) {
  :root { --top: 112px; }
  .topbar { flex-wrap: wrap; align-content: flex-start; height: auto; min-height: var(--top); gap: var(--s2); padding: var(--s3) var(--s4); }
  .brand { display: none; }
  .search { flex: 1 1 100%; }
  .chips { flex: 1 1 100%; }
  .panel { position: fixed; left: 0; right: 0; bottom: 0; width: auto; height: 64vh; z-index: 25; border-radius: var(--r-xl) var(--r-xl) 0 0;
    box-shadow: 0 -8px 24px rgba(0, 25, 54, .14); transform: translateY(100%); transition: transform .22s ease; }
  .grab { display: block; flex: none; width: 36px; height: 4px; margin: var(--s2) auto 0; border-radius: 2px; background: var(--grey-300); }
  body.sheet-open .panel { transform: none; }
  body.detail-open .panel { height: calc(100% - var(--top)); border-radius: 0; }
  body.detail-open .grab { display: none; }
  body.panel-closed .panel { display: flex; }
  .panel-toggle { display: none; }
  .sheet-close { display: inline-flex; }
  .sheet-handle { position: fixed; left: 50%; bottom: calc(var(--s5) + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 24;
    display: inline-flex; align-items: center; gap: var(--s2); height: 48px; padding: 0 var(--s5); border: 0; border-radius: 24px;
    background: var(--grey-900); color: var(--white); font-size: var(--t6); font-weight: 700; box-shadow: var(--shadow); }
  body.sheet-open .sheet-handle { display: none; }
  .pop { left: var(--s3) !important; right: var(--s3); width: auto; }
  .toast { bottom: 88px; }
}
@media (max-width: 480px) {
  .item { grid-template-columns: 80px minmax(0, 1fr); gap: var(--s3); }
  .thumb { width: 80px; height: 80px; }
}

/* ---------- 수집 지역 창 (로컬 테스트판) ---------- */
.modal { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; padding: var(--s4); background: rgba(0, 0, 0, .4); }
.modal-box { width: min(880px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; overflow: hidden; border-radius: var(--r-xl); background: var(--white); box-shadow: var(--shadow); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s3); padding: var(--s6) var(--s6) var(--s3); }
.modal-head h2 { font-size: var(--t3); line-height: var(--t3-lh); font-weight: 700; }
.pick-chips { display: flex; flex-wrap: wrap; gap: var(--s2); padding: 0 var(--s6) var(--s4); max-height: 92px; overflow: auto; }
.pick-chips .chip { padding: 0 var(--s3); }
.pick-chips .chip::after { content: '×'; margin-left: 4px; font-weight: 400; }
.modal-body { display: grid; grid-template-columns: 176px minmax(0, 1fr); min-height: 0; flex: 1; border-top: 1px solid var(--grey-100); }
.sido-list { display: flex; flex-direction: column; gap: 2px; padding: var(--s2); overflow: auto; background: var(--grey-50); }
.sido-list button { display: flex; justify-content: space-between; align-items: center; gap: var(--s2); min-height: 44px; padding: 0 var(--s3); border: 0; border-radius: 10px;
  background: transparent; text-align: left; font-size: var(--t6); color: var(--grey-700); }
.sido-list button:hover { background: var(--grey-100); }
.sido-list button.on { background: var(--white); color: var(--accent-600); font-weight: 700; box-shadow: var(--shadow-sm); }
.sido-list .n { font-size: var(--t7); font-weight: 700; color: var(--accent-500); }
.sgg-pane { display: flex; flex-direction: column; min-height: 0; }
.sgg-tools { display: flex; align-items: center; gap: var(--s2); padding: var(--s4) var(--s5); }
.sgg-list { display: flex; flex-direction: column; gap: var(--s4); padding: 0 var(--s5) var(--s5); min-height: 260px; max-height: 52vh; overflow: auto; }
.sgg-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); }
.sgg-row .city { width: 100%; display: flex; align-items: center; gap: var(--s2); font-size: var(--t7); font-weight: 700; color: var(--grey-500); }
.sgg-row .city button { height: 24px; padding: 0 var(--s2); border: 0; border-radius: 6px; background: var(--accent-50); color: var(--accent-600); font-size: var(--t7); font-weight: 700; }
.pick { height: 36px; padding: 0 var(--s3); border: 0; border-radius: 18px; background: var(--grey-100); color: var(--grey-700); font-size: var(--t7); font-weight: 700; }
.pick:hover { background: var(--grey-200); }
.pick.on { background: var(--accent-500); color: var(--white); }
.pick .n { margin-left: 4px; font-weight: 400; opacity: .75; }
.modal-foot { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; padding: var(--s4) var(--s6); border-top: 1px solid var(--grey-100); }
.modal-foot .sub { flex: 1; min-width: 200px; color: var(--grey-600); }
.foot-btns { display: flex; gap: var(--s2); margin-left: auto; }
.attrib { padding: 0 var(--s6) var(--s4); font-size: 11px; color: var(--grey-400); }
@media (max-width: 640px) {
  .modal { padding: 0; align-items: stretch; }
  .modal-box { max-height: none; height: 100%; border-radius: 0; }
  .modal-body { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
  .sido-list { flex-direction: row; overflow-x: auto; }
  .sido-list button { white-space: nowrap; }
  .sgg-list { max-height: none; flex: 1; }
}

/* ---------- 사진 크게 보기 ---------- */
.lightbox { position: fixed; inset: 0; z-index: 70; display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, .92); }
.lightbox img { max-width: 92vw; max-height: 84vh; object-fit: contain; border-radius: var(--r-sm); }
.lb-btn, .lb-close { position: absolute; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .16); color: var(--white); display: flex; align-items: center; justify-content: center; }
.lb-btn { top: 50%; transform: translateY(-50%); width: 48px; height: 48px; }
.lb-btn .i, .lb-close .i { width: 24px; height: 24px; }
.lb-prev { left: var(--s4); } .lb-next { right: var(--s4); }
.lb-close { top: var(--s4); right: var(--s4); width: 44px; height: 44px; }
.lb-cap { position: absolute; bottom: var(--s5); left: 0; right: 0; padding: 0 64px; text-align: center; color: rgba(255, 255, 255, .8); font-size: var(--t7); }
