:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-2: #f7f9fc;
  --ink: #0d1424;
  --muted: #677184;
  --line: #e1e6ef;
  --blue: #1677ff;
  --blue-soft: #e8f1ff;
  --green: #18c964;
  --green-soft: #e8f9ef;
  --red: #ef4444;
  --red-soft: #fff0f0;
  --amber: #f59e0b;
  --amber-soft: #fff7e8;
  --gray-soft: #f1f3f6;
  --radius-xl: 28px;
  --radius-lg: 18px;
  --shadow: 0 14px 36px rgba(16, 24, 40, .08);
  --shadow-soft: 0 8px 22px rgba(16, 24, 40, .06);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
}
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }

.container {
  width: min(1200px, calc(100% - 36px));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(244, 246, 251, .88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(225, 230, 239, .7);
}

.header-inner {
  min-height: 74px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
  font-size: 22px;
  letter-spacing: -.03em;
  margin-right: auto;
}

.logo-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--blue);
  color: #fff;
  box-shadow: 0 8px 18px rgba(22, 119, 255, .28);
}

.top-nav {
  display: flex;
  align-items: center;
  gap: 22px;
  color: #2e3748;
  font-weight: 650;
}
.top-nav a:hover { color: var(--blue); }

.btn {
  border: 0;
  border-radius: 14px;
  padding: 13px 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 850;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  background: var(--green);
  color: #07180f;
  box-shadow: 0 10px 22px rgba(24, 201, 100, .22);
}
.btn-secondary {
  background: #fff;
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line);
}
.btn-map {
  background: var(--blue-soft);
  color: #0b59c8;
  padding: 10px 13px;
  border-radius: 12px;
  font-weight: 800;
}
.btn-outline {
  border: 0;
  background: #fff;
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line);
  padding: 10px 13px;
  border-radius: 12px;
  font-weight: 800;
  cursor: pointer;
}

.hero {
  margin-top: 22px;
  display: grid;
  grid-template-columns: 1fr 330px;
  gap: 22px;
  background: #101827;
  color: #fff;
  border-radius: var(--radius-xl);
  padding: 34px;
  box-shadow: var(--shadow);
}
.eyebrow {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: 12px;
  font-weight: 850;
  color: #7ea7ff;
}
.hero h1 {
  margin: 0;
  max-width: 760px;
  font-size: clamp(36px, 5vw, 62px);
  line-height: .95;
  letter-spacing: -.06em;
}
.hero-text {
  max-width: 720px;
  margin: 18px 0 0;
  color: rgba(255,255,255,.82);
  font-size: 17px;
}
.hero-actions {
  margin-top: 24px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.hero-card {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 22px;
  padding: 18px;
  align-self: stretch;
  display: grid;
  gap: 10px;
}
.metric {
  background: rgba(255,255,255,.08);
  border-radius: 16px;
  padding: 16px;
}
.metric strong {
  display: block;
  font-size: 34px;
  line-height: 1;
  letter-spacing: -.04em;
}
.metric span {
  display: block;
  margin-top: 5px;
  color: rgba(255,255,255,.72);
  font-weight: 650;
}
.small-note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}
.hero-card .small-note { color: rgba(255,255,255,.62); }

.seo-intro, .seo-block {
  margin-top: 20px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 24px;
}
.seo-intro h2, .seo-block h2 {
  margin: 0 0 8px;
  letter-spacing: -.03em;
}
.seo-intro p, .seo-block p {
  margin: 0;
  color: var(--muted);
  max-width: 920px;
}

