/* Fuel Sniper — the stylesheet every page except the map shares.
   The map page (index.html) is the specification: the app's own colours, white
   panels floating on a soft canvas, frosted glass only where something floats
   over content, Bricolage for numbers and headlines, price colour by tier.
   Class names .sh-* (header) and .sf-* (footer) are kept from chrome.css so the
   markup on every page stays the same. */

:root {
  --ease-out: cubic-bezier(.23,1,.32,1);
  --ease-sheet: cubic-bezier(.32,.72,0,1);
  /* Straight from the app's constants/colors.ts, as on the map page. */
  --brand:#2D6A4F; --brand-light:#40916C; --brand-dark:#1B4332; --brand-ink:#ffffff;
  /* Brand-coloured TEXT; in dark mode a lighter green, as #40916C on the dark ground is under 4.5:1. */
  --brand-text:#2D6A4F;
  --closest:#E07B39;
  --paper:#FFFFFF; --canvas:#F3F5F4; --line:#E5E7EB;
  --ink:#111827; --ink-soft:#5F6874; --ink-faint:#6E7681;
  --tier-cheap:#4ADE80; --tier-mid:#FACC15; --tier-dear:#DC2626;
  --tier-cheap-ink:#08240f; --tier-mid-ink:#231a00; --tier-dear-ink:#ffffff;
  /* Text-weight versions of the tiers, dark enough to read on white. */
  --p-cheap:#15803D; --p-mid:#B45309; --p-dear:#C9271F;
  --glass: color-mix(in srgb, var(--paper) 82%, transparent);
  --glass-line: color-mix(in srgb, var(--ink) 8%, transparent);
  --float: 0 1px 2px rgb(0 0 0 / .06), 0 8px 24px rgb(0 0 0 / .10);
  --lift: 0 1px 2px rgb(17 24 39 / .04), 0 4px 14px rgb(17 24 39 / .05);
  --r-panel: 22px;
  --shell: 1180px;
  --display: "Bricolage Grotesque", ui-sans-serif, -apple-system, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --brand:#40916C; --brand-text:#74C69D; --brand-ink:#04100a; --closest:#F4A261;
    --paper:#1F2937; --canvas:#111827; --line:#374151;
    --ink:#F9FAFB; --ink-soft:#AEB7C0; --ink-faint:#9AA4AE;
    --p-cheap:#4ADE80; --p-mid:#FBBF24; --p-dear:#F87171;
    --float: 0 1px 2px rgb(0 0 0 / .3), 0 10px 28px rgb(0 0 0 / .45);
    --lift: 0 1px 2px rgb(0 0 0 / .25), 0 6px 18px rgb(0 0 0 / .25);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--canvas); }
body {
  margin: 0; min-height: 100dvh; display: flex; flex-direction: column;
  background: var(--canvas); color: var(--ink);
  font: 16px/1.55 ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-variant-numeric: tabular-nums; -webkit-tap-highlight-color: transparent;
  caret-color: var(--brand);
}
body > main { flex: 1 0 auto; }
::selection { background: color-mix(in srgb, var(--brand) 26%, transparent); }
:focus-visible { outline: 2.5px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
button { font: inherit; color: inherit; }
a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1.5px; }
h1, h2, h3 { font-family: var(--display); font-weight: 800; letter-spacing: -.03em; line-height: 1.06; margin: 0; text-wrap: balance; }
p { text-wrap: pretty; }
.shell { max-width: var(--shell); margin: 0 auto; padding: 0 16px; width: 100%; }
@media (min-width: 700px) { .shell { padding: 0 24px; } }

