:root {
  --tlo: #0d1117;
  --panel: #161b22;
  --tekst: #f0f6fc;
  --przygaszony: #8b949e;
  --akcent: #2ea043;
  --stop: #da3633;
  --ostrzezenie: #d29922;
  color-scheme: dark;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--tlo);
  color: var(--tekst);
  font: 16px/1.4 system-ui, -apple-system, "Segoe UI", sans-serif;
  min-height: 100dvh;
  -webkit-user-select: none;
  user-select: none;
}

#app {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px;
  min-height: 100dvh;
  max-width: 560px;
  margin: 0 auto;
}

.kwota {
  font-size: clamp(64px, 22vw, 128px);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: center;
  line-height: 1;
  margin: 24px 0 8px;
}

.metryki {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  text-align: center;
}

.metryka { background: var(--panel); border-radius: 12px; padding: 12px 8px; }
.metryka b { display: block; font-size: 22px; font-variant-numeric: tabular-nums; }
.metryka span { color: var(--przygaszony); font-size: 12px; }

button {
  font: inherit;
  color: var(--tekst);
  background: var(--panel);
  border: 1px solid #30363d;
  border-radius: 12px;
  padding: 16px;
  min-height: 64px;
  cursor: pointer;
}

button:active { filter: brightness(1.3); }

.glowny { font-size: 28px; font-weight: 700; min-height: 88px; border: none; }
.start { background: var(--akcent); }
.stop { background: var(--stop); }

.strefa { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.strefa button[aria-pressed="true"] { background: var(--akcent); border-color: transparent; }

.pasek {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  color: var(--przygaszony);
  font-size: 14px;
}

.gps-dobry { color: var(--akcent); }
.gps-slaby { color: var(--ostrzezenie); }
.gps-brak { color: var(--stop); }

.link {
  background: none;
  border: none;
  padding: 0;
  min-height: 0;
  font-size: 14px;
  text-decoration: underline;
  white-space: nowrap;
}

.ostrzezenie {
  background: #3d2e0a;
  border: 1px solid var(--ostrzezenie);
  color: var(--ostrzezenie);
  border-radius: 12px;
  padding: 12px;
  font-size: 14px;
}

.dodatki, .taryfy { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.dodatki button, .taryfy button { min-height: 56px; padding: 10px; text-align: left; }
.dodatki b, .taryfy b { display: block; font-size: 15px; }
.dodatki span, .taryfy span { display: block; color: var(--przygaszony); font-size: 12px; }
.dodatki button[aria-pressed="true"],
.taryfy button[aria-pressed="true"] { background: var(--akcent); border-color: transparent; }
.dodatki button[aria-pressed="true"] span,
.taryfy button[aria-pressed="true"] span { color: var(--tekst); }

.rozbicie { background: var(--panel); border-radius: 12px; padding: 8px 16px; }
.wiersz {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid #21262d;
}
.wiersz:last-child { border-bottom: none; }
.rozbicie .wiersz:last-child { font-size: 18px; }
.wiersz span { color: var(--przygaszony); }
.wiersz b { font-variant-numeric: tabular-nums; text-align: right; }

.rt3000 {
  background: var(--ostrzezenie);
  color: #0d1117;
  font-weight: 700;
  font-size: 18px;
  text-align: center;
  border-radius: 12px;
  padding: 16px;
}

.kurs { background: var(--panel); border-radius: 12px; padding: 8px 16px; }

.mapa-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 1000;
}

.mapa-panel {
  background: var(--tlo);
  border: 1px solid #30363d;
  border-radius: 12px;
  padding: 16px;
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  overflow: auto;
}

.mapa-naglowek {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.mapa-kontener {
  width: 100%;
  height: 360px;
  border-radius: 8px;
  /* Leaflet rysuje wlasne kafelki jako tlo; bez tego bylyby przezroczyste
     do czasu wczytania i przebijalby przez nie ciemny motyw aplikacji. */
  background: #ddd;
}

h1 { font-size: 22px; margin: 8px 0; }

.rozpychacz { flex: 1; }
