:root {
  --gruen: #0B6E4F;
  --gruen-hell: #CFF3E3;
  --gold: #B26A00;
  --gold-hell: #FFE9C7;
  --rot: #B3261E;
  --grau: #5B6660;
  --linie: #E2E8E4;
  --bg: #FFFFFF;
  --text: #16201B;
}

@media (prefers-color-scheme: dark) {
  :root {
    --gruen: #7FD1AE;
    --gruen-hell: #0C3A2B;
    --gold: #FFB86B;
    --gold-hell: #3A2A0E;
    --rot: #FFB4AB;
    --grau: #A6B2AC;
    --linie: #26302B;
    --bg: #101512;
    --text: #E6ECE8;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  overscroll-behavior-y: contain;
}

header {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(env(safe-area-inset-top) + 10px) 16px 10px;
  background: var(--bg);
  border-bottom: 1px solid var(--linie);
}
header h1 { font-size: 20px; margin: 0; font-weight: 700; }
header button {
  background: none; border: none; color: var(--text);
  font-size: 24px; line-height: 1; padding: 4px 8px; cursor: pointer;
}

nav#tabs {
  position: sticky; top: 0; z-index: 19;
  display: flex; background: var(--bg);
  border-bottom: 1px solid var(--linie);
}
.tab {
  flex: 1; padding: 12px 4px; border: none; background: none;
  color: var(--grau); font-size: 15px; font-weight: 600; cursor: pointer;
  border-bottom: 3px solid transparent;
}
.tab.active { color: var(--gruen); border-bottom-color: var(--gruen); }
#page-sprit .tab.active { color: var(--gold); }

main#pages {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}
main#pages::-webkit-scrollbar { display: none; }

.page {
  flex: 0 0 100%;
  scroll-snap-align: start;
  min-height: calc(100vh - 120px);
  padding-bottom: calc(env(safe-area-inset-bottom) + 24px);
}

/* ------------------------------------------------------------- Abschnitte */

.abschnitt { padding: 14px 16px 4px; }
.abschnitt h2 { margin: 0; font-size: 17px; font-weight: 700; }
.abschnitt p { margin: 2px 0 0; font-size: 13px; color: var(--grau); }

.kopfzeile {
  display: flex; padding: 4px 16px 2px;
  font-size: 12px; font-weight: 700; color: var(--grau);
}
.kopfzeile .fill { flex: 1; }
.kopfzeile span.spalte { width: 78px; text-align: right; }
.kopfzeile span.icon-platz { width: 24px; }

/* --------------------------------------------------------------- Zeilen */

.zeile {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; border-bottom: 1px solid var(--linie);
  cursor: pointer;
}
.zeile:active { background: var(--gruen-hell); }
.rang {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--gruen); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; flex: 0 0 auto;
}
.sprit .rang { background: var(--gold); }
.mitte { flex: 1; min-width: 0; }
.mitte .name { font-size: 16px; font-weight: 600; }
.mitte .sub { font-size: 12.5px; color: var(--grau); margin-top: 1px; }
.mitte .hinweis { font-size: 12.5px; color: var(--gruen); font-weight: 600; margin-top: 2px; }
.mitte .warn { font-size: 12.5px; color: var(--gold); margin-top: 2px; }
.mitte .block { font-size: 12.5px; margin-top: 2px; color: var(--grau); }
.mitte .block.aktiv { color: var(--rot); }

.preis { width: 78px; text-align: right; flex: 0 0 auto; }
.preis .wert {
  font-size: 17px; font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.preis .wert.best { color: var(--gruen); }
.preis .wert.blass { color: var(--grau); font-weight: 400; }
.preis .einheit { font-size: 11px; color: var(--grau); }
.preis .anbieter { font-size: 11px; color: var(--grau); }
.preis .anbieter.best { color: var(--gruen); font-weight: 600; }

.sprit .preis .wert { color: var(--gold); width: 90px; }
.sprit .preis { width: 92px; }

.pfeil { width: 20px; text-align: center; color: var(--gruen); font-size: 18px; flex: 0 0 auto; }
.sprit .pfeil { color: var(--gold); }

.leer { padding: 8px 16px; font-size: 14px; color: var(--grau); }

/* Umkreis-Umschalter auf der Sprit-Seite */
.radiuszeile {
  display: flex; align-items: center; gap: 8px;
  padding: 14px 16px 2px;
}
.radiuszeile span { font-size: 14px; font-weight: 600; }
.chip {
  padding: 6px 14px; border-radius: 16px; cursor: pointer;
  border: 1px solid var(--linie); background: none;
  color: var(--text); font-size: 14px;
}
.chip.aktiv {
  background: var(--gold); border-color: var(--gold); color: #fff; font-weight: 600;
}
.chip[disabled] { opacity: .5; }

.ohnepreis-kopf {
  padding: 12px 16px 2px; font-size: 13px; font-weight: 700; color: var(--gold);
}

/* ----------------------------------------------------------------- Karte */

.card {
  margin: 14px 12px; padding: 14px; border-radius: 14px;
  background: var(--gruen-hell);
}
.card.sprit { background: var(--gold-hell); }
.status-line { font-size: 14px; font-weight: 700; }
.status-sub { font-size: 12.5px; margin-top: 4px; color: var(--grau); }
.quellen { margin-top: 8px; font-size: 11.5px; line-height: 1.5; }
.quellen .fehler { color: var(--rot); font-weight: 600; }
.hinweise { margin-top: 8px; font-size: 12.5px; color: var(--rot); line-height: 1.45; }

.btn {
  margin-top: 12px; padding: 10px 16px; border: none; border-radius: 20px;
  background: var(--gruen); color: #fff; font-size: 14px; font-weight: 600;
  cursor: pointer;
}
.btn-sprit { background: var(--gold); }
.btn[disabled] { opacity: .5; }

.fuss {
  padding: 14px 16px 4px; font-size: 11.5px; color: var(--grau);
  line-height: 1.5; border-top: 1px solid var(--linie); margin-top: 10px;
}
.fuss strong { color: var(--text); }
