:root {
  color-scheme: light;
  --bg: #eef4f3;
  --panel: rgba(248, 252, 251, 0.9);
  --panel-border: rgba(20, 53, 61, 0.1);
  --text: #112128;
  --muted: #58707a;
  --accent: #0f8c82;
  --accent-strong: #0b5d59;
  --surface: #ffffff;
  --surface-alt: #f4f8f8;
  --shadow: 0 24px 60px rgba(18, 42, 48, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Space Grotesk", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(15, 140, 130, 0.16), transparent 24%),
    radial-gradient(circle at bottom right, rgba(17, 33, 40, 0.12), transparent 28%),
    linear-gradient(135deg, #eef5f4, #f9fbfb 46%, #e8f0ef);
}

button,
select {
  font: inherit;
}

.shell {
  display: grid;
  grid-template-columns: minmax(320px, 420px) 1fr;
  min-height: 100vh;
}

.panel {
  padding: 28px;
  background: var(--panel);
  backdrop-filter: blur(14px);
  border-right: 1px solid var(--panel-border);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 22px;
  z-index: 2;
}

.panel,
.map-wrap {
  min-width: 0;
}

.eyebrow {
  margin: 0 0 6px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.72rem;
  color: var(--accent-strong);
  font-weight: 700;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 0.96;
  max-width: 9ch;
  font-family: "Source Serif 4", serif;
  letter-spacing: -0.03em;
}

.lede {
  margin-top: 14px;
  line-height: 1.5;
  color: var(--muted);
  max-width: 36ch;
}

.state-control {
  display: grid;
  gap: 6px;
}

.state-control select {
  width: 100%;
}

select,
button {
  border-radius: 16px;
  border: 1px solid var(--panel-border);
  padding: 12px 14px;
  background: var(--surface);
  min-height: 48px;
}

button {
  background: linear-gradient(180deg, #12a799, var(--accent));
  color: white;
  border: none;
  cursor: pointer;
  font-weight: 700;
}

button:hover {
  background: linear-gradient(180deg, #19b9aa, #0c756d);
}

.status-card,
.details {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--panel-border);
  border-radius: 24px;
  padding: 18px;
  box-shadow: 0 12px 30px rgba(19, 43, 49, 0.06);
}

.status-card {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.status-card--compact {
  grid-template-columns: 1fr;
}

.status-label {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 6px;
}

.cheapest-card {
  display: grid;
  gap: 4px;
  text-align: left;
  padding: 16px 18px;
  border-radius: 24px;
  border: 1px solid rgba(20, 53, 61, 0.08);
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.4), transparent 34%),
    linear-gradient(145deg, #dff7f3, #c6ece7 82%);
  color: var(--text);
  box-shadow: 0 18px 36px rgba(15, 88, 82, 0.14);
}

.cheapest-card--diesel {
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.35), transparent 34%),
    linear-gradient(145deg, #e2ecfb, #ceddf5 82%);
  box-shadow: 0 18px 36px rgba(41, 78, 132, 0.14);
}

.cheapest-card strong {
  font-size: 1.4rem;
  line-height: 1;
  color: var(--accent-strong);
}

.cheapest-card--diesel strong {
  color: #234d86;
}

.cheapest-card span:last-child {
  color: var(--muted);
}

.timezone-note {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.details.empty {
  color: var(--muted);
}

.station-meta {
  display: grid;
  gap: 6px;
  color: var(--muted);
  margin-top: 8px;
}

.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.detail-tags span {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(244, 248, 248, 0.95);
  border: 1px solid rgba(20, 53, 61, 0.08);
  color: var(--text);
  font-size: 0.9rem;
}

.history-card {
  margin-top: 18px;
  padding: 14px;
  border-radius: 22px;
  background: rgba(245, 249, 249, 0.92);
  border: 1px solid rgba(20, 53, 61, 0.08);
}

.history-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 12px;
}

.history-head h3 {
  margin: 0;
  font-size: 1rem;
}

.history-controls {
  display: flex;
  align-items: end;
  gap: 10px;
  flex-wrap: wrap;
}

.history-range {
  display: inline-flex;
  padding: 4px;
  border-radius: 999px;
  background: rgba(17, 33, 40, 0.06);
}

.history-range__button {
  min-height: 34px;
  padding: 6px 10px;
  border: none;
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 700;
}

.history-range__button.is-active {
  background: linear-gradient(180deg, #12a799, #0b5d59);
  color: white;
}

.history-control {
  display: grid;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--muted);
}

.history-control select {
  min-height: 38px;
  padding: 8px 10px;
}

.history-body {
  margin-top: 12px;
  height: 180px;
}

.price-list {
  list-style: none;
  padding: 0;
  margin: 16px 0 0;
  display: grid;
  gap: 10px;
}

.price-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid rgba(59, 47, 24, 0.08);
}

.price-name {
  font-weight: 700;
}

.price-value {
  font-variant-numeric: tabular-nums;
}

.timestamp {
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.9rem;
}

.map-wrap {
  position: relative;
  min-height: 50vh;
}

.map-search {
  position: absolute;
  top: 18px;
  left: 18px;
  z-index: 500;
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--panel-border);
  box-shadow: 0 18px 36px rgba(19, 43, 49, 0.14);
  backdrop-filter: blur(10px);
}

