:root {
  --bg: #f3f4ef;
  --panel: #ffffff;
  --panel-border: #d9ddd1;
  --text: #4a4a4a;
  --muted: #737373;
  --accent: #95bf00;
  --accent-dark: #6f9300;
  --shadow: 0 18px 40px rgba(74, 74, 74, 0.08);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  background: #ffffff;
  font-family: "Source Sans 3", sans-serif;
}

button,
input,
select {
  font: inherit;
}

.page-shell {
  width: min(1400px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 22px 0 28px;
}

.filter-bar {
  display: grid;
  grid-template-columns: minmax(300px, 380px) minmax(220px, 260px) minmax(260px, 360px) 1fr;
  gap: 14px;
  align-items: end;
  padding: 18px;
  border: 1px solid var(--panel-border);
  border-radius: 22px;
  background: linear-gradient(180deg, #ffffff, #f6f8f2);
  box-shadow: var(--shadow);
}

.filter-group,
.filter-meta {
  display: flex;
  gap: 10px;
  align-items: end;
}

.filter-group--toggle {
  align-self: stretch;
}

.filter-group--archive {
  display: grid;
  grid-template-columns: 1fr 110px;
  gap: 10px;
}

.field {
  display: grid;
  gap: 8px;
  width: 100%;
}

.field span {
  color: var(--muted);
  font-family: "Barlow Condensed", sans-serif;
  font-size: 1.1rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.field input,
.field select {
  height: 48px;
  padding: 0 14px;
  border: 1px solid #d6dbcf;
  border-radius: 14px;
  background: #ffffff;
  color: var(--text);
}

#parameterSelect {
  min-width: 0;
}

.toggle {
  flex: 1;
  height: 48px;
  border: 1px solid #d6dbcf;
  border-radius: 14px;
  background: #ffffff;
  color: var(--text);
  cursor: pointer;
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease;
}

.toggle:hover,
.toggle:focus-visible {
  transform: translateY(-1px);
  border-color: var(--accent);
}

.toggle.active {
  border-color: transparent;
  background: linear-gradient(180deg, var(--accent), var(--accent-dark));
  color: #ffffff;
}

.filter-meta {
  justify-content: flex-end;
  flex-wrap: wrap;
  align-items: center;
}

.meta-badge,
.meta-status {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 999px;
  background: #edf3dc;
  color: var(--text);
  font-weight: 700;
}

.meta-status {
  background: #f2f4ed;
  color: var(--muted);
  min-width: 0;
  padding: 0;
  background: transparent;
}

.map-panel {
  margin-top: 18px;
  padding: 14px;
  border: 1px solid var(--panel-border);
  border-radius: 24px;
  background: linear-gradient(180deg, #ffffff, #f5f7f0);
  box-shadow: var(--shadow);
}

#map {
  min-height: 820px;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid #d9ddd1;
  background:
    radial-gradient(circle at 20% 10%, rgba(149, 191, 0, 0.13), transparent 20%),
    linear-gradient(180deg, #fcfcfa, #eef2e5);
}

.leaflet-container {
  background: transparent;
}

.leaflet-popup-content-wrapper {
  border-radius: 16px;
}

.station-popup h3 {
  margin: 0 0 8px;
  color: var(--text);
  font-family: "Barlow Condensed", sans-serif;
  font-size: 1.25rem;
}

.station-popup p {
  margin: 4px 0;
}

.station-label-wrapper {
  background: transparent;
  border: 0;
}

.station-label {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  min-height: 26px;
  padding: 0 8px;
  border: 2px solid #ffffff;
  border-radius: 999px;
  background: var(--marker-color);
  color: #ffffff;
  box-shadow: 0 10px 20px rgba(74, 74, 74, 0.18);
  font-weight: 700;
  line-height: 1;
}

.station-label span {
  font-size: 0.9rem;
}

@media (max-width: 1160px) {
  .filter-bar {
    grid-template-columns: 1fr 1fr;
  }

  .filter-meta {
    justify-content: flex-start;
  }

  #map {
    min-height: 680px;
  }
}

@media (max-width: 760px) {
  .page-shell {
    width: min(100vw - 20px, 100%);
    padding-top: 10px;
  }

  .filter-bar {
    grid-template-columns: 1fr;
    padding: 14px;
  }

  .filter-group--archive {
    grid-template-columns: 1fr;
  }

  .map-panel {
    padding: 10px;
  }

  #map {
    min-height: 520px;
  }
}
