/* Parkplatz-Planer – Mobile First, ab 360 px, helles und dunkles Farbschema.
   Gestaltung nach dem, was Autofahrer in Ingolstadt tatsächlich sehen:
   - das blaue P-Verkehrszeichen (Marke, Hauptaktionen in Verkehrsblau),
   - die dunklen Anzeigetafeln des Parkleitsystems mit Leuchtziffern (Karte und Liste, in beiden Schemata dunkel),
   - Barlow, eine an Straßenbeschilderung angelehnte Schrift.
   Statusfarben (grün/bernstein/rot) stehen nur für die Auslastung bzw. Warnungen.
   Alle Text/Hintergrund-Paare erreichen mindestens 4,5:1 (geprüft). */

@font-face { font-family: "Barlow"; font-weight: 400; font-style: normal; font-display: swap; src: url("vendor/fonts/barlow-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 500; font-style: normal; font-display: swap; src: url("vendor/fonts/barlow-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 600; font-style: normal; font-display: swap; src: url("vendor/fonts/barlow-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 700; font-style: normal; font-display: swap; src: url("vendor/fonts/barlow-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Semi Condensed"; font-weight: 600; font-style: normal; font-display: swap; src: url("vendor/fonts/barlow-semi-condensed-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Semi Condensed"; font-weight: 700; font-style: normal; font-display: swap; src: url("vendor/fonts/barlow-semi-condensed-latin-700-normal.woff2") format("woff2"); }

/* ---------- Farben ---------- */
:root {
  color-scheme: light;
  /* Hell: Papierweiß, Keynote-Dunkelblau als Schrift */
  --bg: #f4f5f8;
  --surface: #ffffff;
  --text: #111a42;
  --muted: #535c7b;
  --line: rgba(17, 26, 66, 0.12);
  --line-strong: rgba(17, 26, 66, 0.28);
  --track: rgba(17, 26, 66, 0.1);
  --highlight: rgba(14, 90, 167, 0.08);
  --link: #0e5aa7;
  --shadow: 0 1px 2px rgba(17, 26, 66, 0.08);
  --ok: #0b7a3c;
  --warn: #9a5800;
  --full: #c0262d;
  --tiles-filter: saturate(0.55) contrast(0.95);

  /* Unabhängig vom Schema: Verkehrszeichen und Anzeigetafeln */
  --sign-blue: #0e5aa7;
  --panel: #0a0e24;
  --panel-line: #2b3366;
  --panel-text: #eef0f8;
  --panel-muted: #9aa2c4;
  --led-ok: #3ee07f;
  --led-warn: #ffb21a;
  --led-full: #ff6a62;

  --gutter: 16px;
  --radius: 4px;
  --font: "Barlow", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-num: "Barlow Semi Condensed", "Barlow", system-ui, sans-serif;
}

/* Dunkel: Keynote-Dunkelblau als Grund. Zweimal notiert, weil CSS keine geteilten Blöcke kennt:
   einmal für "System = dunkel" (ohne feste Wahl), einmal für die feste Wahl "dunkel". */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #111a42;
    --surface: #18224f;
    --text: #eef0f8;
    --muted: #a3abcc;
    --line: rgba(255, 255, 255, 0.1);
    --line-strong: rgba(255, 255, 255, 0.24);
    --track: rgba(255, 255, 255, 0.12);
    --highlight: rgba(255, 255, 255, 0.06);
    --link: #9cc0ff;
    --shadow: none;
    --ok: #3ee07f;
    --warn: #ffb21a;
    --full: #ff6a62;
    --tiles-filter: invert(1) hue-rotate(190deg) brightness(0.82) contrast(0.92) saturate(0.55);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111a42;
  --surface: #18224f;
  --text: #eef0f8;
  --muted: #a3abcc;
  --line: rgba(255, 255, 255, 0.1);
  --line-strong: rgba(255, 255, 255, 0.24);
  --track: rgba(255, 255, 255, 0.12);
  --highlight: rgba(255, 255, 255, 0.06);
  --link: #9cc0ff;
  --shadow: none;
  --ok: #3ee07f;
  --warn: #ffb21a;
  --full: #ff6a62;
  --tiles-filter: invert(1) hue-rotate(190deg) brightness(0.82) contrast(0.92) saturate(0.55);
}

/* Auslastungsstufe: --level für Flächen im Farbschema, --led für die dunklen Anzeigetafeln */
[data-level="low"] { --level: var(--ok); --led: var(--led-ok); }
[data-level="mid"] { --level: var(--warn); --led: var(--led-warn); }
[data-level="high"] { --level: var(--full); --led: var(--led-full); }

/* ---------- Grundlagen ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 var(--font);
}

a { color: var(--link); }
a:focus-visible, button:focus-visible, summary:focus-visible, select:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
}

.wrap {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding-left: max(var(--gutter), env(safe-area-inset-left));
  padding-right: max(var(--gutter), env(safe-area-inset-right));
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* Zahlen auf Flächen im Farbschema */
.num {
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--level, var(--text));
}
/* Leuchtziffern – nur auf dunklen Anzeigetafeln */
.led {
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--led, var(--led-ok));
  letter-spacing: 0.01em;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 6px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font: 500 0.92rem var(--font);
  text-decoration: none;
  cursor: pointer;
}
.btn:hover { border-color: var(--text); }
.btn:disabled { opacity: 0.6; cursor: default; }
.btn--primary { border-color: var(--sign-blue); background: var(--sign-blue); color: #fff; }
.btn--primary:hover { border-color: var(--text); }

/* ---------- Kopfzeile ---------- */
.bar { background: var(--surface); border-bottom: 1px solid var(--line); }
.bar__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  padding-top: 12px;
  padding-bottom: 12px;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; }