/* ---------- Header: a floating glass bar, like the map page's top ---------- */
.sh {
  position: sticky; top: 0; z-index: 900; flex: 0 0 auto;
  padding: calc(env(safe-area-inset-top) + 10px) 12px 0; pointer-events: none;
}
.sh-in {
  pointer-events: auto; position: relative;
  max-width: var(--shell); margin: 0 auto; height: 60px; padding: 0 8px 0 8px;
  display: flex; align-items: center; gap: 8px; border-radius: 18px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(20px) saturate(1.7); backdrop-filter: blur(20px) saturate(1.7);
  border: 1px solid var(--glass-line); box-shadow: var(--float);
}
.sh-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); flex: 0 0 auto; padding-right: 6px; }
.sh-brand img { width: 42px; height: 42px; border-radius: 12px; display: block; }
.sh-brand span { font-family: var(--display); font-weight: 800; font-size: 18px; letter-spacing: -.03em; line-height: 1; }
.sh-links { display: flex; gap: 2px; margin-left: 10px; }
.sh-links a {
  text-decoration: none; color: var(--ink-soft); font-weight: 600; font-size: 14.5px;
  padding: 8px 13px; border-radius: 11px; white-space: nowrap;
  transition: color 150ms var(--ease-out), background-color 150ms var(--ease-out);
}
.sh-links a[aria-current="page"] { color: var(--brand-text); background: color-mix(in srgb, var(--brand) 12%, transparent); }
@media (hover:hover) and (pointer:fine) { .sh-links a:not([aria-current]):hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 5%, transparent); } }
.sh-sp { flex: 1; }
.sh-cta {
  text-decoration: none; background: var(--brand); color: var(--brand-ink); font-weight: 650; font-size: 14.5px;
  padding: 10px 16px; border-radius: 12px; white-space: nowrap; transition: transform 150ms var(--ease-out);
}
.sh-cta:active { transform: scale(.97); }
.sh-cta[aria-disabled="true"] { opacity: .5; pointer-events: none; }
.sh-menu {
  display: none; width: 44px; height: 44px; border-radius: 13px; place-items: center; cursor: pointer;
  border: 0; background: color-mix(in srgb, var(--ink) 6%, transparent); color: var(--ink);
  transition: transform 160ms var(--ease-out);
}
.sh-menu:active { transform: scale(.95); }
.sh-drop {
  pointer-events: auto;
  position: absolute; right: 12px; top: calc(env(safe-area-inset-top) + 76px); width: min(300px, calc(100vw - 24px)); padding: 8px; border-radius: 20px;
  background: color-mix(in srgb, var(--paper) 97%, transparent);
  -webkit-backdrop-filter: blur(20px) saturate(1.7); backdrop-filter: blur(20px) saturate(1.7);
  border: 1px solid var(--glass-line); box-shadow: var(--float);
  transform-origin: top right; transition: opacity 180ms var(--ease-out), transform 180ms var(--ease-out);
}
.sh-drop[hidden] { display: block; opacity: 0; visibility: hidden; transform: scale(.96) translateY(-4px); pointer-events: none; }
.sh-drop a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 13px; text-decoration: none; color: var(--ink); font-weight: 600; font-size: 15px; line-height: 1.3; }
.sh-drop a small { display: block; font-weight: 450; font-size: 13px; color: var(--ink-soft); }
.sh-drop .ic { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; flex: 0 0 auto;
  background: color-mix(in srgb, var(--brand) 12%, transparent); color: var(--brand-text); }
.sh-drop a[aria-current="page"] .ic { background: var(--brand); color: var(--brand-ink); }
.sh-drop a:active { background: color-mix(in srgb, var(--ink) 6%, transparent); }
@media (hover:hover) and (pointer:fine) { .sh-drop a:hover { background: color-mix(in srgb, var(--ink) 5%, transparent); } }
.sh-drop hr { border: 0; border-top: 1px solid var(--line); margin: 6px 4px; }
.sh-drop a[aria-disabled="true"] { opacity: .5; pointer-events: none; }
@media (max-width: 899px) {
  .sh-links, .sh-cta { display: none; }
  .sh-menu { display: grid; }
}

