.map-view-body {
  margin: 0;
  min-height: 100vh;
  background: #f4f4f2;
  color: #222;
  font-family: "Champagne Limousines", system-ui, sans-serif;
}

/* global.css setzt header { position:fixed } — hier zurück in den Dokumentfluss */
.map-view-body > header.map-header {
  position: sticky;
  top: 0;
  left: auto;
  right: auto;
  z-index: 40;
  height: auto;
  min-height: 0;
  box-sizing: border-box;
}

.map-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: #fff;
  border-bottom: 1px solid #e5e5e5;
}

.map-header h1 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
}

.map-sub {
  margin: 0.15rem 0 0;
  color: #666;
  font-size: 0.9rem;
}

.map-back {
  color: #9e4242;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 600;
  white-space: nowrap;
}

.map-back:hover { text-decoration: underline; }

.map-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 0.75rem 1.25rem;
  padding: 0.75rem 1.25rem;
  background: #fff;
  border-bottom: 1px solid #eee;
}

.map-search, .map-filter {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.75rem;
  color: #666;
}

.map-search input,
.map-filter select {
  min-width: 160px;
  padding: 0.45rem 0.6rem;
  border: 1px solid #ddd;
  border-radius: 8px;
  font: inherit;
  font-size: 0.95rem;
}

.map-toggle {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  padding-bottom: 0.35rem;
}

.map-count {
  margin-left: auto;
  font-size: 0.85rem;
  color: #666;
  padding-bottom: 0.35rem;
}

.map-view-hint {
  font-size: 0.85rem;
  color: #555;
  padding-bottom: 0.35rem;
}

.map-view-hint.hidden {
  display: none;
}

.map-reset-view {
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  font-weight: 600;
  color: #9e4242;
  cursor: pointer;
  text-decoration: underline;
}

.map-layout {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 0;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem;
}

@media (max-width: 900px) {
  .map-layout { grid-template-columns: 1fr; }
  .map-legend { order: -1; }
}

.map-canvas-wrap {
  position: relative;
  background: #fff;
  border-radius: 14px;
  border: 1px solid #e8e8e8;
  box-shadow: 0 2px 12px rgba(0,0,0,0.04);
  padding: 0.5rem;
}

#map-svg {
  width: 100%;
  height: auto;
  max-height: min(85vh, 620px);
  display: block;
  user-select: none;
}

#map-svg[data-zoomed-zone] {
  max-height: min(72vh, 720px);
}

.map-zone-label {
  font-size: 11px;
  font-weight: 700;
  fill: rgba(0,0,0,0.45);
  pointer-events: none;
}

.map-axis-label {
  font-size: 12px;
  fill: #555;
}

.map-grid-line {
  stroke: #ececec;
  stroke-width: 1;
}

/* Mittelkreuz bei Valenz 5 / Aktivierung 5 — leicht hervorgehoben */
.map-mid-cross-line {
  stroke: #c9c4c4;
  stroke-width: 1.35;
  stroke-opacity: 0.85;
  pointer-events: none;
}

.map-zone-rect {
  stroke: rgba(255,255,255,0.6);
  stroke-width: 1;
}

.map-term {
  cursor: pointer;
  transition: r 0.12s ease;
}

.map-term.core { stroke: rgba(255,255,255,0.9); stroke-width: 1; }
.map-term.border { stroke: #333; stroke-width: 1.2; stroke-dasharray: 2 2; fill-opacity: 0.85; }

.map-term.highlight { stroke: #000; stroke-width: 2; }
.map-term.dim { opacity: 0.12; }

.map-term-hit {
  cursor: pointer;
  pointer-events: all;
}

.map-term-anchor {
  pointer-events: none;
  fill-opacity: 0.45;
}

.map-term-link {
  stroke: rgba(60, 50, 50, 0.22);
  stroke-width: 1;
  pointer-events: none;
}

.map-term-label {
  font-size: 8px;
  fill: #222;
  pointer-events: none;
  text-anchor: middle;
}

.map-tooltip {
  position: absolute;
  pointer-events: none;
  z-index: 10;
  max-width: 220px;
  padding: 0.5rem 0.65rem;
  background: rgba(20,20,20,0.92);
  color: #fff;
  border-radius: 8px;
  font-size: 0.82rem;
  line-height: 1.35;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

.map-tooltip.hidden { display: none; }
.map-tooltip-meta {
  margin: 0 0 0.4rem;
  font-size: 0.75rem;
  opacity: 0.85;
}
.map-tooltip-block + .map-tooltip-block {
  margin-top: 0.45rem;
  padding-top: 0.45rem;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}
.map-tooltip strong { display: block; font-size: 0.95rem; margin-bottom: 0.2rem; }

.map-legend {
  padding: 0.75rem 0 0 1rem;
}

@media (max-width: 900px) {
  .map-legend {
    padding: 0 0 0.75rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.75rem;
  }
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.45rem;
  font-size: 0.85rem;
  cursor: pointer;
  border: none;
  background: none;
  padding: 0.2rem 0;
  font-family: inherit;
  color: inherit;
  text-align: left;
}

.legend-item:hover { opacity: 0.75; }
.legend-item.active { font-weight: 700; }

.legend-swatch {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  flex-shrink: 0;
  border: 1px solid rgba(0,0,0,0.15);
}

.map-footer {
  text-align: center;
  font-size: 0.8rem;
  color: #777;
  padding: 0.75rem 1rem 1.5rem;
}

.hidden { display: none; }

#map-crosshair line {
  stroke: #9e4242;
  stroke-width: 1.5;
  stroke-dasharray: 4 3;
  opacity: 0.65;
  pointer-events: none;
}

#map-crosshair circle {
  fill: #9e4242;
  stroke: #fff;
  stroke-width: 2;
  pointer-events: none;
}
