/* Design tokens */

:root {
  color-scheme: light;
  --bg: #eef2ef;
  --panel: #fff;
  --text: #182019;
  --muted: #68736b;
  --line: #dbe3dd;
  --accent: #16A34A;
  --accent-soft: #e7f4eb;
  --blue: #66809e;
  --route-accent: #2f66e8;
  --route-accent-soft: #e8f0ff;
  --danger: #a23b3b;
  --cluster-green: #19c45a;
  --price-mid: #f2b72f;
  --cluster-red: #ef3e4d;
  --shadow: 0 18px 48px rgba(27,52,35,.1);
  font-family: system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  --app-header-h: 68px;
  --mobile-nav-h: 54px;
  --mobile-edge: 12px;
  --control-height: 48px;
  --radius-control: 12px;
  --radius-panel: 24px;
  --search-gutter: 16px;
  --floating-control-border: #cfd9d2;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
}

.app-shell {
  min-height: 100vh;
}

.brand {
  justify-self: start;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.18rem;
  letter-spacing: -.015em;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  flex: 0 0 38px;
  border-radius: 12px;
  overflow: hidden;
}

.brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.nav-button,
.icon-button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
  border-radius: 10px;
  padding: 9px 13px;
}

.nav-button.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

.nav-button:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.icon-button {
  justify-self: end;
  border: 1px solid var(--line);
  color: var(--text);
  width: 42px;
  height: 42px;
  padding: 0;
  font-size: 1.1rem;
}

.results-panel {
  background: var(--panel);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: 0;
  position: relative;
  z-index: 500;
}

.search-form>label,
.search-form label span,
dialog label,
.trend-controls label {
  font-size: .78rem;
  color: var(--muted);
  font-weight: 600;
}

input,
select {
  font: inherit;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  padding: 11px 12px;
  min-width: 0;
}

input:focus,
select:focus,
button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(39,115,74,.25);
  outline-offset: 1px;
}

.filter-row {
  display: grid;
  grid-template-columns: 1.15fr .8fr 1fr;
  gap: 8px;
}

.filter-row label,
.trend-controls label {
  display: grid;
  gap: 5px;
}

.primary-button,
.secondary-button {
  border-radius: 11px;
  padding: 11px 16px;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
}

.primary-button {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
}

.secondary-button {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
}

.result-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 14px;
  border-top: 1px solid var(--line);
  padding-top: 17px;
}

.result-heading h1 {
  font-size: 1.08rem;
  margin: 0 0 4px;
}

.result-heading p {
  font-size: .76rem;
  color: var(--muted);
  margin: 0;
}

.sort-label select {
  padding: 7px 8px;
  font-size: .8rem;
  border: 0;
  color: var(--accent);
}

.status-message {
  padding: 18px;
  text-align: center;
  color: var(--muted);
  font-size: .88rem;
  border: 1px dashed var(--line);
  border-radius: 13px;
}

.status-message.error {
  color: var(--danger);
}

.station-card {
  position: relative;
  border: 2px solid var(--price-color,var(--line));
  background: var(--panel);
  border-radius: 15px;
  padding: 12px;
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  gap: 7px 14px;
  text-align: left;
  color: var(--text);
  cursor: pointer;
  width: 100%;
}

.station-card.selected .rank {
  color: #2563eb;
  background: #dbeafe;
}

.station-name {
  display: flex;
  gap: 8px;
  align-items: center;
  font-weight: 650;
  min-width: 0;
}

.rank {
  flex: 0 0 25px;
  height: 25px;
  border-radius: 8px;
  background: var(--bg);
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: .72rem;
}

.station-name span:last-child {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.price-pair small {
  font-size: .67rem;
  color: var(--muted);
}

.price-pair strong {
  font-size: 1.05rem;
}

.station-meta {
  padding-left: 33px;
  color: var(--muted);
  font-size: .76rem;
}

.results-panel footer {
  margin-top: auto;
  color: var(--muted);
  font-size: .68rem;
  display: flex;
  justify-content: space-between;
}

.map-panel,
#map {
  height: 100%;
  min-height: 400px;
}

.leaflet-container {
  font-family: inherit;
  background: var(--bg);
}

.price-marker {
  width: 0 !important;
  height: 0 !important;
  overflow: visible;
  background: transparent;
  border: 0;
}

.price-marker span {
  position: absolute;
  left: 0;
  bottom: 8px;
  display: block;
  width: max-content;
  transform: translateX(-50%);
  background: var(--panel);
  border: 2px solid var(--accent);
  border-radius: 11px;
  padding: 6px 8px;
  box-shadow: 0 5px 15px rgba(27,52,35,.18);
  font-weight: 700;
  white-space: nowrap;
}

.price-marker span::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -8px;
  transform: translateX(-50%);
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-top: 8px solid var(--marker-color);
}

.price-marker.selected span {
  background: var(--accent);
  color: #fff;
}

.trend-view {
  min-height: calc(100vh - 68px);
}

.trend-container {
  max-width: 1060px;
  margin: 0 auto;
  padding: 26px;
}

.back-button {
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
  margin-bottom: 22px;
}

.station-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
}

.station-identity {
  display: flex;
  gap: 14px;
  align-items: center;
}

.station-logo {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid;
  place-items: center;
  font-weight: 800;
}

.station-header h1 {
  font-size: 1.45rem;
  margin: 0 0 5px;
}

.station-header p {
  font-size: .82rem;
  color: var(--muted);
  margin: 0;
}

.trend-controls {
  display: flex;
  justify-content: space-between;
  align-items: end;
  margin-bottom: 12px;
}

.fuel-tabs,
.range-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg);
  padding: 3px;
  border-radius: 10px;
}

.fuel-tabs button,
.range-tabs button,
.mobile-tab {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: .82rem;
  padding: 8px 11px;
  border-radius: 8px;
  cursor: pointer;
}

.fuel-tabs button.active,
.range-tabs button.active,
.mobile-tab.active {
  background: var(--panel);
  color: var(--text);
  box-shadow: 0 2px 8px rgba(27,52,35,.09);
  font-weight: 650;
}

.price-summary {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  margin-bottom: 14px;
}

.price-summary>div {
  padding: 18px 20px;
}

.price-summary>div+div {
  border-left: 1px solid var(--line);
}

.price-summary small {
  display: block;
  color: var(--muted);
  font-size: .76rem;
  margin-bottom: 5px;
}

.price-summary strong {
  font-size: 1.42rem;
}

.chart-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
}

.chart-heading {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 18px;
}

.chart-heading h2 {
  font-size: 1.08rem;
  margin: 0 0 4px;
}

.chart-heading p {
  font-size: .76rem;
  color: var(--muted);
  margin: 0;
}

.legend {
  display: flex;
  gap: 18px;
  color: var(--muted);
  font-size: .76rem;
  margin: 18px 0 2px;
}

.legend span {
  display: flex;
  gap: 6px;
  align-items: center;
}

.legend i {
  width: 18px;
  height: 3px;
  border-radius: 2px;
  background: var(--accent);
}

.legend .average-key {
  height: 2px;
  background: var(--blue);
}

#trend-chart {
  width: 100%;
  height: 330px;
  display: block;
  overflow: visible;
}

#trend-chart text {
  font: 12px inherit;
  fill: var(--muted);
}

#trend-chart .grid {
  stroke: var(--line);
  stroke-width: 1;
}

#trend-chart .frame {
  fill: none;
  stroke: var(--line);
}

#trend-chart .station-line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 3;
  stroke-linejoin: round;
  stroke-linecap: round;
}

#trend-chart .average-line {
  fill: none;
  stroke: var(--blue);
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}

#trend-chart .dot {
  fill: var(--panel);
  stroke: var(--accent);
  stroke-width: 2;
}

#trend-chart .latest {
  fill: var(--accent);
  stroke: var(--panel);
  stroke-width: 3;
}

.empty-chart {
  height: 300px;
  display: grid;
  place-content: center;
  text-align: center;
  color: var(--muted);
}

.empty-chart strong {
  color: var(--text);
}

.empty-chart p {
  max-width: 350px;
  margin: 6px 0;
}

.insight-row {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 12px;
  margin-top: 12px;
}

.insight-row article {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 16px;
}

.insight-row small {
  display: block;
  color: var(--muted);
  font-size: .74rem;
  margin-bottom: 4px;
}

.insight-row strong {
  font-size: 1rem;
}

.insight-row p {
  font-size: .8rem;
  color: var(--muted);
  margin: 5px 0 0;
}

dialog {
  width: min(480px,calc(100% - 28px));
  border: 1px solid var(--line);
  border-radius: 17px;
  padding: 0;
  background: var(--panel);
  color: var(--text);
  box-shadow: var(--shadow);
}

dialog::backdrop {
  background: rgba(12,18,14,.48);
}

dialog form {
  padding: 20px;
  display: grid;
  gap: 10px;
}

.dialog-heading {
  display: flex;
  justify-content: space-between;
  align-items: start;
}

.dialog-heading h2 {
  margin: 0 0 4px;
  font-size: 1.15rem;
}

.dialog-heading p,
.help-text {
  margin: 0;
  color: var(--muted);
  font-size: .78rem;
}

.dialog-close {
  border: 0;
  background: transparent;
  font-size: 1.5rem;
  color: var(--muted);
  cursor: pointer;
}

dialog menu {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 10px 0 0;
  margin: 0;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%,20px);
  background: var(--text);
  color: var(--panel);
  padding: 10px 14px;
  border-radius: 10px;
  font-size: .82rem;
  opacity: 0;
  pointer-events: none;
  transition: .2s;
  z-index: 2000;
}

.toast.visible {
  opacity: 1;
  transform: translate(-50%,0);
}

/* Compact search controls */

.radius-field {
  display: grid;
  gap: 3px;
}

.radius-field span {
  font-size: .68rem !important;
}

.radius-field select {
  width: 91px;
}

.fuel-picker {
  border: 0;
  padding: 0;
  margin: 0;
}

.fill-slider {
  display: grid;
}

.slider-scale {
  display: grid;
  grid-template-columns: auto minmax(120px,1fr) auto;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: .72rem;
}

.slider-track {
  position: relative;
  padding-top: 19px;
}

.slider-track output {
  position: absolute;
  top: -4px;
  left: var(--fill-progress,83.333%);
  transform: translateX(-50%);
  background: var(--accent);
  color: #fff;
  border-radius: 7px;
  padding: 2px 6px;
  font-size: .68rem;
  font-weight: 700;
  white-space: nowrap;
}

.slider-track input {
  width: 100%;
  padding: 0;
  border: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.station-saving:empty {
  visibility: hidden;
}

.price-marker.popup-open span {
  visibility: hidden;
}

.fuel-buttons {
  border-radius: 11px;
  display: grid;
  grid-template-columns: repeat(3,minmax(64px,1fr));
  gap: 8px;
  background: transparent;
  padding: 0;
}

.fuel-buttons button {
  color: var(--muted);
  font: inherit;
  font-weight: 650;
  cursor: pointer;
  min-width: 64px;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--panel);
  font-size: 1rem;
}

.price-marker.graded span {
  transition: background-color .2s,border-color .2s;
}

.station-skeleton {
  cursor: default;
  pointer-events: none;
  min-height: 83px;
}

.station-skeleton i,
.skeleton-meta {
  display: block;
  border-radius: 7px;
  background: linear-gradient(90deg,var(--bg) 25%,var(--accent-soft) 50%,var(--bg) 75%);
  background-size: 200% 100%;
  animation: skeleton-pulse 1.35s ease-in-out infinite;
}

.skeleton-name {
  display: flex;
  align-items: center;
  gap: 8px;
}

.skeleton-name i:first-child {
  width: 25px;
  height: 25px;
}

.skeleton-name i:last-child {
  width: min(145px,65%);
  height: 17px;
}

.skeleton-prices {
  display: flex;
  gap: 8px;
  align-items: center;
}

.skeleton-prices i {
  width: 68px;
  height: 30px;
}

.skeleton-meta {
  width: 92px;
  height: 12px;
  margin-left: 33px;
}

@keyframes skeleton-pulse {
  to {
    background-position: -200% 0;
  }
}

.prices-view {
  height: calc(100vh - 68px);
  display: grid;
  grid-template-columns: clamp(390px,32vw,480px) minmax(0,1fr);
}

