* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  display: flex;
  background: #1a1f24;
  color: #e6e6e6;
}

#sidebar {
  width: 340px;
  flex-shrink: 0;
  background: #20262d;
  border-right: 1px solid #2c343d;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

#sidebar header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #2c343d;
  position: sticky;
  top: 0;
  background: #20262d;
  z-index: 2;
}

#sidebar h1 {
  margin: 0 0 .5rem;
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -.01em;
}

#sidebar h2 {
  margin: 1rem 1.25rem .5rem;
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #8a96a3;
}

#latest {
  font-size: .85rem;
  line-height: 1.4;
  color: #b8c1cb;
}
#latest .pill {
  display: inline-block;
  padding: 2px 8px;
  background: #2c343d;
  border-radius: 10px;
  font-size: .75rem;
  margin-right: .35rem;
}
#latest .pill.live { background: #1f3a2a; color: #6ee7a0; }

#status {
  font-size: .72rem;
  color: #6b7785;
  margin-top: .5rem;
}

#settings {
  margin-top: .65rem;
  font-size: .75rem;
  color: #8a96a3;
  display: flex;
  align-items: center;
  gap: .4rem;
}
#settings select {
  background: #2c343d;
  color: #e6e6e6;
  border: 1px solid #3a434d;
  border-radius: 5px;
  padding: 2px 6px;
  font-size: .75rem;
  cursor: pointer;
}

#trip-list-wrap { flex: 1; padding-bottom: 1rem; }
#trip-list { padding: 0 .75rem; }

.trip {
  padding: .65rem .8rem;
  margin-bottom: .35rem;
  background: #262e36;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid transparent;
  font-size: .9rem;
  transition: background .12s, border-color .12s;
}
.trip:hover { background: #2c343d; }
.trip.active {
  background: #1e3a5f;
  border-color: #3b82f6;
}
.trip-date { font-weight: 600; color: #e6e6e6; }
.trip-meta {
  color: #8a96a3;
  font-size: .78rem;
  margin-top: .2rem;
}

main {
  flex: 1;
  position: relative;
}
#map {
  width: 100%;
  height: 100%;
  background: #0e1116;
}

#toggle-sidebar {
  display: none;
  position: absolute;
  top: .75rem;
  left: .75rem;
  z-index: 1000;
  background: white;
  border: 1px solid #ccc;
  width: 40px;
  height: 40px;
  border-radius: 6px;
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,.3);
}

.leaflet-popup-content-wrapper {
  background: #20262d;
  color: #e6e6e6;
  border-radius: 6px;
}
.leaflet-popup-content { font-size: .85rem; line-height: 1.4; }
.leaflet-popup-tip { background: #20262d; }
.leaflet-popup-content b { color: #fff; }

@media (max-width: 760px) {
  body { flex-direction: column; }
  #sidebar {
    width: 100%;
    max-height: 45vh;
  }
  main { height: 55vh; flex: 1; }
  #toggle-sidebar { display: block; }
  body.sidebar-hidden #sidebar { display: none; }
  body.sidebar-hidden main { height: 100%; }
}
