/* Grund-Setup */
:root {
  --bg: #f6f7fb;
  --card: #ffffff;
  --text: #0b1220;
  --muted: #5c6473;
  --primary: #007aff;
  --accent: #10b981;
  --border: #e4e7ed;
  --shadow: 0 18px 45px rgba(21, 31, 55, 0.08);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1117;
    --card: #161b22;
    --text: #f5f7fb;
    --muted: #9aa4b5;
    --primary: #5ac8fa;
    --accent: #34d399;
    --border: #1f2630;
    --shadow: 0 16px 36px rgba(0, 0, 0, 0.6);
  }
}

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

body {
  margin: 0;
  font-family: "SF Pro Display", "SF Pro Text", "Helvetica Neue", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: radial-gradient(120% 140% at 10% 10%, rgba(0, 122, 255, 0.06), transparent), radial-gradient(90% 120% at 80% 0%, rgba(52, 211, 153, 0.06), transparent), var(--bg);
  min-height: 100vh;
  padding: 16px 16px 90px;
}

h1, h2, h3, h4, h5 {
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.01em;
}

p {
  margin: 0;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 12px 0 20px;
}

.layout {
  max-width: 960px;
  margin: 0 auto;
  display: grid;
  gap: 16px;
}

.card {
  background: var(--card);
  border-radius: 18px;
  padding: 18px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.panel {
  display: none;
  flex-direction: column;
  gap: 14px;
}

.panel.active {
  display: flex;
}

.hero {
  padding: 22px;
  border-radius: 22px;
  background: linear-gradient(135deg, #007aff, #34d399);
  color: #fff;
  box-shadow: var(--shadow);
  text-align: center;
}

.hero .eyebrow {
  color: rgba(255, 255, 255, 0.8);
}

.odometer-shell {
  display: inline-flex;
  align-items: stretch;
  background: linear-gradient(180deg, #0e1117, #0c0f13 60%, #06080c);
  border-radius: 12px;
  border: 2px solid #262a30;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.7), 0 4px 12px rgba(0, 0, 0, 0.2);
  padding: 10px 12px;
  gap: 8px;
  justify-content: center;
}

.odometer-digits {
  display: grid;
  grid-auto-flow: column;
  gap: 6px;
  font-family: "SFMono-Regular", "Courier New", monospace;
}

.odometer-digits .digit {
  background: linear-gradient(180deg, #1c1f26, #0f1117);
  color: #f2f5f9;
  width: 32px;
  height: 48px;
  border-radius: 6px;
  border: 1px solid #353941;
  box-shadow: inset 0 -2px 6px rgba(0, 0, 0, 0.5), inset 0 4px 6px rgba(255, 255, 255, 0.05);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 800;
}

.odometer-unit {
  display: inline-flex;
  align-items: center;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.8);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.flat {
  border-radius: 16px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 600;
  color: var(--text);
}

.field span {
  font-size: 14px;
  color: var(--muted);
}

input {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  font-size: 16px;
  background: rgba(255, 255, 255, 0.8);
  color: var(--text);
  transition: border 0.2s ease, box-shadow 0.2s ease;
}

input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.15);
}

button {
  appearance: none;
  border: none;
  border-radius: 14px;
  padding: 14px 16px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  background: linear-gradient(120deg, #007aff, #00c6ff);
  color: #ffffff;
  box-shadow: 0 12px 30px rgba(0, 122, 255, 0.35);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

button:active {
  transform: translateY(1px);
  box-shadow: 0 8px 18px rgba(0, 122, 255, 0.25);
}

.ghost {
  background: transparent;
  color: var(--text);
  box-shadow: none;
  border: 1px solid var(--border);
}

.actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.feedback {
  margin-top: 10px;
  color: var(--muted);
  min-height: 20px;
}

.status {
  display: flex;
  gap: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(0, 122, 255, 0.1);
  color: #0057b7;
  font-weight: 700;
  font-size: 13px;
}

.chip.online {
  background: rgba(16, 185, 129, 0.12);
  color: #0b8f62;
}

.chip.offline {
  background: rgba(255, 149, 0, 0.16);
  color: #b46900;
}

.chip.muted {
  background: rgba(92, 100, 115, 0.12);
  color: var(--muted);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.stat {
  padding: 12px;
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(0, 122, 255, 0.06), rgba(255, 255, 255, 0));
  border: 1px solid var(--border);
}

.stat .label {
  font-size: 14px;
  color: var(--muted);
}

.stat .value {
  font-size: 26px;
  font-weight: 800;
  margin: 4px 0;
}

.stat .hint {
  color: var(--muted);
  font-size: 13px;
}

.stats-grid.compact .value {
  font-size: 22px;
}

.pill {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(0, 122, 255, 0.08);
  color: #0057b7;
  font-weight: 700;
  font-size: 13px;
}

.chart-wrap {
  background: radial-gradient(circle at 10% 20%, rgba(0, 122, 255, 0.06), transparent 30%), var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
}

canvas {
  width: 100%;
  height: auto;
  display: block;
}

.list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.list-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(0, 122, 255, 0.04);
  border: 1px solid var(--border);
}

.list-item .meta {
  color: var(--muted);
  font-size: 13px;
}

.list-item .value {
  font-weight: 700;
  font-size: 16px;
}

.list-item .badge {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.12);
  color: #0b8f62;
  font-weight: 700;
  font-size: 13px;
  align-self: start;
}

.hint {
  color: var(--muted);
  font-size: 14px;
  margin-top: 6px;
}

.big {
  font-size: 24px;
  font-weight: 800;
}

.tabbar {
  position: fixed;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 6px;
  width: min(960px, calc(100% - 24px));
  box-shadow: var(--shadow);
  z-index: 10;
}

.tab {
  border: none;
  background: transparent;
  color: var(--muted);
  padding: 10px 8px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 13px;
  box-shadow: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.tab.active {
  background: rgba(0, 122, 255, 0.12);
  color: #0057b7;
}

@media (max-width: 640px) {
  body {
    padding: 12px 12px 80px;
  }
  .card {
    padding: 16px;
  }
  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .status {
    flex-wrap: wrap;
  }
  button {
    width: 100%;
  }
  .actions {
    flex-direction: column;
  }
  .tabbar {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}