.radius-buttons {
  grid-template-columns: repeat(4,minmax(0,1fr));
}

.radius-buttons button {
  min-width: 0;
  padding: 0 3px;
  font-size: .78rem;
}

.station-saving {
  grid-column: 1/-1;
  text-align: left;
  background: var(--accent-soft);
  border-radius: 10px;
  padding: 9px 10px;
  margin-top: 3px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px 12px;
  color: var(--muted);
  font-size: .72rem;
}

.station-saving strong {
  grid-column: 1/-1;
  color: var(--accent);
  font-size: .76rem;
}

.station-saving span:last-child {
  text-align: right;
}

.search-panel {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
}

.search-panel-toggle {
  width: 100%;
  min-height: 58px;
  padding: 11px var(--search-gutter);
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
  cursor: pointer;
}

.search-panel-toggle>span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.search-panel-toggle strong {
  font-size: 1rem;
  line-height: 1.2;
}

.search-panel-toggle small {
  color: var(--muted);
  font-size: .76rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-chevron {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform .2s ease;
}

.search-panel-toggle[aria-expanded="true"] .search-chevron {
  transform: rotate(180deg);
}

.search-panel-toggle[aria-expanded="true"]+.search-form {
  display: grid !important;
}

.search-panel-toggle[aria-expanded="false"]+.search-form {
  display: none !important;
}

.fuel-buttons button.active {
  background: var(--panel);
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 4px 12px rgba(22,163,74,.14);
}

.fuel-buttons button,
.radius-buttons button {
  font-size: .85rem;
}

.map-panel {
  position: relative;
}

.map-legend {
  position: absolute;
  z-index: 800;
  left: 16px;
  bottom: 24px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255,255,255,.94);
  box-shadow: 0 5px 18px rgba(27,52,35,.14);
  color: var(--muted);
  font-size: .68rem;
  white-space: nowrap;
}

.map-legend i {
  width: 78px;
  height: 7px;
  border-radius: 5px;
  background: linear-gradient(90deg,var(--cluster-green),var(--price-mid),var(--cluster-red));
}

.price-marker.compact span {
  padding: 5px 7px;
  border-radius: 9px;
  font-size: .82rem;
}

.search-center-marker {
  display: grid !important;
  place-items: center;
  background: rgba(255,255,255,.78);
  border: 2px solid #3B82F6;
  border-radius: 50%;
  box-shadow: 0 1px 6px rgba(37,99,235,.18);
}

.search-center-marker span {
  display: block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #3B82F6;
  opacity: .88;
}

.location-input-wrap {
  position: relative;
  min-width: 0;
}

.location-input-wrap input {
  width: 100%;
  padding-right: 44px;
}

.search-form input {
  min-height: var(--control-height);
  border-radius: var(--radius-control);
}

.search-form input::placeholder {
  color: #9aa39c;
  opacity: 1;
}

.search-form > .primary-button {
  min-height: var(--control-height);
  border-radius: var(--radius-control);
}


.location-input-wrap input::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
}

.location-clear {
  position: absolute;
  top: 50%;
  right: 5px;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
}

.location-clear:focus-visible {
  color: var(--accent);
  background: transparent;
}

.location-clear[hidden] {
  display: none;
}

.refresh-button {
  width: 28px;
  height: 28px;
  padding: 5px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  display: grid;
  place-items: center;
  cursor: pointer;
  touch-action: manipulation;
}

.refresh-button:hover,
.refresh-button:focus-visible {
  color: var(--accent);
  background: var(--accent-soft);
}

.refresh-button:disabled {
  cursor: wait;
  opacity: .7;
}

.refresh-button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.refresh-button.loading svg {
  animation: refresh-spin .8s linear infinite;
}

@keyframes refresh-spin {
  to {
    transform: rotate(360deg);
  }
}

/* Roomier search controls and clearer location/fill affordances. */

.search-form {
  display: grid;
  gap: 16px;
}

.search-panel .search-form {
  border-top: 1px solid var(--line);
  padding: 18px var(--search-gutter) 16px;
}

.location-row {
  display: grid;
  align-items: end;
  grid-template-columns: minmax(0,1fr) auto;
  gap: 10px;
}

.radius-picker {
  display: grid;
  gap: 8px;
}

.fuel-and-fill {
  display: grid;
  align-items: end;
  grid-template-columns: 1fr;
  gap: 16px;
}

.fuel-picker legend,
.fill-slider>span {
  font-size: .78rem;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 8px;
}

.form-field {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.form-field > label {
  display: block;
  margin: 0;
  font-size: .78rem;
  line-height: 1.25;
  color: var(--muted);
  font-weight: 600;
}

.location-button {
  width: var(--control-height);
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--panel);
  font-size: 1.25rem;
  cursor: pointer;
  height: var(--control-height);
  display: grid;
  place-items: center;
  color: var(--muted);
  padding: 0;
}

.location-button-icon {
  width: 20px;
  height: 20px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #fff;
}

.location-button-icon i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.fill-label {
  display: block;
}

.slider-scale>span {
  min-width: 1ch;
  text-align: center;
  font-weight: 700;
}

.sort-label>span {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

.sort-label {
  display: grid;
  font-size: .7rem;
  color: var(--muted);
  gap: 0;
}

.result-meta-row {
  display: flex;
  gap: 5px;
  align-items: center;
}

.result-meta-copy {
  display: grid;
  gap: 2px;
}

.price-trend {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: .72rem;
  font-weight: 400;
  white-space: nowrap;
}

.price-trend[hidden] {
  display: none;
}

.price-trend-arrow {
  font-size: 1rem;
  line-height: 1;
  font-weight: 400;
}

.price-trend.up {
  color: var(--danger);
}

.price-trend.down {
  color: var(--accent);
}

.price-trend.same {
  color: #a66f00;
}

.price-trend-difference[hidden] {
  display: none;
}

/* Blue interaction feedback stays separate from the price-coded border. */

.station-card:hover .rank {
  color: #3b82f6;
  background: #eff6ff;
}

.station-card.selected .rank,
.station-card.selected:hover .rank {
  color: #2563eb;
  background: #dbeafe;
}

/* Closed stations remain available but are visually separated from live prices. */

.station-card.closed,
.station-card.closed:hover,
.station-card.closed.selected,
.station-card.closed.selected:hover {
  border-color: #9e9e9e;
  background: #f2f2f2;
  color: #6f6f6f;
}

.station-card.closed .rank,
.station-card.closed:hover .rank,
.station-card.closed.selected .rank,
.station-card.closed.selected:hover .rank {
  background: #e2e2e2;
  color: #6f6f6f;
}

.station-card.closed .price-pair small,
.station-card.closed .station-meta {
  color: #757575;
}

/* Card alignment refinements. */

.price-pair {
  display: grid;
  text-align: right;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 0;
}

.price-unit,
.fill-total {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.price-unit {
  padding-right: 10px;
  border-right: 1px solid var(--line);
  padding: 0 12px 0 0;
}

.fill-total {
  padding: 0 0 0 12px;
}

.price-thousandths {
  font-size: 10px;
  line-height: 0;
  vertical-align: super;
}

.marker-thousandths {
  font-size: .62em;
  line-height: 0;
  vertical-align: super;
}

.station-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
  overflow: auto;
  padding-right: 12px;
  scrollbar-gutter: stable;
}

.station-list::-webkit-scrollbar {
  width: 8px;
}

.station-list::-webkit-scrollbar-track {
  background: transparent;
}

.station-list::-webkit-scrollbar-thumb {
  background: rgba(104,115,107,.55);
  border-radius: 8px;
}

/* Map-area search appears only after the viewport leaves the active radius. */

.search-area-button {
  position: absolute;
  z-index: 800;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  border: 1px solid #d5dfd8;
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  padding: 10px 16px;
  font: inherit;
  font-size: .85rem;
  font-weight: 650;
  box-shadow: 0 4px 14px rgba(27,52,35,.18);
  cursor: pointer;
  white-space: nowrap;
  touch-action: manipulation;
}

.search-area-button:hover,
.search-area-button:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
  background: #f7fbf8;
}

.search-area-button:disabled {
  cursor: wait;
  opacity: .7;
}

.search-area-button[hidden] {
  display: none;
}

/* Home and local statistics views. */

[hidden] {
  display: none !important;
}

.home-view {
  min-height: calc(100vh - 68px);
  background: linear-gradient(180deg,#f5fbf7 0,#eef2ef 58%);
}

.home-hero {
  max-width: 820px;
  margin: 0 auto;
  padding: 72px 24px 56px;
  text-align: center;
}

.eyebrow {
  display: inline-block;
  color: var(--accent);
  font-size: .78rem;
  font-weight: 750;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.home-hero h1 {
  max-width: 720px;
  margin: 12px auto 16px;
  font-size: clamp(2.25rem,6vw,4.4rem);
  line-height: 1.02;
  letter-spacing: -.045em;
}

.home-hero>p {
  max-width: 630px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 1.06rem;
  line-height: 1.6;
}

.home-search {
  max-width: 650px;
  margin: 34px auto 0;
  padding: 18px;
  background: rgba(255,255,255,.96);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  text-align: left;
}

.home-search>label {
  display: block;
  margin: 0 0 8px;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 650;
}

.home-search-row {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  gap: 9px;
}

.home-search-row input {
  height: 50px;
  font-size: 1rem;
}

.home-search-row .primary-button {
  min-width: 140px;
}

.home-location-link {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 10px 0 0;
  padding: 4px 2px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: .78rem;
  cursor: pointer;
}

.home-location-link .location-button-icon {
  width: 16px;
  height: 16px;
}

.home-location-link .location-button-icon i {
  width: 6px;
  height: 6px;
}

.feature-section {
  max-width: 1120px;
  margin: 0 auto;
  padding: 36px 24px 72px;
}

.section-heading {
  text-align: center;
  margin-bottom: 24px;
}

.section-heading h2 {
  margin: 8px 0 0;
  font-size: 1.55rem;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(4,1fr);
  gap: 14px;
}

.feature-grid article {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 17px;
  padding: 22px;
}

.feature-icon,
.stats-card-icon {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid;
  place-items: center;
  font-weight: 800;
}

.feature-grid h3 {
  margin: 18px 0 7px;
  font-size: 1rem;
}

.feature-grid p {
  margin: 0;
  color: var(--muted);
  font-size: .82rem;
  line-height: 1.55;
}

.fuelwise-network {
  margin-top: 52px;
}

.network-heading {
  margin-bottom: 18px;
}

.network-heading h2 {
  margin: 7px 0 0;
  font-size: 1.55rem;
}

.network-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.network-card {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 20px;
  min-height: 230px;
  padding: 30px;
  border-radius: 22px;
  overflow: hidden;
  color: #fff;
  text-decoration: none;
  box-shadow: 0 14px 32px rgba(17,24,39,.13);
  transition: transform .18s ease,box-shadow .18s ease;
}

.network-card::after {
  content: "";
  position: absolute;
  width: 170px;
  height: 170px;
  right: -45px;
  bottom: -80px;
  border: 34px solid rgba(255,255,255,.08);
  border-radius: 50%;
}

.network-card:hover,
.network-card:focus-visible {
  transform: translateY(-3px);
  box-shadow: 0 18px 38px rgba(17,24,39,.2);
  outline: 3px solid rgba(59,130,246,.3);
  outline-offset: 3px;
}

.network-card-ev {
  background: linear-gradient(135deg,#03a9f4 0%,#3f51b5 62%,#2196f3 100%);
}

.network-card-road {
  background: linear-gradient(135deg,#253247 0%,#344b6c 62%,#49709b 100%);
}

.network-icon {
  position: relative;
  z-index: 1;
  width: 58px;
  height: 58px;
  border: 1px solid rgba(255,255,255,.35);
  border-radius: 17px;
  background: rgba(255,255,255,.14);
  display: grid;
  place-items: center;
  font-size: 1.65rem;
  font-weight: 850;
}

.network-card>div {
  position: relative;
  z-index: 1;
}

.network-kicker {
  font-size: .72rem;
  font-weight: 750;
  letter-spacing: .07em;
  text-transform: uppercase;
  opacity: .78;
}

.network-card h3 {
  margin: 8px 0 10px;
  font-size: 1.55rem;
  letter-spacing: -.02em;
}

.network-card p {
  max-width: 360px;
  margin: 0;
  color: rgba(255,255,255,.85);
  font-size: .9rem;
  line-height: 1.55;
}

.network-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 24px;
  font-size: .84rem;
  font-weight: 750;
}

.stats-view {
  min-height: calc(100vh - 68px);
}

.stats-container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 48px 24px 72px;
}

.stats-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
}

.stats-heading h1 {
  margin: 8px 0 6px;
  font-size: 2rem;
  letter-spacing: -.025em;
}

.stats-heading p {
  margin: 0;
  color: var(--muted);
}

.stats-empty {
  max-width: 620px;
  margin: 70px auto;
  padding: 48px 28px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  text-align: center;
}

.stats-empty-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 18px;
  border-radius: 15px;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid;
  place-items: center;
  font-size: 1.3rem;
}

