/* Neighborhood map. Colors: sequential blue ramp and the first three validated categorical slots. */
:root {
  --seq-1: #cde2fb; --seq-2: #86b6ef; --seq-3: #3987e5; --seq-4: #256abf; --seq-5: #104281;
  --cat-res: #2a78d6; --cat-com: #eb6834; --cat-ind: #1baf7a; --cat-other: #b9b8b3;
  --nodata: #e4e3df;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    /* Low values recede into the dark surface, so the ramp runs dark to light here. */
    --seq-1: #184f95; --seq-2: #256abf; --seq-3: #3987e5; --seq-4: #6da7ec; --seq-5: #b7d3f6;
    --cat-res: #3987e5; --cat-com: #d95926; --cat-ind: #199e70; --cat-other: #5f5e5a;
    --nodata: #2c2c2a;
  }
}
:root[data-theme="dark"] {
  --seq-1: #184f95; --seq-2: #256abf; --seq-3: #3987e5; --seq-4: #6da7ec; --seq-5: #b7d3f6;
  --cat-res: #3987e5; --cat-com: #d95926; --cat-ind: #199e70; --cat-other: #5f5e5a;
  --nodata: #2c2c2a;
}

.hood-layout { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 380px; }
.hood-panel { overflow-y: auto; border-left: 1px solid var(--border); background: var(--surface); padding: 14px 16px 24px; display: grid; gap: 18px; align-content: start; }
.hood-panel h2 { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 8px; }

.legend-block .metric-name { font-size: 15px; font-weight: 700; }
.legend-block .metric-note { font-size: 12.5px; color: var(--muted); margin: 3px 0 10px; }
.swatches { display: grid; grid-template-columns: repeat(5, 1fr); gap: 2px; }
.swatches span { height: 12px; }
.swatches span:first-child { border-radius: 4px 0 0 4px; }
.swatches span:last-child { border-radius: 0 4px 4px 0; }
.ticks { display: grid; grid-template-columns: repeat(5, 1fr); font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.ticks span:not(:first-child) { text-align: left; }
.scale-ends { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.legend-cats { display: grid; gap: 5px; font-size: 13px; }
.legend-cats span { display: flex; align-items: center; gap: 8px; }
.legend-cats i, .nodata-key i { width: 14px; height: 14px; border-radius: 3px; display: inline-block; }
.nodata-key { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); margin-top: 8px; }
.nodata-key i { background: var(--nodata); border: 1px solid var(--border); }

#detail { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; background: var(--bg); }
#detail h3 { font-size: 17px; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
#detail h3 button { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 15px; }
#detail .aka { color: var(--muted); font-size: 12.5px; margin: 2px 0 10px; }
.facts { display: grid; gap: 0; font-size: 13px; }
.facts .grp { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 10px 0 3px; }
.facts .row { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; padding: 4px 0; border-bottom: 1px solid var(--border); align-items: baseline; }
.facts .row.current { font-weight: 700; }
.facts .val { font-variant-numeric: tabular-nums; text-align: right; }
.facts .rank-of { color: var(--muted); font-size: 11.5px; font-variant-numeric: tabular-nums; min-width: 78px; text-align: right; }
.bldgs-here { margin-top: 10px; font-size: 13px; }
.bldgs-here a { display: block; }

#search { width: 100%; padding: 6px 9px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); margin-bottom: 6px; }
.rank { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.rank li { display: grid; grid-template-columns: 30px 12px 1fr auto; gap: 8px; align-items: center; padding: 5px 4px; border-radius: 6px; cursor: pointer; }
.rank li:hover, .rank li.selected { background: var(--surface-2); }
.rank li .n { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 11.5px; text-align: right; }
.rank li i { width: 12px; height: 12px; border-radius: 3px; }
.rank li .v { font-variant-numeric: tabular-nums; color: var(--muted); }

.hover-card { position: absolute; pointer-events: none; z-index: 5; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow); padding: 7px 10px; font-size: 12.5px; max-width: 240px; }
.hover-card b { display: block; font-size: 13.5px; }
.hover-card .muted { font-size: 11.5px; }

.station-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 3px solid var(--text); box-shadow: 0 0 0 2px var(--surface); }
.bldg-dot { display: flex; align-items: center; gap: 4px; padding: 2px 7px 2px 3px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); font-size: 11.5px; font-weight: 600; white-space: nowrap; cursor: pointer; color: var(--text); text-decoration: none; }
.bldg-dot b { min-width: 18px; height: 18px; padding: 0 4px; border-radius: 999px; display: grid; place-items: center; background: var(--accent); color: #fff; font-size: 10.5px; }
.bldg-dot.forma { border-color: var(--accent); }

.sources { font-size: 11.5px; color: var(--muted); line-height: 1.5; }
.sources ul { margin: 4px 0 0; padding-left: 16px; }

@media (max-width: 860px) {
  body { overflow: auto; }
  .hood-layout { grid-template-columns: 1fr; grid-template-rows: 58vh auto; }
  .hood-layout .map-pane { min-height: 58vh; }
  .hood-panel { border-left: 0; border-top: 1px solid var(--border); overflow: visible; }
  .top .filters { flex-wrap: wrap; }
}
.rank li .city { display: block; font-size: 11px; color: var(--muted); }