.map-search__field {
  position: relative;
}

.map-search input {
  width: min(240px, 48vw);
  min-height: 42px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(20, 53, 61, 0.14);
  background: rgba(255, 255, 255, 0.95);
  color: var(--text);
  font: inherit;
}

.search-suggestions {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  overflow: hidden;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid rgba(20, 53, 61, 0.12);
  box-shadow: 0 24px 44px rgba(19, 43, 49, 0.18);
}

.search-suggestions button {
  width: 100%;
  min-height: 0;
  padding: 12px 14px;
  border-radius: 0;
  border: 0;
  border-top: 1px solid rgba(20, 53, 61, 0.08);
  background: rgba(255, 255, 255, 0.98);
  color: var(--text);
  font-weight: 500;
  text-align: left;
  box-shadow: none;
}

.search-suggestions button:first-child {
  border-top: 0;
}

.search-suggestions button:hover {
  background: linear-gradient(180deg, #eef8f7, #e1f1ef);
}

.search-suggestions button.is-active {
  background: linear-gradient(180deg, #dff5f2, #cdebe6);
}

.search-suggestions__title {
  display: block;
  font-weight: 700;
}

.search-suggestions__meta {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.82rem;
}

.map-search button {
  min-height: 42px;
  padding: 10px 14px;
}

#map {
  height: 100vh;
  width: 100%;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.popup-title {
  font-weight: 700;
  margin-bottom: 4px;
  font-size: 1.06rem;
  font-family: "Source Serif 4", serif;
  letter-spacing: -0.02em;
}

.popup-meta {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.35;
}

.popup-kicker {
  margin-bottom: 4px;
  color: color-mix(in srgb, var(--popup-accent) 72%, #36545b);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.popup-card {
  min-width: 250px;
  padding: 4px;
}

.leaflet-popup-content-wrapper {
  border-radius: 24px;
  padding: 0;
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.68), transparent 34%),
    linear-gradient(160deg, #ffffff, #eef7f6 74%, #e3f0ef);
  box-shadow: 0 26px 54px rgba(18, 42, 48, 0.2);
  border: 1px solid rgba(20, 53, 61, 0.08);
}

.leaflet-popup-content {
  margin: 0;
  padding: 0;
}

.leaflet-popup-tip {
  background: #edf5f4;
}

.popup-card__head {
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 14px;
  align-items: center;
  padding: 12px 12px 10px;
  border-bottom: 1px solid rgba(20, 53, 61, 0.08);
}

.popup-card__brand {
  width: 46px;
  height: 46px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, color-mix(in srgb, var(--popup-accent) 88%, white), var(--popup-accent));
  color: white;
  font-family: Arial, sans-serif;
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

.popup-card__brand--logo {
  background: rgba(255, 253, 248, 0.92);
  color: inherit;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.38),
    0 1px 0 rgba(59, 47, 24, 0.05);
}

.popup-card__brand--logo img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  display: block;
}

.popup-prices {
  list-style: none;
  margin: 0;
  padding: 12px;
  display: grid;
  gap: 10px;
}

.popup-prices li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 12px 13px;
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(243, 248, 248, 0.92));
  border: 1px solid rgba(20, 53, 61, 0.08);
  font-size: 0.9rem;
}