.stats-empty h2 {
  margin: 0 0 8px;
}

.stats-empty p {
  max-width: 450px;
  margin: 0 auto 22px;
  color: var(--muted);
  line-height: 1.55;
}

.stats-empty .primary-button {
  display: inline-block;
}

.stats-summary {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: 12px;
  margin-bottom: 14px;
}

.stats-summary article,
.stats-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 17px;
}

.stats-summary article {
  padding: 18px 20px;
}

.stats-summary small {
  display: block;
  color: var(--muted);
  font-size: .75rem;
  margin-bottom: 5px;
}

.stats-summary strong {
  font-size: 1.35rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.stats-card {
  padding: 22px;
}

.stats-card-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.stats-card-heading h2 {
  margin: 0 0 3px;
  font-size: 1.02rem;
}

.stats-card-heading p {
  margin: 0;
  color: var(--muted);
  font-size: .75rem;
}

.stat-bars {
  display: grid;
  gap: 15px;
}

.stat-row {
  display: grid;
  grid-template-columns: minmax(92px,auto) minmax(80px,1fr) auto;
  align-items: center;
  gap: 12px;
}

.stat-row-label {
  display: grid;
}

.stat-row-label strong {
  font-size: .82rem;
}

.stat-row-label span {
  font-size: .66rem;
  color: var(--muted);
}

.stat-track {
  height: 8px;
  border-radius: 6px;
  background: var(--bg);
  overflow: hidden;
}

.stat-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #8bcda1;
}

.stat-row.highest .stat-track i {
  background: #d99846;
}

.stat-row>strong {
  font-size: .8rem;
}

.stats-privacy {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: .72rem;
  text-align: center;
}

.stats-section-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  margin: 0 0 12px;
}

.stats-section-heading h2 {
  margin: 0 0 3px;
  font-size: 1.18rem;
}

.stats-section-heading p {
  margin: 0;
  color: var(--muted);
  font-size: .76rem;
}

.snapshot-grid {
  display: grid;
  grid-template-columns: repeat(5,minmax(0,1fr));
  gap: 10px;
}

.snapshot-grid article {
  min-width: 0;
  padding: 17px 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.snapshot-grid small,
.saving-highlight small,
.operator-extreme small,
.spread-heading small,
.spread-axis small {
  display: block;
  color: var(--muted);
  font-size: .7rem;
  margin-bottom: 6px;
}

.snapshot-grid strong {
  display: block;
  font-size: 1.12rem;
  white-space: nowrap;
}

.snapshot-grid .positive-stat strong {
  color: var(--accent);
}

.snapshot-grid .negative-stat strong {
  color: #dc2626;
}

.stats-price-unit {
  font-size: .66em;
  font-weight: 700;
  margin-left: 2px;
}

.spread-card {
  display: grid;
  grid-template-columns: minmax(170px,.3fr) 1fr;
  gap: 28px;
  align-items: center;
  margin: 12px 0;
  padding: 18px 20px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 15px;
}

.spread-heading strong {
  font-size: 1.3rem;
}

.spread-heading p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: .72rem;
}

.spread-track {
  position: relative;
  height: 11px;
  margin: 10px 5px 13px;
  border-radius: 7px;
  background: linear-gradient(90deg,#16a34a 0%,#eab308 52%,#dc2626 100%);
}

.spread-average-marker {
  position: absolute;
  top: 50%;
  width: 18px;
  height: 18px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: #344054;
  box-shadow: 0 0 0 1px #344054;
  transform: translate(-50%,-50%);
}

.spread-axis {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
}

.spread-axis>span:nth-child(2) {
  text-align: center;
}

.spread-axis>span:last-child {
  text-align: right;
}

.spread-axis strong {
  font-size: .8rem;
  white-space: nowrap;
}

.saving-highlight {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 12px 0;
  padding: 18px 20px;
  border: 1px solid #c8ead3;
  border-radius: 15px;
  background: #f0faf3;
}

.saving-icon {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border: 2px solid var(--accent);
  border-radius: 13px;
  color: var(--accent);
  display: grid;
  place-items: center;
  font-size: 1.15rem;
  font-weight: 800;
}

.saving-highlight strong {
  display: block;
  color: var(--accent);
  font-size: 1.35rem;
}

.saving-highlight p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: .72rem;
}

.snapshot-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.snapshot-detail-grid .stats-card>h2 {
  margin: 0 0 14px;
  font-size: 1rem;
}

.operator-extremes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-bottom: 13px;
}

.operator-extreme {
  min-width: 0;
  padding: 11px 13px;
  border-radius: 10px;
}

.cheapest-operator {
  background: var(--accent-soft);
}

.expensive-operator {
  background: #fff1f1;
}

.operator-extreme strong {
  display: block;
  font-size: .82rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cheapest-operator strong {
  color: var(--accent);
}

.expensive-operator strong {
  color: #c62828;
}

.operator-extreme p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: .69rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.operator-bars {
  display: grid;
  gap: 10px;
}

.operator-row {
  display: grid;
  gap: 4px;
}

.operator-row>div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: .72rem;
}

.operator-row>div span {
  color: var(--muted);
  white-space: nowrap;
}

.operator-row>i {
  height: 7px;
  border-radius: 6px;
  background: var(--bg);
  overflow: hidden;
}

.operator-row>i>b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #aeb7b0;
}

.operator-row>i>b.best {
  background: var(--accent);
}

.distribution-card {
  display: flex;
  flex-direction: column;
}

.distribution-chart {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: 18px;
  height: 185px;
  margin: 3px 12px 0;
}

.distribution-column {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 7px;
  text-align: center;
}

.distribution-column>strong {
  font-size: .92rem;
}

.distribution-column>i {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg,transparent 48%,#eef1ef 48%,#eef1ef 52%,transparent 52%);
}

.distribution-column>i>b {
  display: block;
  width: min(46px,70%);
  min-height: 3px;
  border-radius: 7px 7px 2px 2px;
  transition: height .25s ease;
}

.distribution-column.cheap>i>b {
  background: #16a34a;
}

.distribution-column.average>i>b {
  background: #eab308;
}

.distribution-column.expensive>i>b {
  background: #dc2626;
}

.distribution-column>span {
  font-size: .72rem;
  color: var(--muted);
}

.distribution-card>p {
  margin: auto 0 0;
  padding-top: 18px;
  text-align: center;
  color: var(--muted);
  font-size: .7rem;
}

.history-section {
  margin-top: 34px;
}

.history-section .stats-empty {
  max-width: none;
  margin: 0;
  padding: 36px 28px;
}

.history-section .stats-content {
  margin-top: 0;
}

.distribution-pie-layout {
  display: grid;
  grid-template-columns: minmax(130px,180px) 1fr;
  gap: 28px;
  align-items: center;
  justify-content: center;
  margin: 8px auto 0;
  width: min(100%,410px);
}

.distribution-pie {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: conic-gradient(#16a34a 0 33.33%,#eab308 33.33% 66.66%,#dc2626 66.66% 100%);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.06);
}

.distribution-legend {
  display: grid;
  gap: 13px;
}

.distribution-legend span {
  display: grid;
  grid-template-columns: 10px 24px 1fr;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: .76rem;
}

.distribution-legend i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.distribution-legend .cheap i {
  background: #16a34a;
}

.distribution-legend .average i {
  background: #eab308;
}

.distribution-legend .expensive i {
  background: #dc2626;
}

.distribution-legend strong {
  color: var(--ink);
  font-size: .86rem;
}

.stats-coverage {
  margin: 18px 0 0;
  padding: 11px 12px;
  border-radius: 10px;
  background: var(--bg);
  color: var(--muted);
  font-size: .72rem;
  line-height: 1.45;
}

/* Blue interaction language for station selection and map details. */

.station-card:hover {
  border-color: var(--price-color,var(--accent));
  background: var(--panel);
  box-shadow: 0 0 0 3px rgba(59,130,246,.12);
}

.station-card.closed:hover {
  background: #f2f2f2;
}

.station-card:not(.selected):hover .rank {
  background: var(--bg);
  color: var(--muted);
}

.station-card.closed:not(.selected):hover .rank {
  background: #e2e2e2;
  color: #6f6f6f;
}

.station-card.selected,
.station-card.selected:hover {
  border-color: var(--price-color,var(--accent));
  border: 3px solid #5590f7;
  background: var(--panel);
  box-shadow: none;
}

.station-card.closed.selected,
.station-card.closed.selected:hover {
  border: 3px solid #5590f7;
  background: #f2f2f2;
}

.station-card.selected::before {
  content: "";
  position: absolute;
  top: 14px;
  bottom: 14px;
  left: 6px;
  width: 4px;
  border-radius: 4px;
  background: #3b82f6;
  display: none;
}

.leaflet-popup-content-wrapper {
  padding: 0;
  border: 3px solid #5590f7;
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 5px 18px rgba(27,52,35,.22);
  color: #303030;
}

.leaflet-popup-content {
  width: 120px !important;
  min-width: 120px;
  margin: 13px 24px 13px 20px;
  font-size: 13px;
  line-height: 1.3;
}

.leaflet-popup-content strong {
  font-size: inherit;
}

.popup-updated {
  display: block;
  margin-top: 5px;
  color: #999;
  font-size: 11px;
  white-space: nowrap;
}

.popup-recommendation {
  display: table;
  margin: 0 0 5px;
  padding: 3px 6px;
  border-radius: 6px;
  background: #2563eb;
  color: #fff;
  font-size: 10px;
  font-weight: 750;
  line-height: 1;
  white-space: nowrap;
}

.leaflet-container a.leaflet-popup-close-button {
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  padding: 0;
  color: #707070;
  font-size: 21px;
  font-weight: 300;
  line-height: 22px;
}

.leaflet-container a.leaflet-popup-close-button:hover {
  color: #303030;
}

.leaflet-popup-tip-container {
  width: 40px;
  height: 20px;
  margin-top: -1px;
}

.leaflet-popup-tip {
  width: 17px;
  height: 17px;
  margin: -10px auto 0;
  background: #5590f7;
  box-shadow: none;
}

.map-location-button {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--floating-control-border);
  border-radius: 12px;
  background: #fff;
  color: var(--muted);
  box-shadow: 0 4px 14px rgba(27,52,35,.24);
  cursor: pointer;
}

.map-location-button:hover {
  background: #f7f8f7;
}

.map-location-button:disabled {
  cursor: wait;
  opacity: .65;
}

.station-list-subheader {
  margin: 12px 2px 1px;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 650;
  line-height: 1.3;
}

.station-card-wrap {
  position: relative;
}

.station-favorite-button {
  position: absolute;
  z-index: 2;
  top: 10px;
  right: 12px;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #a3aaa5;
  font-size: 19px;
  line-height: 1;
  cursor: pointer;
  box-shadow: none;
}

.station-favorite-button:hover {
  background: transparent;
  color: #f0a500;
  transform: scale(1.05);
}

.station-favorite-button.active {
  background: transparent;
  color: #e39a00;
}

.station-card .price-pair {
  padding-right: 40px;
}

.popup-favorite {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 8px 0 0;
  padding: 5px 7px;
  border: 0;
  border-radius: 7px;
  background: #f2f4f3;
  color: #59635d;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.popup-favorite span {
  color: #a3aaa5;
}

.popup-favorite.active {
  background: #fff4cb;
  color: #8b6500;
}

.popup-favorite.active span {
  color: #e39a00;
}

