/* Kartenseiten */

/* Übersicht */
.map-card { display: flex; flex-direction: column; padding: 0; overflow: hidden; color: inherit; text-decoration: none; }
.map-card:hover { border-color: var(--accent); }
.map-card img { width: 100%; aspect-ratio: 1; object-fit: cover; background: var(--surface-2); }
.map-card-body { padding: 14px 16px; }
.map-card-body p { margin: 0; }

/* Detailseite */
.map-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px; }
.map-switch { display: flex; gap: 6px; flex-wrap: wrap; }
.map-switch .chip { text-decoration: none; color: inherit; }

.map-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: var(--gap);
  height: calc(100vh - 150px);
  min-height: 480px;
}

.map-canvas {
  height: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #0d0f0a;
  overflow: hidden;
}

.map-panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
  overflow-y: auto;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.map-panel .panel-section { flex-shrink: 0; }
.map-panel h3 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); margin-bottom: 8px; }
.map-panel .input { width: 100%; }
.map-info p { margin: 4px 0 0; }

.map-results { list-style: none; margin: 6px 0 0; padding: 0; }
.map-results button {
  display: flex; flex-direction: column; align-items: flex-start; width: 100%;
  padding: 6px 8px; border: 0; border-radius: 6px; background: transparent; cursor: pointer; text-align: left;
}
.map-results button:hover { background: var(--surface-2); }
.map-results .muted { font-size: 0.8rem; }

.layer-list { display: flex; flex-direction: column; gap: 4px; }
.layer-toggle { display: grid; grid-template-columns: auto 14px 1fr auto; align-items: center; gap: 8px; font-size: 0.9rem; cursor: pointer; }
.layer-toggle .swatch { width: 14px; height: 14px; border-radius: 3px; }
.layer-toggle .count { color: var(--text-muted); font-size: 0.8rem; }

.tint-control { display: flex; align-items: center; gap: 8px; font-size: 0.8rem; }
.tint-control input { flex: 1; min-width: 0; accent-color: var(--accent); }
.zone-value { min-width: 3.5em; text-align: right; font-variant-numeric: tabular-nums; color: var(--text-muted); }

/* Sichtlinie */
.los-buttons { display: flex; gap: 8px; }
.los-buttons .btn { flex: 1; }
.los-toggle[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--surface); }
.los-heights { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 6px; }
.los-point { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border); }
.los-point-head { display: flex; align-items: center; gap: 8px; }
.los-dot {
  display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid #fff; color: #fff; font-size: 11px; font-weight: 700; box-shadow: 0 1px 3px rgb(0 0 0 / 0.5);
}
.los-dot.los-a { background: #2e86de; }
.los-dot.los-b { background: #e67e22; }
.los-site { font-size: 0.8rem; margin: 4px 0 0; }
.los-heights label { display: flex; flex-direction: column; gap: 4px; font-size: 0.8rem; color: var(--text-muted); }
.los-hint { font-size: 0.78rem; margin: 8px 0 0; }
.los-status p { margin: 8px 0 0; font-size: 0.88rem; }
.los-verdict { font-weight: 700; font-size: 1rem !important; }
.los-verdict.ok { color: var(--up); }
.los-verdict.blocked { color: var(--down); }
.los-mode { cursor: crosshair; }
.los-mode .leaflet-interactive { cursor: crosshair; }

.los-marker {
  display: grid; place-items: center;
  border-radius: 50%; border: 2px solid #fff;
  font-weight: 700; font-size: 13px; color: #fff;
  box-shadow: 0 1px 4px rgb(0 0 0 / 0.6);
}
.los-marker.los-a { background: #2e86de; }
.los-marker.los-b { background: #e67e22; }

.los-profile .los-ground { fill: #8d6e4a; opacity: 0.45; }
.los-profile .los-ground-line { fill: none; stroke: #8d6e4a; stroke-width: 1.5; }
.los-profile .los-object { fill: #8e44ad; opacity: 0.8; }
.los-profile .los-ray { stroke-width: 2.5; }
.los-profile .los-ray.ok { stroke: var(--up); }
.los-profile .los-ray.blocked { stroke: var(--down); stroke-dasharray: 6 5; }
.los-profile .los-hit { fill: var(--down); stroke: var(--surface); stroke-width: 2; }
.los-profile .los-end { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }
.los-profile .los-end-label { fill: var(--text); font-size: 13px; font-weight: 700; }
.los-objects { margin: 0; padding-left: 20px; font-size: 0.88rem; }
.los-objects li { margin: 3px 0; }

.building-legend { margin-top: 8px; font-size: 0.78rem; gap: 6px 10px; }
.building-legend span::before { border-radius: 2px; }

/* Gebiete: nur der Rand reagiert auf Maus, damit Gebäude darunter anklickbar bleiben */
.leaflet-pane path.zone-path.leaflet-interactive { pointer-events: visibleStroke; }

/* Mauszeiger-Höhe */
.cursor-readout {
  background: rgb(20 22 15 / 0.85);
  color: #e8e6dc;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}

/* Gebäude-Details */
.building-info .kv { margin-bottom: 8px; }
.destructible { border-top: 1px solid var(--border); padding-top: 8px; }
.kv-row { display: flex; justify-content: space-between; gap: 8px; }

/* Leaflet an das Seitendesign anpassen */
.map-canvas.leaflet-container { font: inherit; }
.map-tooltip { background: #14160f; color: #e8e6dc; border: 1px solid #353a2c; box-shadow: none; }
.map-tooltip::before { display: none; }
.leaflet-control-attribution { background: rgb(0 0 0 / 0.55) !important; color: #ccc; }
.leaflet-control-attribution a { color: #e0b143; }
.leaflet-bar a { background: var(--surface); color: var(--text); border-color: var(--border); }
.leaflet-bar a:hover { background: var(--surface-2); }

@media (max-width: 900px) {
  .map-layout { grid-template-columns: minmax(0, 1fr); height: auto; }
  .map-canvas { height: 70vh; }
  .map-panel { overflow: visible; }
}
