:root {
  --bg: #0b3d5c;
  --accent: #18a0d8;
  --water: #2a9df4;
  --airco: #16b8a6;
  --both: #6c4fd8;
  --text: #0f2230;
  --panel: #ffffff;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
}

body {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
}

#topbar {
  background: linear-gradient(120deg, var(--bg), var(--accent));
  color: #fff;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  z-index: 1000;
}

.brand { display: flex; align-items: center; gap: 10px; }
.brand .logo { font-size: 28px; }
.brand h1 { margin: 0; font-size: 19px; line-height: 1.1; }
.tagline { margin: 2px 0 0; font-size: 12px; opacity: 0.9; }

.filters {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.filters label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 14px;
  background: rgba(255, 255, 255, 0.15);
  padding: 6px 10px;
  border-radius: 999px;
  cursor: pointer;
  user-select: none;
}
.filters input { accent-color: #fff; cursor: pointer; }
.filters button {
  font-size: 14px;
  padding: 6px 12px;
  border: none;
  border-radius: 999px;
  background: #fff;
  color: var(--bg);
  font-weight: 600;
  cursor: pointer;
}
.filters button:active { transform: scale(0.97); }

#map { flex: 1 1 auto; width: 100%; z-index: 1; }

.count {
  position: absolute;
  top: 70px;
  left: 10px;
  z-index: 800;
  background: var(--panel);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  pointer-events: none;
}

#footer {
  background: #08293d;
  color: #cfe6f2;
  font-size: 11px;
  padding: 6px 12px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
#footer .credit { opacity: 0.7; }
#footer #status { flex: 1 1 auto; }
.add-link {
  background: #fff;
  color: var(--bg);
  font-weight: 700;
  text-decoration: none;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.add-link:active { transform: scale(0.97); }

/* Custom marker pins: rotated teardrop drawn by ::before, icon kept upright and
   centered over the round head (so it never looks skewed). */
.pin {
  position: relative;
  width: 38px;
  height: 38px;
}
.pin::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}
.pin-water::before { background: var(--water); }
.pin-airco::before { background: var(--airco); }
.pin-both::before  { background: var(--both); }
.pin span {
  position: absolute;
  left: 0;
  right: 0;
  top: 15px;
  transform: translateY(-50%);
  text-align: center;
  line-height: 1;
  font-size: 17px;
  white-space: nowrap;
}
.pin-both span { font-size: 14px; letter-spacing: -1px; }

/* Popup */
.popup-name { font-weight: 700; font-size: 15px; margin-bottom: 4px; }
.popup-addr { font-size: 13px; color: #444; margin-bottom: 6px; }
.popup-hours { font-size: 12px; color: #555; margin-bottom: 6px; }
.popup-badges { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.badge {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 999px;
  color: #fff;
  font-weight: 600;
}
.badge-water { background: var(--water); }
.badge-airco { background: var(--airco); }
.badge-unknown { background: #9aa7b0; } /* "?" = not reported, unknown */
.popup-status {
  font-size: 13px;
  font-weight: 700;
  margin: 4px 0 6px;
}
.popup-status.open { color: #138a36; }
.popup-status.closed { color: #c0392b; }
.popup-week {
  border-collapse: collapse;
  font-size: 12px;
  margin-bottom: 8px;
  width: 100%;
}
.popup-week td {
  padding: 1px 8px 1px 0;
  color: #555;
}
.popup-week td:last-child { text-align: right; white-space: nowrap; }
.popup-week tr.today td {
  font-weight: 700;
  color: #0f2230;
}
.popup-route {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}

@media (max-width: 560px) {
  .brand h1 { font-size: 17px; }
  .tagline { display: none; }
  .count { top: 116px; }
}
