:root {
  --blue: #0079c1;
  --blue-dark: #005d95;
  --red: #e31837;
  --yellow: #ffd200;
  --green: #00703c;
  --ink: #102235;
  --muted: #68798a;
  --bg: #e0e5eb;
  --line: #cbd4dc;
  --white: #fff;
  font-family: "Plus Jakarta Sans", Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; }
button, input, select { font: inherit; }
button, select { cursor: pointer; }
.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; }

.app-header {
  height: 72px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--white);
  border-bottom: 1px solid var(--line);
  position: relative;
  z-index: 5;
}
.brand { display: inline-flex; }
.brand img { display: block; width: 154px; height: auto; }
.header-actions { display: flex; align-items: center; gap: 18px; }
.header-actions a { color: var(--blue); font-size: 14px; font-weight: 800; text-decoration: none; }
.install-button { min-height: 40px; padding: 0 16px; border: 0; border-radius: 8px; color: white; background: var(--blue); font-weight: 800; }

.app-shell { height: calc(100% - 72px); display: grid; grid-template-columns: minmax(390px, 42%) 1fr; }
.search-panel { min-width: 0; display: flex; flex-direction: column; background: var(--bg); border-right: 1px solid var(--line); overflow: hidden; }
.search-controls { padding: 18px 20px 14px; background: var(--white); border-bottom: 1px solid var(--line); }
.location-search { display: grid; grid-template-columns: 1fr 50px; }
.location-search input { min-width: 0; height: 50px; border: 2px solid var(--ink); border-right: 0; border-radius: 9px 0 0 9px; padding: 0 15px; color: var(--ink); background: var(--white); font-weight: 650; outline: none; }
.location-search input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0,121,193,.15); }
.location-search button { border: 0; border-radius: 0 9px 9px 0; color: var(--white); background: var(--blue); font-size: 25px; font-weight: 900; }
.location-button { width: 100%; min-height: 44px; margin-top: 9px; border: 0; border-radius: 8px; background: #c8d8e6; color: var(--blue-dark); font-weight: 850; display: flex; align-items: center; justify-content: center; gap: 9px; }
.target-icon, .target-large { display: inline-block; border: 3px solid currentColor; border-radius: 50%; position: relative; }
.target-icon { width: 18px; height: 18px; }
.target-large { width: 40px; height: 40px; color: var(--blue); }
.target-icon::before, .target-large::before { content: ""; position: absolute; inset: 28%; border-radius: 50%; background: currentColor; }
.target-icon::after, .target-large::after { content: ""; position: absolute; left: 44%; top: -6px; width: 12%; height: calc(100% + 12px); background: linear-gradient(currentColor 0 22%, transparent 22% 78%, currentColor 78%); }
.filter-grid { display: grid; grid-template-columns: 1.3fr .9fr .9fr; gap: 9px; margin-top: 13px; }
.filter-grid label { color: var(--muted); font-size: 11px; font-weight: 850; text-transform: uppercase; letter-spacing: .04em; }
.filter-grid select { width: 100%; height: 42px; margin-top: 5px; padding: 0 10px; border: 0; border-radius: 7px; background: var(--bg); color: var(--ink); font-size: 14px; font-weight: 750; }
.app-ad-slot { min-height: 74px; margin-top: 12px; }
.app-ad-slot-list { margin: 0 0 10px; }

.results-heading { padding: 16px 20px 12px; display: flex; align-items: end; justify-content: space-between; gap: 12px; }
.eyebrow { margin: 0 0 3px; color: var(--muted); font-size: 11px; font-weight: 900; letter-spacing: .05em; text-transform: uppercase; }
h1 { margin: 0; font-size: 24px; line-height: 1.1; }
.result-count { flex: none; color: var(--muted); font-size: 13px; font-weight: 750; }
.status-card { margin: 0 20px; padding: 28px 22px; border-radius: 10px; background: var(--white); text-align: center; }
.status-card strong { display: block; margin-top: 12px; font-size: 18px; }
.status-card p { margin: 6px auto 0; max-width: 360px; color: var(--muted); font-size: 14px; font-weight: 650; }
.station-list { padding: 0 20px 24px; overflow-y: auto; overscroll-behavior: contain; }
.station-card { margin-bottom: 10px; border-radius: 9px; background: var(--white); box-shadow: 0 2px 8px rgba(16,34,53,.05); overflow: hidden; }
.station-card-stale .updated { color: var(--red); font-weight: 900; }
.station-select { width: 100%; min-height: 108px; padding: 15px 38px 15px 15px; border: 0; color: var(--ink); background: transparent; display: grid; grid-template-columns: 50px minmax(0,1fr) auto; gap: 13px; align-items: center; text-align: left; position: relative; }
.station-select:hover, .station-select:focus-visible { background: #f5f8fa; }
.brand-tile { width: 50px; height: 50px; border-radius: 8px; display: grid; place-items: center; background: var(--yellow); color: var(--ink); font-size: 21px; font-weight: 950; text-transform: uppercase; }
.station-main { min-width: 0; display: block; }
.price { display: inline-block; padding: 3px 8px 4px; border-radius: 5px; color: var(--yellow); background: var(--green); font-size: 19px; line-height: 1; font-weight: 950; }
.station-name { display: block; margin-top: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 17px; line-height: 1.1; }
.station-address { display: block; margin-top: 4px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 650; }
.station-meta { text-align: right; }
.distance { display: block; color: var(--blue); font-size: 14px; }
.updated { display: block; margin-top: 5px; color: var(--muted); font-size: 10px; font-weight: 650; }
.chevron { position: absolute; right: 14px; top: 36px; color: var(--line); font-size: 34px; line-height: 1; }

.map-panel { min-width: 0; height: 100%; position: relative; background: #dce3e9; }
#map { position: absolute; inset: 0; }
.map-message { position: absolute; top: 16px; left: 50%; transform: translateX(-50%); max-width: calc(100% - 32px); padding: 10px 15px; border-radius: 8px; background: rgba(255,255,255,.94); box-shadow: 0 3px 16px rgba(16,34,53,.15); color: var(--muted); font-size: 13px; font-weight: 750; text-align: center; z-index: 2; }
.map-location-button { position: absolute; right: 14px; bottom: 28px; width: 48px; height: 48px; border: 0; border-radius: 50%; display: grid; place-items: center; color: var(--ink); background: var(--white); box-shadow: 0 3px 14px rgba(16,34,53,.22); z-index: 3; }
.price-marker { border: 0; padding: 5px 8px; border-radius: 6px; color: var(--yellow); background: var(--green); box-shadow: 0 2px 7px rgba(16,34,53,.28); font: 850 13px/1 system-ui, sans-serif; white-space: nowrap; }
.price-marker::after { content: ""; position: absolute; left: 50%; bottom: -6px; transform: translateX(-50%); border: 6px solid transparent; border-top-color: var(--green); border-bottom: 0; }
.price-marker.selected { color: var(--yellow); background: var(--green); box-shadow: 0 0 0 2px var(--yellow), 0 3px 9px rgba(16,34,53,.32); transform: scale(1.12); z-index: 2; }
.price-marker.selected::after { border-top-color: var(--green); }
.station-detail { position: absolute; left: 18px; right: 18px; bottom: 18px; max-width: 560px; margin: 0 auto; padding: 18px; border-radius: 10px; background: var(--white); box-shadow: 0 10px 35px rgba(16,34,53,.24); z-index: 4; }
.detail-close { position: absolute; top: 8px; right: 8px; width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--bg); font-size: 22px; }
.station-detail h2 { margin: 7px 38px 3px 0; font-size: 23px; line-height: 1.05; }
.station-detail p { margin: 5px 0; color: var(--muted); font-size: 13px; font-weight: 650; }
.station-detail .stale-warning { margin-top: 10px; padding: 9px 11px; border-radius: 8px; color: var(--red); background: rgba(227,24,55,.08); font-weight: 900; }
.detail-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.detail-actions a { min-height: 44px; border-radius: 8px; display: flex; align-items: center; justify-content: center; color: var(--white); background: var(--blue); font-size: 13px; font-weight: 850; text-decoration: none; text-align: center; }
.detail-actions a.secondary { color: var(--blue); background: #c8d8e6; }
.mobile-nav { display: none; }

@media (max-width: 760px) {
  html, body { min-height: 100%; min-height: 100dvh; }
  .app-header { height: 62px; padding: env(safe-area-inset-top) 15px 0; }
  .brand img { width: 136px; }
  .header-actions a { display: none; }
  .install-button { min-height: 36px; padding: 0 12px; font-size: 12px; }
  .app-shell { height: calc(100dvh - 62px - 64px - env(safe-area-inset-bottom)); display: block; }
  .search-panel, .map-panel { height: 100%; border: 0; }
  .app-shell > section:not(.mobile-active) { display: none; }
  .search-controls { padding: 12px 14px 10px; }
  .location-search input { height: 46px; }
  .location-button { min-height: 40px; }
  .filter-grid { grid-template-columns: 1.2fr .8fr .8fr; gap: 6px; margin-top: 10px; }
  .filter-grid label { font-size: 9px; }
  .filter-grid select { height: 38px; padding: 0 5px; font-size: 12px; }
  .app-ad-slot { min-height: 60px; margin-top: 10px; }
  .results-heading { padding: 12px 14px 9px; }
  h1 { font-size: 20px; }
  .status-card { margin: 0 14px; }
  .station-list { padding: 0 14px 18px; }
  .station-select { min-height: 96px; padding: 12px 33px 12px 12px; grid-template-columns: 45px minmax(0,1fr) auto; gap: 10px; }
  .brand-tile { width: 45px; height: 45px; }
  .station-name { font-size: 15px; }
  .map-message { top: 12px; }
  .map-location-button { bottom: 18px; }
  .station-detail { left: 12px; right: 12px; bottom: 12px; }
  .mobile-nav { position: fixed; left: 0; right: 0; bottom: 0; height: calc(64px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); display: grid; grid-template-columns: 1fr 1fr; background: var(--white); border-top: 1px solid var(--line); z-index: 10; }
  .mobile-nav button { border: 0; background: var(--white); color: var(--muted); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 11px; font-weight: 800; }
  .mobile-nav button span { font-size: 23px; line-height: 1; }
  .mobile-nav button.active { color: var(--blue); background: #eef6fa; }
}