.nav-button {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.nav-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-star {
  display: grid;
  place-items: center;
  color: inherit;
  font-size: 16px;
  line-height: 1;
}

.map-filter-overlay {
  position: absolute;
  z-index: 800;
  top: 16px;
  left: 50%;
  width: min(520px,calc(100% - 32px));
  transform: translateX(-50%);
  padding: 12px 14px;
  border: 1px solid rgba(207,217,210,.95);
  border-radius: 15px;
  background: rgba(255,255,255,.96);
  box-shadow: 0 5px 18px rgba(27,52,35,.16);
  backdrop-filter: blur(8px);
}

.map-filter-overlay .fuel-and-fill {
  grid-template-columns: auto minmax(210px,1fr);
  align-items: end;
  gap: 18px;
}

.map-filter-overlay .fuel-buttons {
  display: grid;
  grid-template-columns: repeat(3,48px);
  gap: 5px;
}

.map-filter-overlay .fuel-buttons button {
  min-width: 48px;
  height: 40px;
  font-size: .8rem;
}

.map-filter-overlay .fuel-picker legend,
.map-filter-overlay .fill-slider>span {
  margin-bottom: 5px;
  font-size: .7rem;
}

.map-filter-overlay .slider-scale {
  grid-template-columns: auto minmax(150px,1fr) auto;
}

.map-location-control {
  margin-right: 16px !important;
  margin-bottom: 30px !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  display: flex;
  align-items: center;
  gap: 8px;
}

.map-location-control .search-area-button {
  position: static;
  z-index: auto;
  top: auto;
  left: auto;
  height: 44px;
  padding: 0 15px;
  transform: none;
  border-radius: 12px;
  font-size: .8rem;
}

.map-location-control .search-area-button[hidden] {
  display: none !important;
}

/* Unlimited favorites: a quiet watchlist focused on quick price comparison. */

.favorites-view {
  min-height: calc(100vh - 68px);
  background: linear-gradient(180deg,#f5fbf7 0,#eef2ef 100%);
}

.favorites-container {
  max-width: 960px;
  margin: 0 auto;
  padding: 48px 24px 72px;
}

.favorites-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 24px;
  margin-bottom: 24px;
}

.favorites-heading h1 {
  margin: 8px 0 6px;
  font-size: 2rem;
  letter-spacing: -.025em;
}

.favorites-heading p {
  margin: 0;
  color: var(--muted);
}

.favorites-empty {
  max-width: 620px;
  margin: 68px auto;
  padding: 50px 28px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #fff;
  text-align: center;
  box-shadow: var(--shadow);
}

.favorites-empty-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin: 0 auto 18px;
  border-radius: 18px;
  background: #fff4cb;
  color: #e39a00;
  font-size: 26px;
}

.favorites-empty h2 {
  margin: 0 0 9px;
  font-size: 1.4rem;
}

.favorites-empty p {
  max-width: 430px;
  margin: 0 auto 24px;
  color: var(--muted);
  line-height: 1.55;
}

.favorites-empty .primary-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.favorites-empty .location-button-icon {
  border-color: #fff;
}

.favorites-empty .location-button-icon::before,
.favorites-empty .location-button-icon::after {
  background: #fff;
}

.favorites-empty .location-button-icon i {
  border-color: #fff;
}

.favorites-empty>a {
  display: block;
  margin-top: 15px;
  color: var(--accent);
  font-size: .82rem;
  font-weight: 650;
}

.favorites-summary {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: .78rem;
}

.favorites-summary strong {
  color: var(--text);
  font-size: .9rem;
}

.favorites-list {
  display: grid;
  gap: 12px;
}

.favorite-monogram {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 13px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 800;
}

.favorite-copy {
  min-width: 0;
}

.favorite-copy p {
  margin: 0;
  color: var(--muted);
  font-size: .78rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.favorite-price {
  text-align: right;
}

.favorite-price small {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: .68rem;
}

.favorite-price strong {
  font-size: 1.15rem;
}

.favorite-actions button {
  padding: 7px 10px;
  border-radius: 9px;
  font: inherit;
  font-size: .72rem;
  font-weight: 650;
  cursor: pointer;
}

.favorite-view-button {
  border: 1px solid var(--line);
  background: #fff;
  color: #2563eb;
}

/* Mobile view switch lives in the header, leaving the full viewport for content. */

.topbar {
  height: 68px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  display: grid;
  align-items: center;
  padding: 0 24px;
  position: relative;
  z-index: 1001;
  grid-template-columns: 1fr auto;
  padding-left: 24px;
  padding-right: 24px;
}

/* Route-price search mode. */

.search-mode-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border-radius: var(--radius-control);
  background: var(--bg);
}

.search-mode-tabs button {
  height: 42px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: .82rem;
  font-weight: 650;
  cursor: pointer;
}

.nearby-search-fields,
.route-search-fields {
  display: grid;
  gap: 16px;
}

.route-search-fields input {
  width: 100%;
}

.route-origin-row {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  gap: 10px;
}

.route-origin-row .location-button {
  height: var(--control-height);
}

.route-search-fields .field-helper {
  margin: 0;
  color: var(--muted);
  font-size: .78rem;
  line-height: 1.4;
}

.home-route-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  margin: 13px 0 0;
  padding: 10px;
  border: 0;
  border-top: 1px solid var(--line);
  background: transparent;
  color: #2563eb;
  font: inherit;
  font-size: .82rem;
  font-weight: 650;
  cursor: pointer;
}

.home-route-link:hover,
.home-route-link:focus-visible {
  color: #1d4ed8;
}

.route-alternative-heading {
  margin-top: 18px;
  color: #2563eb;
}

.station-name>span:nth-child(2) {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.route-price-badge {
  flex: 0 0 auto;
  margin-left: auto;
  padding: 3px 6px;
  border-radius: 999px;
  font-size: .58rem;
  font-weight: 750;
  line-height: 1.2;
  white-space: nowrap !important;
  overflow: visible !important;
}

.route-price-badge.cheapest {
  background: #dcfce7;
  color: #15803d;
}

.route-price-badge.highest {
  background: #fee2e2;
  color: #b91c1c;
}

.station-card.route-alternative {
  border-style: dashed;
}

.route-offset {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 7px;
  border-radius: 999px;
  background: #eaf2ff;
  color: #245ec7;
  font-weight: 750;
  line-height: 1.2;
  white-space: nowrap;
}

.route-offset>span {
  font-size: 13px;
  line-height: 1;
}

.favorite-day-chart>span {
  font-size: .7rem;
}

.favorite-day-chart svg.trend-up polyline {
  stroke: var(--cluster-red);
}

.favorite-day-chart svg.trend-down polyline {
  stroke: var(--cluster-green);
}

.favorite-day-chart .chart-grid {
  stroke: #dfe5e1;
  stroke-width: 1;
}

.favorite-day-chart .chart-axis-label {
  fill: #707973;
  font-size: 8px;
  font-weight: 550;
}


.favorite-day-chart .chart-value {
  fill: #34413a;
  font-size: 9px;
  font-weight: 750;
}

.favorite-day-chart svg.trend-up circle {
  stroke: var(--cluster-red);
}

.favorite-day-chart svg.trend-down circle {
  stroke: var(--cluster-green);
}

.favorite-day-chart svg.trend-up {
  color: var(--cluster-red);
}

.favorite-day-chart svg.trend-down {
  color: var(--cluster-green);
}

.favorite-day-chart svg.trend-flat {
  color: #64748b;
}

.route-endpoint {
  display: grid !important;
  place-items: center;
  border: 3px solid #fff;
  border-radius: 50%;
  background: #2563eb;
  color: #fff;
  box-shadow: 0 3px 10px rgba(37,99,235,.35);
  font-size: .72rem;
  font-weight: 800;
}

.route-endpoint span {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
}

.price-marker.route-cheapest span {
  box-shadow: 0 0 0 4px rgba(22,163,74,.28),0 5px 15px rgba(27,52,35,.18);
}

.price-marker.route-highest span {
  box-shadow: 0 0 0 4px rgba(220,38,38,.24),0 5px 15px rgba(27,52,35,.18);
}

.price-marker.recommended span {
  box-shadow: 0 0 0 4px rgba(37,99,235,.28),0 7px 18px rgba(27,52,35,.25);
}

.price-marker .recommendation-badge {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 5px);
  transform: translateX(-50%);
  padding: 3px 6px;
  border-radius: 6px;
  background: #2563eb;
  color: #fff;
  font-size: 10px;
  font-weight: 750;
  line-height: 1;
  white-space: nowrap;
}

.price-marker.recommended.selected .recommendation-badge {
  background: #1d4ed8;
}

.fuel-price-cluster {
  overflow: visible !important;
  border: 0 !important;
  background: transparent !important;
}

.fuel-cluster-marker {
  --cluster-green: #19c45a;
  --cluster-red: #ef3e4d;
  position: relative;
  width: 53px;
  height: 55px;
  color: #fff;
  text-align: center;
}

.fuel-cluster-marker strong {
  position: absolute;
  z-index: 2;
  top: 0;
  left: 9px;
  display: grid;
  width: 35px;
  height: 35px;
  box-sizing: border-box;
  place-items: center;
  border: 4px solid var(--cluster-green);
  border-radius: 50%;
  background: #17202a;
  color: #fff;
  box-shadow: 0 3px 10px rgba(23,32,42,.28);
  font-size: 13px;
  line-height: 1;
}

.fuel-cluster-marker::after {
  content: "";
  position: absolute;
  z-index: 1;
  top: 29px;
  left: 21px;
  width: 11px;
  height: 11px;
  clip-path: polygon(0 0,100% 0,50% 100%);
  background: var(--cluster-green);
}

.fuel-cluster-marker small {
  position: absolute;
  z-index: 3;
  top: 39px;
  left: 50%;
  transform: translateX(-50%);
  padding: 2px 4px;
  border: 1px solid #dfe5e2;
  border-radius: 4px;
  background: #fff;
  color: #314039;
  box-shadow: 0 2px 6px rgba(23,32,42,.14);
  font-size: 10px;
  font-weight: 650;
  line-height: 1.1;
  white-space: nowrap;
}

.fuel-cluster-red strong {
  border-color: var(--cluster-red);
}

.fuel-cluster-red::after {
  background: var(--cluster-red);
}

.fuel-cluster-mixed strong {
  border-color: transparent;
  background: linear-gradient(#17202a,#17202a) padding-box,conic-gradient(var(--cluster-red) 0 50%,var(--cluster-green) 50% 100%) border-box;
}

.fuel-cluster-mixed::after {
  background: linear-gradient(90deg,var(--cluster-green) 0 50%,var(--cluster-red) 50% 100%);
}

.fuel-cluster-neutral strong {
  border-color: #9ca3af;
}

.fuel-cluster-neutral::after {
  background: #9ca3af;
}

.marker-cluster-spider-leg {
  stroke: #5590f7;
  stroke-width: 2;
  stroke-opacity: .65;
}

.search-mode-tabs button.active {
  background: var(--panel);
  color: var(--accent);
  box-shadow: 0 2px 8px rgba(27,52,35,.09);
}

.search-panel[data-search-mode="route"] .search-mode-tabs button.active {
  color: var(--route-accent);
  box-shadow: none;
}

.search-panel[data-search-mode="route"] .primary-button {
  border-color: var(--route-accent);
  background: var(--route-accent);
}

.search-panel[data-search-mode="route"] .primary-button:hover,
.search-panel[data-search-mode="route"] .primary-button:focus-visible {
  border-color: #2458d6;
  background: #2458d6;
}




.favorite-fuel-price:last-child {
  border-right: 0;
}

.favorite-fuel-price.active {
  background: var(--accent-soft);
}

.favorite-fuel-price small {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: .68rem;
  font-weight: 650;
}

.favorite-fuel-price strong {
  display: block;
  font-size: 1rem;
  white-space: nowrap;
}

.favorite-trend-heading {
  min-width: 0;
}

.favorite-trend span {
  display: block;
  color: var(--text);
  font-size: .72rem;
  font-weight: 700;
}

.favorite-trend small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: .66rem;
}

