/* 지도 화면 — PC: 왼쪽 목록·상세 패널 + 지도 / 모바일: 전체 지도 + 하단 시트 */
html, body.mapview { height: 100%; overflow: hidden; }
.appbar-map { position: fixed; top: 0; left: 0; right: 0; }
.appbar-map .searchbox { max-width: 400px; }
:root { --side-w: 400px; }
.mv { position: fixed; top: var(--appbar-h); left: 0; right: 0; bottom: 0; }
.side { position: absolute; top: 0; left: 0; bottom: 0; width: var(--side-w); z-index: 20; background: var(--bg); border-right: 1px solid var(--line-weak); display: flex; flex-direction: column; }
.mapwrap { position: absolute; top: 0; bottom: 0; left: var(--side-w); right: 0; overflow: hidden; background: #f2efe9; }
.mv.collapsed .side { display: none; }
.mv.collapsed .mapwrap { left: 0; }
#map { position: absolute; inset: 0; }

/* 목록 패널 */
.side-list, .side-detail { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.side-head { padding: 18px 20px 10px; border-bottom: 1px solid var(--line-weak); flex: none; }
.side-title { display: flex; align-items: baseline; gap: 6px; }
.side-title h2 { font-size: 18px; font-weight: 700; letter-spacing: -.03em; }
.side-title .num { font-size: 18px; font-weight: 700; color: var(--brand-text); }
.side-tools { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 12px; }
.side-active { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.side-active:empty { display: none; }
.achip { display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 6px 0 10px; border-radius: 8px; background: var(--brand-weak); color: var(--brand-text); font-size: 13px; font-weight: 600; }
.achip .ic { width: 14px; height: 14px; stroke-width: 2.4; }
.achip.reset { background: none; color: var(--text-4); padding: 0 6px; font-weight: 500; }
.side-body { overflow-y: auto; padding: 0 20px 24px; flex: 1; overscroll-behavior: contain; }
.side-body .zitem { width: 100%; text-align: left; cursor: pointer; }
.side-body .zitem.hl .zitem-title { color: var(--brand-text); }
.side-empty { padding: 40px 0; text-align: center; color: var(--text-3); }
.side-empty b { display: block; color: var(--text); font-size: 16px; margin-bottom: 4px; }
.side-more { margin: 12px 0 0; }
.btn-filter { position: relative; }
.btn-filter .cnt { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--brand); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; }
.btn-filter .cnt:empty { display: none; }
.side-dhead { display: flex; align-items: center; gap: 2px; height: 52px; padding: 0 8px; border-bottom: 1px solid var(--line-weak); flex: none; }
.side-dhead span { font-weight: 600; color: var(--text-2); flex: 1; }
.side-dbody { overflow-y: auto; padding: 18px 20px 28px; flex: 1; overscroll-behavior: contain; }
.side-toggle { position: absolute; z-index: 21; top: 50%; left: var(--side-w); transform: translateY(-50%); width: 22px; height: 56px; border-radius: 0 10px 10px 0;
  background: var(--bg); border: 1px solid var(--line-weak); border-left: 0; color: var(--text-3); display: grid; place-items: center; box-shadow: var(--sh-sm); }
.side-toggle .ic { width: 16px; height: 16px; stroke-width: 2.2; }
.mv.collapsed .side-toggle { left: 0; }
.mv.collapsed .side-toggle .ic { transform: rotate(180deg); }

/* 구역 상세 (패널·시트 공통) */
.zd .tags { margin-bottom: 6px; }
.zd-title { font-size: 21px; font-weight: 700; letter-spacing: -.035em; line-height: 1.35; }
.zd-addr { display: flex; gap: 4px; align-items: center; margin-top: 4px; color: var(--text-3); font-size: 14px; }
.zd-addr .ic { color: var(--text-4); }
.zd-status { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 16px 0 10px; }
.zd-status b { font-size: 16px; font-weight: 700; letter-spacing: -.02em; }
.zd-acts { display: flex; gap: 8px; margin: 18px 0 4px; }
.zd-acts .btn-primary { flex: 1; }
.zd .facts { margin-top: 18px; }
.zd .facts > div { padding: 12px 14px; }
.zd .facts dd { font-size: 14px; }
/* 아래 섹션(관련 추진·정보몽땅·중개사무소): 패널 끝까지 닿는 회색 띠로 나누고, 아이콘 달린 큰 제목으로 시작 */
.zd-sec { margin: 28px -20px 0; padding: 22px 20px 0; border-top: 8px solid var(--bg-sub); }
.zd-sec-h { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.zd-sec-ic { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; flex: none; background: var(--brand-weak); color: var(--brand-text); }
.zd-sec-ic .ic { width: 16px; height: 16px; stroke-width: 2.1; }
.zd-sec h3 { flex: 1; min-width: 0; font-size: 17px; font-weight: 700; letter-spacing: -.03em; line-height: 1.35; }
.zd-sec-m { flex: none; font-size: 13px; color: var(--text-4); }
.zd-sec-sub { margin: 2px 0 2px 36px; font-size: 13px; color: var(--text-4); }
.zd-sec .rows > * + * { border-top: 1px solid var(--line-weak); }
.zd-sec .row { min-height: 0; padding: 11px 0; }
.zd-sec .row-title { font-size: 14px; font-weight: 500; }
.zd-sec .row-end .ic { width: 14px; height: 14px; stroke-width: 2; color: var(--text-5); }
.zd .note { margin-top: 14px; font-size: 13px; }
.zd-src { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 28px -20px 0; padding: 16px 20px 0; border-top: 1px solid var(--line-weak); font-size: 13px; }
.zd-src-h { flex-basis: 100%; font-size: 12px; font-weight: 600; color: var(--text-4); }
.zd-src a { color: var(--text-3); display: inline-flex; align-items: center; gap: 2px; }
.zd-src a:hover { color: var(--text); }
.zd-chg { margin-top: 14px; }

/* 지도 위 요소 */
.quick { position: absolute; z-index: 10; top: 12px; left: 12px; right: 72px; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px; }
.quick::-webkit-scrollbar { display: none; }
.qchip { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 999px; background: var(--elev); color: var(--text-2);
  font-size: 14px; font-weight: 600; box-shadow: var(--sh-md); white-space: nowrap; transition: background .15s, color .15s; }
.qchip .dot { width: 8px; height: 8px; }
.qchip.on { background: var(--text); color: var(--bg); }
.qchip.qf .ic { width: 18px; height: 18px; }
.qchip.qf .cnt { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--brand); color: #fff; font-size: 11px; line-height: 18px; text-align: center; }
.qchip.qf .cnt:empty { display: none; }
.fabs { position: absolute; z-index: 10; top: 12px; right: 12px; display: flex; flex-direction: column; gap: 8px; }
.fab { width: 44px; height: 44px; border-radius: 12px; background: var(--elev); color: var(--text-2); display: grid; place-items: center; box-shadow: var(--sh-md); }
.fab:hover { color: var(--text); }
.fab.on { color: var(--brand-text); }
.fab .ic { width: 22px; height: 22px; }
.zoomctl { position: absolute; z-index: 10; right: 12px; bottom: 28px; display: flex; flex-direction: column; border-radius: 12px; background: var(--elev); box-shadow: var(--sh-md); overflow: hidden; }
.zoomctl button { width: 44px; height: 44px; display: grid; place-items: center; color: var(--text-2); }
.zoomctl button + button { border-top: 1px solid var(--line-weak); }
.zoomctl button:hover { background: var(--press); }
.listfab { display: none; }
.legend { position: absolute; z-index: 10; left: 12px; bottom: 24px; width: 220px; padding: 12px 14px; border-radius: 14px; background: var(--elev); box-shadow: var(--sh-md); font-size: 13px; }
.legend-h { display: flex; align-items: center; justify-content: space-between; gap: 6px; width: 100%; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.legend-h span { display: inline-flex; align-items: center; gap: 2px; font-size: 12px; font-weight: 600; color: var(--text-4); }
.legend-h .ic { width: 14px; height: 14px; stroke-width: 2.2; }
.legend li { display: flex; align-items: center; gap: 8px; padding: 2px 0; color: var(--text-2); }
.legend li b { margin-left: auto; font-weight: 500; color: var(--text-4); font-variant-numeric: tabular-nums; font-size: 12px; }
.legend li .dot { width: 10px; height: 10px; border-radius: 3px; }
.legend.min ul { display: none; }
.legend.min .legend-h { margin: 0; }
.newspill { position: absolute; z-index: 11; top: 58px; left: 50%; transform: translateX(-50%); max-width: min(520px, calc(100% - 24px)); display: flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 8px 0 12px; border-radius: 999px; background: rgba(25, 31, 40, .9); color: #fff; font-size: 13px; box-shadow: var(--sh-md); white-space: nowrap; animation: fade .3s; }
.newspill b { color: #9fa8ff; font-weight: 700; flex: none; }
.newspill span { overflow: hidden; text-overflow: ellipsis; }
.newspill .x { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; color: rgba(255, 255, 255, .7); flex: none; }
.newspill .x .ic { width: 14px; height: 14px; stroke-width: 2.4; }
.maperr { position: absolute; z-index: 12; inset: 0; display: grid; place-items: center; background: var(--bg); color: var(--text-3); padding: 24px; text-align: center; }

/* 지도 위 말풍선·이름표 (카카오 CustomOverlay) */
.gub { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 58px; height: 58px; padding: 0 8px; border-radius: 29px;
  background: var(--brand); color: #fff; box-shadow: 0 4px 14px rgba(79, 70, 229, .35), 0 0 0 3px rgba(255, 255, 255, .9); font-family: var(--font); cursor: pointer; transition: transform .15s; }
.gub:hover { transform: scale(1.06); }
.gub b { font-size: 16px; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.gub span { font-size: 11px; font-weight: 600; opacity: .9; line-height: 1.2; white-space: nowrap; }
.gub.sm { min-width: 48px; height: 48px; border-radius: 24px; }
.gub.sm b { font-size: 14px; }
.zlbl { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px 0 7px; border-radius: 12px; background: rgba(255, 255, 255, .96); color: #191f28;
  font: 600 12px/1 var(--font); box-shadow: 0 1px 4px rgba(0, 0, 0, .22); white-space: nowrap; max-width: 180px; overflow: hidden; text-overflow: ellipsis; pointer-events: none; letter-spacing: -.02em; }
.zlbl i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); flex: none; }
.zlbl.sel { background: #191f28; color: #fff; }
.mypos { width: 18px; height: 18px; border-radius: 50%; background: #3182f6; border: 3px solid #fff; box-shadow: 0 0 0 6px rgba(49, 130, 246, .2), 0 2px 6px rgba(0, 0, 0, .3); }
.placepin { display: flex; flex-direction: column; align-items: center; pointer-events: none; }
.placepin b { padding: 5px 10px; border-radius: 10px; background: #191f28; color: #fff; font: 600 13px/1.2 var(--font); white-space: nowrap; box-shadow: var(--sh-md); }
.placepin i { width: 2px; height: 10px; background: #191f28; }
.placepin s { width: 10px; height: 10px; border-radius: 50%; background: #191f28; border: 2px solid #fff; margin-top: -2px; }

/* 지도 설정 */
.lg-list li { display: flex; align-items: center; gap: 10px; padding: 7px 0; font-size: 14px; }
.lg-list li .dot { width: 12px; height: 12px; border-radius: 4px; }
.lg-list li b { margin-left: auto; font-weight: 500; color: var(--text-4); font-variant-numeric: tabular-nums; }
.lg-list li small { color: var(--text-4); font-size: 12px; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 0; }
.toggle-row span b { display: block; font-weight: 600; }
.toggle-row span small { color: var(--text-3); font-size: 13px; }
.fsel { width: 100%; height: 44px; border: 1px solid var(--line); border-radius: var(--r-m); background: var(--surface); padding: 0 12px; font-size: 15px; }

/* ---------- 모바일 ---------- */
@media (max-width: 767px) {
  .mv { bottom: var(--tabbar-h); }
  .mapwrap { left: 0; }
  .side-toggle, .zoomctl, .legend { display: none; }
  .appbar-map { gap: 10px; }
  .appbar-map .searchbox { height: 40px; padding: 0 12px; font-size: 14px; }
  .appbar-map .searchbox span { font-size: 14px; }
  .quick { left: 0; right: 0; top: 10px; padding: 2px 12px 8px; gap: 6px; scroll-padding: 0 12px; touch-action: pan-x; overscroll-behavior-x: contain;
    -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 40px), transparent); }
  .quick.at-end { -webkit-mask-image: none; mask-image: none; }
  .quick::after { content: ""; flex: none; width: 1px; }
  .qchip { height: 36px; padding: 0 13px; font-size: 14px; }
  .fabs { top: 62px; right: 12px; }
  .fab { width: 42px; height: 42px; }
  .newspill { top: 62px; left: 12px; right: 64px; transform: none; max-width: none; }
  .gub { min-width: 50px; height: 50px; border-radius: 25px; padding: 0 6px; }
  .gub b { font-size: 15px; }
  .gub span { font-size: 10px; }
  .gub.sm { min-width: 44px; height: 44px; }
  .listfab { display: inline-flex; align-items: center; gap: 6px; position: absolute; z-index: 10; left: 50%; bottom: 16px; transform: translateX(-50%);
    height: 42px; padding: 0 18px; border-radius: 21px; background: var(--text); color: var(--bg); font-size: 14px; font-weight: 700; box-shadow: var(--sh-md); white-space: nowrap; }
  .listfab .ic { width: 18px; height: 18px; stroke-width: 2.2; }
  .listfab b { color: #9fa8ff; font-variant-numeric: tabular-nums; }
  /* 목록 = 하단 시트 */
  .side { position: fixed; top: auto; left: 0; right: 0; bottom: var(--tabbar-h); width: auto; height: min(76vh, calc(100% - 120px)); border: 0; z-index: 1002;
    border-radius: 22px 22px 0 0; box-shadow: 0 -8px 32px rgba(0, 0, 0, .18); transform: translateY(calc(100% + var(--tabbar-h) + 10px)); transition: transform .28s cubic-bezier(.2, .8, .2, 1); }
  .side.open { transform: none; }
  .side .grab { display: block; width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 10px; }
  .side-head { padding: 8px 20px 10px; touch-action: none; }
  .side-dhead { display: none; }
  .zsheet { position: fixed; left: 0; right: 0; bottom: var(--tabbar-h); z-index: 1002; max-height: 56vh; display: flex; flex-direction: column;
    background: var(--bg); border-radius: 22px 22px 0 0; box-shadow: 0 -8px 32px rgba(0, 0, 0, .2); transition: transform .28s cubic-bezier(.2, .8, .2, 1), max-height .28s; }
  .zsheet.full { max-height: calc(100% - var(--appbar-h) - var(--tabbar-h) + 40px); }
  .zsheet[hidden] { display: flex !important; transform: translateY(calc(100% + var(--tabbar-h) + 10px)); pointer-events: none; }
  .zsheet-grab { flex: none; padding: 8px 0 4px; touch-action: none; cursor: grab; }
  .zsheet-grab i { display: block; width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto; }
  .zsheet-x { position: absolute; top: 10px; right: 10px; }
  .zsheet-body { overflow-y: auto; padding: 4px 20px calc(20px + var(--safe-b)); overscroll-behavior: contain; }
  .zsheet .zd-title { padding-right: 36px; }
  .scrim.light { background: transparent; }
}
@media (min-width: 768px) { .zsheet, .side .grab { display: none !important; } }
.legend-f { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line-weak); font-size: 12px; color: var(--text-4); }
:root[data-theme="dark"] .listfab b { color: #4f46e5; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .listfab b { color: #4f46e5; } }
.noscript-intro { position: fixed; z-index: 2000; left: 16px; right: 16px; bottom: 80px; padding: 20px; border-radius: 16px; background: var(--bg); color: var(--text-2); box-shadow: 0 8px 30px rgba(0,0,0,.18); word-break: keep-all; }
.noscript-intro h2 { font-size: 17px; margin-bottom: 8px; color: var(--text); }
.noscript-intro p { font-size: 14px; line-height: 1.6; margin-top: 6px; }
.noscript-intro a { color: var(--brand-text); text-decoration: underline; }
