html, body {
  margin: 0;
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

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

#top-bar {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  white-space: nowrap;
}

#site-title {
  margin: 0;
  padding: 6px 14px;
  font-size: 15px;
  font-weight: 600;
  color: #222;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
  pointer-events: none;
}

#follow-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  background: #fc5200;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
  text-decoration: none;
  pointer-events: auto;
  transition: background 0.15s;
}

#follow-btn:hover {
  background: #e04a00;
}

#strava-icon {
  width: 14px;
  height: 14px;
  fill: #fff;
}

#basemap-switch {
  position: absolute;
  bottom: 12px;
  right: 12px;
  z-index: 10;
  display: flex;
  gap: 4px;
  background: rgba(255, 255, 255, 0.9);
  padding: 4px;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

.basemap-btn {
  border: none;
  background: transparent;
  padding: 5px 10px;
  font-size: 13px;
  border-radius: 6px;
  cursor: pointer;
  color: #333;
}

.basemap-btn:hover {
  background: rgba(0, 0, 0, 0.06);
}

.basemap-btn.active {
  background: #fc5200;
  color: #fff;
}

#filter-panel {
  position: absolute;
  top: 56px;
  right: 12px;
  z-index: 1;
  background: rgba(255, 255, 255, 0.92);
  padding: 8px;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
  max-height: calc(100vh - 90px);
  overflow-y: auto;
  font-size: 13px;
}

#filter-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-weight: 600;
  color: #333;
  margin: 2px 4px 6px;
}

#filter-collapse {
  width: 0;
  height: 0;
  border-left: 5px solid #fc5200;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  cursor: pointer;
  flex: none;
  transition: transform 0.15s;
}

#filter-panel.collapsed #filter-collapse {
  transform: rotate(-90deg);
}

#filter-panel.collapsed #filter-rows,
#filter-panel.collapsed .filter-actions {
  display: none;
}

#filter-panel.collapsed #filter-head {
  margin-bottom: 0;
}

.filter-actions button {
  border: none;
  background: transparent;
  color: #fc5200;
  font-size: 12px;
  cursor: pointer;
  padding: 0 3px;
  font-weight: 500;
}

.filter-actions button:hover {
  text-decoration: underline;
}

.filter-row {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  border: none;
  background: transparent;
  padding: 4px 6px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  color: #333;
  text-align: left;
}

.filter-row:hover {
  background: rgba(0, 0, 0, 0.06);
}

.filter-row .swatch {
  width: 14px;
  height: 4px;
  border-radius: 2px;
  flex: none;
}

.filter-row .frow-emoji {
  font-size: 13px;
}

.filter-row:not(.active) {
  opacity: 0.4;
}

.filter-row:not(.active) .swatch {
  background: #bbb !important;
}

#loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
  background: rgba(255, 255, 255, 0.92);
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

#loading.hidden {
  display: none;
}

.popup-name {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 2px;
}

.popup-meta {
  color: #666;
  font-size: 12px;
  margin-bottom: 6px;
}

.maplibregl-popup-content a {
  color: #fc5200;
  font-size: 13px;
  text-decoration: none;
  font-weight: 500;
}

.maplibregl-popup-content a:hover {
  text-decoration: underline;
}
