:root { --bg:#0f172a; --panel:#111827; --muted:#94a3b8; --text:#e5e7eb; --accent:#38bdf8; --line:#243044; --app-height:100dvh; }
* { box-sizing:border-box; }
html, body { min-height:100%; }
body { margin:0; font:14px/1.4 system-ui,-apple-system,Segoe UI,sans-serif; background:var(--bg); color:var(--text); overflow:hidden; }
header { min-height:72px; display:flex; justify-content:space-between; align-items:center; gap:16px; padding:14px 18px; border-bottom:1px solid var(--line); background:#0b1220; }
h1 { margin:0; font-size:22px; } p { margin:4px 0 0; color:var(--muted); }
.controls { display:flex; gap:12px; flex-wrap:wrap; color:var(--muted); }
main { display:grid; grid-template-columns:minmax(0,1fr) 390px; height:calc(var(--app-height) - 72px); min-height:0; }
#map { min-height:420px; height:100%; width:100%; }
aside { min-height:0; overflow:auto; border-left:1px solid var(--line); background:#0b1220; padding:12px; -webkit-overflow-scrolling:touch; }
.card { background:var(--panel); border:1px solid var(--line); border-radius:12px; padding:12px; margin-bottom:12px; box-shadow:0 8px 24px rgb(0 0 0 / .18); }
h2 { margin:0 0 10px; font-size:16px; }
.kpis { display:grid; grid-template-columns:repeat(2,1fr); gap:8px; }
.kpi { border:1px solid var(--line); border-radius:10px; padding:8px; }
.kpi strong { display:block; font-size:20px; }
input#search { width:100%; padding:10px; border-radius:10px; border:1px solid var(--line); background:#0f172a; color:var(--text); margin-bottom:10px; }
.listing { padding:10px; border-top:1px solid var(--line); cursor:pointer; }
.listing:hover { background:#172033; }
.listing a { color:var(--accent); text-decoration:none; font-weight:600; }
.meta { color:var(--muted); font-size:12px; margin-top:3px; }
.price { color:#a7f3d0; font-weight:700; }
.basis { color:var(--muted); font-size:11px; text-transform:uppercase; margin-left:2px; }
.chips { display:flex; flex-wrap:wrap; gap:5px; margin-top:7px; }
.chips span { display:inline-flex; align-items:center; border:1px solid #334155; border-radius:999px; padding:2px 7px; background:#172033; color:#cbd5e1; font-size:11px; line-height:1.5; }
.muted-chip span { color:#94a3b8; border-style:dashed; }
table { width:100%; border-collapse:collapse; font-size:13px; }
th,td { text-align:left; padding:7px 5px; border-bottom:1px solid var(--line); }
th { color:var(--muted); font-weight:600; }
.legend { line-height:18px; color:#111827; background:white; padding:8px 10px; border-radius:8px; box-shadow:0 2px 10px rgb(0 0 0 / .2); }
.legend i { width:18px; height:18px; float:left; margin-right:8px; opacity:.8; }
.maplibregl-popup-content { color:#111827; min-width:220px; line-height:1.35; }
.maplibregl-popup-content a { color:#0369a1; font-weight:700; }
.maplibregl-popup-content .chips span { background:#eef2ff; color:#1e293b; border-color:#c7d2fe; }
.maplibregl-canvas { outline:none; }
.maplibre-legend { position:absolute; right:10px; bottom:34px; z-index:2; }
@media (max-width: 900px) {
  body { overflow:auto; }
  header { min-height:0; position:relative; z-index:1000; align-items:flex-start; flex-direction:column; gap:8px; padding:10px 12px; }
  h1 { font-size:18px; }
  #subtitle { font-size:12px; margin-top:2px; }
  .controls { gap:8px 10px; font-size:13px; }
  main { display:block; height:auto; min-height:0; }
  #map { height:58svh; min-height:360px; max-height:620px; position:sticky; top:0; z-index:1; border-bottom:1px solid var(--line); }
  aside { overflow:visible; border-left:0; border-top:1px solid var(--line); padding:10px; }
  .card { border-radius:10px; padding:10px; margin-bottom:10px; }
  .kpis { grid-template-columns:repeat(4,1fr); gap:6px; }
  .kpi { padding:6px; font-size:11px; }
  .kpi strong { font-size:15px; }
  table { font-size:12px; }
  th,td { padding:6px 4px; }
  .maplibregl-ctrl-attrib { font-size:10px; }
  .legend { display:none; }
  .maplibregl-popup-content { min-width:190px; max-width:240px; }
}
@media (max-width: 420px) {
  #map { height:54svh; min-height:320px; }
  .controls label { white-space:nowrap; }
  .kpis { grid-template-columns:repeat(2,1fr); }
}
