:root {
  --amber: #f5a623;
  --amber-dark: #c47f0a;
  --ink: #14202e;
  --muted: #6b7787;
  --line: #e4e8ee;
  --card: #ffffff;
  --green: #2e9e6b;
  --indigo: #5b6ee1;
  --slate: #8a94a6;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--ink);
}

#map { position: absolute; inset: 0; background: #a8c8e0; }

.panel {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 1000;
  width: 296px;
  max-height: calc(100% - 28px);
  overflow-y: auto;
  background: var(--card);
  border-radius: 14px;
  box-shadow: 0 10px 34px rgba(10, 20, 35, .26);
  scrollbar-width: thin;
}

.panel-head {
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 11px; }

.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--amber);
  color: #2b1c00;
  font-weight: 800;
  font-size: 19px;
  box-shadow: 0 2px 0 var(--amber-dark);
}

.brand h1 { margin: 0; font-size: 17px; letter-spacing: -.2px; }
.brand p { margin: 1px 0 0; font-size: 11.5px; color: var(--muted); }

.search { position: relative; padding: 12px 14px 4px; }

.search input {
  width: 100%;
  padding: 9px 11px;
  font-size: 13px;
  font-family: inherit;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fbfcfe;
  outline: none;
}

.search input:focus { border-color: var(--amber); background: #fff; }

#results {
  position: absolute;
  top: 47px;
  left: 14px;
  right: 14px;
  z-index: 1200;
  margin: 0;
  padding: 4px;
  list-style: none;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 12px 26px rgba(10, 20, 35, .22);
  max-height: 264px;
  overflow-y: auto;
}

#results li {
  padding: 7px 9px;
  border-radius: 7px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
}

#results li:hover, #results li.active { background: #fff6e2; }
#results .r-name { font-size: 13px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#results .r-kind { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
#results .empty { color: var(--muted); font-size: 12.5px; cursor: default; }
#results .empty:hover { background: none; }

.block { padding: 10px 14px 4px; }
.block h2 {
  margin: 0 0 7px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--muted);
}

.toggles { display: flex; flex-direction: column; gap: 2px; }

.toggles label {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 6px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  user-select: none;
}

.toggles label:hover { background: #f6f8fb; }
.toggles input { accent-color: var(--amber); width: 15px; height: 15px; }
.toggles .count { margin-left: auto; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.swatch { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.swatch.sq { border-radius: 2px; }
.swatch.ln { width: 15px; height: 3px; border-radius: 2px; }
.swatch.dash { background: none; border: 1.5px dashed; }

.chips { display: flex; gap: 6px; flex-wrap: wrap; }

.chips button {
  padding: 5px 11px;
  font-size: 12px;
  font-family: inherit;
  color: var(--muted);
  background: #f4f6f9;
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
}

.chips button:hover { color: var(--ink); }
.chips button.on { background: #fff6e2; border-color: var(--amber); color: var(--amber-dark); font-weight: 600; }

.legend { margin: 0; padding: 0 0 2px; list-style: none; display: grid; gap: 5px; }
.legend li { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #404c5c; }

.stats {
  padding: 10px 14px 13px;
  margin-top: 6px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  line-height: 1.65;
  color: var(--muted);
}

.stats b { color: var(--ink); font-variant-numeric: tabular-nums; }

#planlegend {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.plan-note {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  font-size: 10.5px;
  line-height: 1.5;
  color: var(--muted);
}
.plan-note p { margin: 0 0 4px; }
.plan-note p:last-child { margin-bottom: 0; }
.plan-note b { color: var(--ink); }
.plan-note .warn { color: #9a5312; }

.hint {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 900;
  padding: 6px 14px;
  font-size: 12px;
  color: #fff;
  background: rgba(15, 25, 38, .78);
  border-radius: 999px;
  pointer-events: none;
  transition: opacity .5s;
}

.hint.gone { opacity: 0; }

/* map labels */
.lbl {
  background: none;
  border: none;
  box-shadow: none;
}

.lbl span {
  display: inline-block;
  padding: 0 3px;
  font-size: 11px;
  font-weight: 600;
  line-height: 14px;
  white-space: nowrap;
  color: #16202c;
  text-shadow: 0 0 3px #fff, 0 0 3px #fff, 0 0 5px #fff, 1px 1px 2px #fff;
  transform: translate(-50%, -100%);
}

.lbl-landmark span { font-size: 12px; font-weight: 800; color: #14432c; }
.lbl-business span { color: #6b4300; }
.lbl-house span { color: #2f3a8c; }
.lbl-building span { color: #4a5462; }
.lbl-road span { font-size: 10.5px; font-weight: 700; color: #3d4b5c; letter-spacing: .02em; }
.lbl-plan span {
  font-size: 9.5px;
  font-weight: 700;
  color: #22303f;
  font-variant-numeric: tabular-nums;
  padding: 0 2px;
}

.on-satellite .lbl span {
  color: #fff;
  text-shadow: 0 0 3px #000, 0 0 4px #000, 0 0 6px #000, 1px 1px 2px #000;
}
.on-satellite .lbl-landmark span,
.on-satellite .lbl-business span,
.on-satellite .lbl-house span,
.on-satellite .lbl-building span,
.on-satellite .lbl-road span { color: #fff; }

.leaflet-popup-content-wrapper { border-radius: 11px; }
.leaflet-popup-content { margin: 12px 14px; font-size: 12.5px; line-height: 1.55; }

.pop-name { margin: 0 0 3px; font-size: 15px; font-weight: 700; letter-spacing: -.2px; }
.pop-badge {
  display: inline-block;
  padding: 1px 8px;
  margin-bottom: 7px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  border-radius: 999px;
  background: #fff2d6;
  color: var(--amber-dark);
}
.pop-badge.landmark { background: #ddf3e8; color: #1d6b47; }
.pop-badge.house { background: #e4e7fb; color: #3a48a8; }
.pop-badge.building { background: #eceff3; color: #56606f; }
.pop-badge.road { background: #e8edf4; color: #3d4b5c; }
.pop-badge.closed { background: #fde3e3; color: #a02626; }
.pop-badge.plan { background: #e8edf4; color: #33404f; font-variant-numeric: tabular-nums; }
.pop-badge.existing { background: #dfe6dd; color: #33513c; }
.pop-badge.proposed { background: #fde9d6; color: #9a5312; }

.pop-rows { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 3px 9px; }
.pop-rows dt { color: var(--muted); font-size: 11.5px; }
.pop-rows dd { margin: 0; font-size: 12px; word-break: break-word; }
.pop-rows a { color: #1f6feb; text-decoration: none; }
.pop-rows a:hover { text-decoration: underline; }
.pop-foot {
  margin-top: 8px;
  padding-top: 7px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: var(--muted);
}
.pop-foot a { font-size: 11.5px; color: var(--muted); text-decoration: none; }
.pop-foot a:hover { color: var(--ink); text-decoration: underline; }

@media (max-width: 620px) {
  .panel { width: calc(100% - 20px); left: 10px; top: 10px; max-height: 46%; }
  .hint { display: none; }
}