/* ---------- Footer ---------- */
.sf { margin-top: 72px; padding: 0 12px calc(env(safe-area-inset-bottom) + 12px); color: var(--ink-soft); font-size: 14px; line-height: 1.6; flex: 0 0 auto; }
.sf-in { max-width: var(--shell); margin: 0 auto; padding: 28px 24px 26px; display: grid; gap: 20px;
  background: var(--paper); border-radius: var(--r-panel); border: 1px solid var(--glass-line); box-shadow: var(--lift); }
.sf-top { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: space-between; }
.sf-top .sh-brand img { width: 36px; height: 36px; border-radius: 10px; }
.sf-top p { margin: 0; }
.sf-links { display: flex; flex-wrap: wrap; gap: 0 22px; }
.sf-links a { color: var(--ink); text-decoration: none; font-weight: 600; display: inline-flex; align-items: center; min-height: 44px; }
@media (hover:hover) and (pointer:fine) { .sf-links a:hover { color: var(--brand-text); } }
.sf-legal { margin: 0; max-width: 82ch; font-size: 13px; padding-top: 18px; border-top: 1px solid var(--line); }
.sf-legal a { color: var(--brand-text); }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.sf-copy { margin: 0; font-size: 13px; color: var(--ink-faint); }

/* ---------- Page heads ---------- */
.crumbs { display: flex; gap: 6px; align-items: center; font-size: 14px; color: var(--ink-soft); margin: 34px 0 12px; }
.crumbs a { color: var(--ink-soft); text-decoration: none; font-weight: 550; display: inline-flex; align-items: center; min-height: 28px; }
.crumbs a:hover { color: var(--brand-text); }
.crumbs svg { color: var(--ink-faint); }
.phead { padding: 0 0 22px; }
.phead h1 { font-size: clamp(34px, 6.2vw, 60px); letter-spacing: -.035em; }
.phead .sub { margin: 14px 0 0; font-size: 17.5px; color: var(--ink-soft); max-width: 60ch; }
.phead .sub a { color: var(--brand-text); }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 16px; font-size: 14px; color: var(--ink-soft); }

