:root {
  --bg: #0e1116;
  --panel: #171b22;
  --panel-2: #1e242d;
  --line: #2a313c;
  --text: #e6edf3;
  --muted: #8b98a5;
  --accent: #4aa8ff;
  --ok: #3fb950;
  --bad: #f85149;
  --tesla: #e82127;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  display: flex;
  flex-direction: column;
}
header {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 10px 16px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}
.brand { font-weight: 700; font-size: 16px; }
.tag {
  font-size: 10px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--muted); border: 1px solid var(--line); border-radius: 4px;
  padding: 1px 5px; margin-left: 4px;
}
.status { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.sep { opacity: .5; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); display: inline-block; }
.dot.ok { background: var(--ok); box-shadow: 0 0 6px var(--ok); }
.dot.bad { background: var(--bad); }
.veh { margin-left: auto; color: var(--muted); }
select {
  background: var(--panel-2); color: var(--text);
  border: 1px solid var(--line); border-radius: 6px; padding: 5px 8px; margin-left: 6px;
}

.onboarding {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px; padding: 12px 16px 0;
}
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px;
}
.card h3 { margin: 0 0 8px; font-size: 13px; }
.card-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
button {
  background: var(--panel-2); color: var(--text); border: 1px solid var(--line);
  border-radius: 6px; padding: 6px 10px; cursor: pointer; font-size: 12px;
}
button:hover { border-color: var(--accent); }
button.primary { background: var(--tesla); border-color: var(--tesla); color: #fff; font-weight: 600; }
.pill { display: inline-block; padding: 1px 7px; border-radius: 999px; font-size: 11px; border: 1px solid var(--line); }
.pill.ok { color: var(--ok); border-color: var(--ok); }
.pill.bad { color: var(--bad); border-color: var(--bad); }
.out { margin: 10px 0 0; max-height: 120px; overflow: auto; font-size: 11px; color: var(--muted); white-space: pre-wrap; }
.out:empty { display: none; }

.account { display: flex; align-items: center; gap: 10px; }
.logout {
  color: var(--muted); text-decoration: none; font-size: 12px;
  border: 1px solid var(--line); border-radius: 6px; padding: 4px 8px;
}
.logout:hover { color: var(--text); border-color: var(--accent); }
.acct-veh { display: flex; align-items: center; gap: 8px; padding: 4px 0; flex-wrap: wrap; }
.enable-btn { margin-left: auto; }

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px; padding: 12px 16px;
}
.tile {
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px;
}
.tile .k { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
.tile .v { font-size: 22px; font-weight: 650; margin-top: 3px; }

.content { flex: 1; display: grid; grid-template-columns: 1fr 380px; min-height: 0; }
#map { height: 100%; background: var(--panel-2); }
.side {
  border-left: 1px solid var(--line); background: var(--panel);
  overflow-y: auto; padding: 12px 14px;
}
.side-head { display: flex; align-items: center; justify-content: space-between; }
.side h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 14px 0 6px; }
#follow-btn {
  background: var(--panel-2); color: var(--text); border: 1px solid var(--line);
  border-radius: 6px; padding: 4px 8px; cursor: pointer; font-size: 12px;
}
#follow-btn.active { border-color: var(--accent); color: var(--accent); }

table { width: 100%; border-collapse: collapse; }
th { text-align: left; color: var(--muted); font-weight: 500; font-size: 11px; padding: 4px 6px; border-bottom: 1px solid var(--line); }
td { padding: 5px 6px; border-bottom: 1px solid var(--panel-2); }
#trips tbody tr { cursor: pointer; }
#trips tbody tr:hover { background: var(--panel-2); }
#trips tbody tr.open td:first-child::after { content: " ●"; color: var(--ok); }
.muted { color: var(--muted); }

@media (max-width: 820px) {
  .content { grid-template-columns: 1fr; }
  #map { height: 45vh; }
}
