:root {
  color-scheme: light;
  --ink: #17202a;
  --muted: #667085;
  --paper: #f6f7f3;
  --card: #ffffff;
  --accent: #204c37;
  --green: #32a852;
  --yellow: #e6c229;
  --orange: #ed8b2c;
  --gray: #9ba3ad;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body { padding-bottom: env(safe-area-inset-bottom); }

.topbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  padding: calc(16px + env(safe-area-inset-top)) 18px 14px;
  background: var(--card);
  border-bottom: 1px solid #e4e7ec;
}

.eyebrow {
  margin: 0 0 2px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 23px; letter-spacing: -.03em; }

.legend {
  display: grid;
  grid-template-columns: repeat(2, auto);
  gap: 4px 10px;
  color: var(--muted);
  font-size: 10px;
}

.legend span { display: flex; align-items: center; gap: 4px; }
.legend i { width: 8px; height: 8px; border-radius: 50%; }
.green { background: var(--green); }
.yellow { background: var(--yellow); }
.orange { background: var(--orange); }
.gray { background: var(--gray); }

.state-card {
  margin: 44px 20px;
  padding: 28px 22px;
  text-align: center;
  background: var(--card);
  border: 1px solid #e4e7ec;
  border-radius: 20px;
  box-shadow: 0 12px 30px rgba(16, 24, 40, .07);
}

.state-card h2 { margin-bottom: 8px; }
.state-card p { color: var(--muted); line-height: 1.5; }
.location-icon { font-size: 44px; color: var(--accent); }

button {
  font: inherit;
  -webkit-tap-highlight-color: transparent;
}

.launch-actions { display: grid; gap: 10px; }

#show-taganrog, #locate {
  width: 100%;
  padding: 13px 18px;
  border: 0;
  border-radius: 12px;
  background: var(--accent);
  color: white;
  font-weight: 750;
  cursor: pointer;
}

#locate.secondary {
  border: 1px solid #b8c7bd;
  background: transparent;
  color: var(--accent);
}

#address-form[hidden] { display: none; }

#address-form {
  display: grid;
  gap: 9px;
  text-align: left;
}

#address-form label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

#address-input {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid #b8c7bd;
  border-radius: 12px;
  background: white;
  color: var(--ink);
  font: inherit;
}

#address-submit {
  width: 100%;
  padding: 13px 18px;
  border: 0;
  border-radius: 12px;
  background: var(--accent);
  color: white;
  font-weight: 750;
  cursor: pointer;
}
.experience { position: relative; }
#map { height: min(54vh, 470px); min-height: 330px; background: #dbe4dd; }

.map-status {
  position: absolute;
  z-index: 2;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  padding: 7px 11px;
  border-radius: 99px;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 4px 14px rgba(16, 24, 40, .14);
  font-size: 12px;
  white-space: nowrap;
}

.maplibregl-ctrl-attrib { font-size: 10px; }

.user-dot {
  width: 18px;
  height: 18px;
  border: 4px solid white;
  border-radius: 50%;
  background: #2878ff;
  box-shadow: 0 0 0 2px #2878ff, 0 4px 12px rgba(26, 86, 190, .4);
}

.center-dot {
  width: 20px;
  height: 20px;
  border: 4px solid white;
  border-radius: 4px;
  background: #385b4a;
  box-shadow: 0 0 0 2px #385b4a, 0 4px 12px rgba(22, 55, 39, .35);
  transform: rotate(45deg);
}

.map-context {
  margin: 0;
  padding: 10px 16px 25px;
  background: var(--paper);
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.map-station-marker, .station-marker {
  --marker-color: var(--gray);
  display: block;
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border: 3px solid white;
  border-radius: 50%;
  background: var(--marker-color);
  box-shadow: 0 1px 7px rgba(16, 24, 40, .38);
}

.map-station-marker.double, .station-marker.double {
  box-shadow: 0 0 0 3px var(--marker-color), 0 0 0 5px white, 0 2px 8px rgba(16, 24, 40, .38);
}

.map-station-marker { cursor: pointer; }
.map-station-marker[data-color="green"], .station-marker[data-color="green"] { --marker-color: var(--green); }
.map-station-marker[data-color="yellow"], .station-marker[data-color="yellow"] { --marker-color: var(--yellow); }
.map-station-marker[data-color="orange"], .station-marker[data-color="orange"] { --marker-color: var(--orange); }

.results-shell {
  position: relative;
  z-index: 3;
  margin-top: -18px;
  padding: 18px 14px 24px;
  border-radius: 20px 20px 0 0;
  background: var(--paper);
}

.results-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px 10px;
}

.results-heading h2 { margin-bottom: 0; font-size: 18px; }
#result-count { color: var(--muted); font-size: 13px; }
.results { display: grid; gap: 9px; }

.station-card {
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  padding: 14px;
  text-align: left;
  border: 1px solid #e4e7ec;
  border-radius: 14px;
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
}

.station-card:focus-visible, #locate:focus-visible, #show-taganrog:focus-visible {
  outline: 3px solid #79a98c;
  outline-offset: 2px;
}
.station-copy { display: grid; min-width: 0; gap: 3px; }
.station-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.station-address { color: var(--muted); font-size: 12px; }
.station-meta { color: var(--accent); font-size: 11px; font-weight: 700; }
.station-fuels { color: #475467; font-size: 12px; }
.fuel-chip { font-weight: 700; }
.fuel-chip[data-availability="uncertain"] {
  color: #9a6700;
  background: #fff2b8;
  border-radius: 4px;
  padding: 1px 4px;
}
.chevron { margin-left: auto; color: #98a2b3; font-size: 24px; }

.maplibregl-popup-content {
  max-width: 250px;
  padding: 12px 14px;
  border-radius: 12px;
}

.popup h3 { margin: 0 0 5px; font-size: 15px; }
.popup p { margin: 3px 0; color: #475467; font-size: 12px; line-height: 1.35; }
.popup .sources { color: var(--accent); font-weight: 700; }

@media (min-width: 720px) {
  body { max-width: 760px; margin: 0 auto; box-shadow: 0 0 50px rgba(16, 24, 40, .1); }
}
