/* Litrewise: the "Roadside" design. The rules behind it are written down in DESIGN.md; read it before changing styles.
   World: UK roadworks and road-sign graphics. Hi-vis chartreuse is the one committed colour (hero fields, the
   cheapest rows, primary controls); ink black and white carry everything else; sign blue marks links.
   Type: Barlow Condensed for headings and prices (the numbers are the product), Barlow for text.
   Layout: petrol and diesel as two big price boards, the map as a quiet strip under them, trend and
   summary side by side. Square-ish corners, 2px ink outlines, no shadows. */


/* Fonts are self-hosted (SIL Open Font License, see assets/fonts/OFL-Barlow.txt): no request goes to Google. */
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 400; font-display: swap; src: url("/fonts/barlow-latin-ext-400-normal.woff2") format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 400; font-display: swap; src: url("/fonts/barlow-latin-400-normal.woff2") format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 500; font-display: swap; src: url("/fonts/barlow-latin-ext-500-normal.woff2") format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 500; font-display: swap; src: url("/fonts/barlow-latin-500-normal.woff2") format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 600; font-display: swap; src: url("/fonts/barlow-latin-ext-600-normal.woff2") format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 600; font-display: swap; src: url("/fonts/barlow-latin-600-normal.woff2") format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 700; font-display: swap; src: url("/fonts/barlow-latin-ext-700-normal.woff2") format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 700; font-display: swap; src: url("/fonts/barlow-latin-700-normal.woff2") format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 500; font-display: swap; src: url("/fonts/barlow-condensed-latin-ext-500-normal.woff2") format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 500; font-display: swap; src: url("/fonts/barlow-condensed-latin-500-normal.woff2") format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 600; font-display: swap; src: url("/fonts/barlow-condensed-latin-ext-600-normal.woff2") format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 600; font-display: swap; src: url("/fonts/barlow-condensed-latin-600-normal.woff2") format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 700; font-display: swap; src: url("/fonts/barlow-condensed-latin-ext-700-normal.woff2") format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 700; font-display: swap; src: url("/fonts/barlow-condensed-latin-700-normal.woff2") format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 800; font-display: swap; src: url("/fonts/barlow-condensed-latin-ext-800-normal.woff2") format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 800; font-display: swap; src: url("/fonts/barlow-condensed-latin-800-normal.woff2") format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }

:root {
  color-scheme: light dark;
  --hivis: #d6ef16;
  --ink: #15181e;
  --bg: light-dark(#f3f5f7, #101318);
  --surface: light-dark(#ffffff, #1a1e26);
  --surface-2: light-dark(#e9edf1, #232834);
  --text: light-dark(#15181e, #eef1f5);
  --muted: light-dark(#4d5563, #a2acbb);
  --line: light-dark(#15181e, #4a5262);          /* strong outlines */
  --border: light-dark(#d3d9e0, #2c3340);        /* quiet dividers */
  --link: light-dark(#0b4fb3, #8db8ff);
  --focus: light-dark(#0b4fb3, #d6ef16);
  --press-bg: light-dark(#15181e, #d6ef16);       /* selected chips, buttons */
  --press-fg: light-dark(#d6ef16, #15181e);
  --head-bg: #0b0d11;
  --hero-bg: light-dark(#d6ef16, #0b0d11);
  --band-fg: light-dark(#15181e, #f4f6f8);
  --band-muted: light-dark(#2d3320, #b5bfcc);
  --band-link: light-dark(#0a2f73, #d6ef16);
  --r1-bg: #d6ef16;  --r1-fg: #15181e;
  --r2-bg: light-dark(#e7f58a, #4c5a12); --r2-fg: light-dark(#15181e, #f4f6f8);
  --r3-bg: light-dark(#f2fac0, #343d10); --r3-fg: light-dark(#15181e, #f4f6f8);
  --open: light-dark(#0a6b3a, #5fdc97);
  --soon: light-dark(#8a5a00, #ffc94d);
  --cheap: light-dark(#0a6b3a, #5fdc97);
  --note: light-dark(#5b5547, #cfc7b4);
  --note-bg: light-dark(#ece9df, #2a2820);
  --scale: linear-gradient(90deg, #0f9d7a, #e9c46a 50%, #e4572e);
  --radius: 8px;
  --radius-sm: 6px;
  --s-1: .5rem; --s-2: .75rem; --s-3: 1rem; --s-4: 1.5rem; --s-5: 2.5rem; --s-6: 4rem;
  --font-text: "Barlow", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Barlow Condensed", "Barlow", system-ui, sans-serif;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --hazard: repeating-linear-gradient(135deg, #15181e 0 12px, #d6ef16 12px 24px);
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-color: #8a93a3 transparent; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 1.0625rem/1.55 var(--font-text); font-variant-numeric: tabular-nums; overflow-x: clip; -webkit-font-smoothing: antialiased; }
::selection { background: var(--hivis); color: var(--ink); }
input, select, button { caret-color: var(--link); }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 32px); }
a { color: var(--link); text-underline-offset: .2em; text-decoration-thickness: 1.5px; }
a:hover { text-decoration-thickness: 3px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.site-header :focus-visible, .site-footer :focus-visible { outline-color: var(--hivis); }
.band :focus-visible { outline-color: var(--ink); }
:root[data-theme="dark"] .band :focus-visible { outline-color: var(--hivis); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .band :focus-visible { outline-color: var(--hivis); } }

h1, h2, h3 { font-family: var(--font-display); text-wrap: balance; text-transform: uppercase; letter-spacing: .01em; }
h1 { font-size: clamp(2.4rem, 1.3rem + 4.6vw, 4.6rem); line-height: .94; font-weight: 800; margin: var(--s-3) 0 var(--s-2); }
h2 { font-size: clamp(1.6rem, 1.3rem + 1vw, 2.1rem); line-height: 1; font-weight: 700; margin: var(--s-5) 0 var(--s-3); }
h3 { line-height: 1; font-weight: 700; }
p { text-wrap: pretty; }
main p, .band p { max-width: 68ch; }
.lead { font-size: 1.25rem; line-height: 1.4; font-weight: 500; }
.muted { color: var(--muted); font-size: .98rem; }

/* Header: ink bar, hi-vis pump mark */
.site-header { background: var(--head-bg); color: #fff; }
.site-header .wrap { display: flex; justify-content: space-between; align-items: center; padding-top: var(--s-2); padding-bottom: var(--s-2); gap: var(--s-3); flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; font: 800 1.8rem/1 var(--font-display); letter-spacing: .01em; text-transform: uppercase; text-decoration: none; color: #fff; white-space: nowrap; }
.brand svg { width: 34px; height: 34px; flex: none; }
.wordmark b { color: var(--hivis); font-weight: inherit; }
.site-header nav { display: flex; gap: 4px; }
.site-header nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 14px; border-radius: var(--radius-sm); text-decoration: none; color: #fff; font: 600 1.05rem var(--font-display); text-transform: uppercase; letter-spacing: .04em; transition: background .15s, color .15s; }
.site-header nav a:hover { background: var(--hivis); color: var(--ink); }
.theme-toggle { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; border: 2px solid #ffffff59; border-radius: var(--radius-sm); background: transparent; color: #fff; cursor: pointer; transition: background .15s, color .15s; }
.theme-toggle:hover { background: var(--hivis); color: var(--ink); border-color: var(--hivis); }
.theme-toggle svg { width: 20px; height: 20px; }
.theme-toggle .sun { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .theme-toggle .moon { display: none; } :root:not([data-theme="light"]) .theme-toggle .sun { display: inline; } }
:root[data-theme="dark"] .theme-toggle .moon { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: inline; }
.crumbs { margin: 0; font: 600 .95rem var(--font-text); color: var(--band-muted); }
.crumbs a { color: var(--band-link); text-decoration: underline; text-underline-offset: 3px; } /* underlined: colour alone is not enough */
.crumbs a:hover { text-decoration-thickness: 2px; }

/* Tables */
.scroll { overflow-x: auto; border: 2px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table.data { border-collapse: collapse; width: 100%; font-size: 1rem; }
table.data th, table.data td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
table.data thead th { font: 700 .98rem var(--font-display); text-transform: uppercase; letter-spacing: .08em; white-space: nowrap; background: var(--ink); color: #fff; border-bottom: 0; }
:root[data-theme="dark"] table.data thead th { background: var(--surface-2); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) table.data thead th { background: var(--surface-2); } }
table.data tbody tr:last-child th, table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody th { font-weight: 500; }
table.stations { min-width: 780px; }
.num { text-align: right !important; white-space: nowrap; }
.price { font: 700 1.5rem/1 var(--font-display); display: block; letter-spacing: .01em; }
.when { display: block; font-size: .85rem; color: var(--muted); }
.st-name { font-weight: 700; display: block; font-size: 1.05rem; }
.brand-name { font-size: .92rem; color: var(--muted); }
.addr { display: block; font-size: .9rem; color: var(--muted); font-weight: 400; }
.tag, .flag { display: inline-block; font: 700 .74rem var(--font-text); text-transform: uppercase; letter-spacing: .05em; padding: 2px 7px; border-radius: 3px; background: var(--note-bg); color: var(--note); vertical-align: middle; }
td.stale .price { color: var(--muted); font-weight: 500; text-decoration: line-through; text-decoration-thickness: 2px; }
.stale-flag { border: 1px dashed var(--note); }
.notice { background: var(--note-bg); color: var(--text); border: 2px dashed var(--note); padding: var(--s-2) var(--s-3); border-radius: var(--radius); font-size: .98rem; }
.site-footer { margin-top: var(--s-6); padding: var(--s-5) 0 var(--s-5); background: var(--head-bg); color: #b9c2cf; font-size: .95rem; position: relative; }
.site-footer::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 12px; background: var(--hazard); }
.site-footer .wrap { padding-top: var(--s-2); }
.site-footer a { color: var(--hivis); }
.site-footer strong { color: #fff; }
.site-footer p { max-width: 80ch; }

/* Ranks: the cheapest is hi-vis, the next two fade out */
td.rank-1 { background: var(--r1-bg); color: var(--r1-fg); } td.rank-2 { background: var(--r2-bg); color: var(--r2-fg); } td.rank-3 { background: var(--r3-bg); color: var(--r3-fg); }
td.rank-1 .price, td.rank-2 .price, td.rank-3 .price, td[class*="rank-"] .when { color: inherit; }
.badge { display: inline-block; margin-left: 6px; font: 700 .85rem/1.2 var(--font-display); letter-spacing: .05em; text-transform: uppercase; padding: 2px 7px; border-radius: 3px; background: var(--ink); color: var(--hivis); vertical-align: middle; }
:root[data-theme="dark"] .badge { background: #0b0d11; }
td .badge { margin: 4px 0 0; display: block; width: fit-content; margin-left: auto; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: var(--s-3); }
/* A price board: black title bar, then the rows */
.card { min-width: 0; overflow: hidden; border: 2px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 0 0 var(--s-2); }
.card h3 { margin: 0 0 var(--s-2); padding: 10px 16px; font-size: 1.7rem; font-weight: 800; background: var(--ink); color: #fff; display: flex; align-items: center; gap: 10px; }
:root[data-theme="dark"] .card h3 { background: #0b0d11; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .card h3 { background: #0b0d11; } }
.card ol { min-width: 0; list-style: none; margin: 0; padding: 0 var(--s-2); display: grid; gap: 6px; }
.card li { min-width: 0; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius-sm); font-size: .98rem; }
.card li .badge { margin: 0; flex: none; }
.card li .who { flex: 1; min-width: 0; line-height: 1.25; }
.card li .who strong, .card li .who .when { display: block; }
.card li .who strong { font-weight: 700; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card li .who .when { margin-top: 2px; }
.card-empty { margin: var(--s-2) 16px var(--s-1); }
.card li .amt { font: 700 1.9rem/1 var(--font-display); letter-spacing: .01em; }
.card li.rank-1 { background: var(--r1-bg); color: var(--r1-fg); padding-block: 16px; }
.card li.rank-1 .amt { font-size: 3.2rem; font-weight: 800; }
.card li.rank-2 { background: var(--r2-bg); color: var(--r2-fg); } .card li.rank-3 { background: var(--r3-bg); color: var(--r3-fg); }
.card li[class*="rank-"] .when, .card li[class*="rank-"] .save, .card li[class*="rank-"] .status { color: inherit; }
.card li[class*="rank-"] .when { opacity: .82; }

/* View tabs, radius chips, map */
.view-head { display: flex; justify-content: space-between; align-items: end; gap: var(--s-3); flex-wrap: wrap; }
.view-head h2 { margin-bottom: var(--s-2); }
.map-controls button { font: 600 1.1rem var(--font-display); text-transform: uppercase; letter-spacing: .05em; min-height: 44px; padding: 7px 20px; border: 0; background: transparent; color: var(--text); cursor: pointer; }
.map-controls { display: flex; gap: var(--s-1); flex-wrap: wrap; margin: 10px 0; }
.map-controls button { border: 2px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.map-controls button[aria-pressed=true], .chipset button[aria-pressed=true] { background: var(--press-bg); color: var(--press-fg); border-color: var(--press-bg); }
.pin-wrap { background: none; border: 0; }
/* Pins: ink text on the coloured fill (white text failed contrast on the amber and orange ends of the scale) */
.pin { display: block; width: 48px; text-align: center; font: 700 .76rem/22px var(--font-text); color: #15181e; border-radius: 5px; border: 2px solid #fff; font-variant-numeric: tabular-nums; transition: transform .12s var(--ease); }
.pin.grey { background: #e9edf1; color: #15181e; border: 2px dashed #4d5563; }
.pin.cluster { width: 56px; border-radius: 6px; line-height: 22px; }
.pin.cluster small { font-size: .62rem; font-weight: 600; margin-left: 4px; padding: 0 4px; border-radius: 3px; background: rgba(255,255,255,.55); }
.marker-cluster-small, .marker-cluster-medium, .marker-cluster-large { background: none; }
.legend { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: .92rem; flex-wrap: wrap; }
.legend .bar { width: 120px; height: 10px; border-radius: 2px; background: var(--scale); }
table.pop td { padding: 1px 8px 1px 0; font-size: .88rem; }

/* Controls: one horizontal strip */
.controls-section { margin-top: var(--s-4); }
.controls { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-5); align-items: center; margin: 0; padding: var(--s-3); background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius); }
.controls .car { flex: 1 0 100%; }
.chipset { display: flex; gap: 6px; flex-wrap: wrap; }
.chipset button { font: 600 1.15rem var(--font-display); letter-spacing: .03em; text-transform: uppercase; min-height: 44px; padding: 5px 16px; border: 2px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); cursor: pointer; transition: background .12s, color .12s; }
.chipset button:hover:not(:disabled):not([aria-pressed=true]) { background: var(--r2-bg); color: var(--r2-fg); }
.chipset button:disabled { opacity: .35; cursor: not-allowed; }
td.dist { color: var(--muted); font-size: .95rem; }

/* Search */
.search { position: relative; display: flex; gap: var(--s-1); }
.search input { flex: 1; min-width: 0; font: inherit; min-height: 48px; padding: 10px 16px; border: 2px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); }
.search input::placeholder { color: var(--muted); }
.search .go { font: 700 1.25rem var(--font-display); text-transform: uppercase; letter-spacing: .06em; padding: 0 26px; border: 2px solid var(--press-bg); border-radius: var(--radius-sm); background: var(--press-bg); color: var(--press-fg); cursor: pointer; transition: transform .15s var(--ease); }
.search .go:hover { transform: translateY(-2px); }
.header-search { flex: 1 1 220px; max-width: 380px; }
.header-search input { background: #ffffff14; border-color: #ffffff59; color: #fff; }
.header-search input::placeholder { color: #ffffffb3; }
.header-search .go { display: none; }
.hero { padding: var(--s-3) 0 var(--s-1); }
.hero-search { max-width: 680px; }
.hero-search input { font-size: 1.4rem; min-height: 64px; padding: 14px 20px; border: 3px solid var(--ink); background: #fff; color: var(--ink); }
.hero-search input::placeholder { color: #4d5563; }
.hero-search .go { font-size: 1.5rem; padding: 0 32px; border-width: 3px; }
:root[data-theme="dark"] .hero-search input { border-color: var(--hivis); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hero-search input { border-color: var(--hivis); } }
.results { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 1000; list-style: none; margin: 0; padding: 6px; background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius-sm); color: var(--text); }
.results li a { display: flex; justify-content: space-between; gap: var(--s-3); padding: 10px 12px; border-radius: 4px; text-decoration: none; color: var(--text); }
.results li a small { color: var(--muted); }
.results li.active a, .results li a:hover { background: var(--r1-bg); color: var(--r1-fg); }
.results li.active a small, .results li a:hover small { color: inherit; }
.results li.none { padding: 10px 12px; color: var(--muted); }
.linklike { font: inherit; background: none; border: 0; min-height: 44px; padding: 6px 0; color: var(--band-link); font-weight: 600; text-decoration: underline; text-underline-offset: .2em; cursor: pointer; }
.az { display: flex; flex-wrap: wrap; gap: 0; font: 700 1.5rem var(--font-display); }
.az a { display: inline-flex; align-items: center; min-width: 44px; min-height: 44px; }
body:has(.hero) .header-search { display: none; }

/* Price board on the home page: black panels, big hi-vis numerals */
.board { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: var(--s-2); max-width: 720px; margin: var(--s-4) 0 var(--s-1); padding: 0; list-style: none; }
.board li { background: var(--ink); color: var(--hivis); border-radius: var(--radius); padding: 12px 16px; }
:root[data-theme="dark"] .board li { background: #1a1e26; border: 2px solid #4a5262; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .board li { background: #1a1e26; border: 2px solid #4a5262; } }
.board small { display: block; font: 600 .95rem var(--font-display); opacity: 1; text-transform: uppercase; letter-spacing: .09em; color: #fff; }
.board b { font: 800 3rem/1 var(--font-display); letter-spacing: .01em; }

/* Home page: lowest/highest cells name the station and where it is */
td.extreme { min-width: 200px; }
td.extreme .price { font-size: 1.8rem; }
td.extreme .who { display: block; font-weight: 700; line-height: 1.3; }
td.extreme .who a { color: var(--text); }
td.extreme .who a:hover { color: var(--link); }
td.extreme .where { display: block; font-size: .88rem; color: var(--muted); line-height: 1.3; }

/* Opening status and directions */
.status { display: inline-flex; align-items: center; gap: 6px; font-size: .9rem; font-weight: 600; line-height: 1.3; }
.status::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: currentColor; flex: none; }
.status.open { color: var(--open); }
.status.soon { color: var(--soon); }
.status.closed { color: var(--note); }
.status.closed::before { background: transparent; border: 2px solid currentColor; }
.status.unknown { color: var(--muted); font-weight: 500; }
.status.unknown::before { background: transparent; border: 2px dotted currentColor; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin-top: 3px; font-weight: 400; }
a.dir { display: inline-flex; align-items: center; gap: 5px; font-size: .95rem; font-weight: 700; color: var(--link); text-decoration: none; }
a.dir:hover { text-decoration: underline; }
a.dir svg { width: 14px; height: 14px; }
a.dir.icon { flex: none; width: 44px; height: 44px; justify-content: center; border-radius: var(--radius-sm); background: var(--ink); color: var(--hivis); transition: transform .15s var(--ease); }
:root[data-theme="dark"] a.dir.icon { background: var(--hivis); color: var(--ink); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) a.dir.icon { background: var(--hivis); color: var(--ink); } }
.card li[class*="rank-"] a.dir.icon { background: var(--ink); color: var(--hivis); }
a.dir.icon:hover { transform: scale(1.08); }
a.dir.icon svg { width: 20px; height: 20px; }
.card li .who .status { white-space: normal; margin-top: 1px; }
.opts { display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; }
.check { font-size: 1rem; color: var(--muted); display: inline-flex; align-items: center; gap: 8px; cursor: pointer; min-height: 44px; }
.check input { width: 20px; height: 20px; accent-color: var(--ink); }
.pop-body { display: flex; align-items: flex-start; gap: 14px; }
.pop-info { flex: 1; min-width: 0; font-size: 1rem; line-height: 1.35; }
.pop-name { font-size: 1.15rem; }
.pop-info table.pop td { font-size: 1rem; padding: 2px 10px 2px 0; white-space: nowrap; }
@media (max-width: 700px) { .pop-info, .pop-info table.pop td { font-size: .92rem; } .pop-name { font-size: 1.05rem; } .pop-body { gap: 10px; } }

/* Your fuel, savings and freshness */
.ctl-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; min-width: 0; }
.ctl-label { font: 700 1.05rem var(--font-display); letter-spacing: .09em; text-transform: uppercase; color: var(--muted); min-width: 56px; }
table.data th.mine { color: var(--hivis); }
td.mine .price { font-size: 1.7rem; }
table.data tr.mine th, table.data tr.mine td { font-weight: 700; background: var(--r3-bg); color: var(--r3-fg); }
.yours { font: 700 .95rem/1.3 var(--font-display); letter-spacing: .06em; text-transform: uppercase; padding: 1px 8px; border-radius: 3px; background: var(--hivis); color: var(--ink); }
.save { display: block; font-size: .9rem; font-weight: 700; line-height: 1.3; color: var(--open); }
.card li .who .save { white-space: normal; }
.car { font-size: 1rem; }
.car summary { cursor: pointer; color: var(--link); font-weight: 600; width: fit-content; padding: 8px 0; }
.car-fields { display: flex; gap: var(--s-3); flex-wrap: wrap; margin-top: 6px; }
.car-fields label { display: flex; flex-direction: column; gap: 4px; font-size: .9rem; color: var(--muted); }
.car-fields input { width: 130px; font: inherit; min-height: 44px; padding: 6px 10px; border: 2px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); }
.fresh { margin: 2px 0 0; font-weight: 500; }
.fresh::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--ink); margin-right: 8px; vertical-align: middle; }
:root[data-theme="dark"] .fresh::before { background: var(--hivis); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .fresh::before { background: var(--hivis); } }
.fresh.late { color: var(--note); font-weight: 700; }
.fresh.late::before { background: transparent; border: 2px solid var(--note); animation: none; }
.band .muted { color: var(--band-muted); }

/* Price trend charts */
.trends { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: var(--s-3); }
.trend { border: 2px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: var(--s-3) var(--s-3) var(--s-2); min-width: 0; }
.trend-title { margin: 0 0 var(--s-1); font-size: 1.5rem; }
.trend-title .muted { font: 500 .95rem var(--font-text); text-transform: none; letter-spacing: 0; }
.trend-chart { width: 100%; height: auto; display: block; }
.tr-grid { stroke: var(--border); stroke-width: 1; }
.tr-text { fill: var(--muted); font: 600 11px var(--font-text); font-variant-numeric: tabular-nums; }
.tr-line { fill: none; stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.tr-line.tr-med, .key.tr-med { stroke: var(--text); background: var(--text); }
.tr-line.tr-min, .key.tr-min { stroke: var(--link); background: var(--link); }
.tr-dot { stroke: var(--surface); stroke-width: 1.5; }
.tr-dot.tr-med { fill: var(--text); }
.tr-dot.tr-min { fill: var(--link); }
.trend-legend { display: flex; align-items: center; gap: 6px; margin: 2px 0; font-size: .92rem; color: var(--muted); }
.trend-legend .key { display: inline-block; width: 16px; height: 4px; border-radius: 1px; margin-left: 8px; }
.trend-legend .key:first-child { margin-left: 0; }
.trend p.muted { margin: 4px 0 8px; }
.trends.single { grid-template-columns: 1fr; }
.source-note { margin: var(--s-2) 0 0; font-size: .92rem; max-width: 70ch; }
.trends-sub { margin: var(--s-4) 0 var(--s-2); }

/* Hero field: the whole band is hi-vis (charcoal at night), edged with a roadworks hazard stripe */
.band { position: relative; margin: 0 calc(50% - 50vw); padding: var(--s-4) calc(50vw - 50%) var(--s-5); background: var(--hero-bg); color: var(--band-fg); }
.band::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 12px; background: var(--hazard); }
.band h1 { margin-top: var(--s-2); }
.band .lead { color: var(--band-fg); }
.band a { color: var(--band-link); }
.hero.band { padding-top: var(--s-5); padding-bottom: calc(var(--s-6) + 6px); }
.hero.band h1 { font-size: clamp(3rem, 1.4rem + 7vw, 6.4rem); max-width: 13ch; line-height: .88; }
.hero.band .lead { max-width: 48ch; }
.hero.band .board li { border: 0; }
.page-head.band { margin-bottom: 0; padding-bottom: calc(var(--s-5) + 6px); }
.page-head.band h1 { font-size: clamp(2.4rem, 1.2rem + 4.4vw, 4.4rem); max-width: 20ch; }

/* Section rhythm */
main > section { margin-top: var(--s-5); }
main > section > h2, main > section .view-head h2 { margin-top: 0; }

/* One authored moment: the hero field is unveiled left to right like a sign, once */
@media (prefers-reduced-motion: no-preference) {
  .band { animation: unveil .8s var(--ease) backwards; }
  .band > * { animation: rise .6s var(--ease) .15s backwards; }
  .fresh::before { animation: blink 2.4s ease-in-out infinite; }
}
@keyframes unveil { from { clip-path: inset(0 100% 0 0); } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
@keyframes blink { 50% { opacity: .35; } }

/* ===== Place page layout ===== */
/* Petrol and diesel: two big boards side by side with equal weight. The map is a quiet strip beneath them. */
main > .top-section { margin-top: var(--s-4); }
.top-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s-3); align-items: stretch; }
.top-cards, .top-cards .cards { display: contents; }
.top-cards .card { align-self: start; }
/* Map panel: fuel and distance chips, a big map, and the cheapest stations beside it. One outlined frame, no shadows. */
.map-panel { grid-column: 1 / -1; order: 3; background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.map-bar { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-5); align-items: center; padding: var(--s-2) var(--s-3); border-bottom: 2px solid var(--line); }
.map-body { display: grid; grid-template-columns: minmax(0, 1fr); }
.mini-wrap { position: relative; height: 340px; }
.mini-map { position: absolute; inset: 0; overflow: hidden; z-index: 0; background: var(--surface); } 
.mini-map.leaflet-grab { cursor: crosshair; }
.map-results { padding: var(--s-3); border-top: 1px solid var(--border); min-width: 0; }
.map-results h3 { margin: 0; font: 700 1.3rem var(--font-display); text-transform: uppercase; letter-spacing: .04em; }
.map-results p { margin: 2px 0 var(--s-2); font-size: .95rem; }
.map-results ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.mr-row { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0 var(--s-2); align-items: center; width: 100%; min-height: 44px; padding: 6px 10px; text-align: left; font: inherit; color: var(--text); background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius-sm); cursor: pointer; }
.mr-row.rank-1 { background: var(--r1-bg); color: var(--r1-fg); }
.mr-row.rank-2 { background: var(--r2-bg); color: var(--r2-fg); }
.mr-row.rank-3 { background: var(--r3-bg); color: var(--r3-fg); }
.mr-row[class*="rank-"] .status { color: inherit; }
.mr-item { display: flex; gap: 6px; align-items: stretch; }
.mr-item .mr-row { flex: 1; width: auto; min-width: 0; }
.mr-item .acts { align-self: center; }
.mr-row:hover { outline: 2px solid var(--line); outline-offset: 1px; }
.mr-price { font: 700 1.7rem/1 var(--font-display); font-variant-numeric: tabular-nums; min-width: 4.2ch; }
.mr-who { display: grid; min-width: 0; font-size: .9rem; line-height: 1.25; }
.mr-who strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mr-note { margin-top: var(--s-2); }
/* Stacked layout: the fuel and distance chips sit between the map and the list they control, not far above the map. */
@media (max-width: 899px) {
  .map-panel { display: flex; flex-direction: column; }
  .map-body { display: contents; }
  .mini-wrap { order: 1; }
  .map-bar { order: 2; border-bottom: 0; border-top: 2px solid var(--line); }
  .map-results { order: 3; }
}
@media (min-width: 900px) {
  .map-body { grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); }
  .mini-wrap { height: 520px; }
  .map-results { border-top: 0; border-left: 1px solid var(--border); height: 520px; overflow-y: auto; }
}
.btn { display: inline-flex; align-items: center; justify-content: center; font: 700 1.15rem var(--font-display); text-transform: uppercase; letter-spacing: .05em; min-height: 44px; padding: 8px 18px; border: 0; border-radius: var(--radius-sm); background: var(--press-bg); color: var(--press-fg); text-decoration: none; cursor: pointer; transition: transform .15s var(--ease); }
.btn:hover { transform: translateY(-2px); }
.view-all { grid-column: 1 / -1; order: 2; margin: 0; }
.minor-row { margin-top: var(--s-3); }
.card.phone-only { display: none; }
.minor-row .cards { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }

/* Trend and summary side by side on wide screens */
@media (min-width: 1040px) {
  main:has(#r-trend) { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); column-gap: var(--s-4); }
  main:has(#r-trend) > * { grid-column: 1 / -1; }
  main:has(#r-trend) > section:has(#r-trend) { grid-column: 1; }
  main:has(#r-trend) > section:has(#r-summary) { grid-column: 2; }
}
@media (max-width: 1039px) { .top-cards .card { align-self: stretch; } }
@media (max-width: 700px) {
  /* Room for the whole "Town or postcode" placeholder beside the Search button */
  .hero-search input { font-size: 1.25rem; padding-inline: 14px; }
  .hero-search .go { font-size: 1.3rem; padding: 0 16px; }
  main > section { margin-top: var(--s-4); }
  .top-grid { grid-template-columns: 1fr; gap: var(--s-2); }
  /* One column: the fuel the visitor chose comes first, so choosing Diesel doesn't leave Petrol on top. */
  .top-cards .card.mine { order: -1; }
  .card.phone-only { display: block; }
  .card.phone-hide { display: none; }
  .mini-wrap { height: 420px; }
  .view-all .btn { width: 100%; }
  .band { padding-top: var(--s-3); padding-bottom: calc(var(--s-4) + 6px); }
  .hero.band { padding-top: var(--s-4); padding-bottom: calc(var(--s-5) + 6px); }
  .card li.rank-1 .amt { font-size: 2.6rem; }
  .card li .amt { font-size: 1.7rem; }
  .board b { font-size: 2rem; }
  .board li { padding: 10px 12px; }
  table.data th, table.data td { padding: 10px 12px; }
  .site-header .wrap { gap: var(--s-1) var(--s-2); }
  .brand { flex: 1; }
  .theme-toggle { order: 1; }
  .site-header nav { order: 2; flex: 1 1 100%; margin-left: -14px; }
  .header-search { order: 3; flex: 1 1 100%; max-width: none; }
  .controls { gap: var(--s-2); }
  .chipset { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; padding-bottom: 4px; scrollbar-width: none; }
  .chipset button { flex: none; white-space: nowrap; }
  .ctl-row { display: grid; justify-items: start; gap: 4px; }
  .stations-wrap { border: 0; background: none; overflow: visible; }
  table.stations, table.stations tbody { display: block; min-width: 0; }
  table.stations thead { display: none; }
  table.stations tr { display: grid; grid-template-columns: 1fr 1fr; margin-bottom: var(--s-3); border: 2px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
  table.stations tbody th { grid-column: 1 / -1; padding: 12px 14px 2px; border: 0; order: -2; }
  table.stations td { border: 0; border-top: 1px solid var(--border); text-align: left !important; }
  table.stations td.dist { grid-column: 1 / -1; order: -1; padding: 0 14px 10px; border: 0; }
  table.stations td.none { display: none; }
  /* Home UK price summary: one card per fuel, lowest and highest full width, then median and stations side by side */
  .summary-wrap { border: 0; background: none; overflow: visible; }
  table.summary, table.summary tbody { display: block; }
  table.summary thead { display: none; }
  table.summary tr { display: grid; grid-template-columns: 1fr 1fr; margin-bottom: var(--s-3); border: 2px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
  table.summary tbody th { grid-column: 1 / -1; padding: 12px 14px 2px; border: 0; font-weight: 700; }
  table.summary td { border: 0; border-top: 1px solid var(--border); }
  table.summary td.extreme { grid-column: 1 / -1; }
  table.summary td.mid { order: 1; }
  table.stations td[data-label]::before, table.summary td[data-label]::before { content: attr(data-label); display: block; font: 700 .9rem var(--font-display); text-transform: uppercase; letter-spacing: .08em; color: inherit; opacity: .75; margin-bottom: 2px; }
  table.stations td .badge { margin-left: 0; }
}

/* Super unleaded and premium diesel: the same board, smaller and quieter */
.card.minor { background: transparent; border-width: 1px; border-color: var(--border); padding-bottom: var(--s-1); }
.card.minor h3 { background: transparent; color: var(--muted); font-size: 1.15rem; padding: 10px 12px 4px; }
.card.minor ol { padding: 0 var(--s-1); }
.card.minor li { font-size: .9rem; padding: 6px 8px; }
.card.minor li .amt { font-size: 1.3rem; }
.card.minor li.rank-1 { padding-block: 8px; }
.card.minor li.rank-1 .amt { font-size: 1.5rem; }
.card.minor li .save, .card.minor li .status { display: none; }
.card.minor li a.dir.icon { width: 34px; height: 34px; }
.card.minor li a.dir.icon svg { width: 16px; height: 16px; }

/* Table row hover */
table.stations tbody tr:hover th { background: var(--surface-2); }
table.stations tbody tr:hover td:not([class*="rank-"]) { background: var(--surface-2); }
@media (hover: none) { table.stations tbody tr:hover th, table.stations tbody tr:hover td:not([class*="rank-"]) { background: transparent; } }

/* List on map pin groups: opens beside the pin after a short hover, pins open on click. Follows the theme. */
.cluster-pop { position: absolute; z-index: 1001; padding: 10px; opacity: 0; transform: translateY(2px); transition: opacity .14s ease, transform .14s ease; pointer-events: auto; }
.cluster-pop.show { opacity: 1; transform: none; }
.cluster-pop::before { content: ""; position: absolute; top: var(--ay, 20px); width: 11px; height: 11px; background: var(--line); transform: rotate(45deg); }
.cluster-pop.side-right::before { left: 5px; }
.cluster-pop.side-left::before { right: 5px; transform: rotate(225deg); }
.cluster-pop.side-below::before { display: none; }
.cluster-pop .cp-card { position: relative; width: 252px; overflow-y: auto; background: var(--surface); color: var(--text); border: 2px solid var(--line); border-radius: var(--radius); }
.cluster-pop .cp-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 8px 7px 12px; font: 700 .8rem var(--font-text); color: #fff; background: var(--ink); }
.cluster-pop .cp-close { display: none; flex: none; width: 44px; height: 44px; margin: -8px -8px -7px 0; padding: 0; border: 0; background: transparent; color: #fff; font-size: 1.5rem; line-height: 1; cursor: pointer; }
.cluster-pop .cp-close:hover { background: #ffffff2e; }
.cluster-pop.pinned .cp-close { display: block; }
.cluster-pop .cp-row { display: grid; grid-template-columns: 56px 1fr; gap: 0 8px; align-items: baseline; width: 100%; padding: 7px 12px; border: 0; border-bottom: 1px solid var(--border); background: var(--surface); color: var(--text); text-align: left; font: inherit; cursor: pointer; }
.cluster-pop .cp-row:last-of-type { border-bottom: 0; }
.cluster-pop .cp-row:hover, .cluster-pop .cp-row:focus-visible { background: var(--r3-bg); color: var(--r3-fg); }
.cluster-pop .cp-row:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; }
.cluster-pop .cp-price { font: 700 1.2rem var(--font-display); font-variant-numeric: tabular-nums; }
.cluster-pop .cp-row.first .cp-price { background: var(--hivis); color: var(--ink); padding: 0 4px; margin: 0 -4px; }
.cluster-pop .cp-name { font: 700 .9rem/1.25 var(--font-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cluster-pop .cp-meta { grid-column: 2; font: 400 .8rem/1.3 var(--font-text); color: var(--muted); }
.cluster-pop .cp-more { padding: 6px 12px; font: 400 .8rem var(--font-text); color: var(--muted); background: var(--surface-2); border-top: 1px solid var(--border); }
@media (prefers-reduced-motion: reduce) { .cluster-pop { transition: none; transform: none; } .pin { transition: none; } }
/* Pin drop: choose your own spot on the map. Hi-vis label with an ink outline; same chip and button styles as the controls. */
.pin-btn { font: 600 1.15rem var(--font-display); letter-spacing: .03em; text-transform: uppercase; min-height: 44px; min-width: 44px; padding: 5px 16px; border: 2px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); cursor: pointer; transition: background .12s, color .12s; }
.pin-btn:hover { background: var(--r2-bg); color: var(--r2-fg); }
.mini-wrap.pin-mode .mini-map { cursor: crosshair; outline: 4px solid var(--hivis); outline-offset: -4px; }
.you-pin { display: block; width: 88px; height: 46px; position: relative; }
.you-pin-label { display: block; box-sizing: border-box; height: 32px; line-height: 28px; text-align: center; font: 700 .95rem var(--font-display); letter-spacing: .05em; text-transform: uppercase; background: var(--hivis); color: var(--ink); border: 2px solid var(--ink); border-radius: var(--radius-sm); }
.you-pin::after { content: ""; position: absolute; left: 50%; top: 31px; width: 12px; height: 12px; margin-left: -6px; background: var(--ink); transform: rotate(45deg); }
.leaflet-marker-draggable .you-pin { cursor: grab; }
.pin-wrap:focus { outline: none; }
.leaflet-marker-icon:focus-visible .you-pin-label { outline: 3px solid var(--focus); outline-offset: 2px; }
.cluster-pop .cp-dist { display: none; }
.cluster-pop:not(.pinned) .cp-card { width: 244px; }
.cluster-pop:not(.pinned) .cp-row { grid-template-columns: 56px 1fr auto; padding: 6px 10px; align-items: center; }
.cluster-pop:not(.pinned) .cp-dist { display: inline; font: 400 .78rem var(--font-text); color: var(--muted); white-space: nowrap; }
.cluster-pop:not(.pinned) .cp-meta { display: none; }
.cluster-pop:not(.pinned) .cp-head { padding: 6px 12px; }
.cluster-pop:not(.pinned) .cp-more { padding: 5px 12px; }

/* Leaflet controls, tooltips and popups follow the theme. No shadows. */
.leaflet-bar { border: 2px solid var(--line); border-radius: var(--radius-sm); box-shadow: none; }
.leaflet-bar a, .leaflet-touch .leaflet-bar a { width: 44px; height: 44px; line-height: 44px; background: var(--surface); color: var(--text); border-bottom: 1px solid var(--border); }
.leaflet-bar a:hover, .leaflet-bar a:focus-visible { background: var(--r2-bg); color: var(--r2-fg); }
.leaflet-touch .leaflet-bar a:first-child, .leaflet-touch .leaflet-bar a:last-child { border-radius: 0; }
.leaflet-container .leaflet-control-attribution { background: var(--surface); color: var(--muted); }
.leaflet-container .leaflet-control-attribution a { color: var(--link); }
.leaflet-tooltip { background: var(--ink); color: #fff; font: 700 .82rem var(--font-text); padding: 4px 8px; border: 0; border-radius: 4px; box-shadow: none; }
.leaflet-tooltip-top:before { border-top-color: var(--ink); }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--surface); color: var(--text); box-shadow: none; }
.leaflet-popup-content-wrapper { border: 2px solid var(--line); border-radius: var(--radius-sm); }
.leaflet-container a.leaflet-popup-close-button { width: 44px; height: 44px; font-size: 26px; line-height: 44px; color: var(--muted); }
/* Dark mode: the street tiles are darkened so the map is not the brightest thing on the page */
:root[data-theme="dark"] .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.92) contrast(.9); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.92) contrast(.9); } }
/* The dashed search circle is ink on the light map; on the dark map it would vanish, so it turns white. */
:root[data-theme="dark"] .search-ring { stroke: #fff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .search-ring { stroke: #fff; } }

/* All stations: a plain list under its heading, with a one-line note on how it is ordered. */
#all-stations .view-head { display: block; }
#r-listhead { margin-bottom: var(--s-2); }
.meta a.dir { min-height: 44px; }

/* Home hero: headline and search on the left, the UK price board stacked on the right */
@media (min-width: 900px) {
  .hero.band { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(260px, 1fr); column-gap: var(--s-5); align-content: center; }
  .hero.band > * { grid-column: 1; }
  .hero.band > .board { grid-column: 2; grid-row: 1 / span 6; align-self: center; grid-template-columns: 1fr; max-width: none; margin: 0; }
  .hero.band .board li { padding: 14px 20px; }
  .hero.band .board b { font-size: 4.6rem; }
  .hero.band h1 { font-size: clamp(3rem, 1rem + 5vw, 5.4rem); max-width: 12ch; }
}

/* Equal-height boards; the minor fuels stay quiet (no full hi-vis) so petrol and diesel lead */
.top-cards .card { align-self: stretch; }
.card.minor li.rank-1 { background: var(--r2-bg); color: var(--r2-fg); }
.card.minor li.rank-2 { background: var(--r3-bg); color: var(--r3-fg); }
.card.minor li.rank-3 { background: transparent; color: var(--text); }
.card.minor li[class*="rank-"] a.dir.icon { background: var(--ink); color: var(--hivis); }
:root[data-theme="dark"] .card.minor li[class*="rank-"] a.dir.icon { background: var(--hivis); color: var(--ink); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .card.minor li[class*="rank-"] a.dir.icon { background: var(--hivis); color: var(--ink); } }
.pin-stack { display: grid; gap: 6px; justify-items: end; margin: 10px 10px 0 0; }
.pin-stack .btn { border: 2px solid var(--line); }
.pin-map-btn { background: var(--press-bg); color: var(--press-fg); border-color: var(--line); }
.pin-stack .pin-btn:not(.pin-map-btn) { background: var(--surface); color: var(--text); }
/* Skip link: off screen until a keyboard user tabs to it, then a hi-vis button at the top left. */
.skip-link { position: absolute; left: 8px; top: -80px; z-index: 1000; display: inline-flex; align-items: center; min-height: 44px; padding: 8px 18px; font: 700 1.15rem var(--font-display); text-transform: uppercase; letter-spacing: .05em; background: var(--hivis); color: var(--ink); border-radius: var(--radius-sm); text-decoration: none; }
.skip-link:focus { top: 8px; outline-color: var(--ink); }
#main:focus { outline: none; }
.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; }

.pin-map-btn:hover { background: var(--press-bg); color: var(--press-fg); }
.pin-map-btn[hidden] { display: none; }
.map-locate-btn { background: var(--surface); color: var(--text); margin-top: 6px; }
.map-locate-btn:hover { background: var(--r2-bg); color: var(--r2-fg); }
.map-locate-btn[hidden] { display: none; }
.locate-stack { display: grid; gap: 4px; justify-items: end; margin: 6px 10px 0 0; }
.locate-stack .map-locate-btn { margin: 0; }

/* Share buttons: the page (in the controls strip) and one station (beside Directions) */
.share-page { display: inline-flex; align-items: center; gap: 8px; }
.share-page svg, .share-st svg { width: 18px; height: 18px; flex: none; }
.acts { display: flex; flex-direction: column; gap: 4px; flex: none; }
.share-st { display: inline-flex; align-items: center; gap: 5px; font: 700 .95rem var(--font-text); color: var(--link); background: none; border: 0; padding: 0; min-height: 44px; cursor: pointer; }
.share-st:hover { text-decoration: underline; }
.share-st.icon { width: 44px; justify-content: center; padding: 0; border: 2px solid currentColor; border-radius: var(--radius-sm); color: inherit; }
.share-st.icon:hover { text-decoration: none; transform: scale(1.08); }
.card.minor li .share-st.icon { width: 34px; min-height: 34px; height: 34px; }
.card.minor li .share-st.icon svg { width: 15px; height: 15px; }
/* The smaller boards keep 34px icons but a 44px touch area; the wider gap stops the two areas overlapping. */
.card.minor .acts { gap: 10px; }
.card.minor li a.dir.icon, .card.minor li .share-st.icon { position: relative; }
.card.minor li a.dir.icon::after, .card.minor li .share-st.icon::after { content: ""; position: absolute; inset: -5px; }
@media (max-width: 700px) { .controls .share-page { justify-self: start; } }
/* Once a location is drawn, the locate button becomes "Not here? Drop a pin" and replaces the plain Drop a pin button */
.mini-wrap.located .pin-stack [data-act=start] { display: none; }
.mini-wrap.located.pin-mode .locate-stack { display: none; }