.sign {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 2px solid #fff;
  border-radius: 5px;
  background: var(--sign-blue);
  box-shadow: 0 0 0 1px var(--line-strong);
  color: #fff;
  font: 700 22px/1 var(--font);
}
/* Handy: Name über Stadt, damit Marke und Schalter in eine Zeile passen */
.brand__text { display: grid; font-size: 1.08rem; line-height: 1.15; }
.brand__text strong { font-weight: 700; }
.brand__text span { color: var(--muted); font-size: 0.82rem; }
.status { order: 3; flex: 1 1 100%; margin: 0; color: var(--muted); font-size: 0.92rem; }
.status strong { color: var(--text); font-family: var(--font-num); font-size: 1.05rem; }
.bar__tools { display: flex; gap: 6px; margin-left: auto; }
.tool {
  min-width: 44px;
  min-height: 36px;
  padding: 4px 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: none;
  color: var(--muted);
  font: 600 0.82rem var(--font);
  cursor: pointer;
}
.tool:hover { color: var(--text); border-color: var(--text); }

/* ---------- "Hier geparkt" ---------- */
.parked {
  margin-top: 12px;
  padding-top: 12px;
  padding-bottom: 12px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--level, var(--ok));
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.parked__text, .parked__line { margin: 0; }
.parked__line { margin-top: 4px; color: var(--muted); }
.parked__line .num { font-size: 1.5rem; margin-right: 4px; }
.parked__actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 6px; }

/* ---------- Layout: Handy untereinander, Desktop Liste links + Karte rechts ---------- */
.layout { display: grid; gap: 16px; padding-top: 16px; }

/* ---------- Karte ---------- */
.map-frame {
  position: relative;
  isolation: isolate; /* Leaflet-Ebenen (z-index 400+) bleiben unter der klebenden Werkzeugleiste */
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}
/* Handy: Karte kompakt, damit die ersten Anlagen ohne Scrollen sichtbar sind */
.map { height: clamp(280px, 44vh, 400px); background: var(--surface); transition: height 0.2s ease; }
.map-frame--large .map { height: 76vh; }
.map--error { display: grid; place-items: center; color: var(--muted); }

.legend {
  position: absolute;
  left: 8px;
  bottom: 8px;
  z-index: 500;
  display: flex;
  gap: 12px;
  margin: 0;
  padding: 5px 9px;
  list-style: none;
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--panel-muted);
  font-size: 0.74rem;
  pointer-events: none;
}
.legend li { display: flex; align-items: center; gap: 5px; }
.legend li::before { content: ""; width: 8px; height: 8px; border-radius: 1px; background: var(--led); }

