:root {
  color-scheme: light;
  --brand-cobalt: #234dc9;
  --brand-blue: #6791f4;
  --bg: #f4f7fd;
  --paper: #fff;
  --input: #edf2fa;
  --ink: #111e39;
  --muted: #4b5c7a;
  --line: #dce5f2;
  --field-line: #bbcbe2;
  --accent: #234dc9;
  --accent-line: #aec3f6;
  --accent-hover: #dae6ff;
  --focus: #2454dc;
  --tint: #e8f0ff;
  --row-highlight: #f1f6ff;
  --blue: #215fa9;
  --blue-tint: #e7f2ff;
  --slate-blue: #43577d;
  --action: #234dc9;
  --action-hover: #193da9;
  --on-action: #fff;
  --floating: #192c50;
  --on-floating: #fff;
  --warning: #fff3e2;
  --warning-text: #79401a;
  --shadow-low: #142a5509;
  --shadow-float: #142a552e;
  --shadow-accent: #234dc930;
  --shadow-modal: #111e3958;
  --scrim: #111e39b8;
  --logo-filter: none;
  --data-up: #a62946;
  --data-down: #167450;
  --data-flat: #6b7890;
  --scroll-track: #e8eef9;
  --scroll-thumb: #b8c8df;
  --scroll-thumb-hover: #8fa8c8;
  --display: "Manrope", "Segoe UI", system-ui, sans-serif;
  --body: "Inter", "Segoe UI", system-ui, sans-serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #10192b;
  --paper: #18243b;
  --input: #21314d;
  --ink: #eff4ff;
  --muted: #adbeda;
  --line: #304364;
  --field-line: #4d6389;
  --accent: #a8c2ff;
  --accent-line: #4b68a0;
  --accent-hover: #2a4380;
  --focus: #80a5ff;
  --tint: #233864;
  --row-highlight: #1e3052;
  --blue: #9dcdff;
  --blue-tint: #203b60;
  --slate-blue: #b1c7fa;
  --action: #a8c2ff;
  --action-hover: #ccdbff;
  --on-action: #122652;
  --floating: #273e68;
  --warning: #392920;
  --warning-text: #ffd6a6;
  --shadow-low: #0000001f;
  --shadow-float: #0000004a;
  --shadow-accent: #6e9aff32;
  --shadow-modal: #00000080;
  --scrim: #080e1cc0;
  --logo-filter: brightness(0) invert(.94);
  --data-up: #ff9bad;
  --data-down: #75d9ae;
  --data-flat: #a5b6d4;
  --scroll-track: #142036;
  --scroll-thumb: #3b5277;
  --scroll-thumb-hover: #5d7ba7;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 1rem/1.5 var(--body); }
html, body { scrollbar-color: var(--scroll-thumb) var(--scroll-track); scrollbar-width: thin; }
* { scrollbar-color: var(--scroll-thumb) var(--scroll-track); scrollbar-width: thin; }
*::-webkit-scrollbar { width: .7rem; height: .7rem; }
*::-webkit-scrollbar-track { background: var(--scroll-track); border-radius: 999px; }
*::-webkit-scrollbar-thumb {
  background: var(--scroll-thumb);
  border: 2px solid var(--scroll-track);
  border-radius: 999px;
}
*::-webkit-scrollbar-thumb:hover { background: var(--scroll-thumb-hover); }
*::-webkit-scrollbar-corner { background: var(--scroll-track); }
html:not([data-js]) :is(.controls, .sort-field, .qr-legend, .station-fuel-qr, .stat-qr) { display: none; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3, strong { font-family: var(--display); }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button, select { cursor: pointer; }
button:disabled { cursor: default; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.hidden { display: none !important; }
.skip-link:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.skip-link:focus { position: fixed; z-index: 5; top: .5rem; left: .5rem; padding: .75rem; background: var(--paper); }
.shell { width: min(100% - 5rem, 84rem); margin-inline: auto; }

.topbar {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.nav { min-height: 4.5rem; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 1.5rem; }
.brand { display: inline-flex; align-items: center; justify-self: start; min-height: 2.75rem; }
.brand img, .footer-brand img { display: block; height: auto; filter: var(--logo-filter); }
.brand img { width: clamp(8.5rem, 17vw, 11.5rem); }
.header-actions { display: flex; align-items: center; justify-content: end; gap: .85rem; }
.updated-status { position: relative; z-index: 2; }
.updated-pill { display: block; min-height: 2.75rem; padding: .55rem .15rem; border: 0; background: transparent; font-size: .85rem; font-weight: 650; color: var(--muted); text-decoration: underline dotted; text-underline-offset: .24em; }
.updated-tooltip {
  position: absolute;
  top: 100%;
  right: 0;
  width: max-content;
  max-width: min(18rem, calc(100vw - 2rem));
  padding: .65rem .8rem;
  border-radius: .55rem;
  background: var(--floating);
  color: var(--on-floating);
  box-shadow: 0 4px 14px var(--shadow-float);
  font-size: .875rem;
  visibility: hidden;
  opacity: 0;
  transition: opacity .16s, visibility .16s;
}
.updated-status:not([data-dismissed]) .updated-pill:is(:focus-visible, [aria-expanded="true"]) + .updated-tooltip { visibility: visible; opacity: 1; }
@media (hover: hover) {
  .updated-status:not([data-dismissed]):hover .updated-tooltip { visibility: visible; opacity: 1; }
}
.theme-toggle[hidden] { display: none; }
.theme-toggle {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  place-items: center;
  flex: none;
  width: 5rem;
  height: 2.75rem;
  padding: .15rem;
  border: 1px solid var(--field-line);
  border-radius: 999px;
  background: var(--input);
  color: var(--muted);
  isolation: isolate;
}
.theme-toggle::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: .2rem auto .2rem .2rem;
  width: calc(50% - .2rem);
  border-radius: 999px;
  background: var(--tint);
  box-shadow: inset 0 0 0 1px var(--accent-line);
  transition: transform .22s ease;
}
.theme-toggle[aria-pressed="true"]::before { transform: translateX(100%); }
.theme-toggle:hover { border-color: var(--accent); }
.theme-sun { font: 1.3rem/1 system-ui, sans-serif; }
.theme-moon { width: .94rem; height: .94rem; border-radius: 50%; box-shadow: inset .29rem -.15rem currentColor; transform: rotate(-16deg); }
.theme-toggle:not([aria-pressed="true"]) .theme-sun, .theme-toggle[aria-pressed="true"] .theme-moon { color: var(--accent); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  min-height: 2.75rem;
  padding: .55rem .95rem;
  border: 1px solid transparent;
  border-radius: .7rem;
  font-size: .875rem;
  font-weight: 750;
  transition: background .2s, border-color .2s, color .2s, transform .2s, box-shadow .2s;
}
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn-primary { background: var(--action); color: var(--on-action); }
.btn-primary:hover { background: var(--action-hover); box-shadow: 0 5px 22px var(--shadow-accent); }
.btn-outline { background: var(--paper); border-color: var(--line); color: var(--ink); }
.btn-outline:hover:not(:disabled, [aria-disabled="true"]) { background: var(--tint); border-color: var(--accent-line); }
.btn:is(:disabled, [aria-disabled="true"]) { opacity: .53; cursor: default; }
.btn-text { color: var(--accent); background: transparent; padding-inline: .35rem; }
.btn-text:hover { text-decoration: underline; }
.icon { position: relative; display: inline-block; flex: none; width: 1rem; height: 1rem; }
.icon-drop, .icon-pin { width: .7rem; height: .7rem; border: 1.5px solid currentColor; transform: rotate(-45deg); border-radius: 65% 0 65% 65%; }
.icon-pin { transform: rotate(135deg) translate(.06rem, -.06rem); }
.icon-pin::after { content: ""; position: absolute; inset: 2px; border-radius: 50%; background: currentColor; }
.icon-target { border: 1.5px solid currentColor; border-radius: 50%; }
.icon-target::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: currentColor; }
.icon-search { width: .8rem; height: .8rem; border: 1.5px solid currentColor; border-radius: 50%; margin-right: .15rem; }
.icon-search::after { content: ""; position: absolute; left: 89%; top: 88%; height: .32rem; width: 1.5px; border-radius: 1px; background: currentColor; transform: rotate(-45deg); transform-origin: top; }
.icon-qr { width: .88rem; height: .88rem; background: linear-gradient(currentColor 0 0) 0 0 / 40% 40%, linear-gradient(currentColor 0 0) 100% 0 / 40% 40%, linear-gradient(currentColor 0 0) 0 100% / 40% 40%, linear-gradient(currentColor 0 0) 100% 100% / 25% 25%; background-repeat: no-repeat; }
.icon-grid { width: .7rem; height: .7rem; border: 1px solid currentColor; border-radius: 2px; background: linear-gradient(currentColor 0 0) center / 1px 100%, linear-gradient(currentColor 0 0) center / 100% 1px; background-repeat: no-repeat; }
.icon-filter { height: .8rem; background: linear-gradient(currentColor 0 0) center top / 100% 1.5px, linear-gradient(currentColor 0 0) center / 72% 1.5px, linear-gradient(currentColor 0 0) center bottom / 40% 1.5px; background-repeat: no-repeat; }

main { padding-top: 2.1rem; }
.masthead {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 1.25rem 2rem;
  padding: .75rem 0 1.2rem;
  border-bottom: 1px solid var(--accent-line);
  scroll-margin-top: 1rem;
}
.eyebrow { color: var(--accent); font-size: .78rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.masthead-kicker { display: flex; align-items: center; gap: .55rem; margin-bottom: .5rem; }
.masthead-kicker::before { content: ""; width: 1.45rem; height: 2px; background: var(--brand-blue); }
.masthead h1 { font-size: clamp(2.15rem, 4.7vw, 4.25rem); line-height: 1.03; letter-spacing: -.055em; font-weight: 800; }
.masthead-search { justify-self: end; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

.overview, .station-board { margin-top: 2rem; scroll-margin-top: 1.25rem; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: .3rem 1rem; margin-bottom: .85rem; }
.section-heading h1, .section-heading h2 { font-size: clamp(1.55rem, 2.8vw, 2.25rem); line-height: 1.12; letter-spacing: -.055em; }
.section-heading p { color: var(--muted); font-size: .92rem; }
.stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .85rem; }
.stat {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: .35rem;
  padding: .95rem 1.1rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 1rem;
  box-shadow: 0 3px 8px var(--shadow-low);
  animation: rise .55s ease-out both;
}
.stat:nth-child(2) { animation-delay: .06s; }
.stat:nth-child(3) { animation-delay: .12s; }
.stat:nth-child(4) { animation-delay: .18s; }
.stat:nth-child(5) { animation-delay: .24s; }
.stat-network { background: var(--tint); border-color: var(--accent-line); }
.stat-label { display: flex; align-items: center; gap: .55rem; color: var(--accent); font-size: .875rem; font-weight: 750; }
.stat-label:has(.stat-qr) { padding-inline-end: 1.2rem; font-size: .78rem; line-height: 1.3125rem; }
.stat strong { font-size: clamp(1.7rem, 3vw, 2.25rem); line-height: 1.1; letter-spacing: -.055em; font-variant-numeric: tabular-nums; }
.stat-value { display: flex; align-items: baseline; gap: .3rem; }
.stat-value > span { font-size: .82rem; color: var(--muted); white-space: nowrap; }
.stat-foot { color: var(--muted); font-size: .82rem; line-height: 1.32; overflow-wrap: anywhere; }
.stat:has(.stat-station-link, .stat-qr) { position: relative; }
.stat:has(.stat-station-link):is(:hover, :focus-within) { border-color: var(--accent); }
.stat-station { display: grid; gap: .25rem; }
.stat-station-link, .stat-station-name { color: var(--ink); font-weight: 750; }
.stat-station-link { text-decoration: underline; text-decoration-color: var(--accent-line); text-underline-offset: .17em; }
.stat-station-link span { color: var(--accent); }
.stat-station-link::after { position: absolute; inset: 0; content: ""; border-radius: 1rem; }
.stat-qr { position: absolute; z-index: 1; inset-block-start: .1rem; inset-inline-end: .15rem; width: 2.75rem; height: 2.75rem; padding: 0; background: transparent; border-color: transparent; color: var(--accent); }
.stat-qr .icon { width: 1rem; height: 1rem; }
.stat-station-services { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .55rem; margin-top: .25rem; }
.stat-hours { color: var(--ink); font-variant-numeric: tabular-nums; }
.stat-station-services .badge { white-space: normal; }

.market-movements { margin-top: 1.5rem; }
.movement-panel { border: 1px solid var(--line); border-radius: 1rem; background: var(--paper); }
.movement-heading { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: .85rem; padding: .9rem 1.15rem; cursor: pointer; list-style: none; }
.movement-heading::-webkit-details-marker { display: none; }
.movement-heading > span:first-child { display: grid; }
.movement-heading strong { color: var(--ink); font-size: 1.25rem; letter-spacing: -.035em; }
.movement-heading span span { color: var(--muted); font-size: .875rem; }
.movement-latest { color: var(--accent); font-size: .875rem; font-weight: 750; }
.movement-chevron { width: .55rem; height: .55rem; border: solid var(--accent); border-width: 0 2px 2px 0; transform: rotate(45deg) translateY(-2px); }
.movement-panel[open] .movement-chevron { transform: rotate(225deg); }
.movement-content { border-top: 1px solid var(--line); padding: .8rem 1.15rem 1rem; }
.movement-controls, .movement-fuels { display: flex; flex-wrap: wrap; gap: .45rem; }
.movement-controls { align-items: center; justify-content: space-between; margin-bottom: .45rem; }
.movement-fuels [aria-pressed="true"] { color: var(--accent); background: var(--tint); border-color: var(--accent-line); }
.movement-range { flex-direction: row; align-items: center; }
.movement-explorer { margin-block: .9rem .45rem; }
.movement-readout { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .7rem .85rem; border-radius: .7rem; background: var(--tint); }
.movement-selection { display: grid; gap: .15rem; color: var(--muted); font-size: .8rem; }
.movement-selection strong { color: var(--ink); font-size: clamp(1.35rem, 3vw, 1.8rem); line-height: 1.1; font-variant-numeric: tabular-nums; letter-spacing: -.035em; }
.movement-selection [data-direction="increase"] { color: var(--data-up); }
.movement-selection [data-direction="rollback"] { color: var(--data-down); }
.movement-stepper { display: flex; flex-shrink: 0; gap: .35rem; }
.movement-stepper .btn { width: 2.75rem; min-height: 2.75rem; padding: 0; font-size: 1.15rem; }
#movement-chart { min-width: 0; margin-top: .5rem; }
#movement-chart .u-over { cursor: crosshair; touch-action: pan-y pinch-zoom; }
.movement-guide { position: absolute; pointer-events: none; top: 0; bottom: 0; transform: translateX(-50%); background: color-mix(in srgb, var(--accent) 12%, transparent); border-radius: .2rem; }
.movement-guide::after { content: ""; position: absolute; inset: 0 auto 0 50%; border-left: 1px solid var(--accent); opacity: .5; }
.movement-chart-error { color: var(--muted); font-size: .875rem; }
.movement-data summary { cursor: pointer; color: var(--accent); font-size: .875rem; font-weight: 700; }
#movement-table { margin-top: .5rem; }
#movement-table td.increase { color: var(--data-up); }
#movement-table td.rollback { color: var(--data-down); }
#movement-table :is(th, td):last-child { text-align: right; }
.record-pagination { display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin-top: .65rem; color: var(--muted); font-size: .82rem; }

.board { border-radius: 1.1rem; border: 1px solid var(--line); background: var(--paper); box-shadow: 0 6px 22px var(--shadow-low); }
.controls { padding: 1.1rem 1.25rem; }
.product-pills { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .55rem; }
.pill {
  --fuel: var(--accent);
  --fuel-tint: var(--tint);
  display: flex; align-items: center; justify-content: center; gap: .55rem;
  min-height: 3.15rem; padding: .45rem;
  background: var(--paper); color: var(--ink); border: 1px solid var(--line); border-radius: .7rem;
  font-size: .95rem; font-weight: 750; white-space: nowrap;
  transition: color .2s, background .2s, border-color .2s, transform .2s;
}
.pill[data-product="gas91"] { --fuel: var(--blue); --fuel-tint: var(--blue-tint); }
.pill[data-product="diesel"] { --fuel: var(--slate-blue); --fuel-tint: var(--blue-tint); }
.pill[data-product="gas97"] { --fuel: var(--slate-blue); --fuel-tint: var(--tint); }
.pill .icon { color: var(--fuel); }
.pill:hover { color: var(--fuel); background: var(--fuel-tint); border-color: var(--fuel); }
.pill[aria-pressed="true"] { color: var(--fuel); background: var(--fuel-tint); border-color: var(--fuel); box-shadow: inset 0 -2px var(--fuel); }
.pill[aria-pressed="true"] .icon-drop { background: currentColor; }
.pill:active { transform: scale(.98); }
.search-bar { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: .55rem; margin-top: .8rem; }
.search-bar input { min-height: 3rem; border-color: var(--field-line); font-size: 1rem; }
.search-bar .btn { white-space: nowrap; }
.search-bar .btn:is([aria-expanded="true"], [aria-pressed="true"]) { border-color: var(--accent-line); background: var(--tint); color: var(--accent); }
.location-status { margin-top: .65rem; color: var(--muted); font-size: .9rem; }
.filter-count { min-width: 1.25rem; padding-inline: .22rem; border-radius: 999px; background: var(--action); color: var(--on-action); font-size: .75rem; }
.filters { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, auto) auto; align-items: end; gap: .75rem; margin-top: .65rem; padding: .8rem; border: 1px solid var(--line); border-radius: .7rem; background: var(--bg); animation: rise .2s ease-out both; }
.field { display: flex; flex-direction: column; gap: .3rem; font-size: .875rem; font-weight: 650; min-width: 0; }
.field-control {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--input);
  border-radius: .65rem;
  color: var(--muted);
  transition: background-color .15s, box-shadow .15s;
}
.field-control:focus-within { background: var(--paper); box-shadow: 0 0 0 3px var(--shadow-accent); }
.field-control :is(input, select) {
  width: 100%;
  min-width: 0;
  min-height: 2.8rem;
  border: 1px solid var(--line);
  border-radius: inherit;
  color: var(--ink);
  background: transparent;
  padding: .55rem .7rem;
  font-weight: 500;
}
.field-control :is(input, select):focus { outline: 0; border-color: var(--accent); }
.field-control .icon { position: absolute; left: .8rem; pointer-events: none; }
.field-control input { padding-left: 2.15rem; }
.field-control input::placeholder { color: var(--muted); }
.select-control select {
  appearance: none;
  padding-right: 1.75rem;
  text-overflow: ellipsis;
  background-color: var(--input);
}
.select-control select:hover { background-color: var(--paper); }
.select-control::after {
  content: "";
  position: absolute;
  right: .85rem;
  top: 42%;
  width: .42rem;
  height: .42rem;
  transform: rotate(45deg);
  border: solid var(--muted);
  border-width: 0 1.5px 1.5px 0;
  pointer-events: none;
}
select option, select optgroup { background-color: var(--paper); color: var(--ink); }
:root[data-theme="dark"] select { color-scheme: dark; }
:root[data-theme="dark"] select option, :root[data-theme="dark"] select optgroup { background-color: var(--paper); color: var(--ink); }
.filter-actions, .active-filters { display: flex; align-items: center; gap: .4rem .55rem; flex-wrap: wrap; }
.filter-actions { margin-top: .45rem; justify-content: space-between; }
.filter-chip { display: inline-flex; align-items: center; gap: .5rem; min-height: 2.4rem; border: 1px solid var(--accent-line); border-radius: 999px; padding: .2rem .65rem; background: var(--tint); color: var(--accent); font-size: .875rem; font-weight: 700; }
.filter-chip:hover { border-color: var(--accent); }
.filter-chip span { font-size: 1.15rem; }
.check { display: inline-flex; gap: .5rem; align-items: center; min-height: 2.75rem; color: var(--muted); font-size: .875rem; cursor: pointer; }
.check input { width: 1rem; height: 1rem; margin: 0; accent-color: var(--accent); }
.check:has(:disabled) { opacity: .6; cursor: default; }
.filter-options { display: grid; gap: .1rem; }
.filter-options .check { min-height: 2rem; }

.table-panel { border-top: 1px solid var(--line); }
.table-head, .table-foot { display: flex; align-items: center; justify-content: space-between; gap: .75rem 1.25rem; padding: .95rem 1.25rem; }
.sort-field { flex-direction: row; align-items: center; gap: .6rem; white-space: nowrap; }
.sort-field select { min-height: 2.55rem; }
.table-head h3 { font-size: 1.35rem; line-height: 1.2; letter-spacing: -.045em; }
.table-head p, .legend, .table-foot { color: var(--muted); font-size: .85rem; }
.table-head p { margin-top: .2rem; }
.legend { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem 1.1rem; padding: 0 1.25rem .8rem; }
.legend > span { display: inline-flex; align-items: center; gap: .4rem; }
.locq-text { background: var(--blue-tint); color: var(--blue); padding: .12rem .34rem; border-radius: .25rem; letter-spacing: .05em; font-size: .75rem; }
.table-wrap { overflow-x: auto; scrollbar-gutter: stable; overscroll-behavior-x: contain; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
thead { background: var(--input); color: var(--muted); }
th, td { padding: .68rem .75rem; text-align: left; vertical-align: middle; }
th:first-child, td:first-child { padding-left: 1.25rem; }
th:last-child, td:last-child { padding-right: 1.25rem; }
th { color: var(--muted); font-size: .83rem; font-weight: 750; white-space: nowrap; }
th.active-product { color: var(--accent); }
tbody tr { border-bottom: 1px solid var(--line); }
tbody tr:hover, tbody .is-lowest { background: var(--row-highlight); }
.col-station { width: 24%; }
.col-loc { width: 26%; }
.col-distance, .distance { white-space: nowrap; }
.col-price { width: 12%; text-align: right; }
.single-fuel .col-station { width: 36%; }
.single-fuel .col-loc { width: 44%; }
.single-fuel .col-price { width: 20%; }
.station-name { font-weight: 750; }
.station-meta { margin-top: .15rem; color: var(--muted); font-size: .8rem; overflow-wrap: anywhere; }
.station-features, .station-hours { display: flex; align-items: center; flex-wrap: wrap; gap: .2rem .45rem; }
.station-features { margin-top: .4rem; }
.station-name-link { color: var(--accent); text-decoration: underline; text-decoration-color: var(--accent-line); text-underline-offset: .18em; }
.station-name-link:hover { color: var(--blue); text-decoration-color: currentColor; }
.station-hours { font-size: .78rem; }
.hours-label { font-weight: 750; }
.hours-open { color: var(--data-down); }
.hours-closed, .hours-unknown, .hours-detail { color: var(--muted); }
.hours-closed { color: var(--data-up); }
.badge.badge-ev { display: inline-flex; align-items: center; gap: .25rem; background: var(--blue-tint); color: var(--blue); }
.icon-bolt { width: .58rem; height: .85rem; background: currentColor; clip-path: polygon(52% 0, 100% 0, 69% 40%, 100% 40%, 26% 100%, 41% 58%, 0 58%); }
.station-geo { margin-top: .3rem; }
.copy-coords {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 6.6rem;
  min-height: 1.75rem;
  padding: .2rem .5rem;
  border: 1px solid var(--line);
  border-radius: .35rem;
  background: var(--paper);
  color: var(--accent);
  font-size: .74rem;
  font-weight: 700;
  white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s;
}
.copy-coords:hover { background: var(--tint); border-color: var(--accent-line); }
.copy-coords.is-copied { background: var(--action); border-color: var(--action); color: var(--on-action); }
.badge { display: inline-block; padding: .1rem .4rem; background: var(--tint); color: var(--accent); border-radius: .3rem; font-size: .73rem; vertical-align: .075em; }
.price-btn { display: inline-flex; align-items: center; justify-content: flex-end; gap: .55rem; min-height: 2.75rem; padding: .3rem .42rem .3rem .5rem; border: 1px solid var(--line); border-radius: .55rem; color: var(--ink); background: var(--paper); white-space: nowrap; vertical-align: middle; transition: background .18s, border-color .18s; }
.price-btn:hover, .price-btn:focus-visible { background: var(--row-highlight); border-color: var(--accent-line); }
.price-amounts { display: grid; justify-items: end; gap: .05rem; line-height: 1.25; }
.price-action { display: inline-flex; align-items: center; gap: .25rem; padding: .28rem .35rem; border-radius: .3rem; background: var(--tint); color: var(--accent); font-size: .75rem; font-weight: 750; }
.price-action .icon { width: .72rem; height: .72rem; }
.price-btn:hover .price-action, .price-btn:focus-visible .price-action { background: var(--accent-hover); }
.price-main { font-weight: 800; font-variant-numeric: tabular-nums; }
.price-locq { color: var(--blue); font-size: .77rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.price-na { color: var(--muted); }
.price-btn-unavailable { background: var(--bg); }
.price-unavailable, .price-unavailable .price-locq { color: var(--muted); }
.price-status { font-size: .7rem; font-weight: 700; line-height: 1.2; white-space: normal; }
.empty { padding: 2.1rem 1rem; text-align: center; color: var(--muted); }
.empty strong { display: block; }
.error-note { margin: 0 1.25rem .85rem; padding: .6rem .75rem; color: var(--warning-text); background: var(--warning); border-radius: .55rem; font-size: .875rem; overflow-wrap: anywhere; }
.pagination { display: flex; align-items: center; justify-content: space-between; gap: .55rem; }
.pagination .btn { padding-inline: .65rem; }

.footer {
  margin-top: clamp(2rem, 5vw, 4rem);
  background: linear-gradient(90deg, var(--brand-cobalt), var(--brand-blue)) top / 100% 3px no-repeat, var(--paper);
  color: var(--muted);
}
.footer-inner { padding-block: clamp(1.5rem, 4vw, 2.4rem) .75rem; }
.footer-main, .footer-bottom { display: flex; justify-content: space-between; gap: .7rem 2rem; }
.footer-main { align-items: end; padding-bottom: 1.25rem; }
.footer-brand img { width: 9.5rem; margin-bottom: .65rem; }
.footer-refresh .eyebrow { margin-bottom: .25rem; }
#footer-refresh-time { display: flex; align-items: center; gap: .55rem; }
.footer-refresh-dot { flex: none; width: .5rem; height: .5rem; border-radius: 50%; background: var(--data-down); animation: footer-refresh-pulse 2.2s ease-in-out infinite; }
@keyframes footer-refresh-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .38; }
}
.footer-refresh time { color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.footer-bottom { align-items: center; border-top: 1px solid var(--line); padding-top: .45rem; font-size: .875rem; }
.footer-bottom a { display: inline-flex; align-items: center; min-height: 2.75rem; color: var(--accent); font-weight: 750; text-underline-offset: .2em; white-space: nowrap; }
.footer-bottom a:hover { text-decoration: underline; }

.station-detail { max-width: 69rem; padding-bottom: 3rem; }
.history-back { display: inline-flex; align-items: center; min-height: 2.75rem; margin-bottom: .65rem; color: var(--accent); font-size: .875rem; font-weight: 750; text-decoration: underline; text-underline-offset: .2em; }
.history-back::before { margin-inline-end: .45rem; content: "←"; }
.station-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(14rem, auto); gap: 1.25rem 2rem; align-items: center; padding: clamp(1rem, 4vw, 2.25rem); border: 1px solid var(--line); border-radius: 1.15rem; background: linear-gradient(120deg, var(--paper), var(--tint)); }
.station-identity h1 { max-width: 25ch; font-size: clamp(1.65rem, 4.3vw, 3rem); line-height: 1.12; letter-spacing: -.05em; overflow-wrap: anywhere; }
.station-address { display: flex; align-items: baseline; gap: .5rem; margin-top: .6rem; color: var(--muted); }
.station-address .icon { flex: none; color: var(--accent); }
.station-services { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .9rem; }
.station-services .badge { padding: .25rem .55rem; }
.station-visit { display: grid; gap: .65rem; border-inline-start: 1px solid var(--accent-line); padding-inline-start: 1.25rem; }
.station-visit-label { color: var(--muted); font-size: .82rem; font-weight: 750; }
.station-visit .station-hours { margin-top: .15rem; font-size: .9rem; }
.station-directions { gap: .45rem; }
.station-coordinates { margin-top: .25rem; color: var(--muted); font-size: .75rem; font-variant-numeric: tabular-nums; }
.station-current { margin-block: clamp(1.4rem, 4vw, 2.35rem); }
.station-section-heading { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: .45rem 1rem; margin-bottom: .8rem; }
.station-section-heading h2 { font-size: clamp(1.4rem, 3vw, 1.95rem); letter-spacing: -.04em; }
.station-section-heading p { color: var(--muted); font-size: .83rem; }
.station-fuel-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .8rem; }
.station-fuel { --fuel-color: #288459; display: flex; flex-direction: column; gap: .45rem; min-width: 0; padding: .9rem; border: 1px solid var(--line); border-top: .22rem solid var(--fuel-color); border-radius: .85rem; background: var(--paper); box-shadow: 0 3px 12px var(--shadow-low); }
.station-fuel[data-fuel="gas95"] { --fuel-color: #bf3f4e; }
.station-fuel[data-fuel="gas97"] { --fuel-color: #397dc1; }
.station-fuel[data-fuel="diesel"] { --fuel-color: #c59605; }
.station-fuel.is-highlighted { border-color: var(--fuel-color); box-shadow: 0 0 0 2px color-mix(in srgb, var(--fuel-color) 22%, transparent); }
.station-fuel.is-unavailable { background: color-mix(in srgb, var(--paper) 62%, var(--bg)); }
.station-fuel-title h3 { display: flex; align-items: center; gap: .45rem; font-size: 1.15rem; letter-spacing: -.02em; }
.station-fuel-title .icon { color: var(--fuel-color); }
.station-fuel-status { margin-top: .15rem; color: var(--muted); font-size: .76rem; font-weight: 700; }
.station-fuel-amounts { display: grid; grid-template-columns: 1fr 1fr; gap: .45rem; margin: .15rem 0 .1rem; }
.station-fuel-amounts.single { grid-template-columns: minmax(0, 1fr); }
.station-fuel-amounts dt, .station-fuel-campaign { color: var(--muted); font-size: .76rem; }
.station-fuel-amounts dd { margin: 0; color: var(--ink); font: 800 clamp(1.02rem, 1.6vw, 1.38rem)/1.25 var(--display); letter-spacing: -.025em; font-variant-numeric: tabular-nums; }
.station-fuel-amounts > :last-child dd { color: var(--blue); }
.station-fuel.is-unavailable dd { color: var(--muted); }
.station-fuel-savings { color: var(--blue); font-size: .8rem; font-weight: 750; }
.station-fuel-campaign { overflow-wrap: anywhere; }
.station-fuel-qr { align-self: stretch; margin-top: auto; }
.station-fuel-qr .icon { flex: none; }
.history-panel { margin-top: 1.4rem; padding: clamp(.9rem, 3vw, 1.5rem); border: 1px solid var(--line); border-radius: 1rem; background: var(--paper); }
.history-panel-head { display: flex; justify-content: space-between; align-items: end; flex-wrap: wrap; gap: .8rem 1.5rem; margin-bottom: .9rem; }
.history-panel-head h2 { font-size: 1.3rem; letter-spacing: -.035em; }
.history-panel-head p, .history-note { color: var(--muted); font-size: .875rem; }
.history-filters { display: flex; align-items: end; flex-wrap: wrap; gap: .55rem; }
.history-filters [type="submit"] { min-width: 6.5rem; }
.history-feedback:not(.is-error) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.history-feedback.is-error { margin-bottom: .65rem; color: var(--data-up); }
.history-chart-toolbar { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: .5rem; margin-top: .6rem; }
.history-readout { display: grid; gap: .3rem; }
.history-selected-date { color: var(--muted); font-size: .8rem; font-variant-numeric: tabular-nums; }
.history-stepper:not([hidden]) { display: flex; gap: .4rem; }
.history-stepper .btn { width: 2.75rem; min-height: 2.75rem; padding: 0; }
.history-legend { display: flex; flex-wrap: wrap; gap: .5rem; }
.history-legend span { display: inline-flex; align-items: center; gap: .4rem; padding: .4rem .62rem; border-radius: .6rem; font-size: .875rem; }
.history-legend span::before { content: ""; width: .52rem; height: .52rem; border-radius: 50%; background: currentColor; }
.history-legend .pump { color: var(--accent); background: var(--tint); }
.history-legend .locq { color: var(--blue); background: var(--blue-tint); }
.history-chart { display: block; width: 100%; max-height: 17rem; margin-block: .55rem .15rem; }
.history-chart.is-interactive { cursor: crosshair; touch-action: pan-y pinch-zoom; }
.history-chart text { font: 12px var(--body); fill: var(--muted); }
.history-grid { stroke: var(--line); }
.history-guide { stroke: var(--accent); stroke-width: 1.25; stroke-dasharray: 3 3; pointer-events: none; }
.history-dot.pump { fill: var(--accent); }
.history-dot.locq { fill: none; stroke: var(--blue); stroke-width: 1.6; }
.history-point.is-selected .history-dot.pump { stroke: var(--paper); stroke-width: 1; }
.history-point.is-selected .history-dot.locq { stroke-width: 2.2; }
.history-empty { margin-top: .75rem; padding: .85rem; border: 1px dashed var(--accent-line); border-radius: .65rem; color: var(--muted); }
.history-table-panel { margin-top: .8rem; }
.history-table-panel summary { cursor: pointer; color: var(--accent); font-size: .875rem; font-weight: 700; }
.history-table-scroll { overflow: auto; max-height: 22rem; margin-top: .5rem; scrollbar-gutter: stable; overscroll-behavior: contain; }
.history-table-scroll tbody th { white-space: normal; font-weight: 500; }
.history-table-scroll td { white-space: nowrap; font-variant-numeric: tabular-nums; }

.qr-modal {
  --qr-accent: #c61724;
  width: min(26rem, 100% - 2rem);
  max-height: min(calc(100% - 2rem), calc(100dvh - 2rem));
  overflow-y: auto;
  scrollbar-gutter: stable;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 1.15rem;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 24px 90px var(--shadow-modal);
}
.qr-modal[data-fuel="gas91"] { --qr-accent: #08743f; }
.qr-modal[data-fuel="gas97"] { --qr-accent: #074681; }
.qr-modal[data-fuel="diesel"] { --qr-accent: #ffda00; }
.qr-modal[open] { animation: rise .22s ease-out both; }
.qr-modal::backdrop { background: var(--scrim); backdrop-filter: blur(5px); }
.qr-modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: .5rem; padding: 1rem 1.15rem; border-bottom: 1px solid var(--line); }
.qr-modal-head h2 { font-size: 1.5rem; line-height: 1.2; letter-spacing: -.04em; margin-block: .2rem; overflow-wrap: anywhere; }
#qr-sub, #qr-help { color: var(--muted); font-size: .9rem; }
.icon-btn { display: grid; place-items: center; flex: none; width: 2.75rem; height: 2.75rem; background: var(--bg); border: 1px solid var(--line); border-radius: .65rem; color: var(--ink); font-size: 1.4rem; line-height: 1; }
.icon-btn:hover { background: var(--tint); }
.qr-modal-body { display: grid; justify-items: center; padding: .85rem 1rem; }
.qr-fuel-card { display: grid; justify-items: center; width: 100%; padding: .85rem; border-radius: .85rem; background: var(--qr-accent); }
.qr-image-wrap { border-radius: .45rem; background: #fff; overflow: hidden; }
.qr-image-wrap img { display: block; width: min(16rem, 66vw); aspect-ratio: 1; image-rendering: pixelated; }
.qr-modal [hidden] { display: none; }
.qr-modal-footer { position: sticky; bottom: 0; display: grid; gap: .55rem; padding: .6rem 1rem .85rem; border-top: 1px solid var(--line); background: var(--paper); text-align: center; }
@media (max-height: 42rem) {
  .qr-modal-head { padding-block: .7rem; }
  .qr-modal-head h2 { font-size: 1.15rem; }
  .qr-image-wrap img { width: min(16rem, 66vw, 38dvh); }
}
.toast { position: fixed; z-index: 4; right: 1.25rem; bottom: 1.25rem; max-width: min(26rem, 100% - 2.5rem); padding: .75rem 1rem; color: var(--on-floating); background: var(--floating); border: 1px solid var(--accent-line); border-radius: .8rem; box-shadow: 0 10px 26px var(--shadow-float); animation: rise .2s ease-out both; }

@media (max-width: 62rem) {
  .shell { width: calc(100% - 2.5rem); }
  .station-fuel-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #filter-done { justify-self: end; }
}
@media (max-width: 56rem), (any-pointer: coarse) and (max-width: 65rem) {
  .masthead { grid-template-columns: minmax(0, 1fr); gap: .7rem; }
  .masthead-search { justify-self: start; }
  .section-heading { flex-direction: column; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-network { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr auto; align-items: center; }
  .stat-network strong { grid-column: 2; grid-row: 1 / span 2; }
  .table-wrap { overflow: hidden; }
  .field-control :is(input, select) { font-size: 1rem; }
  .sort-field .field-control { min-width: 0; }
  .filter-chip, .pill { min-height: 2.75rem; }
  #price-table, #price-table tbody { display: block; }
  #price-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  #price-body tr { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); padding: .85rem 1rem; gap: .2rem .45rem; border-top: 1px solid var(--line); border-bottom: 0; }
  #price-body :is(td, td:first-child, td:last-child) { display: block; padding: 0; width: auto; text-align: left; min-width: 0; }
  tbody :is(.col-station, .col-loc, .empty) { grid-column: 1 / -1; }
  tbody .distance { grid-column: 1 / -1; color: var(--muted); margin-top: .2rem; }
  tbody .col-loc { color: var(--muted); }
  tbody .col-station .station-meta { color: var(--accent); }
  tbody .col-price { margin-top: .35rem; border-top: 1px solid var(--line); padding-top: .3rem; }
  tbody .col-price::before { content: attr(data-label); display: block; color: var(--muted); font-weight: 750; font-size: .78rem; }
  tbody .price-btn { flex-wrap: wrap; justify-content: flex-start; gap: .25rem; max-width: 100%; padding: .27rem .3rem; }
  tbody .price-amounts { justify-items: start; }
  tbody .price-na { display: inline-block; padding-top: .55rem; }
  .single-fuel #price-body tr { grid-template-columns: minmax(0, 1fr) auto; }
  .single-fuel tbody :is(.col-station, .col-loc, .col-price) { width: auto; }
  .single-fuel tbody :is(.col-station, .col-loc, .distance) { grid-column: 1; }
  .single-fuel tbody .col-price { grid-column: 2; grid-row: 1 / span 3; margin: 0; border: 0; padding: 0; align-self: center; }
  .single-fuel tbody .col-price::before { content: none; }
  .single-fuel tbody .price-btn { flex-wrap: nowrap; justify-content: flex-end; gap: .4rem; }
  .single-fuel tbody .price-amounts { justify-items: end; }
  tbody .empty { text-align: center; padding-block: 1rem; }
  .table-foot { border-top: 1px solid var(--line); flex-wrap: wrap; }
}
@media (max-width: 34rem) {
  .shell { width: calc(100% - 1.5rem); }
  .nav { min-height: 3.8rem; gap: .3rem; }
  .brand img { width: clamp(6.7rem, 32vw, 8.5rem); }
  .header-actions { gap: .45rem; }
  .updated-pill { font-size: .8rem; }
  .theme-toggle { grid-template-columns: 1fr; width: 2.75rem; color: var(--accent); background: var(--tint); }
  .theme-toggle::before, .theme-toggle:not([aria-pressed="true"]) .theme-sun, .theme-toggle[aria-pressed="true"] .theme-moon { display: none; }
  .footer-main, .footer-bottom { flex-direction: column; align-items: flex-start; }
  .footer-main { gap: 1.25rem; }
  .footer-bottom { gap: .15rem; padding-top: .75rem; }
  main { padding-top: .85rem; }
  .masthead { padding-block: .45rem .8rem; }
  .overview, .station-board { margin-top: 1.4rem; }
  .masthead + .overview { margin-top: 1rem; }
  .stats { gap: .5rem; }
  .stat { padding: .75rem; }
  .controls, .table-head, .table-foot, .legend { padding-inline: .8rem; }
  .product-pills { gap: .3rem; }
  .pill { flex-direction: column; gap: .32rem; min-height: 3.35rem; padding-inline: .1rem; font-size: .8rem; }
  .search-bar { grid-template-columns: 1fr 1fr; }
  .search-field { grid-column: 1 / -1; }
  .filters { gap: .55rem; }
  .station-hero, .station-fuel-grid { grid-template-columns: minmax(0, 1fr); }
  .station-visit { grid-template-columns: minmax(0, 1fr) auto; align-items: start; padding: .8rem 0 0; border-inline-start: 0; border-top: 1px solid var(--accent-line); }
  .table-head { align-items: flex-start; flex-wrap: wrap; }
  .sort-field { gap: .45rem; }
  .table-foot .pagination { width: 100%; }
  #price-body tr { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .movement-heading { grid-template-columns: minmax(0, 1fr) auto; gap: .3rem .7rem; padding: .8rem; }
  .movement-heading .movement-latest { grid-row: 2; }
  .movement-chevron { grid-column: 2; grid-row: 1 / span 2; }
  .movement-content { padding-inline: .8rem; }
  .filter-options { grid-column: 1 / -1; }
  table:not(.single-fuel) tbody .price-btn { width: 100%; justify-content: space-between; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