.app-layout {
  margin-top: 20px;
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 18px;
  align-items: start;
}
.filters-panel,
.map-card,
.stations-panel,
.content-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow-soft);
}
.filters-panel {
  position: sticky;
  top: 92px;
  padding: 16px;
}
.main-panel {
  display: grid;
  gap: 18px;
}
.panel-block + .panel-block {
  border-top: 1px solid var(--line);
  margin-top: 16px;
  padding-top: 16px;
}
.panel-block h2 {
  margin: 0 0 12px;
  font-size: 20px;
  letter-spacing: -.03em;
}
.panel-title-row, .map-head, .list-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.link-btn {
  border: 0;
  background: transparent;
  color: var(--blue);
  cursor: pointer;
  font-weight: 800;
}
.district-list { display: grid; gap: 6px; }
.district-item {
  width: 100%;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  border: 0;
  background: transparent;
  border-radius: 12px;
  padding: 10px 11px;
  cursor: pointer;
  text-align: left;
  font-weight: 800;
}
.district-item span:last-child {
  font-weight: 700;
  color: var(--muted);
}
.district-item:hover,
.district-item.active {
  background: var(--blue-soft);
  color: #0b59c8;
}
.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip {
  border: 0;
  background: var(--gray-soft);
  border-radius: 999px;
  padding: 9px 12px;
  cursor: pointer;
  font-weight: 800;
  color: #263244;
}
.chip.active {
  background: var(--ink);
  color: #fff;
}
.chip-yes.active { background: var(--green); color: #07180f; }
.chip-no.active { background: var(--red); color: #fff; }
.chip-closed.active { background: var(--amber); color: #271806; }

.help-box {
  background: var(--surface-2);
  border-radius: 16px;
  padding: 14px;
}
.help-box p {
  color: var(--muted);
  margin: 0;
}

.map-card {
  padding: 16px;
}
.map-head h2,
.list-toolbar h2 {
  margin: 0;
  font-size: 28px;
  letter-spacing: -.05em;
}
.map {
  height: 430px;
  margin-top: 14px;
  border-radius: 18px;
  overflow: hidden;
  background: #dfe6ef;
  border: 1px solid var(--line);
}
.map-source {
  margin: 8px 2px 0;
  color: var(--muted);
  font-size: 12px;
}
.leaflet-container {
  font-family: inherit;
  background: #eaf0f6;
}
.leaflet-control-attribution {
  display: none !important;
}
.station-marker {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: 0 6px 15px rgba(15, 23, 42, .25);
}
.marker-available { background: var(--green); }
.marker-empty { background: var(--red); }
.marker-closed { background: var(--amber); }
.marker-unknown { background: #7f8ea3; }
.popup-title {
  font-weight: 900;
  margin: 0 0 4px;
}
.popup-text {
  margin: 0 0 8px;
  color: #536073;
}
.popup-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.popup-actions a,
.popup-actions button {
  border: 0;
  border-radius: 9px;
  padding: 7px 9px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}
.popup-actions a { background: var(--blue-soft); color: #0b59c8; }
.popup-actions button { background: var(--green); color: #07180f; }

.stations-panel { padding: 18px; }
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 4px 0 16px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}
.legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.dot {
  width: 9px;
  height: 9px;
  display: inline-block;
  border-radius: 50%;
}
.dot-yes { background: var(--green); }
.dot-no { background: var(--red); }
.dot-closed { background: var(--amber); }
.dot-unknown { background: #9aa3b2; }

.stations-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.district-heading {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 10px 0 0;
  padding: 8px 4px;
}
.district-heading h3 {
  margin: 0;
  font-size: 22px;
  letter-spacing: -.04em;
}
.district-heading span {
  color: var(--muted);
  font-weight: 800;
}
.station-card {
  position: relative;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 16px;
  overflow: hidden;
  display: grid;
  gap: 10px;
  min-height: 178px;
}
.station-card::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 6px;
  background: #b4bdca;
}
.station-card.status-available {
  background: linear-gradient(90deg, var(--green-soft), #fff 36%);
  border-color: rgba(24, 201, 100, .38);
}
.station-card.status-available::before { background: var(--green); }
.station-card.status-empty {
  background: linear-gradient(90deg, var(--red-soft), #fff 36%);
  border-color: rgba(239, 68, 68, .36);
}
.station-card.status-empty::before { background: var(--red); }
.station-card.status-closed {
  background: linear-gradient(90deg, var(--amber-soft), #fff 36%);
  border-color: rgba(245, 158, 11, .38);
}
.station-card.status-closed::before { background: var(--amber); }
.station-card.status-unknown::before { background: #a5adba; }
.station-card.highlight {
  outline: 4px solid rgba(22,119,255,.18);
  border-color: #80b7ff;
}

.station-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.station-title {
  margin: 0;
  font-size: 18px;
  letter-spacing: -.03em;
}
.station-address {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 14px;
}
.status-badge {
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}
.status-badge.available { background: var(--green); color: #07180f; }
.status-badge.empty { background: var(--red); color: #fff; }
.status-badge.closed { background: var(--amber); color: #271806; }
.status-badge.unknown { background: var(--gray-soft); color: #526071; }
.fuel-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.fuel-pill {
  background: var(--gray-soft);
  border-radius: 999px;
  padding: 6px 9px;
  font-size: 12px;
  font-weight: 850;
}
.comment-box {
  margin: 0;
  color: #364154;
  background: rgba(255,255,255,.72);
  border: 1px solid rgba(225,230,239,.8);
  border-radius: 12px;
  padding: 10px;
  font-size: 14px;
}
.card-actions {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.empty-state {
  padding: 40px 20px;
  text-align: center;
  color: var(--muted);
}

.content-grid {
  margin-top: 20px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.content-card { padding: 24px; }
.content-card h2 {
  margin: 0 0 12px;
  letter-spacing: -.03em;
}
.content-card ol {
  margin: 0;
  padding-left: 20px;
  color: #394458;
}
.content-card p {
  margin: 0;
  color: var(--muted);
}
.source-note {
  margin-top: 12px !important;
  font-size: 14px;
}
.footer {
  margin-top: 30px;
  padding: 26px 0;
  color: var(--muted);
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid var(--line);
  padding-top: 20px;
  font-weight: 700;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
}
.modal.active { display: block; }
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7, 13, 25, .48);
  backdrop-filter: blur(6px);
}
.modal-card {
  position: relative;
  width: min(560px, calc(100% - 28px));
  margin: 7vh auto 0;
  background: #fff;
  border-radius: 24px;
  box-shadow: 0 24px 80px rgba(0,0,0,.22);
  padding: 22px;
  display: grid;
  gap: 16px;
}
.modal-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}
.modal-head h2 { margin: 0; }
.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 0;
  cursor: pointer;
  font-size: 25px;
  line-height: 1;
}
.field {
  display: grid;
  gap: 8px;
  border: 0;
  padding: 0;
  margin: 0;
}
.field span, .field legend {
  color: #2c3648;
  font-size: 14px;
  font-weight: 850;
}
.field select, .field textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 14px;
  padding: 12px 14px;
  outline: none;
}
.field select:focus, .field textarea:focus {
  border-color: #8bbdff;
  box-shadow: 0 0 0 4px rgba(22,119,255,.12);
}
.radio-grid { display: grid; gap: 8px; }
.radio-grid label {
  display: flex;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  cursor: pointer;
  font-weight: 800;
}
.modal-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

@media (max-width: 980px) {
  .top-nav { display: none; }
  .hero { grid-template-columns: 1fr; padding: 26px; }
  .app-layout { grid-template-columns: 1fr; }
  .filters-panel { position: static; }
  .stations-list { grid-template-columns: 1fr; }
  .content-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .container { width: min(100% - 24px, 1200px); }
  .header-inner { min-height: auto; padding: 12px 0; }
  .header-inner > .btn { display: none; }
  .logo { font-size: 20px; }
  .hero { margin-top: 12px; border-radius: 22px; padding: 22px; }
  .hero h1 { font-size: 39px; }
  .map { height: 360px; }
  .map-head, .list-toolbar { align-items: flex-start; flex-direction: column; }
  .footer-inner { flex-direction: column; }
}


/* v2: cleaner station cards and scalable messages */
.station-card {
  padding: 18px;
  gap: 12px;
  box-shadow: 0 8px 24px rgba(16, 24, 40, .045);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.station-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 34px rgba(16, 24, 40, .08);
}

.station-top {
  padding-left: 4px;
}

.station-title {
  font-size: 19px;
}

.status-badge {
  box-shadow: 0 6px 16px rgba(16, 24, 40, .08);
}

.fuel-row {
  padding-left: 4px;
}

.messages-preview {
  background: rgba(255,255,255,.78);
  border: 1px solid rgba(225,230,239,.86);
  border-radius: 16px;
  padding: 12px;
  display: grid;
  gap: 10px;
}

.messages-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 850;
}

.messages-head b {
  min-width: 24px;
  height: 24px;
  padding: 0 8px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: var(--gray-soft);
  color: var(--ink);
  font-size: 12px;
}

.message-list {
  display: grid;
  gap: 8px;
}

.message-item {
  background: #fff;
  border: 1px solid rgba(225,230,239,.86);
  border-radius: 13px;
  padding: 10px;
}

.message-status {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 900;
  color: #2b3547;
}

.message-item p {
  margin: 6px 0 0;
  color: #394458;
  font-size: 14px;
  line-height: 1.38;
}

.message-item p.muted {
  color: var(--muted);
}

.message-item time {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.no-messages {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.messages-toggle {
  width: 100%;
  border: 0;
  background: var(--gray-soft);
  color: #263244;
  border-radius: 11px;
  padding: 9px 10px;
  font-weight: 850;
  cursor: pointer;
}

.messages-toggle:hover {
  background: var(--blue-soft);
  color: #0b59c8;
}

.card-actions {
  padding-left: 4px;
}

.popup-actions {
  margin-top: 8px;
}

.popup-actions button {
  background: var(--green);
  color: #07180f;
}


/* backend v1: hidden honeypot field against primitive bots */
.hp-field {
  position: absolute !important;
  left: -10000px !important;
  top: auto !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  opacity: 0 !important;
}


/* fix v3: map higher on mobile + modal scroll */
body.modal-open {
  overflow: hidden;
}

.app-layout {
  grid-template-columns: 280px minmax(0, 1fr);
}

.filters-panel {
  grid-column: 1;
  grid-row: 1 / span 2;
}

.map-card {
  grid-column: 2;
  grid-row: 1;
  scroll-margin-top: 92px;
}

.stations-panel {
  grid-column: 2;
  grid-row: 2;
}

.modal {
  padding: 12px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-backdrop {
  position: fixed;
}

.modal-card {
  margin: auto;
  max-height: calc(100dvh - 24px);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.modal-actions {
  position: sticky;
  bottom: -22px;
  z-index: 2;
  margin-left: -2px;
  margin-right: -2px;
  padding: 12px 2px 2px;
  background: linear-gradient(to top, #fff 78%, rgba(255,255,255,.92), rgba(255,255,255,0));
}

.modal-actions .btn {
  min-height: 48px;
}

@media (max-width: 980px) {
  .app-layout {
    display: flex;
    flex-direction: column;
  }

  .map-card {
    order: 1;
    width: 100%;
  }

  .filters-panel {
    order: 2;
    width: 100%;
  }

  .stations-panel {
    order: 3;
    width: 100%;
  }
}

@media (max-width: 640px) {
  .seo-intro {
    display: none;
  }

  .app-layout {
    margin-top: 12px;
  }

  .map-card {
    padding: 12px;
    border-radius: 20px;
    scroll-margin-top: 72px;
  }

  .map {
    height: min(68vh, 420px);
    min-height: 340px;
    border-radius: 16px;
  }

  .modal {
    align-items: flex-end;
    padding: 8px;
  }

  .modal.active {
    align-items: flex-end;
  }

  .modal-card {
    width: 100%;
    max-height: 92dvh;
    margin: 0;
    border-radius: 22px 22px 14px 14px;
    padding: 18px;
  }

  .modal-actions {
    bottom: -18px;
    padding-bottom: 6px;
  }

  .modal-actions .btn {
    width: 100%;
  }

  .radio-grid label {
    padding: 14px 12px;
  }

  .field select,
  .field textarea {
    font-size: 16px;
  }
}