/* Live / delayed status, the map page's pill. */
.live {
  display: inline-flex; align-items: center; gap: 7px; flex: 0 0 auto;
  background: color-mix(in srgb, var(--brand) 13%, transparent); color: var(--brand-text);
  font-size: 12.5px; font-weight: 700; padding: 5px 11px 5px 10px; border-radius: 10px;
}
.live i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 22%, transparent); }
.live.delayed { background: color-mix(in srgb, #C98A1B 16%, transparent); color: #8a5c0b; }
@media (prefers-color-scheme: dark) { .live.delayed { color: #e5b45f; } }

/* ---------- Panels ---------- */
.panel { background: var(--paper); border-radius: var(--r-panel); border: 1px solid var(--glass-line); box-shadow: var(--lift); }
.panel-h { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 18px 20px 12px; }
.panel-h h2 { font-size: 19px; letter-spacing: -.02em; }
.panel-h span { font-size: 13.5px; color: var(--ink-soft); }

/* ---------- Grade chips, as on the map ---------- */
.chips {
  display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
  margin: 0 -16px; padding: 2px 16px 6px;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto; appearance: none; cursor: pointer; font-size: 14px; font-weight: 650; text-decoration: none;
  height: 38px; padding: 0 16px; border-radius: 12px; display: inline-flex; align-items: center;
  background: var(--paper); color: var(--ink); border: 1px solid var(--glass-line); box-shadow: 0 1px 2px rgb(0 0 0 / .05);
  transition: background-color 160ms var(--ease-out), color 160ms var(--ease-out), transform 160ms var(--ease-out);
}
.chip:active { transform: scale(.96); }
.chip[aria-pressed="true"], .chip[aria-current="page"] { background: var(--brand); border-color: transparent; color: var(--brand-ink); }
@media (hover:hover) and (pointer:fine) { .chip:not([aria-pressed="true"]):not([aria-current="page"]):hover { border-color: color-mix(in srgb, var(--brand) 45%, transparent); } }
@media (min-width: 700px) { .chips { margin: 0; padding: 2px 0 6px; flex-wrap: wrap; } }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px; white-space: nowrap; cursor: pointer;
  height: 50px; padding: 0 22px; border-radius: 15px; text-decoration: none; border: 0;
  font-weight: 700; font-size: 16px; transition: transform 160ms var(--ease-out), background-color 160ms var(--ease-out);
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--brand); color: var(--brand-ink); }
@media (hover:hover) and (pointer:fine) { .btn-primary:hover { background: var(--brand-dark); } }
@media (hover:hover) and (pointer:fine) and (prefers-color-scheme: dark) { .btn-primary:hover { background: var(--brand-light); } }
.btn-ghost { background: var(--paper); color: var(--ink); border: 1px solid var(--glass-line); box-shadow: 0 1px 2px rgb(0 0 0 / .05); }
.btn[aria-disabled="true"], .btn[disabled] { opacity: .55; pointer-events: none; }

/* ---------- Station rows: the map page's sheet rows ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.st {
  display: grid; grid-template-columns: 28px 40px minmax(0,1fr) auto 40px; gap: 12px; align-items: center;
  padding: 12px 14px 12px 16px; border-top: 1px solid var(--glass-line); color: inherit; text-decoration: none;
  transition: background-color 150ms var(--ease-out);
}
.st.no-rank { grid-template-columns: 40px minmax(0,1fr) auto 40px; }
@media (hover:hover) and (pointer:fine) { .st:hover { background: color-mix(in srgb, var(--ink) 3.5%, transparent); } }
.st .rk { font-family: var(--display); font-weight: 700; font-size: 15px; color: var(--ink-faint); text-align: center; }
.st .n { min-width: 0; }
.st .n b { display: block; font-weight: 650; font-size: 15.5px; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st .n span { display: block; font-size: 13.5px; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st .p { font-family: var(--display); font-weight: 800; font-size: 22px; letter-spacing: -.03em; text-align: right; line-height: 1; }
.st .p small { font-size: .55em; margin-left: 1px; letter-spacing: 0; }
.go-mini {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: var(--brand-text);
  background: color-mix(in srgb, var(--brand) 11%, transparent); transition: transform 160ms var(--ease-out), background-color 160ms var(--ease-out);
}
.go-mini:active { transform: scale(.93); }
@media (hover:hover) and (pointer:fine) { .go-mini:hover { background: var(--brand); color: var(--brand-ink); } }
/* Phones: the rank goes and the button shrinks, so the station name gets the room. */
@media (max-width: 560px) {
  .st, .st.no-rank { grid-template-columns: 36px minmax(0,1fr) auto 34px; gap: 10px; padding: 11px 12px 11px 14px; }
  .st .rk { display: none; }
  .st .logo { width: 36px; height: 36px; }
  .st .p { font-size: 20px; }
  .go-mini { width: 34px; height: 34px; }
  .panel-h span { display: none; }
}
.c-cheap { color: var(--p-cheap); } .c-mid { color: var(--p-mid); } .c-dear { color: var(--p-dear); }

/* Brand mark on a white tile, as on the pins: rounded square, so a wordmark
   (AMPOL, Mobil, Reddy) is not cropped by a circle. Unknown brands get their
   initial rather than a wrong logo. */
.logo {
  width: 40px; height: 40px; border-radius: 10px; flex: 0 0 auto; display: grid; place-items: center; overflow: hidden;
  background: #fff; border: 1px solid rgb(0 0 0 / .08); box-shadow: 0 1px 2px rgb(0 0 0 / .08);
}
.logo img { width: 86%; height: 86%; object-fit: contain; display: block; }
.logo.init { background: color-mix(in srgb, var(--brand) 12%, var(--paper)); border-color: transparent; color: var(--brand-text);
  font: 800 15px/1 var(--display); letter-spacing: -.02em; }
.logo.lg { width: 56px; height: 56px; }
.logo.lg.init { font-size: 21px; }

.tag, .st .n .tag { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 7px; font-size: 11.5px; font-weight: 750; letter-spacing: .02em;
  background: color-mix(in srgb, var(--ink) 6%, transparent); color: var(--ink-soft); vertical-align: 2px; margin-left: 6px; }

/* ---------- Long-form documents (privacy, terms, security) ---------- */
.doc-wrap { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; padding-top: 34px; }
@media (min-width: 1000px) { .doc-wrap { grid-template-columns: 240px minmax(0, 1fr); gap: 28px; align-items: start; } }
.toc { display: none; }
@media (min-width: 1000px) {
  .toc { display: block; position: sticky; top: 96px; padding: 8px; max-height: calc(100dvh - 120px); overflow-y: auto; }
  .toc b { display: block; font-size: 12.5px; font-weight: 700; color: var(--ink-faint); padding: 8px 12px 6px; }
  .toc a { display: block; padding: 7px 12px; border-radius: 10px; font-size: 14px; line-height: 1.35; color: var(--ink-soft); text-decoration: none; font-weight: 550; }
  .toc a:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 4%, transparent); }
  .toc a.on { color: var(--brand-text); background: color-mix(in srgb, var(--brand) 11%, transparent); }
}
main.legal { padding: 30px 22px 38px; max-width: 820px; }
@media (min-width: 700px) { main.legal { padding: 52px 60px 60px; } }
main.legal h1 { font-size: clamp(34px, 5vw, 50px); letter-spacing: -.035em; }
main.legal .updated { display: inline-flex; margin: 14px 0 6px; font-size: 13.5px; font-weight: 600; color: var(--ink-soft);
  background: color-mix(in srgb, var(--ink) 5%, transparent); padding: 5px 11px; border-radius: 9px; }
