/* Sonarix: Design-System
   Gestaltungsidee: nächtlicher Hafen. Ruhige tintenblaue Flächen, ein Signalblau
   fuer alles Bedienbare, die vier Statusfarben NUR fuer ihre Bedeutung.
   Schrift: Geist (SIL Open Font License), Icons: Phosphor (MIT), Karte: Leaflet (BSD-2). */

@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/geist-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/geist-latin-ext-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ------------------------------------------------------------- Werte */
:root {
  color-scheme: dark;
  --flaeche-grund: #0a141c;
  --flaeche: #101e29;
  --flaeche-2: #162838;
  --flaeche-3: #1d3347;
  --linie: #22384a;
  --text: #e8f0f6;
  --text-2: #a9bccb;
  --text-3: #7b93a5;
  --akzent: #5cb0ff;
  --akzent-text: #06121b;
  --akzent-sanft: rgba(92, 176, 255, 0.14);
  --schatten: 0 10px 34px rgba(2, 8, 14, 0.5);

  /* Status: feste, geprüfte Werte (dataviz-Palette). Bedeutung nie nur über die Farbe. */
  --s-kritisch: #d03b3b;
  --s-ernst: #ec835a;
  --s-warnung: #fab219;
  --s-gut: #0ca30c;
  --s-neutral: #7b93a5;

  --schrift: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --r: 10px;           /* eine Rundung für Flächen, Felder und Knöpfe; Pillen nur für Chips */
  --kopf-h: 60px;
  --rand: 24px;
  --z-detail: 1100;    /* über Leaflet (Karten-Ebenen bis 700, Bedienelemente 1000) */
  --z-kopf: 1200;
}

:root[data-theme="hell"] {
  color-scheme: light;
  --flaeche-grund: #f2f5f8;
  --flaeche: #ffffff;
  --flaeche-2: #e9eef3;
  --flaeche-3: #dde5ec;
  --linie: #d0dae3;
  --text: #0e1b26;
  --text-2: #455869;
  --text-3: #566b7c;      /* 5,1:1 auf dem Seitengrund (vorher #647888 mit 4,2:1, zu wenig) */
  --akzent: #1c5cab;
  --akzent-text: #ffffff;
  --akzent-sanft: rgba(28, 92, 171, 0.1);
  --schatten: 0 10px 30px rgba(14, 27, 38, 0.16);
}