.favorite-day-chart polyline {
  fill: none;
  stroke: var(--cluster-green);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.favorite-day-chart>small {
  margin: 0;
  white-space: nowrap;
}

.favorite-day-chart.empty {
  display: grid;
  place-content: center;
  min-height: 108px;
  border: 1px dashed var(--line);
  border-radius: 9px;
  grid-template-columns: 1fr;
  text-align: center;
}

.favorite-trend.empty {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  background: #f8faf9;
}

.favorite-card.closed .favorite-prices,
.favorite-card.closed .favorite-trend {
  filter: grayscale(1);
  opacity: .72;
}

.favorite-card-main>.rank {
  width: 25px;
}

.favorite-copy h2 {
  margin: 0 0 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
  font-size: .95rem;
}

.favorite-prices {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  overflow: hidden;
  margin-top: 10px;
  border: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
}

.favorite-fuel-price {
  min-width: 0;
  border-right: 1px solid var(--line);
  padding: 9px 10px;
}

.favorite-trend {
  display: grid;
  grid-template-columns: auto minmax(250px,1fr);
  align-items: center;
  gap: 18px;
  padding: 10px 12px;
  margin-top: 10px;
  border: 0;
  border-radius: 10px;
  background: var(--bg);
}

.favorite-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
  padding-top: 0;
  border-top: 0;
}

.favorite-remove-button {
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #e39a00;
  font-size: 22px;
  line-height: 1;
  box-shadow: none;
}

.favorite-remove-button:hover {
  background: transparent;
  color: #b77900;
  transform: scale(1.05);
}

.favorite-day-chart circle {
  stroke: var(--cluster-green);
  stroke-width: 2;
}

.favorite-day-chart .sparkline-start {
  fill: var(--panel);
}

.favorite-day-chart .sparkline-end {
  fill: var(--cluster-green);
}

/* Version label under the Tanken? Wo? wordmark */

.brand-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.05;
}

.brand-name {
  font-weight: 800;
  letter-spacing: -.035em;
  white-space: nowrap;
}

.brand-name em {
  color: var(--accent);
  font-style: normal;
  font-weight: 850;
}

.brand-version {
  margin-top: 3px;
  font-size: .62rem;
  font-weight: 650;
  letter-spacing: .02em;
  color: var(--muted);
}

/* ==========================================================================
   V3.3.1 — canonical responsive shell
   One authoritative layout layer replaces the historical V3.x override stack.
   Desktop remains sidebar + map. Mobile List is a drawer over the persistent map.
   ========================================================================== */

.mobile-global-nav,
.map-config-chip,
.map-radius-chip,
.map-filter-heading,
.map-modal-backdrop,
.results-drawer-handle {
  display: none;
}

.map-top-controls {
  position: absolute;
  z-index: 950;
  top: 16px;
  left: 16px;
  width: min(430px, calc(100% - 32px));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  pointer-events: none;
}

.map-top-controls > .search-panel {
  width: 100%;
  margin: 0;
  pointer-events: auto;
}

.map-top-controls > .map-config-chip,
.map-top-controls > .map-radius-chip {
  pointer-events: auto;
}

.map-radius-overlay {
  display: none;
}

.map-config-chip-chevron {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.map-filter-heading {
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  font-size: 1rem;
}

.map-filter-close {
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  display: grid;
  place-items: center;
  font: inherit;
  font-size: 1.6rem;
  line-height: 1;
  text-align: center;
  cursor: pointer;
}

.route-origin-input-wrap {
  position: relative;
  min-width: 0;
}

.route-origin-input-wrap input {
  width: 100%;
  padding-right: 44px;
}

.route-origin-input-wrap input::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
}

.route-origin-clear {
  position: absolute;
  top: 50%;
  right: 5px;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #172019;
  display: grid;
  place-items: center;
  font-family: inherit;
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
}

.route-origin-clear[hidden] {
  display: none !important;
}

.route-origin-clear:focus-visible {
  color: var(--accent);
  background: transparent;
}

/* Favorites: current compact card language and chart order/spacing. */

.favorite-card {
  padding: 12px;
  border: 2px solid var(--line);
  border-radius: 15px;
  background: var(--panel);
  box-shadow: none;
}

.favorite-card.closed {
  color: #6f6f6f;
  border-color: #9e9e9e;
  background: #f2f2f2;
}

.favorite-card-main {
  display: grid;
  align-items: center;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: 8px;
}

.favorite-day-charts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.favorite-day-chart {
  display: grid;
  grid-template-columns: 1fr;
  align-items: stretch;
  gap: 6px;
  min-width: 0;
}

.favorite-day-chart > span {
  display: block;
  margin: 0 0 2px;
  text-align: center;
  font-size: .76rem;
  font-weight: 700;
}

.favorite-day-chart svg {
  display: block;
  width: 100%;
  height: auto;
  min-height: 108px;
  overflow: visible;
}

/* Desktop: search belongs to the sidebar; the map remains the second column. */

/* Mobile: one explicit shell, no chained version overrides. */

@media (min-width: 761px) {
  .prices-view {
    height: calc(100vh - var(--app-header-h));
    display: grid;
    grid-template-columns: clamp(390px, 32vw, 480px) minmax(0, 1fr);
  }

  .results-panel {
    min-width: 0;
    min-height: 0;
  }

  .map-panel,
  #map {
    min-width: 0;
    min-height: 0;
  }

  .map-top-controls {
    display: none;
  }

  .map-filter-heading {
    display: none;
  }
}

@media (max-width:1100px) {
  .snapshot-grid {
    grid-template-columns: repeat(3,1fr);
  }

  .operator-extremes {
    grid-template-columns: 1fr;
  }
}

@media (max-width:1023px) {
  .leaflet-control-zoom {
    display: none !important;
  }
}