.popup-price-note {
  display: block;
  margin-top: 3px;
  font-style: normal;
  font-size: 0.74rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.popup-prices strong {
  font-variant-numeric: tabular-nums;
  color: var(--popup-accent);
  font-size: 1rem;
  letter-spacing: -0.02em;
}

.popup-empty,
.popup-updated {
  margin: 10px;
  color: var(--muted);
  font-size: 0.84rem;
}

.popup-updated {
  margin-top: 0;
  padding: 0 12px 12px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: color-mix(in srgb, var(--popup-accent) 58%, #36545b);
}

.station-marker-wrap {
  background: transparent;
  border: none;
}

.station-cluster-wrap {
  background: transparent;
  border: none;
}

.station-cluster {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.32), transparent 35%),
    linear-gradient(180deg, #12a799, #0b5d59);
  color: white;
  font-family: Arial, sans-serif;
  font-weight: 700;
  box-shadow:
    0 14px 30px rgba(18, 42, 48, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  border: 3px solid rgba(255, 253, 248, 0.88);
}

.station-cluster span {
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}

.station-marker {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  filter: drop-shadow(0 8px 14px rgba(30, 27, 22, 0.22));
}

.station-marker__badge {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: #ffffff;
  border: 2px solid color-mix(in srgb, var(--marker-color) 70%, white);
  display: grid;
  place-items: center;
  overflow: hidden;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.44);
}

.station-marker__badge img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  display: block;
}

.station-marker--fallback .station-marker__badge {
  background: var(--marker-color);
  color: white;
  border-color: rgba(255, 255, 255, 0.85);
}

.leaflet-container {
  background: #dbe7e5;
}

.leaflet-control-zoom a {
  background: rgba(255, 255, 255, 0.96);
  color: var(--text);
  border-bottom-color: rgba(20, 53, 61, 0.1);
}

.leaflet-control-zoom a:hover {
  background: #ffffff;
  color: var(--accent-strong);
}

.station-marker--fallback .station-marker__badge span {
  font-family: Arial, sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

@media (max-width: 900px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .panel {
    padding: 22px 18px 18px;
    border-right: none;
    border-bottom: 1px solid var(--panel-border);
    gap: 18px;
  }

  #map {
    height: 62vh;
  }

  .status-card {
    grid-template-columns: 1fr;
  }

  h1 {
    max-width: none;
    font-size: clamp(2rem, 10vw, 3rem);
  }

  .lede {
    max-width: none;
  }
}

@media (max-width: 640px) {
  body {
    overflow-x: hidden;
  }

  .panel {
    padding: 16px 14px 14px;
    gap: 14px;
  }

  .eyebrow {
    font-size: 0.68rem;
  }

  h1 {
    font-size: clamp(1.8rem, 11vw, 2.4rem);
    line-height: 0.98;
  }

  .lede {
    font-size: 0.96rem;
    line-height: 1.45;
  }

  select,
  button {
    width: 100%;
    font-size: 16px;
    padding: 12px;
  }

  .status-card,
  .details {
    padding: 14px;
    border-radius: 18px;
  }

  .status-card {
    gap: 10px;
  }

  .station-meta {
    gap: 4px;
    font-size: 0.94rem;
  }

  .history-head {
    align-items: start;
    flex-direction: column;
  }

  .history-controls {
    width: 100%;
    align-items: stretch;
  }

  .history-body {
    height: 160px;
  }

  .price-list {
    gap: 8px;
  }

  .price-list li {
    padding: 10px 12px;
  }

  .price-name,
  .price-value {
    font-size: 0.95rem;
  }

  .timestamp {
    font-size: 0.85rem;
  }

  .map-wrap {
    min-height: 58vh;
  }

  #map {
    height: 58vh;
  }

  .station-marker {
    width: 36px;
    height: 36px;
  }

  .station-cluster {
    width: 40px;
    height: 40px;
  }

  .station-marker__badge {
    width: 30px;
    height: 30px;
    box-shadow: 0 0 0 3px rgba(255, 253, 248, 0.42);
  }

  .station-marker__badge img {
    width: 20px;
    height: 20px;
  }
}

@media (max-width: 420px) {
  .panel {
    padding: 14px 12px 12px;
  }

  h1 {
    font-size: clamp(1.7rem, 12vw, 2.15rem);
  }

  .status-label {
    font-size: 0.68rem;
  }

  #map {
    height: 50vh;
  }
}