/* ------------------------------------------------------------- Grund */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  scroll-padding-top: calc(var(--kopf-h) + 12px);  /* die feste Kopfleiste darf den Fokus nie verdecken */
}
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--flaeche-grund);
  color: var(--text);
  font-family: var(--schrift);
  font-size: 15.5px;
  line-height: 1.5;
  font-feature-settings: "ss01", "cv11";
}
h1, h2, h3, p, ul, ol { margin: 0; }
h1, h2, h3 { text-wrap: balance; }
ul, ol { padding: 0; list-style: none; }
button, a, label, input, select, summary { touch-action: manipulation; }
select option { background-color: var(--flaeche); color: var(--text); }  /* Windows im dunklen Modus */a { color: var(--akzent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
button, input, select { font: inherit; color: inherit; }
img, svg { display: block; }
[hidden] { display: none !important; }

:focus-visible { outline: 2px solid var(--akzent); outline-offset: 2px; border-radius: 4px; }

.sym { width: 1.25em; height: 1.25em; flex: none; fill: currentColor; }
.nur-lesen { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sprunglink {
  position: absolute; left: 12px; top: -48px; z-index: 2000; padding: 8px 14px;
  background: var(--akzent); color: var(--akzent-text); border-radius: var(--r); text-decoration: none; font-weight: 600;
}
.sprunglink:focus { top: 10px; }

/* ------------------------------------------------------------- Kopf */
.kopf {
  position: sticky; top: 0; z-index: var(--z-kopf);
  height: var(--kopf-h);
  background: color-mix(in srgb, var(--flaeche-grund) 92%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--linie);
}
.kopf__innen {
  height: 100%; max-width: 1360px; margin: 0 auto; padding: 0 var(--rand);
  display: flex; align-items: center; gap: 28px;
}
.marke { display: flex; align-items: center; gap: 11px; color: var(--text); text-decoration: none; }
.marke__zeichen { width: 32px; height: 32px; border-radius: 8px; }
.marke__name { font-size: 18px; font-weight: 650; letter-spacing: -0.02em; }

.nav { display: flex; gap: 4px; }
.nav a {
  display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px;
  border-radius: var(--r); color: var(--text-2); text-decoration: none; font-weight: 520;
}
.nav a:hover { background: var(--flaeche-2); color: var(--text); }
.nav a[aria-current="page"] { background: var(--akzent-sanft); color: var(--akzent); }

.kopf__rechts { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.icon-knopf {
  display: grid; place-items: center; width: 38px; height: 38px;
  border: 1px solid transparent; border-radius: var(--r); background: transparent; color: var(--text-2); cursor: pointer;
}
.icon-knopf:hover { background: var(--flaeche-2); color: var(--text); }
.icon-knopf .sym { width: 20px; height: 20px; }
:root[data-theme="dunkel"] .theme-mond, :root[data-theme="hell"] .theme-sonne { display: none; }

.pille-lauf {
  display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px;
  border: 1px solid var(--linie); border-radius: 999px; background: var(--flaeche-2);
  color: var(--text); font-size: 13.5px; text-decoration: none;
}
.pille-lauf__punkt { width: 8px; height: 8px; border-radius: 50%; background: var(--akzent); }

/* ------------------------------------------------------------- Seite */
.seite { max-width: 1360px; margin: 0 auto; padding: 32px var(--rand) 64px; display: grid; gap: 48px; }
h2 { font-size: 18px; font-weight: 620; letter-spacing: -0.015em; }
.hilfe { color: var(--text-3); font-size: 13.5px; }
.leer { color: var(--text-2); padding: 18px 0; }

/* ----------------------------------------------------------- Lagebild */
.lagebild { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 56px; align-items: start; }

.held { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 16px; }
.held__zahl { font-size: clamp(56px, 7vw, 88px); line-height: 1; font-weight: 640; letter-spacing: -0.04em; }
.held__text { font-size: 22px; font-weight: 520; color: var(--text-2); letter-spacing: -0.01em; }
.held__unter { margin-top: 10px; color: var(--text-3); }

.kennzahlen { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 34px; border-top: 1px solid var(--linie); }
.kennzahlen li + li { border-left: 1px solid var(--linie); }
.kennzahl {
  display: grid; gap: 4px; padding: 16px 18px 16px 18px; height: 100%;
  color: inherit; text-decoration: none; transition: background 140ms ease;
}
.kennzahlen li:first-child .kennzahl { padding-left: 0; }
.kennzahl:hover { background: var(--flaeche); }
.kennzahl__name { display: flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 14px; }
.kennzahl__name .sym { color: var(--farbe-symbol); }
.kennzahl__wert { font-size: 34px; font-weight: 620; letter-spacing: -0.03em; line-height: 1.1; }
.kennzahl__anteil { color: var(--text-3); font-size: 13px; }

/* Schrift und Symbole auf den Statusfarben: nur Weiss auf Rot erreicht 4,5:1 (WCAG AA, geprueft
   am 2026-11-17: Weiss auf Rot 4,8; auf Orange 2,6; auf Gruen 3,4). Auf Orange, Gelb, Gruen und
   Grau steht deshalb Fast-Schwarz (7,5; 10; 5,9; 6,5). Das weicht bewusst von der Vorgabe
   der Diagramm-Palette ab, die Weiss auf Orange und Gruen nennt. */
[data-art="alarm"] { --farbe: var(--s-kritisch); --farbe-text: #ffffff; }
[data-art="nicht_erreichbar"] { --farbe: var(--s-ernst); --farbe-text: #0b0b0b; }
[data-art="optimierung"] { --farbe: var(--s-warnung); --farbe-text: #0b0b0b; }
[data-art="unauffaellig"] { --farbe: var(--s-gut); --farbe-text: #0b0b0b; }
[data-art="uebersprungen"] { --farbe: var(--s-neutral); --farbe-text: #0b0b0b; }

/* Alleinstehende Symbole (ohne Flaeche dahinter) brauchen 3:1 gegen den Hintergrund. Auf Hell
   sind Orange und Amber dafuer zu hell, dort nehmen Symbole eine dunklere Stufe (4,3:1). */
[data-art] { --farbe-symbol: var(--farbe); }
:root[data-theme="hell"] [data-art="nicht_erreichbar"] { --farbe-symbol: #c75a28; }
:root[data-theme="hell"] [data-art="optimierung"] { --farbe-symbol: #a86f00; }

.segment { display: flex; gap: 2px; margin-top: 24px; height: 28px; }
.segment__teil {
  display: flex; align-items: center; min-width: 0; padding: 0 9px; border-radius: 4px;
  background: var(--farbe); color: var(--farbe-text); font-size: 12.5px; font-weight: 620; white-space: nowrap;
}
.segment--leer { background: var(--flaeche-2); border-radius: 4px; }
.legende { display: flex; flex-wrap: wrap; gap: 6px 20px; margin-top: 12px; color: var(--text-2); font-size: 13.5px; }
.legende li { display: flex; align-items: center; gap: 7px; }
.legende__farbe { width: 10px; height: 10px; border-radius: 3px; background: var(--farbe); }

/* Neue Suche */
.suche { display: grid; gap: 18px; padding: 24px; background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--r); }
.suche form { display: grid; gap: 18px; }
.feld { display: grid; gap: 6px; }
.feld label, .feld__name { font-size: 13.5px; font-weight: 580; color: var(--text-2); }
.feld input, .feld select {
  width: 100%; height: 42px; padding: 0 12px; background: var(--flaeche-grund);
  border: 1px solid var(--linie); border-radius: var(--r); color: var(--text);
}
.feld input::placeholder { color: var(--text-3); }
.feld input:hover, .feld select:hover { border-color: var(--text-3); }
.haken { display: flex; align-items: center; gap: 10px; color: var(--text-2); font-size: 14px; cursor: pointer; }
.haken input { width: 18px; height: 18px; accent-color: var(--akzent); }
.meldung { min-height: 1.4em; font-size: 14px; color: var(--text-2); }
.meldung--fehler { color: var(--text); }
.meldung--fehler::before { content: "Fehler: "; font-weight: 650; color: var(--s-kritisch); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 20px; border: 1px solid var(--linie); border-radius: var(--r);
  background: var(--flaeche-2); color: var(--text); font-weight: 600; cursor: pointer; text-decoration: none;
  transition: transform 90ms ease, background 140ms ease;
}
.btn:hover { background: var(--flaeche-3); }
.btn:active { transform: translateY(1px); }
.btn--primaer { background: var(--akzent); border-color: var(--akzent); color: var(--akzent-text); }
.btn--primaer:hover { background: color-mix(in srgb, var(--akzent) 88%, white); }
.btn[disabled] { opacity: 0.55; cursor: progress; }
.btn--klein { height: 34px; padding: 0 14px; font-size: 14px; }

.auftrag { display: grid; gap: 10px; padding-top: 16px; border-top: 1px solid var(--linie); }
.auftrag__titel { font-weight: 600; }
.auftrag__zeile { display: flex; justify-content: space-between; gap: 12px; color: var(--text-2); font-size: 14px; }
.fortschritt { height: 8px; border-radius: 999px; background: var(--flaeche-3); overflow: hidden; }
.fortschritt__fuellung { height: 100%; width: 0; border-radius: 999px; background: var(--akzent); transition: width 400ms ease; }

/* ------------------------------------------------------- Listen, Reihen */
.spalten { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 56px; }
.abschnitt { display: grid; gap: 6px; align-content: start; }
.abschnitt > .hilfe { margin-bottom: 8px; }

.zeilen li + li { border-top: 1px solid var(--linie); }
.zeile {
  display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 14px; align-items: center;
  padding: 13px 4px; color: inherit; text-decoration: none; transition: background 140ms ease;
}
.zeile:hover { background: var(--flaeche); }
.zeile__symbol { color: var(--farbe-symbol); }
.zeile__symbol .sym { width: 22px; height: 22px; }
.zeile__name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zeile__unter { color: var(--text-3); font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zeile__punkte { font-size: 20px; font-weight: 620; letter-spacing: -0.02em; text-align: right; min-width: 3.2em; }
.zeile__punkte small { display: block; font-size: 12px; font-weight: 450; color: var(--text-3); letter-spacing: 0; }

.branchen li + li { border-top: 1px solid var(--linie); }
.branche { display: grid; gap: 9px; padding: 13px 4px; color: inherit; text-decoration: none; transition: background 140ms ease; }
.branche:hover { background: var(--flaeche); }
.branche__kopf { display: flex; justify-content: space-between; gap: 12px; }
.branche__name { font-weight: 600; }
.branche__zahl { color: var(--text-2); font-size: 14px; }
.segment-duenn { display: flex; gap: 2px; height: 8px; }
.segment-duenn span { display: block; background: var(--farbe); border-radius: 999px; min-width: 6px; }
.segment-duenn--leer { background: var(--flaeche-2); border-radius: 999px; }

/* Tabelle */
.tabelle-huelle { overflow-x: auto; }
.tabelle { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.tabelle th { text-align: left; font-weight: 560; color: var(--text-3); padding: 8px 14px 8px 4px; border-bottom: 1px solid var(--linie); white-space: nowrap; }
.tabelle td { padding: 11px 14px 11px 4px; border-bottom: 1px solid var(--linie); vertical-align: top; }
.tabelle tbody tr:last-child td { border-bottom: 0; }
.zahl { font-variant-numeric: tabular-nums; }
.status-text { display: inline-flex; align-items: center; gap: 6px; }
.status-text--fehler { color: var(--text); }
.status-text--fehler .sym { color: var(--s-kritisch); }

/* ------------------------------------------------------------- Karte */
.karte-seite {
  display: grid; height: calc(100dvh - var(--kopf-h));
  grid-template-columns: 372px minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  grid-template-areas: "filter flaeche" "liste flaeche";
}
.karte-filter { grid-area: filter; display: grid; gap: 14px; padding: 18px 18px 14px; background: var(--flaeche); border-right: 1px solid var(--linie); }
.karte-flaeche { grid-area: flaeche; position: relative; background: var(--flaeche-2); }
#karte { position: absolute; inset: 0; background: var(--flaeche-2); font-family: var(--schrift); }
.karte-liste { grid-area: liste; overflow-y: auto; background: var(--flaeche); border-right: 1px solid var(--linie); border-top: 1px solid var(--linie); overscroll-behavior: contain; }
.karte-liste .zeile { padding: 12px 18px; }
.karte-liste li + li { border-top: 1px solid var(--linie); }
.karte-liste li { content-visibility: auto; contain-intrinsic-size: auto 66px; }  /* lange Listen (bis 2000) zeichnen nur Sichtbares */
.karte-liste .zeile[aria-pressed="true"] { background: var(--akzent-sanft); }
.karte-liste button.zeile { width: 100%; border: 0; background: transparent; text-align: left; cursor: pointer; }
.karte-liste button.zeile:hover { background: var(--flaeche-2); }
.karte-zaehler { padding: 10px 18px; color: var(--text-3); font-size: 13.5px; border-bottom: 1px solid var(--linie); }
.zeile__text { display: grid; min-width: 0; }
.leer-hinweis { padding: 18px; color: var(--text-2); font-size: 14px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px;
  border: 1px solid var(--linie); border-radius: 999px; background: transparent; color: var(--text-2);
  font-size: 13.5px; font-weight: 540; cursor: pointer;
}
.chip .sym { color: var(--farbe-symbol); width: 17px; height: 17px; }
.chip:hover { background: var(--flaeche-2); }
.chip[aria-pressed="true"] { background: var(--akzent-sanft); border-color: var(--akzent); color: var(--text); }

/* Pins auf der Karte */
.pin { background: none; border: 0; }
.pin__koerper {
  position: absolute; left: 0; top: 0; display: grid; place-items: center; width: 32px; height: 32px;
  border-radius: 50% 50% 50% 0; transform: rotate(-45deg);
  background: var(--farbe); color: var(--farbe-text);
  border: 2px solid var(--flaeche); box-shadow: 0 3px 8px rgba(0, 0, 0, 0.45);
  transition: transform 140ms ease;
}
.pin__koerper .sym { width: 16px; height: 16px; transform: rotate(45deg); }
.pin:hover .pin__koerper { transform: rotate(-45deg) scale(1.1); }
.pin--gewaehlt .pin__koerper { transform: rotate(-45deg) scale(1.22); outline: 3px solid var(--akzent); outline-offset: 2px; }
.pin__puls {
  position: absolute; left: 4px; top: 33px; width: 24px; height: 10px; border-radius: 50%;
  border: 2px solid var(--farbe); opacity: 0; pointer-events: none;
}
@media (prefers-reduced-motion: no-preference) {
  .pin--alarm .pin__puls { animation: puls 2.2s ease-out infinite; }
}
@keyframes puls { 0% { transform: scale(0.5); opacity: 0.9; } 100% { transform: scale(2.4); opacity: 0; } }

/* Dunkle Karte: die hellen Kacheln werden umgefärbt, ohne einen anderen Anbieter zu brauchen */
:root[data-theme="dunkel"] .leaflet-tile-pane { filter: invert(1) hue-rotate(192deg) brightness(0.8) contrast(0.92) saturate(0.45); }
.leaflet-container { font-family: var(--schrift); background: var(--flaeche-2); }
.leaflet-control-attribution { background: color-mix(in srgb, var(--flaeche) 88%, transparent) !important; color: var(--text-3) !important; font-size: 11.5px; }
.leaflet-control-attribution a { color: var(--akzent) !important; }
.leaflet-bar a, .leaflet-bar a:hover { background: var(--flaeche); color: var(--text); border-bottom-color: var(--linie); }
.leaflet-bar { border: 1px solid var(--linie); box-shadow: var(--schatten); border-radius: var(--r); overflow: hidden; }

/* Detail */
.detail {
  position: absolute; z-index: var(--z-detail); top: 16px; right: 16px; bottom: 16px;
  width: min(410px, calc(100% - 32px)); overflow-y: auto; overscroll-behavior: contain;
  background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--r); box-shadow: var(--schatten);
}
.detail__kopf { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; padding: 20px 20px 4px; }
.detail__name { font-size: 21px; font-weight: 640; letter-spacing: -0.02em; line-height: 1.2; overflow-wrap: anywhere; }
.detail__unter { color: var(--text-3); font-size: 14px; margin-top: 3px; }
.detail__block { display: grid; gap: 10px; padding: 16px 20px; border-top: 1px solid var(--linie); }
.detail__block:first-of-type { border-top: 0; }
.detail__block h3 { font-size: 14px; font-weight: 620; color: var(--text-2); }
.badge {
  display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 12px;
  border-radius: 999px; background: var(--farbe); color: var(--farbe-text); font-size: 13.5px; font-weight: 640; width: fit-content;
}
.badge .sym { width: 17px; height: 17px; }
.punktzahl { display: flex; align-items: baseline; gap: 8px; }
.punktzahl__wert { font-size: 40px; font-weight: 640; letter-spacing: -0.04em; line-height: 1; }
.punktzahl__text { color: var(--text-3); font-size: 13.5px; }

.massstab { display: grid; gap: 7px; }
.massstab__kopf { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; }
.massstab__name { font-weight: 560; }
.massstab__wert { color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.massstab__spur { height: 6px; border-radius: 999px; background: color-mix(in srgb, var(--farbe) 22%, var(--flaeche-2)); overflow: hidden; }
.massstab__fuellung { height: 100%; border-radius: 999px; background: var(--farbe); }
.massstab__grund { color: var(--text-3); font-size: 13px; overflow-wrap: anywhere; }

.kontakt { display: grid; gap: 8px; }
.kontakt a, .kontakt span { display: flex; align-items: center; gap: 9px; overflow-wrap: anywhere; }
.kontakt .sym { color: var(--text-3); }
.detail__tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { padding: 3px 9px; border: 1px solid var(--linie); border-radius: 999px; font-size: 12.5px; color: var(--text-2); }
.detail__fuss { padding: 14px 20px 20px; border-top: 1px solid var(--linie); display: flex; gap: 10px; flex-wrap: wrap; }

/* ------------------------------------------------------------ Anmeldung */
.anmeldung { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.anmeldung__karte { width: min(100%, 400px); display: grid; gap: 22px; padding: 32px; background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--r); }
.anmeldung__marke { display: flex; align-items: center; gap: 14px; }
.anmeldung__marke img { width: 52px; height: 52px; border-radius: 12px; }
.anmeldung__titel { font-size: 24px; font-weight: 650; letter-spacing: -0.03em; line-height: 1.1; }
.anmeldung__unter { color: var(--text-3); font-size: 14px; margin-top: 2px; }
.anmeldung__fehler { padding: 11px 14px; border: 1px solid var(--s-kritisch); border-radius: var(--r); font-size: 14px; }

.fehlerseite { min-height: 100dvh; display: grid; place-items: center; padding: 24px; text-align: left; }
.fehlerseite div { max-width: 460px; display: grid; gap: 12px; }
.fehlerseite h1 { font-size: 44px; font-weight: 650; letter-spacing: -0.04em; }

/* -------------------------------------------------------------- Schmal */
@media (max-width: 1060px) {
  .lagebild { grid-template-columns: 1fr; gap: 40px; }
  .spalten { grid-template-columns: 1fr; gap: 44px; }
}
@media (max-width: 820px) {
  :root { --rand: 16px; --kopf-h: 56px; }
  .kopf__innen { gap: 10px; }
  /* Nur unsichtbar machen, nicht entfernen: sonst haben Marke und Menue-Links keinen Namen fuer Vorlese-Programme. */
  .marke__name, .nav a span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .nav a { padding: 0 11px; }
  .pille-lauf { max-width: 150px; overflow: hidden; white-space: nowrap; }
  .seite { padding-top: 24px; gap: 40px; }
  .kennzahlen { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kennzahlen li:nth-child(odd) .kennzahl { padding-left: 0; }
  .kennzahlen li:nth-child(3) { border-left: 0; }
  .kennzahlen li:nth-child(n+3) { border-top: 1px solid var(--linie); }
  .kennzahlen li:nth-child(3) .kennzahl { padding-left: 0; }
  .suche { padding: 18px; }
  .karte-seite { grid-template-columns: 1fr; grid-template-rows: auto 40dvh minmax(0, 1fr); grid-template-areas: "filter" "flaeche" "liste"; }
  .karte-filter { grid-template-columns: 1fr 1fr; gap: 10px; border-right: 0; padding: 12px 16px; border-bottom: 1px solid var(--linie); }
  .karte-filter .feld:nth-child(3) { grid-column: 1 / -1; }
  .karte-filter .chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; scrollbar-color: var(--linie) transparent; }
  .karte-filter .chip { flex: none; }
  .karte-liste { border-right: 0; }
  /* Auf dem Handy: Detailfenster fast bildschirmfuellend von unten */
  .detail { position: fixed; top: calc(var(--kopf-h) + 10px); right: 0; left: 0; bottom: 0; width: auto; border-radius: var(--r) var(--r) 0 0; padding-bottom: env(safe-area-inset-bottom); }
  .karte-liste { padding-bottom: env(safe-area-inset-bottom); }
}

/* Touch: groessere Ziele (empfohlen sind 44 px) */
@media (pointer: coarse) {
  .icon-knopf { width: 44px; height: 44px; }
  .nav a { height: 44px; }
  .chip { height: 40px; }
  .btn, .btn--klein { min-height: 44px; }
  .feld input, .feld select { height: 46px; }
}

.noscript { max-width: 520px; margin: 48px auto; padding: 0 var(--rand); color: var(--text); }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
