:root {
  color-scheme: light;
  --bg: #f8fafc;
  --panel: #ffffff;
  --text: #0f172a;
  --muted: #475569;
  --line: #e2e8f0;
  --accent: #0d9488;
  --accent-light: #ccfbf1;
  --accent-dark: #0f766e;
  --warn: #dc2626;
  --chip: #f0fdfa;
  --shadow: 0 12px 30px -5px rgba(0, 0, 0, 0.06);
  font-family: Inter, "SF Pro Text", "Segoe UI", Roboto, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(240, 253, 250, 0.78), rgba(248, 250, 252, 0) 320px),
    var(--bg);
  color: var(--text);
}

button,
input,
select {
  font: inherit;
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.topbar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 16px;
  align-items: center;
  margin-bottom: 24px;
}

.brand-link {
  display: inline-flex;
  align-items: center;
}

.brand-link img {
  height: auto;
  max-width: 220px;
  width: min(220px, 52vw);
}

.login-logo {
  display: block;
  height: auto;
  margin: 0 auto;
  max-width: 150px;
  width: min(150px, 46vw);
}

.topbar-copy {
  min-width: 0;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.06;
  letter-spacing: 0;
}

.eyebrow {
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.topbar p,
.summary,
.station p,
.app-footer,
.meta {
  color: var(--muted);
}

.topbar p {
  margin-top: 8px;
}

.trust-copy {
  max-width: 720px;
  font-size: 15px;
}

.search-panel,
.login-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.location-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
}

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

label span {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 700;
  color: #31363b;
}

input,
select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 9px 11px;
  background: #fff;
  color: var(--text);
}

input:focus,
select:focus,
button:focus,
.map-link:focus,
.station:focus {
  outline: 3px solid rgba(94, 234, 212, 0.55);
  outline-offset: 2px;
}

button,
.map-link {
  min-height: 44px;
  border: 1px solid var(--accent);
  border-radius: 12px;
  padding: 9px 14px;
  background: #fff;
  color: var(--accent);
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

button:disabled {
  opacity: 0.55;
  cursor: wait;
}

.primary {
  width: 100%;
  margin-top: 14px;
  background: var(--accent);
  color: #fff;
}

.primary:hover,
.icon-button:hover {
  background: var(--accent-dark);
  color: #fff;
}

.summary {
  margin: 18px 0 10px;
  font-weight: 700;
}

.status-warning {
  color: var(--warn) !important;
}

.view-toggle {
  display: none;
  gap: 8px;
  margin: 12px 0;
}

.view-toggle button {
  flex: 1;
}

.view-toggle button.active {
  background: var(--accent);
  color: #fff;
}

.results-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 14px;
  align-items: start;
}

.results {
  display: grid;
  gap: 10px;
}

.map-panel {
  position: sticky;
  top: 12px;
  grid-column: 2;
  grid-row: 1;
  min-height: 520px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.map {
  width: 100%;
  min-height: 520px;
}

.map-empty {
  min-height: 520px;
  display: grid;
  place-items: center;
  padding: 18px;
  color: var(--muted);
  text-align: center;
}

.station {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  gap: 14px;
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.station.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(0, 108, 103, 0.14);
}

.rank {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--chip);
  color: var(--accent-dark);
  display: grid;
  place-items: center;
  font-weight: 800;
}

.station-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}

.station h2 {
  font-size: 18px;
  line-height: 1.25;
}

.station strong {
  font-size: 26px;
  color: var(--accent-dark);
  white-space: nowrap;
}

.station p {
  margin-top: 5px;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 9px;
  font-size: 13px;
}

.meta span {
  background: #f1f3f3;
  border-radius: 999px;
  padding: 4px 8px;
}

.meta .freshness.fresh,
.map-popup .freshness.fresh {
  background: #e7f7ef;
  color: #13795b;
}

.meta .freshness.ageing,
.map-popup .freshness.ageing {
  background: #fff4df;
  color: #9a5a00;
}

.meta .freshness.stale,
.map-popup .freshness.stale {
  background: #ffecec;
  color: #b42318;
}

.meta .value-chip {
  background: #eef6ff;
  color: #155e9f;
}

.empty {
  padding: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}

.login-panel {
  width: min(380px, 100%);
}

.login-panel h1 {
  margin: 18px 0 20px;
}

.error {
  margin-top: 12px;
  color: var(--warn);
  font-weight: 700;
}

.app-footer {
  margin-top: 24px;
  display: grid;
  justify-items: center;
  gap: 12px;
  font-size: 13px;
  text-align: center;
}

.powered-by {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-weight: 700;
  text-decoration: none;
}

.powered-by img {
  height: auto;
  max-width: 160px;
}

.login-powered-by {
  justify-content: center;
  margin-top: 20px;
}

.price-marker {
  background: transparent;
}

.price-marker span {
  min-width: 52px;
  height: 28px;
  border: 2px solid #fff;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.price-marker.cheap span {
  background: #13795b;
}

.price-marker.mid span {
  background: #b7791f;
}

.price-marker.high span {
  background: #b42318;
}

.map-popup {
  display: grid;
  gap: 3px;
}

.map-popup span,
.map-popup small {
  color: #4b5563;
}

.map-popup .freshness {
  border-radius: 999px;
  display: inline-flex;
  padding: 3px 7px;
  width: fit-content;
}

.map-popup a {
  color: #0f766e;
  font-weight: 800;
  text-decoration: none;
}

.map-popup a:hover {
  text-decoration: underline;
}

@media (max-width: 720px) {
  .shell {
    width: min(100% - 20px, 1120px);
    padding-top: 18px;
  }

  .topbar,
  .station-heading {
    align-items: stretch;
  }

  .topbar {
    grid-template-columns: 1fr;
  }

  .location-row,
  .filters,
  .station {
    grid-template-columns: 1fr;
  }

  .view-toggle {
    display: flex;
  }

  .results-layout {
    display: block;
  }

  .results-layout[data-view="list"] .map-panel {
    display: none;
  }

  .results-layout[data-view="map"] .results {
    display: none;
  }

  .map-panel,
  .map {
    min-height: 68vh;
  }

  .map-panel {
    position: static;
  }

  .rank {
    display: none;
  }

  .map-link {
    width: 100%;
  }
}
