:root {
  --bg: #f4f2ee; --panel: #ffffff; --ink: #1b2229; --sub: #5d6772; --line: #d9dde2; --acc: #1f5f9e;
  --k-redev: #d9822b; --k-recon: #2f6fb5; --k-living: #3d8b5f; --k-renew: #7b5ea7; --k-etc: #7d8791;
  --shadow: 0 6px 24px rgba(0,0,0,.14);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #12171c; --panel: #1c242c; --ink: #e9eef2; --sub: #9aa6b1; --line: #2e3a45; --acc: #7fb3e6;
    --k-redev: #f0a35a; --k-recon: #6fa6e3; --k-living: #6fc293; --k-renew: #ae93dc; --k-etc: #9aa6b1; --shadow: 0 6px 24px rgba(0,0,0,.5); }
  .leaflet-tile-pane { filter: brightness(.72) contrast(1.1) saturate(.8); }
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink);
  font-family: system-ui, -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif; }
#map { position: fixed; inset: 0; z-index: 0; }

.top { position: fixed; top: 0; left: 0; right: 0; z-index: 1000; padding: calc(env(safe-area-inset-top) + 10px) 10px 0; pointer-events: none; }
.top > * { pointer-events: auto; }
.search { display: flex; gap: 8px; max-width: 560px; margin: 0 auto; }
.search input { flex: 1; min-width: 0; font: inherit; font-size: 16px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--panel); color: var(--ink); box-shadow: var(--shadow); }
.icon { width: 46px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); color: var(--ink); font-size: 20px; box-shadow: var(--shadow); cursor: pointer; }
.results { max-width: 560px; margin: 6px auto 0; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); max-height: 50vh; overflow: auto; }
.results button { display: block; width: 100%; text-align: left; padding: 11px 14px; border: 0; border-bottom: 1px solid var(--line); background: none; color: var(--ink); font: inherit; cursor: pointer; }
.results button small { display: block; color: var(--sub); }
.results .empty { padding: 12px 14px; color: var(--sub); }
.chips { display: flex; gap: 6px; overflow-x: auto; max-width: 560px; margin: 8px auto 0; padding-bottom: 2px; scrollbar-width: none; }
.chip { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--panel); color: var(--ink); font: inherit; font-size: 14px; cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.chip[aria-pressed="true"] { border-color: var(--acc); outline: 2px solid var(--acc); outline-offset: -2px; font-weight: 700; }
.dot { width: 10px; height: 10px; border-radius: 3px; background: var(--c); }
.dot.dash { background: none; border: 2px dashed var(--c); }

.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1000; max-width: 560px; margin: 0 auto; background: var(--panel);
  border-radius: 16px 16px 0 0; box-shadow: var(--shadow); padding-bottom: env(safe-area-inset-bottom); }
.handle { display: block; width: 100%; border: 0; background: none; color: var(--ink); font: inherit; font-weight: 700; padding: 14px 16px 10px; text-align: left; cursor: pointer; }
.handle::before { content: ""; display: block; width: 40px; height: 4px; border-radius: 2px; background: var(--line); margin: 0 auto 10px; }
.list { max-height: 0; overflow: auto; transition: max-height .2s; }
.sheet.open .list { max-height: 42vh; }
.row { display: flex; gap: 10px; align-items: flex-start; width: 100%; padding: 11px 16px; border: 0; border-top: 1px solid var(--line); background: none; color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.row .dot { margin-top: 5px; flex: none; }
.row b { display: block; font-weight: 600; }
.row small { color: var(--sub); }
.list .more { padding: 10px 16px; color: var(--sub); font-size: 14px; }

.card { position: fixed; inset: 0; z-index: 2000; background: rgba(0,0,0,.35); display: flex; align-items: flex-end; justify-content: center; }
.card[hidden] { display: none; }
.cardInner { position: relative; width: 100%; max-width: 560px; max-height: 85vh; overflow: auto; background: var(--panel); border-radius: 16px 16px 0 0; padding: 20px 18px calc(env(safe-area-inset-bottom) + 20px); }
.close { position: absolute; right: 10px; top: 8px; width: 40px; height: 40px; border: 0; background: none; color: var(--sub); font-size: 26px; cursor: pointer; }
.cardInner h2 { margin: 6px 40px 4px 0; font-size: 20px; line-height: 1.35; }
.tag { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--sub); }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 14px 0; font-size: 15px; }
.facts dt { color: var(--sub); }
.facts dd { margin: 0; }
.steps { display: flex; gap: 3px; margin: 10px 0 4px; }
.steps span { flex: 1; height: 6px; border-radius: 3px; background: var(--line); }
.steps span.on { background: var(--acc); }
.stepNames { display: flex; justify-content: space-between; font-size: 11px; color: var(--sub); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 6px; }
.btn { display: inline-flex; align-items: center; min-height: 40px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--ink); font: inherit; font-size: 14px; text-decoration: none; cursor: pointer; }
.btn.primary { background: var(--acc); border-color: var(--acc); color: #fff; }
@media (prefers-color-scheme: dark) { .btn.primary { color: #10161c; } }
.fine { font-size: 12.5px; color: var(--sub); line-height: 1.55; }
textarea { width: 100%; min-height: 80px; font: inherit; padding: 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); }

.notice { position: fixed; left: 50%; top: 50%; transform: translate(-50%,-50%); z-index: 900; max-width: 320px; padding: 16px 18px; border-radius: 14px; background: var(--panel); box-shadow: var(--shadow); text-align: center; line-height: 1.5; }
.foot { margin: 0; padding: 8px 16px 10px; font-size: 11px; line-height: 1.45; color: var(--sub); border-top: 1px solid var(--line); }
.foot a { color: var(--acc); }
.cluster { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; padding: 5px 10px 5px 5px; border-radius: 999px; background: var(--panel); color: var(--ink); font-size: 13px; font-weight: 600; border: 1px solid var(--line); box-shadow: 0 2px 8px rgba(0,0,0,.25); transform: translate(-50%,-50%); width: max-content; }
.cluster b { display: grid; place-items: center; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 999px; background: var(--acc); color: #fff; font-size: 12.5px; }
@media (prefers-color-scheme: dark) { .cluster b { color: #10161c; } }
.leaflet-bottom { bottom: 150px; }
@media (pointer: coarse) { .leaflet-control-zoom { display: none; } }
.leaflet-container { font: inherit; background: var(--bg); }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 3px solid var(--acc); outline-offset: 2px; }
