:root {
  --grund: #f4f5f7; --karte: #fff; --text: #1d2330; --leise: #5d6576; --linie: #dde1e8;
  --rot: #d0021b; --rot-hell: #fdecee; --gelb: #ffd500; --gruen: #1f8a4c; --gruen-hell: #e8f6ee;
  --orange: #b26a00; --orange-hell: #fff4e0; --blau: #1d5fd1;
}
@media (prefers-color-scheme: dark) {
  :root { --grund: #14171d; --karte: #1e222b; --text: #e8eaf0; --leise: #9aa3b5; --linie: #333a47;
          --rot-hell: #3a1d22; --gruen-hell: #18301f; --orange-hell: #3a2c14; --blau: #7aa7ff; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--grund); color: var(--text); font: 15px/1.45 system-ui, "Segoe UI", Roboto, sans-serif; }
a { color: var(--blau); }
main { max-width: 1100px; margin: 0 auto; padding: 16px; }
h1 { font-size: 1.5rem; margin: .3em 0 .6em; }
h2 { font-size: 1.1rem; margin: 0 0 .6em; }

.kopf { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; padding: 8px 16px;
        background: var(--karte); border-bottom: 3px solid var(--rot); }
.kopf .marke { font-weight: 800; color: var(--rot); text-decoration: none; font-size: 1.15rem; line-height: 1.2; }
.kopf .marke small { display: block; font-size: .72rem; font-weight: 600; color: var(--leise); letter-spacing: .01em; }
.anbieter { margin: -6px 0 4px; color: var(--leise); font-size: .85rem; }
.kopf nav { display: flex; flex-wrap: wrap; gap: 2px; flex: 1 1 auto; }
.kopf nav a { padding: 8px 10px; border-radius: 6px; text-decoration: none; color: var(--text); }
.kopf nav a.aktiv { background: var(--grund); font-weight: 600; }
.abmelden { margin: 0; }
.stationsanzeige { display: flex; gap: 6px; text-decoration: none; font-size: .85rem; font-weight: 600; }
.stationsanzeige span { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 99px; white-space: nowrap; }
.stationsanzeige span.ok { background: var(--gruen-hell); color: var(--gruen); }
.stationsanzeige span.fehler { background: var(--rot-hell); color: var(--rot); }
.stationsanzeige i { width: 9px; height: 9px; border-radius: 50%; background: currentColor; }
.stationsanzeige span.fehler i { animation: blinken 1.2s infinite; }
@keyframes blinken { 50% { opacity: .2; } }
button.link { background: none; border: 0; color: var(--leise); cursor: pointer; padding: 8px 0; font: inherit; }

.banner { padding: 10px 16px; margin: 0; }
.banner.ok { background: var(--gruen-hell); color: var(--gruen); }
.banner.fehler { background: var(--rot-hell); color: var(--rot); }
.banner.warn { background: var(--orange-hell); color: var(--orange); }
.tagewahl { border: 1px solid var(--linie); border-radius: 8px; display: flex; flex-wrap: wrap; gap: 6px 16px; }
.artikelwahl { display: grid; gap: 4px; margin-top: 8px; max-height: 320px; overflow: auto; }
.artikelwahl small { color: var(--leise); font-weight: 400; }
details summary { cursor: pointer; font-weight: 600; font-size: .9rem; }
main .banner { border-radius: 8px; margin-bottom: 12px; }

.karte { background: var(--karte); border: 1px solid var(--linie); border-radius: 10px; padding: 16px; margin-bottom: 16px; }
.titelzeile { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }

input, select { font: inherit; padding: 9px 10px; border: 1px solid var(--linie); border-radius: 7px;
                background: var(--karte); color: var(--text); width: 100%; }
label { display: block; font-weight: 600; font-size: .9rem; }
label input, label select { margin-top: 4px; font-weight: 400; }
button, .knopf { font: inherit; padding: 9px 16px; border-radius: 7px; border: 1px solid var(--linie);
                 background: var(--karte); color: var(--text); cursor: pointer; text-decoration: none; display: inline-block; }
button.haupt, .knopf.haupt { background: var(--rot); border-color: var(--rot); color: #fff; font-weight: 600; }
button.gefahr { color: var(--rot); border-color: var(--rot); }
.knopfreihe { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }

.formular { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.formular .breit { grid-column: 1 / -1; }
.formular h2 { margin: 0; }
label.haken { display: flex; align-items: center; gap: 8px; }
label.haken input { width: auto; margin: 0; }
.zeile { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.zeile label { flex: 1 1 200px; }
.suche { display: flex; gap: 8px; margin-bottom: 12px; align-items: flex-end; }
.hinweis { color: var(--leise); font-size: .88rem; margin: 4px 0; }

.kacheln { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 16px; }
.kachel { background: var(--karte); border: 1px solid var(--linie); border-radius: 10px; padding: 12px 16px; }
.kachel b { display: block; font-size: 1.8rem; }
.kachel span { color: var(--leise); }
.kachel.warn b { color: var(--orange); }
.kachel.ok b { color: var(--gruen); }

.station { margin: 4px 0; }
.punkt { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; }
.punkt.ok { background: var(--gruen); } .punkt.fehler { background: var(--rot); }
.marke-ok { color: var(--gruen); } .marke-warn { color: var(--orange); }
.marke-fehler { color: var(--rot); font-weight: 600; } .marke-info { color: var(--blau); }
.marke-leer { color: var(--leise); }
.nr { display: inline-block; min-width: 1.6em; padding: 0 5px; border-radius: 5px; background: var(--text);
      color: var(--karte); font-size: .85em; text-align: center; font-weight: 700; }
.kompakt { margin: 4px 0 8px; padding-left: 20px; }
.etikett { background: var(--gelb); color: #000; font-size: .75rem; padding: 1px 6px; border-radius: 4px; font-weight: 700; }

table.liste { width: 100%; border-collapse: collapse; background: var(--karte); border: 1px solid var(--linie); border-radius: 10px; overflow: hidden; }
.liste th, .liste td { padding: 10px 12px; border-bottom: 1px solid var(--linie); text-align: left; vertical-align: top; }
.liste tbody tr { cursor: pointer; }
.liste tbody tr:hover { background: var(--grund); }
.liste small { color: var(--leise); }
.zahl { text-align: right !important; white-space: nowrap; }
.schmal { width: 1%; text-align: center !important; }

img { image-rendering: pixelated; border: 1px solid var(--linie); background: #fff; max-width: 100%; height: auto; }
.schildraster { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.schildkarte { background: var(--karte); border: 1px solid var(--linie); border-radius: 10px; padding: 8px;
               color: var(--text); text-decoration: none; display: flex; flex-direction: column; gap: 2px; }
.schildkarte:hover { border-color: var(--rot); }
.schildkarte small { color: var(--leise); }
.vorschauen { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.vorlagenraster { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.vorlagenwahl { border: 1px solid var(--linie); border-radius: 8px; display: flex; gap: 12px; flex-wrap: wrap; }
.vorlagenwahl label { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; cursor: pointer; }
.vorlagenwahl input { width: auto; }
img.gross { display: block; margin-bottom: 8px; }

body.login { display: grid; place-items: center; min-height: 100vh; padding: 16px; }
.login-karte { width: 100%; max-width: 360px; display: grid; gap: 12px; }
.login-karte h1 { color: var(--rot); margin: 0; }

button.klein { padding: 5px 10px; font-size: .85rem; }
.tabelle-scroll { overflow-x: auto; }

@media (max-width: 640px) {
  .liste th, .liste td { padding: 8px 6px; }
  .kopf { justify-content: space-between; }
  .kopf nav { order: 3; flex-basis: 100%; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
  .kopf nav a { white-space: nowrap; padding: 6px 8px; }
  .formular { grid-template-columns: 1fr; }
  .kacheln { grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
  .kachel { padding: 8px; } .kachel b { font-size: 1.3rem; }
  main { padding: 12px; }
}
