/* The live map: a working surface, so it fills the screen under a quiet header. Every
   site is ember with its stage in the fill, as on the home map. */
.map-page { display: flex; flex-direction: column; height: 100vh; height: 100svh; overflow: hidden; }
.map-head { flex: none; padding: var(--space-3) var(--gutter); max-width: none; }
.map-shell { flex: 1 1 auto; display: grid; grid-template-columns: 320px minmax(0, 1fr); min-height: 0; }
.map-panel { display: flex; flex-direction: column; gap: var(--space-4); padding: var(--space-3) var(--space-3) var(--space-4); overflow-y: auto; background: var(--surface); }
.map-stage { position: relative; min-width: 0; }
.live-map { position: absolute; inset: 0; background: #0b0b0a; font: 400 13px/18px var(--font-text); }
.leaflet-container { background: #0b0b0a; font: 400 13px/18px var(--font-text); }
.live-map:focus, .live-map:focus-visible { outline: none; }
.base-dark { filter: invert(1) hue-rotate(180deg) brightness(.72) contrast(.92) saturate(.28); }
.leaflet-control-attribution { background: rgba(0, 0, 0, .6) !important; color: var(--ink-muted); font-size: 11px; }
.leaflet-control-attribution a { color: inherit; }
.leaflet-bar a, .leaflet-bar a:hover { background: var(--surface-raised); color: var(--ink); border-color: var(--line); }

.map-controls { position: absolute; z-index: 800; top: var(--space-3); left: var(--space-3); display: flex; gap: var(--space-2); }
.map-button { height: 36px; padding: 0 var(--space-3); border: 0; border-radius: var(--radius-s); background: var(--surface-raised); color: var(--ink); font: 500 14px/20px var(--font-text); cursor: pointer; }
.map-button:hover { background: var(--surface); }
.map-button[aria-pressed="true"] { box-shadow: inset 0 0 0 var(--hairline) var(--ink); }
#panel-toggle { display: none; }

.panel-search { position: relative; }
.panel-search input { width: 100%; height: 44px; padding: 0 var(--space-3); border: 0; border-radius: var(--radius-s); background: var(--surface-raised); color: var(--ink); box-shadow: inset 0 0 0 var(--hairline) var(--line); font: 400 16px/24px var(--font-text); }
.panel-search input:hover { box-shadow: inset 0 0 0 var(--hairline) var(--ink-muted); }
.search-results { position: absolute; z-index: 900; top: 48px; left: 0; right: 0; max-height: 320px; overflow-y: auto; margin: 0; padding: var(--space-1) 0; list-style: none; background: var(--surface-raised); box-shadow: 0 8px 24px rgba(0, 0, 0, .5); }
.search-results button { display: block; width: 100%; padding: var(--space-2) var(--space-3); border: 0; background: none; color: var(--ink); font: 400 15px/20px var(--font-text); text-align: left; cursor: pointer; }
.search-results button:hover, .search-results button:focus-visible { background: var(--surface); }
.search-results span { display: block; font-size: 13px; line-height: 18px; color: var(--ink-muted); }
.search-results .is-empty { padding: var(--space-2) var(--space-3); font-size: 14px; color: var(--ink-muted); }

.layer-group + .layer-group { margin-top: var(--space-4); }
.layer-group h2 { margin: 0 0 var(--space-1); font: 500 13px/18px var(--font-text); letter-spacing: 0; color: var(--ink-muted); }
.layer { display: flex; align-items: center; gap: var(--space-2); padding: 7px 0; font: 400 15px/20px var(--font-text); cursor: pointer; }
.layer input { flex: none; width: 16px; height: 16px; margin: 0; accent-color: var(--ink); }
.layer.is-locked { color: var(--ink-muted); cursor: default; }
.swatch { flex: none; width: 12px; height: 12px; }
.swatch.is-round { border-radius: var(--radius-full); }
.swatch.is-line { height: 2px; }
.swatch.is-area { opacity: .7; }
.layer small { margin-left: auto; font: 500 11px/16px var(--font-data); color: var(--ink-muted); }
.full-note { margin-top: var(--space-2); font: 400 13px/18px var(--font-text); color: var(--ink-muted); }
.full-note a { color: var(--ink); text-underline-offset: 3px; }

.panel-gate { padding: var(--space-3); background: var(--surface-raised); }
.panel-gate h2 { font-size: 20px; line-height: 24px; letter-spacing: -.02em; }
.panel-gate .muted { margin-top: var(--space-1); font-size: 14px; line-height: 20px; }
.panel-gate .form { margin-top: var(--space-3); }
.panel-gate input[type=email] { display: block; width: 100%; background: var(--surface); }
.panel-gate .btn { width: 100%; margin-top: var(--space-2); }
.panel-source { margin-top: auto; }

.map-card { position: absolute; z-index: 800; top: var(--space-3); right: var(--space-3); width: min(340px, calc(100% - 2 * var(--space-3))); max-height: calc(100% - 2 * var(--space-3)); overflow-y: auto; padding: var(--space-3) var(--space-4) var(--space-4); background: var(--surface); box-shadow: 0 8px 32px rgba(0, 0, 0, .55); }
.card-close { float: right; margin: 0 calc(-1 * var(--space-2)) 0 var(--space-2); padding: var(--space-1) var(--space-2); border: 0; background: none; color: var(--ink-muted); font: 400 20px/20px var(--font-text); cursor: pointer; }
.card-close:hover { color: var(--ink); }
.map-card h3 { font-size: 20px; line-height: 24px; }
.card-meta { margin-top: var(--space-1); font: 400 14px/20px var(--font-text); color: var(--ink-muted); }
.card-figure { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); margin-top: var(--space-2); }
.card-figure .data { font-size: 16px; line-height: 24px; }
.card-actions { margin-top: var(--space-3); }
.card-actions .ghost { font-size: 14px; line-height: 20px; }
.card-rows { margin: var(--space-3) 0 0; }
.card-rows div { display: flex; justify-content: space-between; gap: var(--space-3); padding: 6px 0; border-top: var(--hairline) solid var(--line); font: 400 14px/20px var(--font-text); }
.card-rows dt { color: var(--ink-muted); }
.card-rows dd { margin: 0; text-align: right; }
.card-heading { margin-top: var(--space-3); font: 500 13px/18px var(--font-text); color: var(--ink-muted); }
.card-list { margin: var(--space-1) 0 0; padding: 0; list-style: none; }
.card-list li { display: flex; justify-content: space-between; gap: var(--space-3); padding: 6px 0; border-top: var(--hairline) solid var(--line); font: 400 14px/20px var(--font-text); }
.card-list a { color: inherit; text-underline-offset: 3px; }
.card-list .data { flex: none; font-size: 12px; line-height: 20px; color: var(--ink-muted); }
.card-note { margin-top: var(--space-3); font: 400 12px/16px var(--font-text); color: var(--ink-muted); }
.card-note a { color: var(--ink); text-underline-offset: 3px; }

@media (max-width: 860px) {
  .map-shell { grid-template-columns: minmax(0, 1fr); }
  .map-panel { position: absolute; z-index: 850; left: 0; right: 0; bottom: 0; top: auto; max-height: 75%; display: none; box-shadow: 0 -8px 32px rgba(0, 0, 0, .55); }
  .map-panel.is-open { display: flex; }
  .map-shell { position: relative; }
  #panel-toggle { display: block; }
  .map-card { top: auto; bottom: var(--space-3); right: var(--space-3); max-height: 55%; }
}
