/* Spruegel – helles und dunkles Schema, folgt der Einstellung des Geräts. */
:root {
  --grund: #f4f6f8;
  --flaeche: #ffffff;
  --flaeche-2: #eef1f5;
  --text: #141a21;
  --leise: #5a6775;
  --rand: #dde2e8;
  --akzent: #1f6f4a;
  --akzent-text: #ffffff;
  --neu: #0f7b5f;
  --neu-grund: #dff3ea;
  --fehler: #b3261e;
  --schatten: 0 1px 2px rgb(16 24 32 / 6%), 0 8px 24px rgb(16 24 32 / 6%);
  --radius: 14px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --grund: #0f1317;
    --flaeche: #171c22;
    --flaeche-2: #1e252c;
    --text: #e7ecf1;
    --leise: #97a4b2;
    --rand: #2a333c;
    --akzent: #5fd19a;
    --akzent-text: #0d1a14;
    --neu: #7fe0b0;
    --neu-grund: #143a2c;
    --fehler: #ff9a90;
    --schatten: 0 1px 2px rgb(0 0 0 / 40%), 0 10px 30px rgb(0 0 0 / 35%);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 16px/1.5 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--grund);
  color: var(--text);
}
a { color: var(--akzent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
h1, h2, h3 { line-height: 1.25; letter-spacing: -0.01em; }

/* Kopf */
.kopf {
  position: sticky;
  top: 0;
  z-index: 500;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: .7rem clamp(1rem, 4vw, 2rem);
  background: color-mix(in srgb, var(--flaeche) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rand);
}
.marke {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  font-weight: 650;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
}
.marke::before {
  content: "";
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 7px;
  background: linear-gradient(135deg, var(--akzent), color-mix(in srgb, var(--akzent) 45%, #3aa0ff));
}
.kopf nav { display: flex; align-items: center; gap: .35rem 1rem; flex-wrap: wrap; justify-content: flex-end; }
.kopf nav a { color: var(--leise); text-decoration: none; font-size: .92rem; }
.kopf nav a:hover { color: var(--text); }
.kopf form { margin: 0; }

main { max-width: 68rem; margin: 0 auto; padding: clamp(1rem, 3vw, 1.75rem) clamp(1rem, 4vw, 2rem) 3rem; }

/* Reiter Liste / Karte */
.reiter { display: inline-flex; gap: .25rem; padding: .25rem; background: var(--flaeche-2); border-radius: 999px; }
.reiter a {
  padding: .4rem 1rem;
  border-radius: 999px;
  font-size: .92rem;
  font-weight: 550;
  color: var(--leise);
  text-decoration: none;
}
.reiter a[aria-current="page"] { background: var(--flaeche); color: var(--text); box-shadow: var(--schatten); }

/* Filterleiste */
.filter {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
  gap: .7rem;
  align-items: end;
  margin: 1rem 0;
  padding: 1rem;
  background: var(--flaeche);
  border: 1px solid var(--rand);
  border-radius: var(--radius);
  box-shadow: var(--schatten);
}
.filter .weit { grid-column: span 2; min-width: 0; }
label { display: grid; gap: .3rem; font-size: .78rem; font-weight: 600; letter-spacing: .02em; color: var(--leise); text-transform: uppercase; }
input, select, button {
  font: inherit;
  padding: .55rem .7rem;
  border: 1px solid var(--rand);
  border-radius: 10px;
  background: var(--flaeche);
  color: var(--text);
  min-width: 0;
}
input:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--akzent);
  outline-offset: 2px;
}
button { background: var(--akzent); color: var(--akzent-text); border: 0; font-weight: 600; cursor: pointer; }
button:hover { filter: brightness(1.08); }
button.link { background: none; color: var(--leise); padding: 0; font-weight: 500; text-decoration: underline; }
button.link:hover { color: var(--text); }

/* Zahlen oben */
.zahlen { display: flex; flex-wrap: wrap; gap: .6rem; margin: 0 0 1.2rem; }
.kachel {
  flex: 1 1 8rem;
  padding: .7rem .9rem;
  background: var(--flaeche);
  border: 1px solid var(--rand);
  border-radius: var(--radius);
}
.kachel b { display: block; font-size: 1.5rem; font-weight: 650; letter-spacing: -0.02em; }
.kachel span { font-size: .8rem; color: var(--leise); }
.kachel.gebiet { border-left: 4px solid var(--punkt, var(--akzent)); }

/* Gruppen und Karten */
section { margin: 1.8rem 0 0; }
section > h2 {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin: 0 0 .7rem;
  font-size: 1.05rem;
  font-weight: 650;
}
section > h2::before {
  content: "";
  width: .7rem;
  height: .7rem;
  border-radius: 50%;
  background: var(--punkt, var(--akzent));
  flex: none;
}
.zahl { margin-left: auto; font-size: .85rem; font-weight: 500; color: var(--leise); }

.firmen { display: grid; gap: .7rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); }
.firma {
  display: flex;
  flex-direction: column;
  gap: .4rem;
  padding: .9rem 1rem;
  background: var(--flaeche);
  border: 1px solid var(--rand);
  border-radius: var(--radius);
  box-shadow: var(--schatten);
}
.firma h3 { margin: 0; font-size: 1rem; font-weight: 620; }
.firma h3 a { color: var(--text); text-decoration: none; }
.firma h3 a:hover { color: var(--akzent); }
.firma p { margin: 0; }
.firma .zweck { font-size: .9rem; color: var(--text); }
.ort, .datum, .info, .leer { color: var(--leise); font-size: .88rem; }
.marken { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; margin-top: auto; padding-top: .2rem; }
.marke-branche {
  font-size: .74rem;
  font-weight: 600;
  letter-spacing: .02em;
  padding: .12rem .5rem;
  border-radius: 999px;
  background: var(--flaeche-2);
  color: var(--leise);
}
.abzeichen {
  font-size: .74rem;
  font-weight: 700;
  padding: .12rem .5rem;
  border-radius: 999px;
  background: var(--neu-grund);
  color: var(--neu);
}
.leer { padding: 1rem; background: var(--flaeche); border: 1px dashed var(--rand); border-radius: var(--radius); }

/* Karte */
#karte {
  height: min(72vh, 46rem);
  border: 1px solid var(--rand);
  border-radius: var(--radius);
  box-shadow: var(--schatten);
  background: var(--flaeche-2);
  z-index: 0;
}
.legende { display: flex; flex-wrap: wrap; gap: .5rem 1rem; margin: .8rem 0 0; font-size: .85rem; color: var(--leise); }
.legende span { display: inline-flex; align-items: center; gap: .4rem; }
.legende i { width: .8rem; height: .8rem; border-radius: 50%; border: 2px solid var(--flaeche); box-shadow: 0 0 0 1px rgb(0 0 0 / 25%); }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--flaeche); color: var(--text); box-shadow: var(--schatten); }
.leaflet-popup-content { margin: .7rem .9rem; font: inherit; }
.leaflet-popup-content b { font-size: 1rem; }
.leaflet-popup-content .ort { display: block; margin: .15rem 0 .35rem; }
.leaflet-container { font: inherit; background: var(--flaeche-2); }
.leaflet-container a { color: var(--akzent); }
@media (prefers-color-scheme: dark) {
  /* Kartenbilder etwas abdunkeln, damit sie zum dunklen Schema passen */
  .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.92) contrast(.9); }
}

/* Anmeldung */
.anmeldung { max-width: 23rem; margin: clamp(2rem, 8vh, 5rem) auto; display: grid; gap: .9rem; padding: 1.5rem; background: var(--flaeche); border: 1px solid var(--rand); border-radius: var(--radius); box-shadow: var(--schatten); }
.anmeldung h1 { margin: 0; font-size: 1.3rem; }

.fuss { max-width: 68rem; margin: 1rem auto 2rem; padding: 0 clamp(1rem, 4vw, 2rem); color: var(--leise); font-size: .8rem; }
.fehler { color: var(--fehler); font-size: .9rem; }