@media (max-width:900px) {
  .feature-grid {
    grid-template-columns: repeat(2,1fr);
  }

  .network-card {
    min-height: 250px;
    padding: 25px;
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .network-icon {
    width: 48px;
    height: 48px;
  }
}

@media (max-width:760px) {
  :root {
    --mobile-search-max-height: min(420px, calc(100dvh - 104px - env(safe-area-inset-top) - env(safe-area-inset-bottom)));
  }
  .prices-view {
    height: auto;
    display: block;
  }

  .results-panel {
    padding: 15px;
    min-height: calc(100vh - 68px);
  }

  .filter-row {
    grid-template-columns: 1fr 1fr;
  }

  .filter-row label:last-child {
    grid-column: 1/-1;
  }

  .prices-view.show-map .map-panel {
    display: block;
  }

  .trend-container {
    padding: 18px 15px;
  }

  .station-header h1 {
    font-size: 1.15rem;
  }

  .station-header .secondary-button {
    padding: 9px 11px;
  }

  .trend-controls {
    display: grid;
    gap: 10px;
  }

  .price-summary {
    grid-template-columns: 1fr 1fr;
  }

  .price-summary>div {
    padding: 14px;
  }

  .price-summary>div:nth-child(3) {
    grid-column: 1/-1;
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .price-summary strong {
    font-size: 1.16rem;
  }

  .chart-card {
    padding: 15px;
  }

  .chart-heading {
    display: grid;
  }

  .range-tabs {
    justify-self: start;
  }

  #trend-chart {
    height: 270px;
  }

  .insight-row {
    grid-template-columns: 1fr;
  }

  .results-panel footer {
    margin-top: 12px;
  }

  .station-card {
    grid-template-columns: minmax(0,1fr) auto;
    gap: 7px 8px;
  }

  .price-pair {
    gap: 7px;
  }

  .price-unit,
  .fill-total {
    min-width: 64px;
  }

  .price-pair strong {
    font-size: .95rem;
  }

  .location-row {
    grid-template-columns: minmax(0,1fr) auto;
  }

  .location-button {
    grid-column: 2;
    grid-row: 1;
  }

  .radius-field {
    grid-column: 1/-1;
    grid-template-columns: auto 1fr;
    align-items: center;
  }

  .radius-field select {
    width: 100%;
  }

  .map-legend {
    left: 10px;
    right: 10px;
    bottom: 20px;
    justify-content: center;
  }

  .map-legend i {
    width: min(90px,24vw);
  }

  .fuel-and-fill {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .station-list {
    overflow: visible;
    padding-right: 0;
    scrollbar-gutter: auto;
  }

  .search-area-button {
    top: 12px;
    padding: 9px 14px;
  }

  .home-hero {
    padding: 46px 15px 34px;
  }

  .home-hero h1 {
    font-size: 2.5rem;
  }

  .home-search {
    padding: 13px;
  }

  .home-search-row {
    grid-template-columns: 1fr;
  }

  .home-search-row .primary-button {
    height: 48px;
  }

  .feature-section {
    padding: 30px 15px 48px;
  }

  .feature-grid {
    grid-template-columns: 1fr;
  }

  .fuelwise-network {
    margin-top: 40px;
  }

  .network-grid {
    grid-template-columns: 1fr;
  }

  .network-card {
    min-height: 0;
    padding: 24px;
  }

  .network-card h3 {
    font-size: 1.35rem;
  }

  .stats-container {
    padding: 34px 15px 48px;
  }

  .stats-heading {
    align-items: start;
  }

  .stats-heading h1 {
    font-size: 1.6rem;
  }

  .stats-heading .secondary-button {
    white-space: nowrap;
    padding: 9px 11px;
  }

  .snapshot-grid {
    grid-template-columns: 1fr 1fr;
  }

  .snapshot-grid article {
    padding: 14px 13px;
  }

  .snapshot-grid strong {
    font-size: 1rem;
  }

  .spread-card {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .saving-highlight {
    align-items: flex-start;
  }

  .snapshot-detail-grid {
    grid-template-columns: 1fr;
  }

  .operator-extremes {
    grid-template-columns: 1fr 1fr;
  }

  .distribution-card {
    min-height: 290px;
  }

  .stats-summary {
    grid-template-columns: 1fr 1fr;
  }

  .stats-summary article:last-child {
    grid-column: 1/-1;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .stat-row {
    grid-template-columns: 88px minmax(60px,1fr) auto;
  }

  .map-location-control {
    margin-right: 10px !important;
    margin-bottom: 72px !important;
  }

  .map-location-control .search-area-button {
    height: 44px;
    padding: 0 12px;
  }

  .map-panel {
    display: none;
    height: calc(100vh - 126px);
  }

  .prices-view.show-map .results-panel {
    min-height: 0;
    padding-bottom: 10px;
    display: none;
  }

  .favorites-container {
    padding: 34px 15px 48px;
  }

  .favorites-heading h1 {
    font-size: 1.6rem;
  }

  .favorites-heading p {
    font-size: .85rem;
  }

  .favorites-heading .secondary-button {
    white-space: nowrap;
    padding: 9px 11px;
  }

  .favorites-empty {
    margin: 32px auto;
    padding: 38px 20px;
  }

  .favorite-card {
    padding: 14px;
  }

  .favorite-price {
    grid-column: 2;
    text-align: left;
  }

  .favorite-price small {
    display: none;
  }

  .station-favorite-button {
    top: 10px;
    right: 12px;
  }

  
.favorite-remove-button {
    grid-column: auto;
  }

  html,
  body {
    min-height: 100%;
  }

  body {
    padding-bottom: 0;
  }

  .topbar {
    padding-left: 15px;
    padding-right: 15px;
    grid-template-columns: 1fr auto;
    padding: 0 15px;
  }

  .mobile-global-nav {
    position: fixed;
    z-index: 1400;
    left: var(--mobile-edge);
    right: var(--mobile-edge);
    bottom: calc(15px + env(safe-area-inset-bottom));
    height: var(--mobile-nav-h);
    min-height: var(--mobile-nav-h);
    margin: 0;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 2px;
    padding: 3px 5px;
    border: 1px solid rgba(219, 227, 221, .9);
    border-radius: 23px;
    background: #fff;
    box-shadow: 0 8px 28px rgba(24, 32, 25, .16);
    isolation: isolate;
    overflow: hidden;
  }

  .mobile-global-nav .nav-button {
    width: 100%;
    min-width: 0;
    min-height: 45px;
    display: grid;
    grid-template-rows: 18px auto;
    place-items: center;
    gap: 2px;
    padding: 4px 2px;
    border-radius: 15px;
    color: #5f6b63;
    font-size: .62rem;
    font-weight: 560;
    line-height: 1.05;
    letter-spacing: .005em;
    text-decoration: none;
    overflow: hidden;
  }

  .mobile-global-nav .nav-button span:last-child {
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .mobile-global-nav .nav-icon {
    width: 16px;
    height: 16px;
    stroke-width: 2.15;
  }

  .mobile-global-nav .nav-star {
    font-weight: 800;
  }

  .mobile-global-nav .nav-button.active {
    background: rgba(231, 244, 235, .92);
    color: var(--accent);
    font-weight: 700;
  }

  body.map-settings-open .mobile-global-nav,
  body.returning-to-list-settings .mobile-global-nav {
    opacity: 0;
    pointer-events: none;
    transform: translateY(12px);
  }

  .toast {
    bottom: calc(var(--mobile-nav-h) + 40px + env(safe-area-inset-bottom));
    z-index: 1500;
  }

  /* Normal scrolling destinations reserve only enough room for the floating dock. */

  body[data-view="favorites"] .favorites-container,
  body[data-view="stats"] .stats-container,
  body[data-view="trend"] .trend-container {
    padding-bottom: calc(var(--mobile-nav-h) + 42px + env(safe-area-inset-bottom));
  }

  body[data-view="home"] .mobile-global-nav {
    display: none;
  }

  body[data-view="home"] .feature-section {
    padding-bottom: 42px;
  }

  /* Map/List share the same full-viewport prices shell. */

  body[data-view="prices"] {
    overflow: hidden;
    background: #dfe8df;
  }

  body[data-view="prices"] .prices-view {
    position: fixed;
    inset: 0;
    height: 100dvh;
    min-height: 100dvh;
    display: block;
    overflow: hidden;
  }

  body[data-view="prices"] .map-panel {
    position: absolute;
    inset: 0;
    height: 100dvh;
    min-height: 100dvh;
  }

  body[data-view="prices"] #map {
    height: 100dvh;
    min-height: 100dvh;
  }

  /* MAP destination */

  body[data-view="prices"][data-prices-mode="map"] .topbar,
  body[data-view="prices"][data-prices-mode="map"] .results-panel {
    display: none;
  }

  body[data-view="prices"][data-prices-mode="map"] .map-panel {
    display: block;
  }

  body[data-view="prices"][data-prices-mode="map"] .map-top-controls {
    position: absolute;
    z-index: 1320;
    top: calc(10px + env(safe-area-inset-top));
    left: var(--mobile-edge);
    right: var(--mobile-edge);
    width: auto;
    display: flex;
    gap: 10px;
  }

  body[data-view="prices"][data-prices-mode="map"] .map-top-controls > .search-panel {
    display: block;
    width: 100%;
    border-radius: var(--radius-panel);
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 8px 26px rgba(24, 32, 25, .14);
    overflow: hidden;
    -webkit-backdrop-filter: blur(20px) saturate(1.12);
    backdrop-filter: blur(20px) saturate(1.12);
  }

  .search-panel-toggle {
    min-height: 54px;
  }

  body[data-view="prices"][data-prices-mode="map"] .map-top-controls > .search-panel .search-panel-toggle {
    min-height: 54px;
    padding: 10px var(--search-gutter);
  }

  body[data-view="prices"][data-prices-mode="map"] .map-top-controls > .search-panel:has(.search-panel-toggle[aria-expanded="true"]) {
    height: auto;
    max-height: var(--mobile-search-max-height);
  }

  #search-form .radius-picker {
    display: none;
  }

  body[data-view="prices"][data-prices-mode="map"] .map-top-controls > .search-panel:has(.search-panel-toggle[aria-expanded="true"]) .search-form {
    max-height: calc(var(--mobile-search-max-height) - 54px);
    overflow-x: hidden;
    overflow-y: auto;
  }

  .map-panel > .search-panel .search-panel-toggle[aria-expanded="false"] + .search-form {
    display: none !important;
  }

  body[data-view="prices"][data-prices-mode="map"] .map-top-controls > .map-config-chip {
    position: fixed;
    z-index: 1301;
    right: 10px;
    bottom: calc(134px + env(safe-area-inset-bottom));
    left: auto;
    top: auto;
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
    margin: 0;
    padding: 0;
    border: 1px solid var(--floating-control-border);
    border-radius: 50%;
    background: #fff;
    color: var(--accent);
    display: grid;
    place-items: center;
    font-size: 12px;
    font-weight: 750;
    line-height: 1;
    box-shadow: 0 4px 14px rgba(27, 52, 35, .20);
  }

  body[data-view="prices"][data-prices-mode="map"] .map-radius-chip {
    position: fixed;
    z-index: 1302;
    right: 10px;
    bottom: calc(188px + env(safe-area-inset-bottom));
    left: auto;
    top: auto;
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
    margin: 0;
    padding: 0;
    border: 1px solid var(--floating-control-border);
    border-radius: 50%;
    background: #fff;
    color: var(--accent);
    display: grid;
    place-items: center;
    font-size: 12px;
    font-weight: 750;
    line-height: 1;
    box-shadow: 0 4px 14px rgba(27, 52, 35, .20);
  }

  .map-radius-chip[hidden] {
    display: none !important;
  }

  body[data-view="prices"][data-prices-mode="map"] .map-config-chip-chevron {
    display: none;
  }

  body[data-view="prices"] .map-legend {
    display: none;
  }

  body[data-view="prices"][data-prices-mode="map"] .map-location-control {
    z-index: 1300;
    margin-right: 10px !important;
    margin-bottom: calc(68px + env(safe-area-inset-bottom)) !important;
    opacity: 1;
    pointer-events: auto;
  }

  .map-location-button {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    pointer-events: auto;
    touch-action: manipulation;
  }

  #search-area-button[hidden] {
    display: none !important;
  }

  .leaflet-touch .leaflet-control-attribution,
  .leaflet-touch .leaflet-control-layers,
  .leaflet-touch .leaflet-bar {
    font-size: 8px;
    opacity: .6;
  }

  /* LIST destination: mobile drawer over the live map. Desktop is unchanged. */

  body[data-view="prices"][data-prices-mode="list"] {
    background: #dfe8df;
  }

  body[data-view="prices"][data-prices-mode="list"] .topbar {
    display: none;
  }

  body[data-view="prices"][data-prices-mode="list"] .map-panel {
    display: block;
  }

  body[data-view="prices"][data-prices-mode="list"] .map-top-controls {
    position: absolute;
    z-index: 1320;
    top: calc(10px + env(safe-area-inset-top));
    left: var(--mobile-edge);
    right: var(--mobile-edge);
    width: auto;
    display: flex;
    gap: 10px;
  }

  body[data-view="prices"][data-prices-mode="list"] .map-top-controls > .search-panel {
    display: block;
    width: 100%;
    border-radius: var(--radius-panel);
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 8px 26px rgba(24, 32, 25, .14);
    overflow: hidden;
    -webkit-backdrop-filter: blur(20px) saturate(1.12);
    backdrop-filter: blur(20px) saturate(1.12);
  }

  body[data-view="prices"][data-prices-mode="list"] .map-top-controls > .search-panel .search-panel-toggle {
    min-height: 54px;
    padding: 10px var(--search-gutter);
  }

  body[data-view="prices"][data-prices-mode="list"] .map-top-controls > .search-panel:has(.search-panel-toggle[aria-expanded="true"]) {
    height: auto;
    max-height: var(--mobile-search-max-height);
  }

  body[data-view="prices"][data-prices-mode="list"] .map-top-controls > .search-panel:has(.search-panel-toggle[aria-expanded="true"]) .search-form {
    max-height: calc(var(--mobile-search-max-height) - 54px);
    overflow-x: hidden;
    overflow-y: auto;
  }

  body[data-view="prices"][data-prices-mode="list"] .map-top-controls > .map-config-chip,
  body[data-view="prices"][data-prices-mode="list"] .map-top-controls > .map-radius-chip {
    display: none;
  }

  body[data-view="prices"][data-prices-mode="list"] .map-location-control {
    display: none;
  }

  body[data-view="prices"][data-prices-mode="list"] .results-panel {
    position: fixed;
    z-index: 1280;
    left: var(--mobile-edge);
    right: var(--mobile-edge);
    bottom: calc(var(--mobile-nav-h) + 23px + env(safe-area-inset-bottom));
    width: auto;
    min-height: 132px;
    max-height: calc(100dvh - var(--mobile-nav-h) - 110px - env(safe-area-inset-bottom) - env(safe-area-inset-top));
    padding: 4px 12px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow: hidden;
    border: 1px solid rgba(219, 227, 221, .94);
    border-radius: 24px;
    background: rgba(250, 251, 250, .98);
    box-shadow: 0 14px 36px rgba(24, 32, 25, .22);
    -webkit-backdrop-filter: blur(18px) saturate(1.08);
    backdrop-filter: blur(18px) saturate(1.08);
    transition: height .28s cubic-bezier(.22,.61,.36,1);
    will-change: height;
  }

  body[data-view="prices"][data-prices-mode="list"][data-list-drawer="peek"] .results-panel {
    height: 132px;
  }

  body[data-view="prices"][data-prices-mode="list"][data-list-drawer="half"] .results-panel {
    height: 52dvh;
  }

  body[data-view="prices"][data-prices-mode="list"][data-list-drawer="expanded"] .results-panel {
    height: calc(100dvh - var(--mobile-nav-h) - 110px - env(safe-area-inset-bottom) - env(safe-area-inset-top));
  }

  body[data-view="prices"][data-prices-mode="list"] .results-drawer-handle {
    order: 0;
    flex: 0 0 24px;
    width: 100%;
    height: 24px;
    min-height: 24px;
    margin: 0;
    padding: 5px 0 7px;
    border: 0;
    border-radius: 0;
    background: transparent;
    display: grid;
    place-items: center;
    cursor: ns-resize;
    touch-action: none;
  }

  body[data-view="prices"][data-prices-mode="list"] .results-drawer-handle > span {
    width: 38px;
    height: 5px;
    border-radius: 999px;
    background: #bdc7c0;
  }

  body[data-view="prices"][data-prices-mode="list"] .result-heading {
    order: 1;
    flex: 0 0 auto;
    min-height: 52px;
    padding: 0 2px 8px;
    align-items: center;
    border-top: 0;
  }

  body[data-view="prices"][data-prices-mode="list"] .result-heading > div:first-child {
    min-width: 0;
    padding-right: 8px;
  }

  body[data-view="prices"][data-prices-mode="list"] .result-heading h1 {
    margin-bottom: 2px;
    font-size: 1rem;
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  body[data-view="prices"][data-prices-mode="list"] .result-heading p {
    font-size: .73rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  body[data-view="prices"][data-prices-mode="list"] .sort-label {
    display: none;
  }

  body[data-view="prices"][data-prices-mode="list"] .status-message {
    order: 2;
    flex: 0 0 auto;
  }

  body[data-view="prices"][data-prices-mode="list"] .station-list {
    order: 3;
    flex: 1 1 0;
    min-height: 0;
    height: auto;
    gap: 9px;
    padding: 0 1px 10px;
    overflow-x: hidden;
    overflow-y: auto;
    background: transparent;
    border-radius: 0;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  body[data-view="prices"][data-prices-mode="list"][data-list-drawer="peek"] .status-message,
  body[data-view="prices"][data-prices-mode="list"][data-list-drawer="peek"] .station-list {
    visibility: hidden;
    pointer-events: none;
  }

  body[data-view="prices"][data-prices-mode="list"] .results-panel footer {
    display: none;
  }

  body[data-view="prices"][data-prices-mode="list"] .station-card,
  body[data-view="prices"][data-prices-mode="list"] .station-card-wrap:first-child .station-card,
  body[data-view="prices"][data-prices-mode="list"] .station-card-wrap:last-child .station-card {
    border: 2px solid var(--price-color, var(--line));
    border-radius: 15px;
    padding: 12px;
    background: var(--panel);
    box-shadow: none;
  }

  body[data-view="prices"][data-prices-mode="list"] .station-card.selected,
  body[data-view="prices"][data-prices-mode="list"] .station-card.selected:hover {
    border: 3px solid #5590f7;
    background: var(--panel);
  }

  body[data-view="prices"][data-prices-mode="list"] .station-card.closed,
  body[data-view="prices"][data-prices-mode="list"] .station-card.closed:hover {
    border-color: #9e9e9e;
    background: #f2f2f2;
  }

  /* Fuel/fill modal sheet; intentionally no dimming backdrop. */

  .map-modal-backdrop,
  .map-modal-backdrop.is-open {
    display: none;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }

  .map-filter-overlay {
    position: fixed;
    z-index: 1450;
    top: auto;
    left: var(--mobile-edge);
    right: var(--mobile-edge);
    bottom: calc(10px + env(safe-area-inset-bottom));
    width: auto;
    max-width: none;
    padding: 16px 16px 20px;
    border: 1px solid rgba(219, 227, 221, .9);
    border-radius: 28px;
    background: rgba(250, 251, 252, .97);
    box-shadow: 0 18px 48px rgba(24, 32, 25, .25);
    transform: translateY(calc(100% + 40px));
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: transform .24s cubic-bezier(.2, .75, .3, 1), opacity .18s ease, visibility 0s linear .24s;
    -webkit-backdrop-filter: blur(24px) saturate(1.1);
    backdrop-filter: blur(24px) saturate(1.1);
  }

  .map-filter-overlay.is-open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition-delay: 0s;
  }

  .map-radius-overlay {
    display: block;
    padding-bottom: 18px;
  }

  .map-radius-overlay .radius-picker {
    display: block;
    margin: 0;
  }

  .map-filter-overlay.map-radius-overlay .radius-buttons {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
  }

  .map-filter-overlay.map-radius-overlay .radius-buttons button {
    min-width: 0;
    height: 46px;
    padding: 0 4px;
    font-size: .86rem;
  }

  .map-filter-heading {
    display: flex;
  }

  .map-filter-overlay .fuel-and-fill {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .map-filter-overlay .fuel-buttons {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }

  .map-filter-overlay .fuel-buttons button {
    min-width: 0;
    height: 46px;
    font-size: .9rem;
  }

  .map-filter-overlay .slider-scale {
    grid-template-columns: auto minmax(120px, 1fr) auto;
    gap: 9px;
  }

  /* Favorites mobile layout. */

  .favorites-heading {
    align-items: center;
    margin-bottom: 12px;
  }

  .favorites-meta-row {
    width: 100%;
    flex: 0 0 auto;
    justify-content: flex-start;
    gap: 6px;
    margin: 0 0 18px;
    color: var(--muted);
    font-size: .78rem;
  }

  .favorites-meta-row p {
    min-width: 0;
    margin: 0;
    white-space: normal;
  }

  .favorite-card-main {
    grid-template-columns: auto minmax(0, 1fr) auto auto;
  }

  .favorite-actions {
    justify-content: flex-end;
  }
}

@media (max-width:560px) {
  .favorite-prices {
    grid-template-columns: repeat(3,1fr);
  }

  .favorite-fuel-price {
    padding: 9px 8px;
  }

  .favorite-fuel-price strong {
    font-size: .9rem;
  }

  .favorite-trend {
    grid-template-columns: 1fr;
  }

  .favorite-trend.empty {
    display: grid;
  }

  .favorite-day-charts {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .favorite-day-chart svg {
    height: 38px;
    min-height: 120px;
  }
}

@media (max-width:460px) {
  .station-saving {
    grid-template-columns: 1fr;
  }

  .station-saving span:last-child {
    text-align: left;
  }

  .distribution-pie-layout {
    grid-template-columns: 120px 1fr;
    gap: 18px;
  }

  .operator-extremes {
    grid-template-columns: 1fr;
  }

  .route-price-badge {
    display: none;
  }

}


@media (hover:hover) and (pointer:fine) {
  .location-clear:hover,
  .route-origin-clear:hover {
    color: var(--accent);
    background: transparent;
  }
}

@media (prefers-reduced-motion:reduce) {
  .station-skeleton i,
  .skeleton-meta {
    animation: none;
  }

  .search-chevron,
  .results-panel {
    transition: none;
  }

  .refresh-button.loading svg {
    animation: none;
  }
}

/* V3.3.6 search UI normalization */
.search-panel .search-form input,
.search-panel .location-button,
.search-panel .primary-button {
  border-radius: var(--radius-control);
}

.search-panel .location-clear,
.search-panel .route-origin-clear {
  border-radius: 50%;
}


/* V3.3.7: keep the radius control spatially stable across Nearby / Along route. */
.map-radius-route-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: .78rem;
  line-height: 1.4;
}
.map-radius-route-note[hidden] {
  display: none !important;
}


/* V3.3.8: smooth Search disclosure + List drawer entrance/exit on mobile. */
@media (max-width:760px) {
  /* Keep the form mounted so opening/closing can animate instead of popping via display:none. */
  body[data-view="prices"] .map-top-controls > .search-panel .search-panel-toggle + .search-form {
    display: grid !important;
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    border-top-color: transparent;
    opacity: 0;
    transform: translateY(-8px);
    visibility: hidden;
    pointer-events: none;
    overflow: hidden;
    transition:
      max-height .24s cubic-bezier(.2,.75,.3,1),
      padding-top .24s cubic-bezier(.2,.75,.3,1),
      padding-bottom .24s cubic-bezier(.2,.75,.3,1),
      transform .24s cubic-bezier(.2,.75,.3,1),
      opacity .18s ease,
      border-color .18s ease,
      visibility 0s linear .24s;
    will-change: max-height, transform, opacity;
  }

  body[data-view="prices"] .map-top-controls > .search-panel .search-panel-toggle[aria-expanded="true"] + .search-form {
    display: grid !important;
    max-height: calc(var(--mobile-search-max-height) - 54px);
    padding-top: 18px;
    padding-bottom: 16px;
    border-top-color: var(--line);
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
    pointer-events: auto;
    overflow-x: hidden;
    overflow-y: auto;
    transition-delay: 0s;
  }

  /* Keep the list drawer mounted off-canvas while Map is active. This lets the
     List tab use the same physical motion as the drawer handle height changes. */
  body[data-view="prices"][data-prices-mode="map"] .results-panel {
    position: fixed;
    z-index: 1280;
    left: var(--mobile-edge);
    right: var(--mobile-edge);
    bottom: calc(var(--mobile-nav-h) + 23px + env(safe-area-inset-bottom));
    width: auto;
    min-height: 132px;
    max-height: calc(100dvh - var(--mobile-nav-h) - 110px - env(safe-area-inset-bottom) - env(safe-area-inset-top));
    padding: 4px 12px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow: hidden;
    border: 1px solid rgba(219, 227, 221, .94);
    border-radius: 24px;
    background: rgba(250, 251, 250, .98);
    box-shadow: 0 14px 36px rgba(24, 32, 25, .22);
    -webkit-backdrop-filter: blur(18px) saturate(1.08);
    backdrop-filter: blur(18px) saturate(1.08);
    transform: translateY(calc(100% + 36px));
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition:
      height .28s cubic-bezier(.22,.61,.36,1),
      transform .28s cubic-bezier(.22,.61,.36,1),
      opacity .18s ease,
      visibility 0s linear .28s;
    will-change: height, transform, opacity;
  }

  body[data-view="prices"][data-prices-mode="map"][data-list-drawer="peek"] .results-panel {
    height: 132px;
  }

  body[data-view="prices"][data-prices-mode="map"][data-list-drawer="half"] .results-panel {
    height: 52dvh;
  }

  body[data-view="prices"][data-prices-mode="map"][data-list-drawer="expanded"] .results-panel {
    height: calc(100dvh - var(--mobile-nav-h) - 110px - env(safe-area-inset-bottom) - env(safe-area-inset-top));
  }

  body[data-view="prices"][data-prices-mode="list"] .results-panel {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition:
      height .28s cubic-bezier(.22,.61,.36,1),
      transform .28s cubic-bezier(.22,.61,.36,1),
      opacity .18s ease,
      visibility 0s linear 0s;
  }
}

@media (prefers-reduced-motion:reduce) {
  body[data-view="prices"] .map-top-controls > .search-panel .search-form,
  body[data-view="prices"] .results-panel {
    transition: none !important;
  }
}


/* V3.3.11: keep the route destination field visually neutral after entry/autofill. */
#route-destination-input,
#route-destination-input:focus,
#route-destination-input:valid,
#route-destination-input:not(:placeholder-shown) {
  background: var(--panel);
}

#route-destination-input:-webkit-autofill,
#route-destination-input:-webkit-autofill:hover,
#route-destination-input:-webkit-autofill:focus,
#route-destination-input:-webkit-autofill:active {
  -webkit-text-fill-color: var(--text);
  -webkit-box-shadow: 0 0 0 1000px var(--panel) inset;
  box-shadow: 0 0 0 1000px var(--panel) inset;
  caret-color: var(--text);
}


/* V3.3.12: route search polish */
.search-panel .route-origin-clear {
  color: var(--muted);
}

/* V3.3.14: clarify that the operator chart shows aggregated average prices. */
.operator-chart-heading {
  margin: 24px 0 12px;
  font-size: 1rem;
  line-height: 1.3;
  font-weight: 650;
  color: var(--text);
}

/* V3.3.15: structured Stats heading and snapshot context metadata. */
#stats-title {
  display: grid;
  gap: 2px;
}

#stats-title-prefix,
#stats-title-place {
  display: block;
}

.current-stats-meta {
  margin-top: 8px !important;
  font-size: 1rem !important;
  line-height: 1.35;
  color: var(--muted);
}

/* V3.3.18: switch Favorite price-history charts between all fetched fuel types. */

.favorite-history-empty {
  min-height: 108px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: .72rem;
  text-align: center;
}



/* V3.3.19: lighter, more compact Favorite price-history presentation. */
.favorite-trend {
  display: block;
  margin-top: 10px;
  padding: 12px 14px 14px;
  border-radius: 10px;
  background: #f6f8f6;
}

.favorite-trend-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.favorite-trend-heading span {
  font-size: .76rem;
  line-height: 1.25;
}

.favorite-trend-heading small {
  margin-top: 0;
  font-size: .64rem;
  white-space: nowrap;
}

/* Compact text tabs instead of a second large segmented control. */


.favorite-day-charts {
  gap: 14px 20px;
}

.favorite-day-chart {
  gap: 4px;
}

.favorite-day-chart > span {
  margin-bottom: 0;
  color: var(--muted);
  font-size: .68rem;
  font-weight: 700;
  text-transform: none;
}

.favorite-day-chart svg {
  min-height: 92px;
}

.favorite-history-empty {
  min-height: 92px;
}

@media (max-width:560px) {
  .favorite-trend {
    padding: 11px 12px 12px;
  }

  .favorite-trend-heading {
    margin-bottom: 7px;
  }

  
.favorite-day-charts {
    gap: 13px;
  }

  .favorite-day-chart svg {
    min-height: 92px;
    height: auto;
  }
}




/* V3.3.20: Favorite card hierarchy + chart start-price annotation. */
.favorite-card {
  position: relative;
}

.favorite-card-main {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  padding-right: 78px;
}

.favorite-title-row {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.favorite-copy h2 {
  min-width: 0;
  margin: 0;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  overflow-wrap: anywhere;
}

.favorite-copy p {
  margin-top: 3px;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  overflow-wrap: anywhere;
  line-height: 1.35;
}

.favorite-remove-button {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  font-size: 20px;
}

.favorite-day-chart .chart-start-value {
  fill: #58645d;
  font-size: 8px;
  font-weight: 700;
}

@media (max-width:560px) {
  .favorite-card-main {
    grid-template-columns: auto minmax(0, 1fr);
    padding-right: 72px;
  }

  
}


/* V3.4.1: E5 vs E10 savings comparison. */
.gas-saving {
  grid-column: 1 / -1;
  display: grid;
  gap: 2px;
  margin-top: 3px;
  padding: 8px 10px;
  border-radius: 10px;
  background: #f3f7f4;
  color: var(--muted);
  font-size: .7rem;
  line-height: 1.3;
  text-align: left;
}

.gas-saving strong {
  color: var(--text);
  font-size: .74rem;
}



.gas-comparison-highlight {
  margin-top: 14px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
}

.gas-comparison-highlight > div {
  display: grid;
  gap: 4px;
}

.gas-comparison-highlight small {
  color: var(--muted);
  font-size: .74rem;
}

.gas-comparison-highlight strong {
  color: var(--accent);
  font-size: 1.05rem;
  line-height: 1.25;
}

.gas-comparison-highlight p {
  margin: 0;
  color: var(--muted);
  font-size: .76rem;
  line-height: 1.4;
}

.gas-comparison-highlight .gas-compatibility-note {
  margin-top: 4px;
  font-size: .68rem;
}

@media (max-width:760px) {
  .gas-saving {
    padding: 7px 9px;
  }

  .gas-comparison-highlight {
    padding: 14px 15px;
  }
}


/* V3.4.3: restore vertical separation after the E5/E10 comparison card. */
.gas-comparison-highlight {
  margin-bottom: 14px;
}


/* V3.4.4: card comparison hierarchy for selected petrol type vs alternative. */
.gas-saving .gas-selected {
  color: var(--muted);
  font-size: .68rem;
  font-weight: 700;
  line-height: 1.2;
}



/* V3.4.7: show E5/E10 result summary on separate lines. */
.result-meta-fuel-line {
  display: block;
}


/* V4.0.0 — Telegram price alerts for favorite stations */
.favorite-title-actions{display:flex;align-items:center;gap:6px;margin-left:auto}
.favorite-alert-button{width:34px;height:34px;display:grid;place-items:center;border:1px solid var(--line);border-radius:10px;background:transparent;color:var(--muted);cursor:pointer;transition:background .18s ease,border-color .18s ease,color .18s ease,transform .18s ease}
.favorite-alert-button svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}
.favorite-alert-button:hover{color:var(--text);border-color:var(--muted)}
.favorite-alert-button.active{color:var(--accent);border-color:color-mix(in srgb,var(--accent) 42%,var(--line));background:color-mix(in srgb,var(--accent) 9%,transparent)}
.favorite-alert-button.active svg{fill:color-mix(in srgb,var(--accent) 16%,transparent)}
.price-alert-dialog{width:min(460px,calc(100vw - 28px));border:0;border-radius:20px;padding:0;box-shadow:0 24px 70px rgba(0,0,0,.22)}
.price-alert-dialog::backdrop{background:rgba(18,24,20,.48);backdrop-filter:blur(2px)}
.price-alert-dialog form{padding:24px;display:grid;gap:18px}
.price-alert-dialog .dialog-heading{margin:0}
.price-alert-dialog .dialog-heading h2{margin:3px 0 0}
.price-alert-station{display:flex;align-items:center;gap:12px;padding:14px;border:1px solid var(--line);border-radius:14px;background:var(--panel)}
.price-alert-bell{width:38px;height:38px;display:grid;place-items:center;border-radius:11px;background:color-mix(in srgb,var(--accent) 10%,transparent);font-size:18px}
.price-alert-station strong{display:block}.price-alert-station p{margin:3px 0 0;color:var(--muted);font-size:.78rem}
.price-alert-dialog>form>p{margin:0;color:var(--muted);line-height:1.5}
.price-alert-fuels{border:0;padding:0;margin:0}.price-alert-fuels legend{font-size:.76rem;font-weight:700;margin-bottom:8px}.price-alert-fuels .fuel-buttons{display:grid;grid-template-columns:repeat(3,1fr);gap:7px}.price-alert-fuels button{min-height:40px;border:1px solid var(--line);border-radius:10px;background:transparent;color:var(--text);font-weight:700;cursor:pointer}.price-alert-fuels button.active{background:var(--accent);border-color:var(--accent);color:white}
.price-alert-note{font-size:.72rem!important}.price-alert-dialog menu{display:flex;align-items:center;justify-content:flex-end;gap:8px;margin:0;padding:0}.danger-link{margin-right:auto;border:0;background:none;color:#b42318;font-weight:700;cursor:pointer}
@media(max-width:760px){.favorite-alert-button:hover{color:var(--muted);border-color:var(--line)}.favorite-alert-button.active:hover{color:var(--accent);border-color:color-mix(in srgb,var(--accent) 42%,var(--line))}.price-alert-dialog form{padding:20px}.price-alert-dialog menu{display:grid;grid-template-columns:1fr 1fr}.price-alert-dialog .danger-link{grid-column:1/-1;justify-self:start;margin:0}.price-alert-dialog .primary-button,.price-alert-dialog .secondary-button{width:100%}}


/* V4.0.6: desktop header navigation cleanup. */
@media (min-width: 761px) {
  .topbar > nav {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .topbar > nav [data-route-link="stats"],
  .topbar > nav [data-route-link="favorites"] {
    display: inline-flex;
  }
}


/* V4.0.8 — Favorite history interaction and visual cleanup. */
.favorite-trend,
.favorite-trend.empty {
  background: transparent;
}

.favorite-fuel-price {
  appearance: none;
  width: 100%;
  margin: 0;
  border-top: 0;
  border-bottom: 0;
  border-left: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.favorite-fuel-price.active {
  background: var(--accent-soft);
}

.favorite-fuel-price:focus-visible {
  position: relative;
  z-index: 1;
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

@media (hover: hover) and (pointer: fine) {
  .favorite-fuel-price:not(.active):hover {
    background: color-mix(in srgb, var(--accent) 5%, transparent);
  }
}

.favorite-trend-heading {
  margin-bottom: 5px;
}

.favorite-day-charts {
  gap: 14px 20px;
}

.favorite-day-chart {
  gap: 0;
}

.favorite-day-chart > span {
  margin: 0 0 -1px;
}

/* Today is the live green series. */
.favorite-day-chart.today > span {
  color: var(--accent);
}

.favorite-day-chart.today svg polyline,
.favorite-day-chart.today svg.trend-up polyline,
.favorite-day-chart.today svg.trend-down polyline {
  stroke: var(--cluster-green);
}

.favorite-day-chart.today svg circle,
.favorite-day-chart.today svg.trend-up circle,
.favorite-day-chart.today svg.trend-down circle {
  stroke: var(--cluster-green);
}

.favorite-day-chart.today .sparkline-end {
  fill: var(--cluster-green);
}

/* Yesterday is intentionally de-emphasized. */
.favorite-day-chart.yesterday > span {
  color: #7b847f;
}

.favorite-day-chart.yesterday svg polyline,
.favorite-day-chart.yesterday svg.trend-up polyline,
.favorite-day-chart.yesterday svg.trend-down polyline {
  stroke: #8b9490;
}

.favorite-day-chart.yesterday svg circle,
.favorite-day-chart.yesterday svg.trend-up circle,
.favorite-day-chart.yesterday svg.trend-down circle {
  stroke: #8b9490;
}

.favorite-day-chart.yesterday .sparkline-start {
  fill: var(--panel);
}

.favorite-day-chart.yesterday .sparkline-end {
  fill: #8b9490;
}

.favorite-day-chart.yesterday .chart-start-value,
.favorite-day-chart.yesterday .chart-value {
  fill: #68716d;
}

@media (max-width: 560px) {
  .favorite-day-charts {
    gap: 14px;
  }
}

/* Status badge removal also releases the card header width it reserved. */
.favorite-card-main {
  padding-right: 0;
}

@media (max-width: 560px) {
  .favorite-card-main {
    padding-right: 0;
  }
}

/* V4.0.10 — continuous first-card chart now uses the same visual language as Today / Yesterday. */

/* V4.1.2 — insight-first historical price patterns. */
.pattern-section-heading {
  position: relative;
  align-items: center;
  gap: 18px;
}

.pattern-section-heading > div > p {
  margin-top: 4px;
}

.stats-methodology {
  position: relative;
  flex: 0 0 auto;
}

.stats-methodology > summary {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--panel);
  color: var(--muted);
  font-size: .8rem;
  font-weight: 800;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.stats-methodology > summary::-webkit-details-marker {
  display: none;
}

.stats-methodology > summary:hover,
.stats-methodology > summary:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
  background: #f7fbf8;
}

.stats-methodology-popover {
  position: absolute;
  z-index: 30;
  top: calc(100% + 10px);
  right: 0;
  width: min(340px,calc(100vw - 40px));
  padding: 15px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: 0 14px 34px rgba(27,52,35,.14);
}

.stats-methodology-popover strong {
  display: block;
  margin-bottom: 7px;
  font-size: .85rem;
}

.stats-methodology-popover p {
  margin: 0 0 9px;
  color: var(--muted);
  font-size: .76rem;
  line-height: 1.55;
}

.stats-methodology-popover small {
  color: var(--muted);
  font-size: .68rem;
}

.pattern-content {
  display: grid;
  gap: 14px;
}

.pattern-insights {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 12px;
}

.pattern-insight {
  min-width: 0;
  padding: 18px 20px;
  border: 1px solid #ead8bd;
  border-radius: 17px;
  background: #fffaf2;
}

.pattern-insight small {
  display: block;
  margin-bottom: 8px;
  color: #8b6b3d;
  font-size: .72rem;
  font-weight: 700;
}

.pattern-insight > strong {
  display: block;
  margin-bottom: 4px;
  color: var(--text);
  font-size: 1.15rem;
}

.pattern-insight-price {
  color: #9a650f;
  font-size: 1.42rem;
  font-weight: 800;
  line-height: 1.1;
}

.pattern-insight p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: .74rem;
}

.pattern-grid {
  align-items: start;
}

.pattern-card {
  padding: 20px;
}

.pattern-card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.pattern-card-heading h2 {
  margin: 0 0 4px;
  font-size: 1rem;
}

.pattern-card-heading p {
  margin: 0;
  color: var(--muted);
  font-size: .74rem;
}

.pattern-period-chip {
  flex: 0 0 auto;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: #fafcfa;
  font-size: .64rem;
  font-weight: 700;
}

.pattern-list {
  display: grid;
}

.pattern-row {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 49px;
  padding: 9px 10px;
  border-top: 1px solid #edf1ee;
  border-radius: 10px;
}

.pattern-row:first-child {
  border-top-color: transparent;
}

.pattern-row.highest {
  background: #fff8ee;
}

.pattern-row.lowest {
  background: #f3faf5;
}

.pattern-row-name {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pattern-row-name > strong {
  font-size: .84rem;
}

.pattern-extreme-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border-radius: 999px;
  background: #f2f4f2;
  color: var(--muted);
  font-size: .58rem;
  font-weight: 750;
  line-height: 1.2;
}

.pattern-row.highest .pattern-extreme-badge {
  background: #fbe4c3;
  color: #8a570a;
}

.pattern-row.lowest .pattern-extreme-badge {
  background: #dcf5e4;
  color: #137b37;
}

.pattern-row-values {
  display: grid;
  grid-template-columns: auto minmax(58px,auto);
  align-items: baseline;
  justify-content: end;
  gap: 10px;
  text-align: right;
}

.pattern-row-values > strong {
  font-size: .9rem;
  white-space: nowrap;
}

.pattern-delta {
  min-width: 58px;
  color: var(--muted);
  font-size: .68rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.pattern-row.highest .pattern-delta,
.pattern-delta.above {
  color: #a0640b;
}

.pattern-row.lowest .pattern-delta,
.pattern-delta.below {
  color: #16803b;
}

.pattern-delta.neutral {
  color: var(--muted);
}

.pattern-coverage-note {
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: #f6f8f6;
  color: var(--muted);
  font-size: .7rem;
  line-height: 1.45;
}

.pattern-content .stats-privacy {
  margin-top: 0;
}

@media(max-width:760px) {
  .pattern-section-heading {
    align-items: flex-start;
  }

  .stats-methodology-popover {
    position: fixed;
    z-index: 1500;
    top: auto;
    right: 15px;
    bottom: 74px;
    left: 15px;
    width: auto;
  }

  .pattern-insights {
    grid-template-columns: 1fr 1fr;
    gap: 9px;
  }

  .pattern-insight {
    padding: 15px 14px;
  }

  .pattern-insight > strong {
    font-size: 1rem;
  }

  .pattern-insight-price {
    font-size: 1.18rem;
  }

  .pattern-card {
    padding: 16px 14px;
  }

  .pattern-row {
    padding: 9px 6px;
  }

  .pattern-row-values {
    gap: 7px;
  }

  .pattern-extreme-badge {
    display: none;
  }
}

@media(max-width:430px) {
  .pattern-insights {
    grid-template-columns: 1fr;
  }

  .pattern-row-values {
    grid-template-columns: auto;
    gap: 1px;
  }

  .pattern-delta {
    min-width: 0;
  }
}
