:root {
  --bg: #f3f4f1; --card: #ffffff; --text: #1b1d1a; --muted: #656a62; --line: #e1e4dd;
  --accent: #c8102e; --accent-soft: #fbe7ea; --good: #2f7d4f; --mid: #b7791f; --high: #c0392b;
  --route: #c8102e; --chip: #eef0eb;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141614; --card: #1f221f; --text: #ecede9; --muted: #a3a89e; --line: #343833;
    --accent: #ff6b7f; --accent-soft: #3a2226; --good: #6fcf97; --mid: #f2c14e; --high: #ff8a7a;
    --route: #ff6b7f; --chip: #2a2e2a;
  }
}
:root[data-theme="dark"] {
  --bg: #141614; --card: #1f221f; --text: #ecede9; --muted: #a3a89e; --line: #343833;
  --accent: #ff6b7f; --accent-soft: #3a2226; --good: #6fcf97; --mid: #f2c14e; --high: #ff8a7a;
  --route: #ff6b7f; --chip: #2a2e2a;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 18px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
main { max-width: 760px; margin: 0 auto; padding: 16px 16px 48px; }
h1 { font-size: 1.5rem; margin: 4px 0 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
h2 { font-size: 1.1rem; margin: 22px 0 8px; color: var(--muted); font-weight: 600; }
button { font: inherit; color: inherit; }
.muted { color: var(--muted); }

/* Das Auto jetzt */
.now { background: var(--card); border-radius: 18px; overflow: hidden; box-shadow: 0 1px 2px rgb(0 0 0 / .06); }
.now .top { display: flex; gap: 16px; align-items: center; padding: 16px; }
.battery { flex: none; width: 92px; text-align: center; }
.battery b { display: block; font-size: 2rem; line-height: 1; white-space: nowrap; }
.battery .bar { height: 10px; border-radius: 5px; background: var(--line); margin-top: 8px; overflow: hidden; }
.battery .bar i { display: block; height: 100%; background: var(--good); border-radius: 5px; }
.now .info { min-width: 0; }
.now .state { font-weight: 700; font-size: 1.1rem; }
.now .where { overflow-wrap: anywhere; }
.now .map { height: 170px; border-top: 1px solid var(--line); }

/* Reiter */
.tabs { display: flex; gap: 6px; margin: 18px 0 6px; background: var(--card); padding: 5px; border-radius: 14px; }
.tabs button {
  flex: 1; border: 0; background: none; padding: 10px 6px; border-radius: 10px; font-weight: 600; cursor: pointer;
  color: var(--muted);
}
.tabs button[aria-selected="true"] { background: var(--accent); color: #fff; }

/* Karten in den Listen */
.list { list-style: none; margin: 0; padding: 0; }
.item { background: var(--card); border-radius: 14px; margin-bottom: 10px; overflow: hidden; }
.item > button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 12px 14px; cursor: pointer; }
.item .when { color: var(--muted); font-size: .92rem; }
.item .path { font-weight: 600; margin: 2px 0 6px; overflow-wrap: anywhere; }
.item .path .arrow { color: var(--muted); font-weight: 400; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { background: var(--chip); border-radius: 999px; padding: 2px 10px; font-size: .92rem; white-space: nowrap; }
.chip.good { color: var(--good); font-weight: 700; }
.chip.mid { color: var(--mid); font-weight: 700; }
.chip.high { color: var(--high); font-weight: 700; }
.chip.fast { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.item .more { border-top: 1px solid var(--line); }
.item .more .map { height: 240px; }
.item .more dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 14px; margin: 0; padding: 12px 14px; font-size: .95rem; }
.item .more dt { color: var(--muted); }
.item .more dd { margin: 0; }
.day { display: flex; justify-content: space-between; gap: 8px; margin: 18px 2px 6px; color: var(--muted); font-weight: 600; }
.day span:last-child { font-weight: 400; white-space: nowrap; }
.empty { text-align: center; color: var(--muted); padding: 28px 12px; background: var(--card); border-radius: 14px; }
.load { display: block; width: 100%; margin: 6px 0; padding: 12px; border: 1px solid var(--line); background: var(--card); border-radius: 12px; cursor: pointer; }

/* Monate */
.month { background: var(--card); border-radius: 14px; padding: 12px 14px; margin-bottom: 10px; }
.month b { display: block; margin-bottom: 6px; }

.out { border: 0; background: none; color: var(--muted); font-size: .9rem; cursor: pointer; padding: 6px; }
.error { background: var(--accent-soft); color: var(--accent); padding: 10px 14px; border-radius: 12px; margin: 10px 0; }

/* Anmelden */
.login { max-width: 380px; margin: 12vh auto 0; background: var(--card); border-radius: 18px; padding: 24px 20px; }
.login label { display: block; font-weight: 600; margin: 14px 0 6px; }
.login input {
  width: 100%; font: inherit; padding: 12px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--bg); color: var(--text);
}
.login .go { width: 100%; margin-top: 16px; padding: 12px; border: 0; border-radius: 10px; background: var(--accent); color: #fff; font-weight: 700; cursor: pointer; }
.leaflet-container { background: var(--line); font: inherit; }