main.legal h2 { font-size: 23px; letter-spacing: -.025em; margin: 46px 0 12px; scroll-margin-top: 96px; }
main.legal h3 { font-size: 18px; letter-spacing: -.015em; margin: 28px 0 8px; }
main.legal p, main.legal li { color: color-mix(in srgb, var(--ink) 82%, var(--paper)); font-size: 16.5px; line-height: 1.7; max-width: 70ch; }
main.legal ul, main.legal ol { padding-left: 22px; }
main.legal li { margin: 6px 0; }
main.legal li::marker { color: var(--brand-text); }
main.legal a { color: var(--brand-text); }
main.legal strong, main.legal b { color: var(--ink); }
main.legal table { width: 100%; border-collapse: separate; border-spacing: 0; margin: 14px 0 6px; font-size: 14.5px; line-height: 1.45;
  border: 1px solid var(--line); border-radius: 14px; overflow: hidden; display: block; overflow-x: auto; }
main.legal thead th { background: color-mix(in srgb, var(--ink) 4%, transparent); }
main.legal th { text-align: left; font-weight: 700; font-size: 13px; color: var(--ink-soft); padding: 10px 14px; }
main.legal td { padding: 11px 14px; border-top: 1px solid var(--line); vertical-align: top; color: color-mix(in srgb, var(--ink) 85%, var(--paper)); }
main.legal > p:first-of-type { font-size: 18px; }
/* The opening summary reads as a highlighted card, not more body text. */
main.legal h2:first-of-type + ul { background: color-mix(in srgb, var(--brand) 7%, var(--paper)); border: 1px solid color-mix(in srgb, var(--brand) 18%, transparent);
  border-radius: 18px; padding: 16px 20px 16px 40px; }

/* ---------- Scroll reveal: fails open (see app.js) ---------- */
.rv { opacity: 0; transform: translateY(14px); transition: opacity .6s var(--ease-out), transform .6s var(--ease-out); }
.rv.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .rv { opacity: 1; transform: none; transition: none; }
  .sh-drop, .sh-links a, .sh-cta, .chip, .btn, .go-mini, .st { transition: none; }
}
@media print {
  .sh, .sf, .toc { display: none; }
  .rv { opacity: 1 !important; transform: none !important; }
  .panel { box-shadow: none; }
}
.doc-wrap { flex: 1 0 auto; }
