:root {
  --bg: #0f1720;
  --panel: #16212c;
  --accent: #4fb3ff;
  --text: #e7edf3;
  --muted: #8ea0b0;
  --good: #3ecf8e;
  --warn: #ffb84f;
  color-scheme: dark;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}

header {
  padding: 16px 20px 4px;
}
header h1 { margin: 0; font-size: 1.4rem; }
header .sub { margin: 2px 0 0; color: var(--muted); font-size: 0.85rem; }

main {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 16px;
  padding: 16px 20px;
  min-height: 70vh;
}
@media (max-width: 800px) {
  main { grid-template-columns: 1fr; }
}

.panel {
  background: var(--panel);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-self: start;
}

label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.85rem;
  color: var(--muted);
}

select, input, button {
  font-size: 0.95rem;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #2a3a48;
  background: #0f1720;
  color: var(--text);
}

button {
  cursor: pointer;
  background: var(--accent);
  color: #06202f;
  font-weight: 600;
  border: none;
}
button:disabled { opacity: 0.5; cursor: not-allowed; }

.eta-box {
  background: #0f1720;
  border-radius: 10px;
  padding: 14px;
  text-align: center;
}
.eta-value { font-size: 2.4rem; font-weight: 700; color: var(--good); }
.eta-note { color: var(--muted); font-size: 0.8rem; margin-top: 4px; }
.eta-headway { color: var(--warn); font-size: 0.8rem; margin-top: 6px; }
.eta-typical { color: var(--accent); font-size: 0.8rem; margin-top: 6px; }
.eta-last-seen { color: var(--muted); font-size: 0.78rem; margin-top: 6px; }

.vehicle-icon {
  background: var(--accent);
  border: 2px solid #06202f;
  border-radius: 50%;
  width: 14px;
  height: 14px;
}
.stop-icon {
  background: var(--muted);
  border: 1px solid #06202f;
  border-radius: 50%;
  width: 8px;
  height: 8px;
}
.stop-icon.target {
  background: var(--good);
  width: 12px;
  height: 12px;
}

.route-picker-wrap { display: flex; flex-direction: column; gap: 4px; }
.route-picker-label { font-size: 0.85rem; color: var(--muted); }
.route-picker {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 260px;
  overflow-y: auto;
  padding-right: 2px;
}
.route-group-title {
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.route-buttons { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.route-btn {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid #2a3a48;
  background: #0f1720;
  color: var(--text);
  font-weight: 500;
  font-size: 0.82rem;
}
.route-btn:hover { border-color: var(--accent); }
.route-btn.active {
  background: var(--accent);
  color: #06202f;
  border-color: var(--accent);
  font-weight: 700;
}

.hint { font-size: 0.78rem; color: var(--muted); }
.link-code {
  background: #0f1720;
  border-radius: 8px;
  padding: 10px;
  text-align: center;
  font-size: 1.1rem;
  letter-spacing: 2px;
}

.map-wrap { border-radius: 12px; overflow: hidden; min-height: 400px; }
#map { width: 100%; height: 100%; min-height: 400px; }