.map-controls { display: flex; gap: 8px; margin-top: 8px; }
.map-btn {
  min-height: 36px;
  padding: 6px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font: 500 0.85rem var(--font);
  cursor: pointer;
}
.map-btn--size { margin-left: auto; flex: none; }
/* Touch: ein Finger verschiebt die Karte erst nach einem Tipp – sonst scrollt die Seite */
.map-btn--hint { flex: 1 1 auto; min-width: 0; text-align: left; color: var(--muted); }
.map-btn--hint[data-active] { border-color: var(--ok); color: var(--ok); }

/* Anzeigetafeln über den Standorten (in beiden Schemata dunkel, wie die echten Schilder) */
.pin-icon { background: none; border: 0; }
.pin {
  --dx: 0px;
  --lift: 12px;
  --stem-length: 12px;
  --stem-angle: 0deg;
  position: relative;
  width: 0;
  height: 0;
  cursor: pointer;
}
.pin__dot {
  position: absolute;
  left: -5px;
  top: -5px;
  width: 10px;
  height: 10px;
  border: 2px solid var(--panel);
  border-radius: 50%;
  background: var(--led);
}
.pin__float { position: absolute; left: 0; top: 0; width: 0; height: 0; }
.pin__stem {
  position: absolute;
  left: -1px;
  bottom: 0;
  width: 1.5px;
  height: var(--stem-length);
  transform-origin: 50% 100%;
  transform: rotate(var(--stem-angle));
  background: var(--text);
  opacity: 0.4;
}
.pin__badge {
  position: absolute;
  left: var(--dx);
  bottom: var(--lift);
  transform: translateX(-50%);
  display: grid;
  gap: 1px;
  padding: 4px 8px 5px;
  border: 1px solid var(--panel-line);
  border-left: 3px solid var(--led);
  border-radius: 3px;
  background: var(--panel);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  color: var(--panel-text);
  white-space: nowrap;
}
.pin__name {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--panel-muted);
}
.pin__line { display: flex; align-items: baseline; gap: 6px; }
.pin__count { font-size: 1.05rem; line-height: 1.05; }
.pin__pct { color: var(--panel-muted); font-size: 0.7rem; font-variant-numeric: tabular-nums; }
.pin__trend { font-size: 0.75rem; font-weight: 700; color: var(--panel-muted); }
.pin__trend[data-kind="filling"] { color: var(--led-warn); }
.pin__trend[data-kind="emptying"] { color: var(--led-ok); }
.pin__fav { display: none; color: var(--led-warn); font-size: 0.72rem; }
.pin[data-fav] .pin__fav { display: inline; }
.pin[data-fav] .pin__badge { border-color: var(--led-warn); border-left-color: var(--led); }
.pin--stale .pin__badge { opacity: 0.55; }
.pin:hover .pin__badge { border-color: var(--panel-muted); }
.map--compact .pin__name { display: none; }

/* Leaflet an das Design anpassen */
.leaflet-container { background: var(--surface); font: inherit; }
.leaflet-tile-pane { filter: var(--tiles-filter); }
.leaflet-bar { border: 1px solid var(--line-strong) !important; box-shadow: none !important; border-radius: var(--radius) !important; }
.leaflet-bar a, .leaflet-bar a:hover { background: var(--surface); color: var(--text); border-bottom-color: var(--line); }
.leaflet-control-attribution { background: var(--surface) !important; color: var(--muted) !important; font-size: 0.66rem; }
.leaflet-control-attribution a { color: var(--link) !important; }
.lot-popup .leaflet-popup-content-wrapper,
.lot-popup .leaflet-popup-tip {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
}
.lot-popup .leaflet-popup-content { margin: 12px 14px; font-size: 0.9rem; line-height: 1.4; }
.lot-popup a.leaflet-popup-close-button { color: var(--muted); }

.popup__name { margin: 0 18px 2px 0; font-size: 1rem; font-weight: 700; }
.popup__sub { margin: 0; color: var(--muted); font-size: 0.82rem; }
.popup__count { margin: 8px 0 2px; font-size: 1.8rem; line-height: 1; }
.popup__count small { color: var(--muted); font: 400 0.82rem var(--font); }
.popup__price { margin: 6px 0 10px; }
.popup__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.popup__actions .btn { min-height: 36px; }

