/* Neighborhood map — full-stage map + side panel / phone sheet */
body.map-page {
  padding-bottom: 0;
  overflow: hidden;
  height: 100dvh;
}
body.map-page .site-footer { display: none; }
body.map-page #content {
  height: calc(100dvh - var(--hdr));
  overflow: hidden;
}
.map-stage {
  position: relative;
  height: 100%;
  background: #d7e0d6;
}
html[data-theme="dark"] .map-stage { background: #1a1f1c; }
#st-map { position: absolute; inset: 0; }
.map-stage .maplibregl-ctrl-bottom-right {
  bottom: calc(var(--nav-clear, 0px) + 8px);
  right: 8px;
}
.map-stage .maplibregl-ctrl-top-right { top: 10px; right: 10px; }
.map-stage .maplibregl-ctrl-attrib { font-size: 10px; max-width: 52vw; }
html[data-theme="dark"] .maplibregl-ctrl-group { background: #1e1e1e; }
html[data-theme="dark"] .maplibregl-ctrl-group button + button { border-top-color: rgba(255,255,255,.1); }
html[data-theme="dark"] .maplibregl-ctrl-group .maplibregl-ctrl-icon { filter: invert(1) brightness(.9); }
html[data-theme="dark"] .maplibregl-ctrl-attrib { background: rgba(8,8,8,.7); color: #c8c8c8; }
html[data-theme="dark"] .maplibregl-ctrl-attrib a { color: #eee; }
html[data-theme="dark"] .maplibregl-ctrl-attrib-button { filter: invert(1); }

.map-panel {
  position: absolute;
  z-index: 4;
  left: 0; right: 0; bottom: 0;
  height: var(--sheet-h, 46%);
  max-height: calc(100% - 8px);
  display: flex;
  flex-direction: column;
  background: var(--surface, #fcfcfc);
  color: var(--fg, #111);
  border-radius: 18px 18px 0 0;
  box-shadow: 0 -10px 36px rgba(0,0,0,.18);
  padding-bottom: 0;
  transition: height .28s cubic-bezier(.2,.8,.2,1);
  min-height: 132px;
}
.map-panel.is-dragging { transition: none; }
.map-sheet-handle {
  flex: 0 0 auto;
  display: flex;
  justify-content: center;
  padding: 8px 0 4px;
  cursor: grab;
  touch-action: none;
}
.map-sheet-handle span {
  width: 40px; height: 4px; border-radius: 4px;
  background: rgba(0,0,0,.22);
}
html[data-theme="dark"] .map-sheet-handle span { background: rgba(255,255,255,.28); }
.map-panel-head { padding: 0 16px 10px; flex: 0 0 auto; }
.map-panel-head h1 {
  font: 560 1.35rem/1.15 var(--font, Inter, sans-serif);
  letter-spacing: -.02em;
  margin: .15rem 0 .35rem;
}
.map-lede { margin: 0 0 .75rem; font-size: .88rem; line-height: 1.45; color: var(--muted, #555); }
.map-search input {
  width: 100%;
  border: 1px solid var(--line, #ddd);
  background: var(--bg, #fff);
  color: inherit;
  border-radius: 10px;
  padding: .65rem .8rem;
  font: 400 15px/1.2 var(--font, Inter, sans-serif);
}
.map-filters {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-top: .7rem;
}
.map-chip {
  appearance: none; border: 1px solid transparent;
  background: var(--chip, #eee);
  color: inherit;
  border-radius: 999px;
  padding: .35rem .7rem;
  font: 500 12px/1 var(--font, Inter, sans-serif);
  letter-spacing: .02em;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: .35rem;
}
.map-chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--layer, #109647); }
.map-chip[aria-pressed="false"] {
  background: var(--surface-2, #fbfbfb);
  color: var(--muted, #4a4a4a);
  border-color: var(--line, #e3e3e3);
}
.map-chip[aria-pressed="true"] {
  border-color: color-mix(in srgb, var(--layer, #109647) 55%, transparent);
  background: color-mix(in srgb, var(--layer, #109647) 14%, var(--surface, #fff));
}
.map-panel-body { flex: 1 1 auto; overflow: auto; -webkit-overflow-scrolling: touch; padding: 0 8px 12px; }
@media (max-width: 899px) {
  .map-panel-body { padding-bottom: calc(12px + var(--nav-clear, 0px)); }
}
.map-group-label {
  position: sticky; top: 0;
  background: var(--surface, #fcfcfc);
  font: 600 11px/1 var(--font, Inter, sans-serif);
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted, #666);
  padding: .55rem 8px .3rem;
  z-index: 1;
}
.map-item {
  display: block; width: 100%; text-align: left;
  border: 0; background: transparent; color: inherit;
  padding: .7rem 8px; border-radius: 10px;
  cursor: pointer;
  font: 500 15px/1.3 var(--font, Inter, sans-serif);
}
.map-item small { display: block; font: 400 12.5px/1.35 var(--font, Inter, sans-serif); color: var(--muted, #666); margin-top: .15rem; }
.map-item.is-active, html.can-hover .map-item:hover { background: color-mix(in srgb, #109647 10%, transparent); }
.map-empty, .map-detail { padding: .6rem 8px 1rem; }
.map-detail h2 { font: 560 1.2rem/1.2 var(--font, Inter, sans-serif); letter-spacing: -.02em; margin: 0 0 .35rem; }
.map-detail p { margin: 0 0 .7rem; font-size: .92rem; line-height: 1.5; }
.map-source { font-size: .78rem !important; color: var(--muted, #666); }
.map-detail .btn-row { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .4rem; }
.map-back {
  appearance: none; border: 0; background: none; color: var(--green-text, #0e863f);
  font: 500 13px/1 var(--font, Inter, sans-serif);
  padding: 0 0 .6rem; cursor: pointer;
}
.map-panel-foot { flex: 0 0 auto; padding: 8px 16px 10px; }
.map-attrib { margin: 0; font-size: 11px; line-height: 1.4; color: var(--muted, #666); }
.map-attrib a { color: inherit; text-decoration: underline; }
.map-noscript {
  position: absolute; left: 16px; right: 16px; top: 16px; z-index: 5;
  background: var(--surface); padding: 1rem; border-radius: 12px;
}
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); border: 0;
}

@media (min-width: 900px) {
  .map-panel {
    top: 16px; left: 16px; bottom: 16px; right: auto;
    width: min(400px, 36vw);
    height: auto !important;
    max-height: none;
    border-radius: 18px;
    padding-bottom: 0;
    box-shadow: 0 16px 40px rgba(0,0,0,.18);
  }
  .map-sheet-handle { display: none; }
  .map-stage .maplibregl-ctrl-bottom-right { bottom: 10px; }
  .map-panel-head h1 { font-size: 1.5rem; }
}
