/* Nornene: full-screen map with one floating panel. */

:root {
  /* Delay colours. app.js reads these same values to draw the markers. */
  --on-time: #2e9e4f;
  --late: #e6a700;
  --very-late: #d7301f;
  --unknown: #7d8590;

  --panel-bg: rgba(255, 255, 255, 0.94);
  --panel-text: #1c2128;
  --panel-muted: #57606a;
  --panel-border: rgba(0, 0, 0, 0.12);
}

@media (prefers-color-scheme: dark) {
  :root {
    --panel-bg: rgba(27, 31, 36, 0.94);
    --panel-text: #e6edf3;
    --panel-muted: #9da7b3;
    --panel-border: rgba(255, 255, 255, 0.16);
  }
}

html, body {
  height: 100%;
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  color: var(--panel-text);
  background: #dfe6ea;
}

#map {
  position: absolute;
  inset: 0;
}

/* The panel in the top-left corner: title, filters, legend, status. */
#panel {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  width: 232px;
  max-width: calc(100vw - 24px);
  box-sizing: border-box;
  padding: 12px 14px;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
}

#panel h1 {
  margin: 0;
  font-size: 18px;
  letter-spacing: 0.02em;
}

#panel .tagline {
  margin: 2px 0 10px;
  color: var(--panel-muted);
  font-size: 12px;
}

#panel h2 {
  margin: 12px 0 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--panel-muted);
}

/* One row per kind of vehicle: checkbox, shape, name, count. */
.row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 0;
  cursor: pointer;
}

.row .count,
.legend .count {
  margin-left: auto;
  color: var(--panel-muted);
  font-variant-numeric: tabular-nums;
}

.row canvas {
  width: 16px;
  height: 16px;
}

.legend {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 0;
}

.dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  flex: none;
}

#status {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--panel-border);
  color: var(--panel-muted);
  font-size: 12px;
}

#status.problem {
  color: var(--very-late);
  font-weight: 600;
}

/* On a phone the panel folds down to its title; tap the title to open it. */
#panel h1 {
  cursor: pointer;
}

@media (max-width: 560px) {
  #panel.folded > :not(h1) {
    display: none;
  }
}

/* The popup shown for a clicked vehicle. */
.maplibregl-popup-content {
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  color: #1c2128;
}

.popup-title {
  font-weight: 600;
  font-size: 14px;
}

.popup-route,
.popup-extra {
  color: #57606a;
}

.popup-delay {
  margin-top: 4px;
  font-weight: 600;
}
