:root {
  color-scheme: dark;
  --bg: #0a1119;
  --panel: #121d29;
  --line: #293747;
  --ink: #f4f6fa;
  --muted: #9aabbc;
  --accent: #ffb52c;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font:
    16px/1.5 system-ui,
    -apple-system,
    sans-serif;
}
header {
  max-width: 1140px;
  margin: auto;
  padding: 25px 24px;
  display: flex;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid var(--line);
}
header strong {
  font-size: 17px;
  letter-spacing: 1.6px;
}
header small {
  display: block;
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--muted);
}
.brand {
  font-size: 39px;
  line-height: 1;
  color: var(--accent);
}
header button {
  margin-left: auto;
}
main {
  max-width: 1140px;
  margin: 32px auto;
  padding: 0 24px;
}
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 24px;
  margin-bottom: 20px;
}
.login {
  max-width: 540px;
  margin: 8vh auto;
}
.eyebrow {
  color: var(--accent);
  font-size: 11px;
  letter-spacing: 2px;
  font-weight: 700;
}
h1 {
  font-size: clamp(30px, 4vw, 45px);
  line-height: 1.14;
  margin: 12px 0;
}
p {
  color: var(--muted);
}
small {
  color: var(--muted);
}
label {
  display: block;
  font-size: 13px;
  color: var(--muted);
}
input,
select,
button,
a {
  font: inherit;
}
input:not([type="checkbox"]),
select {
  width: 100%;
  padding: 13px;
  background: #0b141f;
  border: 1px solid #3a4c60;
  border-radius: 8px;
  color: var(--ink);
  margin: 6px 0 16px;
}
button,
a {
  border: 1px solid #3a4c60;
  border-radius: 9px;
  background: #1b2938;
  color: var(--ink);
  padding: 12px 18px;
  cursor: pointer;
  text-decoration: none;
  min-height: 46px;
}
button:disabled {
  opacity: 0.45;
  cursor: default;
}
.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #161b21;
  font-weight: 700;
  width: 100%;
  margin: 4px 0 10px;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}
.heading,
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
}
.heading h1 {
  margin-bottom: 5px;
}
.heading p {
  margin-top: 0;
}
.pill {
  border: 1px solid var(--line);
  border-radius: 30px;
  padding: 7px 13px;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}
.pill.online {
  color: #83dfb3;
  background: #102b24;
  border-color: #276449;
}
.toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin: 18px 0;
}
.device-label {
  min-width: 160px;
}
.device-label select {
  margin-bottom: 0;
}
.follow {
  display: flex;
  gap: 6px;
  align-items: center;
}
#map {
  height: 380px;
  background: #142330;
  border: 1px solid var(--line);
  border-radius: 15px;
  overflow: hidden;
}
.map-empty {
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--muted);
  padding: 20px;
  text-align: center;
}
.note {
  font-size: 13px;
}
.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 15px;
}
.metrics article {
  padding: 20px;
}
.metrics span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 1.5px;
}
.metrics strong {
  display: block;
  font-size: 40px;
  font-weight: 500;
  margin: 8px 0;
}
.metrics .time {
  font-size: 20px;
  margin-top: 20px;
}
.metrics small {
  font-size: 12px;
}
.history h2 {
  margin: 5px 0;
  font-size: 26px;
}
.section-head input {
  margin: 4px 0;
}
.trip {
  padding: 14px 0;
  border-top: 1px solid var(--line);
}
.trip strong {
  display: block;
}
.trip small {
  display: block;
}
#alerts {
  color: var(--muted);
  padding-left: 20px;
}
#error,
#loginError {
  color: #ffb4a8;
}
footer {
  padding: 30px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}
.leaflet-container {
  font-family: inherit;
}
.leaflet-control-attribution {
  font-size: 10px;
}
.car-marker {
  background: var(--accent);
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 8px #ffb52c33;
}
.play-marker {
  background: #77e3cd;
  border: 3px solid white;
  border-radius: 50%;
}
[hidden] {
  display: none !important;
}
@media (max-width: 650px) {
  header {
    padding: 18px 16px;
  }
  header strong {
    font-size: 13px;
  }
  header button {
    padding: 8px 12px;
    font-size: 12px;
  }
  main {
    margin-top: 22px;
    padding: 0 16px;
  }
  .card {
    padding: 19px;
  }
  .login {
    margin: 28px auto;
  }
  .heading {
    align-items: flex-start;
  }
  .heading h1 {
    font-size: 32px;
  }
  .pill {
    font-size: 11px;
    margin-top: 12px;
  }
  .metrics {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .metrics article {
    margin-bottom: 0;
  }
  .metrics {
    margin-bottom: 20px;
  }
  #map {
    height: 330px;
  }
  .toolbar {
    gap: 8px;
  }
  button,
  a {
    font-size: 13px;
    padding: 11px 13px;
  }
  .section-head {
    align-items: flex-start;
  }
  .section-head label {
    max-width: 145px;
  }
}