/* ---------- Liste ---------- */
.toolbar {
  display: grid;
  gap: 10px;
  padding: 4px 0 12px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.tabs { display: flex; gap: 2px; margin: 0; padding: 0; border: 0; overflow-x: auto; }
.tabs label { position: relative; flex: none; }
.tabs input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.tabs label > span {
  display: block;
  padding: 8px 10px;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-size: 0.98rem;
  font-weight: 600;
}
.tabs input:checked + span { color: var(--text); border-bottom-color: var(--sign-blue); }
.tabs input:focus-visible + span { outline: 2px solid var(--link); outline-offset: -2px; }
.tabs__count { font-family: var(--font-num); color: var(--muted); }

.toolbar__selects { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: end; }
.locate { grid-column: 1 / -1; min-height: 44px; }
.field { display: grid; gap: 3px; min-width: 0; }
.field > span { color: var(--muted); font-size: 0.78rem; font-weight: 500; }
.field select {
  width: 100%;
  min-height: 40px;
  padding: 8px 30px 8px 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23808aa8' stroke-width='2'/%3E%3C/svg%3E") no-repeat right 10px center;
  color: var(--text);
  font: inherit;
  font-size: 1rem; /* unter 16 px zoomt iOS Safari beim Antippen in die Seite */
  appearance: none;
}

.nearest {
  margin: 12px 0 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--level, var(--ok));
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 0.95rem;
}
.nearest .num { font-size: 1.1rem; }
.linklike {
  padding: 0;
  border: 0;
  background: none;
  color: var(--link);
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.notice {
  margin: 12px 0 0;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--warn);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-size: 0.9rem;
}

.caption { margin: 12px 0 0; color: var(--muted); font-size: 0.82rem; }

.rows { margin: 4px 0 0; padding: 0; list-style: none; }

.group-label {
  padding: 18px 0 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--line);
}

.row {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr) auto;
  grid-template-areas:
    "display main fav"
    "display price price"
    "details details details";
  align-items: start;
  column-gap: 14px;
  padding: 14px 0 4px;
  border-bottom: 1px solid var(--line);
}

