
:root { --sidebar-width: 380px; --bg:#ffffff; --line:#e5e7eb; --text:#1f2937; --muted:#6b7280; --blue:#2563eb; --green:#059669; --black:#111827; }
* { box-sizing: border-box; }
html, body { height:100%; margin:0; }
body { font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif; color:var(--text); background:var(--bg); }

.topbar { display:flex; align-items:center; justify-content:space-between; padding:10px 14px; border-bottom:1px solid var(--line); background:#fff; position:sticky; top:0; z-index: 10; }
.topbar .brand h1 { font-size:18px; margin:0; }
.meta { font-size:12px; color:var(--muted); }
.btn { padding:8px 12px; border:1px solid var(--line); background:#fff; border-radius:10px; cursor:pointer; }

#app { display:flex; min-height: calc(100vh - 104px); } /* header + footer */
#sidebar { width: var(--sidebar-width); border-right:1px solid var(--line); padding:16px; overflow:auto; }
main { position:relative; flex:1 1 auto; }
#map { width:100%; height: calc(100vh - 104px); }

.controls { display:flex; flex-direction:column; gap:18px; }
.field label { font-weight:600; display:flex; align-items:center; gap:8px; margin-bottom:6px; }
.dot { width:10px; height:10px; border-radius:50%; display:inline-block; }
.dot-green { background:#34d399; }
.dot-blue { background:#60a5fa; }

.inputrow { position:relative; margin-bottom:8px; }
.input { width:100%; padding:10px 12px; border:1px solid var(--line); border-radius:10px; background:#fff; outline:none; transition:border .15s, box-shadow .15s; appearance:none; }
.input:focus { border-color:#cbd5e1; box-shadow:0 0 0 3px rgba(59,130,246,.15); }
.input[type="search"] { -webkit-appearance: none; }
.has-icon .icon { position:absolute; right:10px; top:50%; transform:translateY(-50%); font-size:14px; color:var(--muted); pointer-events:none; }

.suggestions { position:absolute; top:100%; left:0; right:0; z-index:999; background:#fff; border:1px solid var(--line); border-top:none; max-height:260px; overflow:auto; display:none; border-radius:0 0 10px 10px; }
.suggestions .item { padding:10px 12px; border-top:1px solid #f3f4f6; cursor:pointer; }
.suggestions .item:hover { background:#f8fafc; }

.hint { margin-top:6px; font-size:12px; color:var(--muted); }

.legend { position:absolute; bottom:10px; left:10px; background:#fff; border:1px solid var(--line); border-radius:10px; padding:6px 8px; font-size:12px; color:#374151; z-index: 500; }
.legend .row { display:flex; align-items:center; gap:6px; margin:4px 0; }
.legend .swatch { width:14px; height:22px; display:inline-block; border-radius:2px 2px 14px 14px; position:relative; }
.legend .swatch::after { content:""; position:absolute; width:2px; height:6px; background:#ccc; left:6px; bottom:-6px; border-radius:2px; }
.sw-green { background:#34d399; }
.sw-blue  { background:#60a5fa; }
.sw-black { background:#111827; }

.counts { margin-top:4px; padding:10px 12px; background:#f9fafb; border:1px solid var(--line); border-radius:10px; font-size:12px; color:#374151; }

/* Footer credits */
.credits { display:flex; flex-direction:column; gap:4px; align-items:center; justify-content:center; padding:10px 14px; border-top:1px solid var(--line); font-size:12px; color:var(--muted); background:#fff; }

/* Sidebar hide */
body.sidebar-hidden #sidebar { display:none; }
body.sidebar-hidden #map { height: calc(100vh - 104px); }
