:root {
  --bg: #11151c;
  --panel: #1a2029;
  --panel2: #222a36;
  --line: #2c3644;
  --fg: #e8edf4;
  --dim: #93a0b3;
  --acc: #4ade80;
  --acc-dark: #16603a;
  --red: #f87171;
  --amber: #fbbf24;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
  padding-bottom: env(safe-area-inset-bottom);
}
.hidden { display: none !important; }

/* ---------- Login ---------- */
.login {
  position: fixed; inset: 0; display: grid; place-items: center;
  background: var(--bg); z-index: 50; padding: 24px;
}
.login form { width: 100%; max-width: 320px; text-align: center; }
.login h1 { font-size: 44px; margin: 0; letter-spacing: -1px; }
.login p { color: var(--dim); margin: 4px 0 24px; }
.login input { width: 100%; }

/* ---------- Chrome ---------- */
header {
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(env(safe-area-inset-top) + 12px) 16px 8px;
}
.car { font-weight: 600; letter-spacing: .3px; }
.gear {
  background: none; border: 0; color: var(--dim); font-size: 22px; padding: 4px 8px;
}
.tab { padding: 8px 16px 96px; max-width: 640px; margin: 0 auto; }
h2 { font-size: 15px; text-transform: uppercase; letter-spacing: .08em; color: var(--dim); margin: 22px 0 10px; }

nav.tabs {
  position: fixed; left: 0; right: 0; bottom: 0;
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: rgba(17,21,28,.94); backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
nav.tabs button {
  background: none; border: 0; color: var(--dim);
  padding: 13px 4px; font-size: 13px; font-weight: 600;
}
nav.tabs button.active { color: var(--acc); }

/* ---------- Tracker ---------- */
.tracker { text-align: center; padding: 10px 0 4px; }
.bigbtn {
  width: 190px; height: 190px; border-radius: 50%;
  border: 3px solid var(--acc); background: transparent; color: var(--acc);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; transition: transform .12s ease, background .2s;
  margin: 6px auto 18px;
}
.bigbtn:active { transform: scale(.96); }
.bigbtn .lbl { font-size: 46px; font-weight: 800; letter-spacing: 1px; }
.bigbtn .sub { font-size: 13px; opacity: .8; font-weight: 600; }
.bigbtn.on {
  border-color: var(--red); color: #fff; background: #3a1420;
  animation: pulse 2.4s ease-in-out infinite;
}
.bigbtn.on .lbl { color: var(--red); }
@keyframes pulse { 50% { box-shadow: 0 0 0 14px rgba(248,113,113,.06); } }

.bigkm { font-size: 52px; font-weight: 800; letter-spacing: -1.5px; line-height: 1; }
.bigkm .unit { font-size: 20px; font-weight: 600; color: var(--dim); margin-left: 6px; }
.livemeta { color: var(--dim); font-size: 14px; margin-top: 8px; font-variant-numeric: tabular-nums; }
.gps.ok { color: var(--acc); }
.gps.weak { color: var(--amber); }
.hint {
  background: #2a2318; border: 1px solid #4a3d1e; color: #f3d99b;
  padding: 10px 12px; border-radius: 12px; font-size: 13px; margin-top: 14px; text-align: left;
}

/* ---------- Karten ---------- */
.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 20px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.card.wide { grid-column: 1 / -1; }
.card .k { font-size: 12px; color: var(--dim); text-transform: uppercase; letter-spacing: .05em; }
.card .v {
  font-size: 25px; font-weight: 700; margin-top: 3px; font-variant-numeric: tabular-nums;
  display: flex; align-items: baseline; gap: 5px; white-space: nowrap; letter-spacing: -.5px;
}
.card .v small { font-size: 13px; color: var(--dim); font-weight: 600; letter-spacing: 0; }
.card .s { font-size: 12px; color: var(--dim); margin-top: 2px; min-height: 16px; }

/* ---------- Listen ---------- */
.list { display: flex; flex-direction: column; gap: 8px; }
.row {
  display: flex; align-items: center; gap: 12px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 11px 14px;
}
/* flex: none noetig — sonst zieht die globale Regel button{width:100%} den
   Loesch-Knopf auf die volle Zeilenbreite und quetscht den Text auf 0 px. */
.row .main { flex: 1 1 auto; min-width: 0; }
.row .val { flex: 0 0 auto; }
.row .del { flex: 0 0 auto; width: 40px; height: 40px; margin-right: -8px; }
.row .t1 { font-weight: 600; font-variant-numeric: tabular-nums; }
.row .t2 { font-size: 12.5px; color: var(--dim); }
.row .val { font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.row .val small { color: var(--dim); font-weight: 600; font-size: 12px; }
.row .del { background: none; border: 0; color: var(--dim); font-size: 17px; padding: 6px; }
.badge {
  display: inline-block; font-size: 10.5px; font-weight: 700; padding: 1px 6px;
  border-radius: 6px; background: var(--panel2); color: var(--dim); margin-left: 6px;
  vertical-align: 1px;
}
.badge.gps { background: var(--acc-dark); color: #b9f6cf; }
.badge.part { background: #4a3d1e; color: #f3d99b; }
.empty { color: var(--dim); text-align: center; padding: 28px 10px; font-size: 14px; }
.note { color: var(--dim); font-size: 12.5px; margin-top: 14px; line-height: 1.5; }

/* ---------- Formulare ---------- */
label { display: block; margin: 12px 0; font-size: 13px; color: var(--dim); font-weight: 600; }
label.check { display: flex; align-items: center; gap: 9px; color: var(--fg); font-weight: 500; font-size: 14.5px; }
label small { display: block; font-weight: 400; margin-top: 4px; color: #7b8798; }
input[type=text], input[type=password], input[type=datetime-local] {
  width: 100%; margin-top: 5px; padding: 12px 13px; font-size: 16px;
  background: var(--panel2); border: 1px solid var(--line); border-radius: 11px; color: var(--fg);
}
input[type=checkbox] { width: 21px; height: 21px; accent-color: var(--acc); margin: 0; }
input:focus { outline: 2px solid var(--acc); outline-offset: 1px; }
button {
  font: inherit; font-weight: 700; border-radius: 12px; border: 0; padding: 13px 16px; width: 100%;
}
button.primary { background: var(--acc); color: #06280f; margin-top: 8px; }
button.ghost { background: transparent; color: var(--dim); border: 1px solid var(--line); margin-top: 10px; }
.login button { background: var(--acc); color: #06280f; margin-top: 12px; }
.err { color: var(--red); font-size: 14px; min-height: 20px; margin-top: 10px; }
.hintline { display: block; color: #7b8798; font-size: 12px; margin: -4px 0 4px; }

details.add {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 4px 14px 6px; margin-bottom: 16px;
}
details.add summary { padding: 10px 0; font-weight: 700; color: var(--acc); cursor: pointer; list-style: none; }
details.add summary::-webkit-details-marker { display: none; }

.panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 4px 16px 18px; margin: 0 16px 8px;
}
.panel h2 { margin-top: 14px; }