/* Freie Plätze als kleine Anzeigetafel – wie am Straßenrand */
.display {
  grid-area: display;
  display: grid;
  justify-items: center;
  align-content: center;
  min-height: 64px;
  padding: 6px 4px;
  border: 1px solid var(--panel-line);
  border-top: 3px solid var(--led);
  border-radius: 3px;
  background: var(--panel);
}
.display__count { font-size: 1.85rem; line-height: 1; }
.display__unit {
  color: var(--panel-muted);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.row__main { grid-area: main; min-width: 0; }
.row__name { margin: 0; font-size: 1.12rem; font-weight: 700; line-height: 1.2; overflow-wrap: anywhere; }
.row__sub { margin: 3px 0 0; color: var(--muted); font-size: 0.86rem; }
.row__sub .stale { color: var(--warn); font-weight: 600; }
.row__sub .tag {
  display: inline-block;
  margin-left: 4px;
  padding: 0 5px;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  color: var(--text);
  font-size: 0.74rem;
  font-weight: 600;
  line-height: 1.5;
}
.trend { font-weight: 600; white-space: nowrap; }
.trend--filling { color: var(--warn); }
.trend--emptying { color: var(--ok); }
.distance { color: var(--text); font-weight: 600; }

.meter { height: 4px; max-width: 360px; margin-top: 8px; background: var(--track); }
.meter span { display: block; height: 100%; width: 0; background: var(--level); }

.row__price { grid-area: price; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 6px; margin-top: 8px; }
.row__price strong { font-family: var(--font-num); font-variant-numeric: tabular-nums; font-size: 1.1rem; }
.row__price span { color: var(--muted); font-size: 0.82rem; }
.price-warn { color: var(--warn) !important; font-weight: 600; }

.fav {
  grid-area: fav;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin: -8px -8px 0 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  cursor: pointer;
}
.fav svg { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; }
.fav[aria-pressed="true"] { color: var(--sign-blue); }
.fav[aria-pressed="true"] svg { fill: currentColor; }
.fav:hover { color: var(--text); }

.row__details { grid-area: details; margin-top: 2px; }
.row__details summary {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px 0 0;
  color: var(--link);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  list-style: none;
}
.row__details summary::-webkit-details-marker { display: none; }
.row__details summary::before {
  content: "";
  width: 7px;
  height: 7px;
  margin-right: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 0.15s ease;
}
.row__details[open] summary::before { transform: rotate(45deg); }

.details { display: grid; gap: 18px; padding: 4px 0 14px; font-size: 0.92rem; }
.details h4 { margin: 0 0 6px; color: var(--muted); font-size: 0.74rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.details p { margin: 0; }
.tariff { width: 100%; max-width: 380px; border-collapse: collapse; font-size: 0.9rem; }
.tariff td { padding: 4px 6px; border-bottom: 1px solid var(--line); }
.tariff td:first-child { padding-left: 0; }
.tariff td:last-child { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; padding-right: 0; }
/* Aktuell zutreffende Tarifstufe: hervorgehoben, aber nicht in Warnfarbe – es ist nichts falsch */
.tariff tr.is-current td { background: var(--highlight); font-weight: 700; }
.tariff tr.is-current td:first-child { box-shadow: inset 3px 0 0 var(--sign-blue); padding-left: 8px; }
.details__note { margin-top: 6px !important; color: var(--muted); font-size: 0.82rem; }
.details__actions { display: flex; flex-wrap: wrap; gap: 8px; grid-column: 1 / -1; }

/* Typische Auslastung: eine Datenreihe, daher ein Farbton; die aktuelle Stunde in Textfarbe */
.profile__summary { margin: 0 0 6px; }
.profile__chart { display: block; width: 100%; max-width: 320px; height: auto; margin-bottom: 4px; overflow: visible; }
.profile__bar { fill: var(--muted); opacity: 0.45; }
.profile__bar.is-now { fill: var(--text); opacity: 1; }
.profile__bar:hover { opacity: 0.85; }
.profile__empty { fill: var(--line-strong); }
.profile__ref { stroke: var(--full); stroke-width: 0.75; stroke-dasharray: 2 2; opacity: 0.6; }
.profile__axis { fill: var(--muted); font-size: 7px; font-family: var(--font); }

.empty { margin: 28px 0; color: var(--muted); }

.footer {
  display: grid;
  gap: 10px;
  margin-top: 24px;
  padding-top: 20px;
  padding-bottom: max(24px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.82rem;
}
.footer p { margin: 0; max-width: 75ch; }
.footer a { color: inherit; text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 2px; }
.footer a:hover { text-decoration-color: currentColor; }

/* Finger statt Maus: Bedienelemente der Karte auf Daumengröße */
@media (pointer: coarse) {
  .leaflet-touch .leaflet-bar a { width: 40px; height: 40px; line-height: 40px; font-size: 20px; }
  .map-btn { min-height: 40px; }
}

/* ---------- ab Tablet ---------- */
@media (min-width: 720px) {
  .status { order: 0; flex: 1 1 auto; }
  .brand__text { display: block; }
  .brand__text span { font-size: inherit; }
  .bar__tools { margin-left: 0; }
  .map { height: clamp(360px, 60vh, 620px); }
  .map-frame--large .map { height: 80vh; }
  .toolbar { position: sticky; top: 0; z-index: 2; grid-template-columns: 1fr auto; align-items: end; }
  .toolbar__selects { grid-template-columns: 130px 160px auto; }
  .locate { grid-column: auto; min-height: 40px; }

  .row {
    grid-template-columns: 96px minmax(0, 1fr) auto 44px;
    grid-template-areas:
      "display main price fav"
      "display details details details";
    column-gap: 18px;
    padding-top: 16px;
  }
  .display__count { font-size: 2.1rem; }
  .row__price { flex-direction: column; align-items: flex-end; gap: 0; margin-top: 0; text-align: right; }
  .row__price strong { font-size: 1.25rem; }
  .details { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }

  .footer { grid-template-columns: 1fr auto; align-items: end; }
}

/* ---------- Desktop: Liste links, Karte rechts (bleibt beim Scrollen stehen) ---------- */
@media (min-width: 1100px) {
  .wrap { max-width: 1440px; }
  .layout {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
    grid-template-areas: "board map";
    align-items: start;
    gap: 28px;
  }
  .board { grid-area: board; }
  .map-section { grid-area: map; position: sticky; top: 16px; }
  .map, .map-frame--large .map { height: calc(100vh - 32px); }
  .map-controls { display: none; } /* "Karte größer" ist hier überflüssig */
  .toolbar { grid-template-columns: 1fr; }
  .toolbar__selects { grid-template-columns: 130px 160px 1fr; }
  .details { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
