:root {
  --bg: #0b0d10;
  --panel: #14171c;
  --panel-hi: #1c2026;
  --border: #242a32;
  --text: #e6e8ea;
  --text-dim: #8a9199;
  --accent: #5fb3ff;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  display: flex;
}

#sidebar {
  width: 320px;
  min-width: 320px;
  height: 100vh;
  overflow-y: auto;
  background: var(--panel);
  border-right: 1px solid var(--border);
  padding: 18px 16px 24px;
}

#sidebar header h1 {
  margin: 0 0 4px 0;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
#sidebar header .tagline {
  margin: 0 0 20px 0;
  color: var(--text-dim);
  font-size: 12px;
}

.pane {
  padding: 14px 0;
  border-top: 1px solid var(--border);
}
.pane h2 {
  margin: 0 0 10px 0;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.stack label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  cursor: pointer;
  padding: 4px 0;
}
.stack label input[type="checkbox"] {
  accent-color: var(--accent);
  margin: 0;
}
.swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  flex: none;
}

.stats {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.7;
}
.stats .row {
  display: flex;
  justify-content: space-between;
}
.stats .num {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

/* Ridership panel */
.asof {
  font-size: 9px;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text-dim);
  margin-left: 6px;
}
.ridership { font-size: 12px; }
.agency-block {
  margin-bottom: 14px;
}
.agency-block:last-child { margin-bottom: 0; }
.agency-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 4px;
}
.agency-head .name {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: var(--text);
  font-size: 12px;
}
.agency-head .total {
  font-variant-numeric: tabular-nums;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}
.mode-row {
  display: grid;
  grid-template-columns: 1fr 54px 62px;
  align-items: center;
  gap: 6px;
  padding: 2px 0;
  font-size: 11px;
  color: var(--text-dim);
}
.mode-row .mlabel { white-space: nowrap; }
.mode-row .mval {
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.mode-row svg.sparkline {
  display: block;
  width: 100%;
  height: 14px;
}

footer {
  margin-top: 22px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 11px;
  line-height: 1.5;
}

#map {
  flex: 1;
  height: 100vh;
}

.popup {
  position: absolute;
  z-index: 10;
  background: var(--panel-hi);
  color: var(--text);
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  max-width: 280px;
  pointer-events: none;
  box-shadow: 0 6px 20px rgba(0,0,0,0.5);
}
.popup .title {
  font-weight: 600;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.popup .pill {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 500;
  background: var(--border);
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.popup .route-color {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  flex: none;
}
.popup .sub {
  color: var(--text-dim);
  font-size: 12px;
}
