:root{
  --bg:#0f172a;
  --panel:#111827;
  --panel2:#0b1220;
  --text:#e5e7eb;
  --muted:#9ca3af;
  --border:rgba(255,255,255,.12);
  --btn:#2563eb;
  --btn2:#334155;
  --shadow: 0 10px 30px rgba(0,0,0,.35);
}

*{ box-sizing:border-box; }
body{
  margin:0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: linear-gradient(180deg, var(--bg), #020617);
  color:var(--text);
}

.topbar{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:14px 18px;
  border-bottom:1px solid var(--border);
  background: rgba(2,6,23,.65);
  backdrop-filter: blur(8px);
  position: sticky;
  top:0;
  z-index:10;
}

h1{
  margin:0;
  font-size:18px;
  font-weight:700;
}
.sub{
  font-size:12px;
  color:var(--muted);
  margin-top:2px;
}

.right{ display:flex; gap:10px; }

.btn{
  border:0;
  padding:10px 12px;
  border-radius:12px;
  background:var(--btn);
  color:white;
  cursor:pointer;
  box-shadow: var(--shadow);
  font-weight:600;
  font-size:13px;
}
.btn.secondary{
  background: var(--btn2);
}

.layout{
  display:grid;
  grid-template-columns: 340px 1fr;
  gap:14px;
  padding:14px;
}

.panel{
  background: rgba(17,24,39,.75);
  border:1px solid var(--border);
  border-radius:16px;
  padding:14px;
  box-shadow: var(--shadow);
}

.panel h2{
  margin:6px 0 10px;
  font-size:14px;
  letter-spacing:.2px;
}
.layerRow{
  background: rgba(2,6,23,.35);
  border:1px solid var(--border);
  padding:12px;
  border-radius:14px;
  margin-bottom:10px;
}

.check{
  display:flex;
  gap:10px;
  align-items:center;
  font-weight:650;
}
.check input{ transform: scale(1.1); }
.small{
  color:var(--muted);
  font-size:12px;
  margin:10px 0 6px;
}
input[type="range"]{
  width:100%;
}

hr{
  border:0;
  border-top:1px solid var(--border);
  margin:12px 0;
}

.legend{
  background: rgba(2,6,23,.35);
  border:1px solid var(--border);
  padding:12px;
  border-radius:14px;
}
.legItem{
  display:flex;
  align-items:center;
  gap:10px;
  margin-bottom:8px;
}
.swatch{
  width:18px;
  height:18px;
  border-radius:6px;
  border:1px solid rgba(255,255,255,.35);
}
.swatch.buffer{ background: rgba(34,197,94,.35); }
.swatch.parks{ background: rgba(239,68,68,.85); }

.hint{
  font-size:12px;
  color:var(--muted);
  margin:10px 0 0;
  line-height:1.35;
}

.status{
  background: rgba(2,6,23,.35);
  border:1px solid var(--border);
  padding:12px;
  border-radius:14px;
  color: var(--text);
  font-size:13px;
  min-height:44px;
  line-height:1.35;
}

.footnote{
  margin-top:10px;
  color:var(--muted);
  font-size:12px;
  line-height:1.35;
}

.mapWrap{
  position:relative;
  background: rgba(17,24,39,.35);
  border:1px solid var(--border);
  border-radius:16px;
  overflow:hidden;
  box-shadow: var(--shadow);
}

.map{
  width:100%;
  height: calc(100vh - 92px);
  min-height:560px;
}

/* Popup (OpenLayers style) */
.ol-popup {
  position: absolute;
  background-color: white;
  color:#111;
  padding: 12px 12px 10px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,.15);
  bottom: 12px;
  left: 12px;
  min-width: 240px;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
}
.ol-popup:after, .ol-popup:before {
  top: 100%;
  border: solid transparent;
  content: " ";
  height: 0;
  width: 0;
  position: absolute;
  pointer-events: none;
}
.ol-popup:after {
  border-top-color: white;
  border-width: 10px;
  left: 18px;
  margin-left: -10px;
}
.ol-popup:before {
  border-top-color: rgba(0,0,0,.15);
  border-width: 11px;
  left: 18px;
  margin-left: -11px;
}
.ol-popup-closer {
  text-decoration: none;
  position: absolute;
  top: 6px;
  right: 10px;
  color:#111;
  font-weight: 800;
}
.ol-popup-closer:after { content: "✕"; }

.coordsBar{
  position:absolute;
  right:12px;
  bottom:10px;
  background: rgba(2,6,23,.75);
  border:1px solid var(--border);
  padding:8px 10px;
  border-radius:12px;
  color: var(--text);
  font-size:12px;
  backdrop-filter: blur(6px);
}