:root { font-family: "Instrument Sans", system-ui, sans-serif; color: var(--ink); background: #f2faf5; color-scheme: light; --primary: #159564; --primary-action: #118355; --primary-dark: #0d704c; --primary-light: #e9f7ef; --primary-border: #c4e7d3; --primary-focus: #7bcba5; --brand-ink: #001a11; --ink: #163d2c; --muted: #536f61; --line: #d8e9df; --shadow: 0 4px 16px #17452d10; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { --header-height: 96px; margin: 0; line-height: 1.45; -webkit-font-smoothing: antialiased; }
header { min-height: var(--header-height); padding: .85rem clamp(1rem, 4vw, 3rem); display: flex; align-items: center; gap: 1rem; background: #fff; color: var(--primary-dark); border-bottom: 3px solid var(--primary); box-shadow: 0 3px 14px #17452d0c; }
.brand { display: inline-flex; align-items: center; gap: .95rem; min-width: 0; color: var(--primary-dark); text-decoration: none; }
.brand-mark { display: block; width: 64px; height: 64px; overflow: hidden; border: 1px solid var(--primary-border); border-radius: 18px; background: white; box-shadow: 0 3px 9px #15956420; flex-shrink: 0; }
.brand-mark img { display: block; width: 100%; height: 100%; object-fit: cover; transform: scale(1.43); }
.brand-copy { display: block; min-width: 0; }
.brand-name { display: block; font-size: 2.15rem; font-weight: 700; line-height: 1.05; letter-spacing: -.045em; }
.header-tagline { display: block; margin-top: .3rem; color: #315b46; font-size: 1rem; font-weight: 500; line-height: 1.35; }
main { display: grid; grid-template-columns: minmax(335px, 395px) 1fr; min-height: calc(100dvh - var(--header-height)); }
.panel { padding: clamp(1.2rem, 3vw, 1.75rem); background: #d2eee0; color: #163d2c; border-right: 1px solid #b3d8c4; --muted: #3f6150; --line: #afd2be; --primary-action: #0d704c; --primary-dark: #003c27; --primary-focus: #0d704c; }
#panel-toggle { display: none; }
h1 { margin: .25rem 0 1.75rem; font-size: clamp(2rem, 4vw, 2.5rem); letter-spacing: -.05em; line-height: 1.1; }
h2 { margin: 0; font-size: 1.23rem; }
label { display: block; font-size: .88rem; font-weight: 700; margin: 0 0 .4rem; }
input, select, button, .route { border-radius: 12px; padding: .7rem .85rem; font: inherit; min-height: 48px; }
input, select { background: white; color: inherit; border: 1px solid #c1d9ca; width: 100%; font-size: 1rem; }
input::placeholder { color: #718477; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
:where(button, a, input, select):focus-visible { outline: 3px solid var(--primary-focus); outline-offset: 3px; }
button, .route, input, select { transition: background-color .16s, border-color .16s, box-shadow .16s; }
button, .route { background: var(--primary-action); color: white; border: 1px solid transparent; cursor: pointer; font-weight: 700; }
button:disabled { opacity: .55; cursor: default; }
button:hover:not(:disabled), .route:hover { background: var(--primary-dark); }
.secondary { background: var(--primary-light); color: var(--primary-dark); border-color: var(--primary-border); white-space: nowrap; }
.secondary:hover:not(:disabled) { background: #d8f0e1; }
.search, .filters { display: grid; grid-template-columns: 1fr auto; gap: .5rem; }
.search > input { min-width: 0; }
.filters { grid-template-columns: minmax(0, 1fr) auto; align-items: end; margin-top: 1rem; }
.filters > div { min-width: 0; }
.quick-locations { margin-bottom: 1.5rem; }
.quick-locations h2 { font-size: .75rem; text-transform: uppercase; letter-spacing: .085em; color: var(--muted); }
.quick-locations p { margin: .35rem 0 .8rem; color: var(--muted); font-size: .85rem; }
.quick-location-buttons { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
.quick-location { min-width: 0; min-height: 56px; padding: .65rem .6rem; background: white; color: #235a3d; border-color: var(--line); line-height: 1.3; font-size: .85rem; font-weight: 600; box-shadow: 0 1px 2px #17452d05; }
.quick-location:hover:not(:disabled) { background: #edf9f1; border-color: #8bc9a5; }
.quick-location[aria-pressed="true"], .quick-location[aria-pressed="true"]:hover:not(:disabled) { background: var(--primary-action); color: white; border-color: var(--primary-action); box-shadow: 0 3px 9px #15956424; }
.quick-location:focus-visible { outline: 3px solid var(--primary-action); outline-offset: 3px; }
#feedback, #count, footer { color: var(--muted); font-size: .92rem; }
#feedback:empty { display: none; }
#feedback:not(:empty) { padding: .75rem; border: 1px solid var(--line); border-radius: 12px; background: var(--primary-light); }
.results { border-top: 1px solid var(--line); padding-top: 1.3rem; margin-top: 1.6rem; }
.results h2 { font-size: 1.15rem; letter-spacing: -.025em; }
#count { margin: .4rem 0 .8rem; }
ol { margin: 0; padding: 0; list-style: none; }
li { margin-bottom: .65rem; }
.station-row { width: 100%; display: grid; grid-template-columns: 1.4rem 2.5rem minmax(0, 1fr) auto; gap: .55rem; align-items: start; text-align: left; background: white; color: var(--ink); border-color: var(--line); padding: .85rem .7rem; border-radius: 15px; box-shadow: 0 2px 8px #17452d06; font-size: .92rem; }
.station-logo { display: inline-flex; align-items: center; justify-content: center; width: 2.5rem; height: 2.5rem; padding: .25rem; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--muted); font-size: .75rem; font-weight: 700; flex-shrink: 0; }
.station-logo img { display: block; width: 100%; height: 100%; object-fit: contain; }
.station-name { min-width: 0; overflow-wrap: anywhere; }
.station-distance { display: inline-flex; align-items: center; margin-top: .45rem; padding: .2rem .55rem; border: 1px solid var(--primary-border); border-radius: 9px; background: var(--primary-light); color: var(--primary-dark); font-size: .75rem; font-weight: 600; line-height: 1.4; white-space: nowrap; }
.station-heading { display: flex; align-items: center; gap: .75rem; }
.station-heading h2 { min-width: 0; overflow-wrap: anywhere; }
.station-row:hover:not(:disabled) { background: #edf9f1; border-color: #8bc9a5; box-shadow: var(--shadow); }
.station-row small { display: block; font-weight: 400; margin-top: .3rem; color: var(--muted); font-size: .78rem; line-height: 1.45; }
.station-row .number { display: inline-flex; align-items: center; justify-content: center; width: 1.4rem; height: 1.4rem; border-radius: 50%; background: var(--primary-light); color: var(--primary-action); font-size: .72rem; }
li:first-child .station-row { border-color: #abd8bd; }
li:first-child .station-row .number { background: var(--primary-action); color: white; }
.station-row .price { white-space: nowrap; color: var(--primary-action); }
@media (min-width: 731px) and (max-width: 1150px), (max-width: 380px) {
  .station-row { grid-template-columns: 1.4rem 2.5rem minmax(0, 1fr); }
  .station-row .price { grid-column: 3; }
}
footer { margin-top: 1.5rem; padding-top: .8rem; border-top: 1px solid var(--line); font-size: .78rem; line-height: 1.5; }
footer a { color: var(--primary-action); }

/* The green sidebar uses its own contrast palette; map and dialogs keep theirs. */
.panel h1 { color: #103f2c; }
.panel .results h2 { color: #103f2c; font-size: 1.25rem; }
.panel input, .panel select { color: #163d2c; border-color: #d1eadc; }
.panel input::placeholder { color: #597262; }
.panel .quick-location { background: #f8fffa; border-color: #d2efdf; color: #16462e; }
.panel .quick-location:hover:not(:disabled) { background: #e7f8ee; border-color: #fff; }
.panel .quick-location[aria-pressed="true"], .panel .quick-location[aria-pressed="true"]:hover:not(:disabled) { background: #004e31; color: white; border-color: #e1fff0; box-shadow: 0 3px 9px #004e312b; }
.panel :where(button, input, select, a):focus-visible { outline: 3px solid #0d704c; outline-offset: 3px; }
.panel #feedback:not(:empty) { background: #f2fff7; border-color: #c4e7d3; color: #163d2c; }
.panel .station-row { color: #163d2c; border-color: #d5e9dd; box-shadow: 0 4px 12px #003c271c; }
.panel .station-row:hover:not(:disabled) { background: #edfff4; border-color: #fff; }
.panel .station-row small { color: #536f61; }
.panel .station-logo { color: #536f61; border-color: #dfece4; }
.panel li:first-child .station-row { border-color: #b7d8c5; }
.panel footer a { color: #174e34; font-weight: 600; text-underline-offset: 3px; }
.panel footer a:hover { text-decoration-thickness: 2px; }
.map-section { position: sticky; top: 0; height: calc(100dvh - var(--header-height)); min-height: 450px; background: #e2f2e8; }
#map { position: absolute; inset: 0; }
.maplibregl-ctrl-group { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); }
.maplibregl-ctrl-group button { width: 44px; height: 44px; min-height: 44px; }
.station-map-marker { width: 0; height: 0; z-index: 1; }
.station-map-marker:focus-within, .station-map-marker:hover { z-index: 2; }
.station-map-connector { position: absolute; inset: 0 auto auto 0; width: 1px; height: 1px; overflow: visible; pointer-events: none; }
.station-map-connector line { stroke: var(--primary-action); stroke-width: 2; }
.station-map-dot { position: absolute; left: -5px; top: -5px; width: 10px; height: 10px; border: 2px solid white; border-radius: 50%; background: var(--primary-action); box-shadow: 0 1px 4px #0b392840; pointer-events: none; }
.station-map-label { position: absolute; transform: translate(-50%, -100%); display: flex; align-items: center; gap: .35rem; min-height: 44px; padding: .3rem .55rem .3rem .35rem; border: 1.5px solid #7ebd99; border-radius: 999px; background: white; color: var(--primary-dark); box-shadow: 0 2px 7px #0b392830; white-space: nowrap; font-size: .8rem; line-height: 1.1; }
.station-map-label:hover:not(:disabled) { background: var(--primary-light); border-color: var(--primary-action); }
.station-map-label:focus-visible { outline: 3px solid var(--primary-action); outline-offset: 3px; }
.station-map-label .station-logo { width: 1.5rem; height: 1.5rem; padding: 1px; border: 0; border-radius: 4px; font-size: .6rem; }
.station-map-price { font-variant-numeric: tabular-nums; }
.station-cluster { width: 48px; height: 48px; min-height: 48px; padding: 0; border: 4px solid #bde7ce; border-radius: 50%; background: var(--primary-action); color: white; font-size: 1rem; line-height: 1; box-shadow: 0 0 0 2px white, 0 2px 6px #0b392830; z-index: 2; }
.station-cluster:hover:not(:disabled) { background: var(--primary-dark); }
.station-cluster:focus-visible { outline: 3px solid #0b3928; outline-offset: 3px; }
#map-cluster-help { position: absolute; bottom: 2.5rem; left: .75rem; max-width: 220px; margin: 0; padding: .6rem .75rem; border-radius: 8px; background: #fffffff2; color: var(--muted); box-shadow: 0 1px 6px #0b392820; font-size: .75rem; line-height: 1.35; pointer-events: none; }
#viewport { position: absolute; top: 1rem; left: 1rem; box-shadow: 0 1px 7px #0b392830; }
#map-error { position: absolute; inset: 4.5rem 1rem auto; background: white; padding: 1rem; border-radius: 8px; }
dialog { width: min(92vw, 440px); max-width: 92vw; max-height: calc(100dvh - 2rem); border: 1px solid var(--line); padding: 1.75rem; border-radius: 22px; color: var(--ink); background: #fff; box-shadow: 0 24px 80px #0b392840; }
dialog::backdrop { background: #0b392880; backdrop-filter: blur(3px); }
dialog .station-heading { padding-right: 2.75rem; min-height: 44px; gap: .7rem; }
dialog .station-heading h2 { font-size: 1.15rem; line-height: 1.3; letter-spacing: -.025em; }
.station-address { margin: 1rem 0 0; color: var(--muted); font-size: .9rem; line-height: 1.5; overflow-wrap: anywhere; }
.station-fuel { --fuel-hue: 145; display: inline-flex; align-items: center; margin: 1.3rem 0 .6rem; padding: .35rem .7rem; border: 1px solid hsl(var(--fuel-hue) 40% 78%); border-radius: 9px; background: hsl(var(--fuel-hue) 65% 93%); color: hsl(var(--fuel-hue) 65% 24%); font-size: .8rem; font-weight: 600; line-height: 1.4; }
.fuel-selection { margin: .6rem 0 0; max-width: 100%; }
.station-detail-price { margin: 0 0 1.3rem; color: var(--primary-action); font-size: clamp(2.25rem, 9vw, 2.8rem); font-weight: 700; letter-spacing: -.04em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.station-detail-info { display: grid; gap: .4rem; padding: .85rem; border: 1px solid var(--line); border-radius: 12px; background: #f1f9f4; }
.station-detail-meta { margin: 0; color: var(--muted); font-size: .78rem; line-height: 1.45; overflow-wrap: anywhere; }
.station-hours { display: flex; align-items: flex-start; gap: .4rem; }
.station-hours svg { flex-shrink: 0; margin-top: 1px; }
.dialog-close-form { position: absolute; top: .8rem; right: .8rem; margin: 0; }
.dialog-close { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; min-height: 44px; padding: 0; border: 1px solid var(--line); border-radius: 12px; background: var(--primary-light); color: var(--primary-dark); }
.dialog-close:hover:not(:disabled) { background: #d8f0e1; border-color: #8bc9a5; }
.route { display: flex; align-items: center; justify-content: center; width: 100%; margin-top: 1.25rem; min-height: 50px; text-decoration: none; box-shadow: 0 3px 10px #15956420; }
.install-logo { width: 72px; height: 72px; margin-bottom: 1.25rem; }
#install-title { padding-right: 1.5rem; font-size: 1.65rem; line-height: 1.2; letter-spacing: -.04em; }
#install-intro { margin: .8rem 0; color: var(--muted); font-size: .92rem; line-height: 1.5; }
.install-actions { display: grid; gap: .5rem; margin-top: 1.25rem; }
.install-actions button { width: 100%; }
.install-actions form { margin: 0; }
#install-instructions { margin-top: 1rem; padding: .85rem; border: 1px solid var(--line); border-radius: 12px; background: #f5fbf7; }
#install-steps-title { margin: 0; font-size: .95rem; }
.install-steps { margin: .7rem 0; padding-left: 1.2rem; list-style: decimal; font-size: .85rem; }
.install-steps li { margin-bottom: .6rem; }
#install-note, .install-status { color: var(--muted); font-size: .78rem; line-height: 1.5; }
.install-status:empty { display: none; }
@media (max-width: 730px) {
  .station-map-label { gap: .2rem; padding: .25rem .35rem; font-size: .72rem; }
  .station-map-label .station-logo { width: 1.15rem; height: 1.15rem; }
  body { --header-height: 88px; --bottom-bar-height: calc(82px + env(safe-area-inset-bottom, 0px)); height: 100dvh; overflow: hidden; }
  header { padding: .7rem 1rem; gap: .7rem; }
  .brand { gap: .75rem; }
  .brand-mark { width: 58px; height: 58px; border-radius: 16px; }
  .brand-name { font-size: 2rem; }
  main { display: block; height: calc(100dvh - var(--header-height)); min-height: 0; }
  .map-section { position: relative; height: calc(100dvh - var(--header-height) - var(--bottom-bar-height)); min-height: 0; }
  .panel { position: fixed; inset: auto 0 0; z-index: 5; display: flex; flex-direction: column; padding: 0 0 env(safe-area-inset-bottom, 0px); border: 1px solid #afd2be; border-bottom: 0; border-radius: 24px 24px 0 0; box-shadow: 0 -6px 28px #103f2c26; max-height: calc(100dvh - var(--header-height) - 12px); }
  .panel.is-open { height: min(78dvh, calc(100dvh - var(--header-height) - 12px)); }
  #panel-toggle { position: relative; display: flex; align-items: center; gap: .75rem; width: 100%; min-height: 82px; flex-shrink: 0; border: 0; border-radius: 24px 24px 0 0; padding: 1.25rem 1.15rem .75rem; background: #e8f7ef; color: #103f2c; text-align: left; }
  #panel-toggle:hover { background: #e8f7ef; }
  .panel-handle { position: absolute; top: 8px; left: calc(50% - 20px); width: 40px; height: 4px; border-radius: 99px; background: #8bbba2; }
  .panel-toggle-copy { display: grid; gap: .2rem; flex: 1; min-width: 0; }
  .panel-toggle-copy strong { font-size: 1rem; }
  #panel-summary { font-size: .75rem; font-weight: 500; color: #486553; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .panel-chevron { flex-shrink: 0; transition: transform .2s; }
  .panel.is-open .panel-chevron { transform: rotate(180deg); }
  #panel-content { min-height: 0; overflow-y: auto; overscroll-behavior-y: contain; padding: .75rem 1.1rem 1.5rem; border-top: 1px solid #bfdccb; }
  .panel:not(.is-open) #panel-content { display: none; }
  .panel h1 { font-size: 1.8rem; margin-bottom: 1.25rem; }
  #viewport { top: .75rem; left: .75rem; font-size: .85rem; }
  dialog { padding: 1.5rem; border-radius: 20px; }
  #install-dialog { padding: 1.25rem; }
  #install-title { font-size: 1.45rem; }
  #install-intro { margin: .65rem 0; font-size: .88rem; }
  .install-logo { margin-bottom: 1rem; }
  .install-actions { margin-top: 1rem; }
  .header-tagline { font-size: .9rem; }
}

@media (prefers-reduced-motion: reduce) {
  button, .route, input, select, .panel-chevron { transition: none; }
}

@media (max-width: 380px) {
  header { gap: .5rem; padding-inline: .75rem; }
  .brand { gap: .5rem; }
  .brand-mark { width: 52px; height: 52px; border-radius: 14px; }
  .brand-name { font-size: 1.85rem; }
  .header-tagline { font-size: .82rem; }
}

#install { margin-left: auto; min-height: 44px; padding: .5rem .7rem; border-color: var(--primary-border); background: var(--primary-light); color: var(--primary-dark); white-space: nowrap; font-size: .85rem; }
#install:hover:not(:disabled) { background: #d8f0e1; }
