/* FuelDash r35 final cascade */
html {
  min-height: 100%;
  background: linear-gradient(165deg, #070708 0%, #12090b 52%, #080708 100%);
}

/* R43: chart interaction stays stable on touch devices. */
#app .chart-block.dashboard-section.glass-card,
#app .chart-block.dashboard-section.glass-card:active {
  transform: scale(0.985) !important;
}

#app .fuel-chart svg,
#app .fuel-chart.is-detail .chart-canvas svg {
  touch-action: pan-y;
  -webkit-tap-highlight-color: transparent;
}

/* The hero price uses the same red as every other price in FuelDash. */
#app .fd-best__price {
  color: #ff3b30 !important;
}

/* Radius choices mirror the centered, single-line fuel choice controls. */
#app .nearby-radius [data-nearby-radius] {
  align-items: stretch;
}

#app .nearby-radius [data-nearby-radius] button {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding-inline: 4px;
  text-align: center;
  white-space: nowrap;
}

body {
  min-height: 100%;
  background: transparent !important;
}

.fuel-map .leaflet-control-attribution {
  display: none !important;
}

.search-field input {
  font-size: 16px !important;
  line-height: 1.2;
}

/* Completely isolated best-price component. No legacy Hero selector applies. */
#app .fd-best {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 56%) minmax(0, 44%);
  align-items: center;
  width: 100%;
  min-height: 304px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.17);
  border-radius: 27px;
  background: #09090b;
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.12),
    0 18px 43px rgba(0, 0, 0, 0.52);
  clip-path: inset(0 round 27px);
  contain: paint;
}

#app .fd-best__map {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  border-radius: inherit;
  background: #100d0f;
  opacity: 0.46;
}

#app .fd-best__map .fuel-map,
#app .fd-best__map .fuel-map-canvas,
#app .fd-best__map .leaflet-container {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  overflow: hidden !important;
  border-radius: inherit !important;
}

#app .fd-best__map .leaflet-marker-pane,
#app .fd-best__map .leaflet-shadow-pane,
#app .fd-best__map .map-price-marker,
#app .fd-best__map .user-location-marker {
  display: none !important;
}

#app .fd-best::after {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
  background:
    linear-gradient(
      90deg,
      rgba(7, 7, 9, 0.94) 0%,
      rgba(7, 7, 9, 0.78) 48%,
      rgba(7, 7, 9, 0.22) 100%
    ),
    linear-gradient(180deg, rgba(5, 5, 7, 0.05), rgba(5, 5, 7, 0.38));
  content: "";
  pointer-events: none;
}

#app .fd-best__tap {
  position: absolute;
  inset: 0;
  z-index: 4;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  border-radius: inherit;
  background: transparent;
  box-shadow: none;
  appearance: none;
}

#app .fd-best__copy {
  position: relative;
  z-index: 3;
  grid-column: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  align-self: center;
  min-width: 0;
  padding: 27px 8px 27px 22px;
  text-align: left;
  pointer-events: none;
}

#app .fd-best__label,
#app .fd-best__station {
  display: block;
  max-width: 100%;
  margin: 0;
  overflow: hidden;
  font-family: inherit;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.2;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#app .fd-best__label {
  color: rgba(255, 255, 255, 0.78);
}

#app .fd-best__trend {
  display: flex;
  align-items: baseline;
  align-self: flex-start;
  gap: 8px;
  margin-top: 13px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
  text-align: left;
}

#app .fd-best__trend.is-lower {
  color: #48ca88;
}

#app .fd-best__trend.is-higher {
  color: #ff3442;
}

#app .fd-best__trend.is-steady {
  color: rgba(255, 255, 255, 0.58);
}

#app .fd-best__trend i {
  color: rgba(255, 255, 255, 0.52);
  font-style: normal;
  font-weight: 500;
}

#app .fd-best__price {
  display: block;
  align-self: flex-start;
  margin: 5px 0 0;
  color: #ff2d3b;
  font-size: clamp(48px, 13.5vw, 62px);
  font-weight: 760;
  letter-spacing: -0.055em;
  line-height: 0.96;
  text-align: left;
  white-space: nowrap;
}

#app .fd-best__station {
  align-self: flex-start;
  width: 100%;
  margin-top: 44px;
  color: rgba(255, 255, 255, 0.92);
}

#app .fd-best__meta {
  display: block;
  align-self: flex-start;
  justify-self: start;
  margin-top: 9px;
  padding: 0;
  color: rgba(255, 255, 255, 0.52);
  font-size: 12px;
  font-weight: 560;
  line-height: 1.25;
  text-align: left;
  white-space: nowrap;
}

#app .fd-best__chevron {
  position: absolute;
  top: 15px;
  right: 14px;
  z-index: 5;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: rgba(255, 255, 255, 0.62);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
  pointer-events: none;
}

.search-suggestion-panel {
  position: relative;
  z-index: 800;
  display: grid;
  margin: 10px 4px 14px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 12px;
  background: linear-gradient(
    145deg,
    rgba(31, 31, 34, 0.78),
    rgba(8, 8, 10, 0.88)
  );
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.12),
    0 13px 28px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(22px) saturate(135%);
  -webkit-backdrop-filter: blur(22px) saturate(135%);
}

.search-suggestion-heading {
  padding: 9px 12px 7px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.42);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.09em;
  line-height: 1;
  text-transform: uppercase;
}

.search-suggestion-panel[hidden] {
  display: none;
}

.search-suggestion-panel button {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-height: 44px;
  padding: 7px 11px;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  color: #fff;
  text-align: left;
  background: transparent;
}

.search-suggestion-panel button:last-child {
  border-bottom: 0;
}

.search-suggestion-panel svg {
  width: 16px;
  fill: none;
  stroke: #ff3b45;
  stroke-width: 1.8;
}

.search-suggestion-panel span,
.search-suggestion-panel strong,
.search-suggestion-panel small {
  display: block;
  min-width: 0;
}

.search-suggestion-panel strong {
  overflow: hidden;
  font-size: 12.5px;
  font-weight: 630;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-suggestion-panel small {
  margin-top: 1px;
  color: rgba(255, 255, 255, 0.48);
  font-size: 9.5px;
}

.map-location-control {
  border-color: rgba(255, 255, 255, 0.12) !important;
  background: rgba(25, 25, 28, 0.7) !important;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.25) !important;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.map-location-control svg {
  opacity: 0.78;
}

.dashboard-favorite-card,
.favorites-screen-card {
  grid-template-areas: none !important;
}

.fuel-advice-card::before,
.fuel-advice-card::after {
  display: none !important;
}

.about-build {
  align-items: center !important;
}

.about-build > em {
  display: flex !important;
  flex-direction: column;
  align-items: flex-end;
  color: #8c8c90 !important;
  font-size: 11px !important;
  font-style: normal;
  line-height: 1.25;
}

.about-build small {
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.4);
  font-size: 10px;
}

@media (max-width: 370px) {
  #app .fd-best {
    grid-template-columns: minmax(0, 58%) minmax(0, 42%);
    min-height: 296px;
  }

  #app .fd-best__copy {
    padding-left: 19px;
  }

  #app .fd-best__label,
  #app .fd-best__station {
    font-size: 16px;
  }

  #app .fd-best__station {
    margin-top: 40px;
  }

  #app .fd-best__price {
    font-size: 47px;
  }
}

/* R40: the recommendation keeps its semantic text color, not its own surface. */
#app .fuel-advice-card,
#app .fuel-advice-card.is-now,
#app .fuel-advice-card.is-soon,
#app .fuel-advice-card.is-later,
#app .fuel-advice-card.is-good,
#app .fuel-advice-card.is-wait,
#app .fuel-advice-card.is-neutral {
  background: linear-gradient(145deg, #0d0d108f, #040406b8) !important;
  border-color: #2c2c31 !important;
  box-shadow:
    inset 0 1px #ffffff18,
    0 16px 36px #0007 !important;
}

#app .fuel-advice-card::before,
#app .fuel-advice-card::after {
  display: none !important;
}

#app .fuel-advice-card.is-now strong,
#app .fuel-advice-card.is-soon strong,
#app .fuel-advice-card.is-later strong,
#app .fuel-advice-card.is-good strong,
#app .fuel-advice-card.is-wait strong,
#app .fuel-advice-card.is-neutral strong {
  text-shadow: none !important;
}

#app .fuel-advice-card.is-now strong {
  color: #55e6a5 !important;
}

#app .fuel-advice-card.is-soon strong,
#app .fuel-advice-card.is-wait strong {
  color: #ffad4a !important;
}

#app .fuel-advice-card.is-later strong {
  color: #ff5f57 !important;
}

/* R35: compact, calm best-price card — final cascade over the earlier isolated variant. */
#app .location {
  margin-bottom: 14px !important;
}

#app .fd-best {
  display: grid;
  grid-template-columns: 1fr;
  min-height: 228px;
  place-items: center;
}

#app .fd-best__map {
  opacity: 0.64;
}

#app .fd-best::after {
  background:
    linear-gradient(180deg, rgba(5, 5, 7, 0.26), rgba(5, 5, 7, 0.38)),
    radial-gradient(circle at 50% 50%, rgba(5, 5, 7, 0.56) 0%, rgba(5, 5, 7, 0.29) 58%, rgba(5, 5, 7, 0.1) 100%);
}

#app .fd-best__copy {
  grid-column: 1;
  align-items: center;
  justify-content: center;
  align-self: center;
  gap: 8px;
  width: 100%;
  padding: 20px 22px;
  text-align: center;
}

#app .fd-best__label,
#app .fd-best__station {
  width: auto;
  max-width: 100%;
  margin: 0;
  overflow: visible;
  color: rgba(255, 255, 255, 0.88);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-overflow: clip;
  white-space: normal;
}

#app .fd-best__trend {
  align-self: center;
  margin: 0;
  font-size: 12px;
  text-align: center;
}

#app .fd-best__price {
  align-self: center;
  margin: 0;
  color: #ff2d3b;
  font-size: clamp(48px, 13.5vw, 60px);
  text-align: center;
}

#app .fd-best__station {
  align-self: center;
  margin: 0;
}

#app .fd-best__meta {
  align-self: center;
  justify-self: center;
  margin: 0;
  text-align: center;
}

#app .fd-best + .dashboard-section {
  margin-top: 16px !important;
}

@media (max-width: 370px) {
  #app .fd-best {
    grid-template-columns: 1fr;
    min-height: 220px;
  }

  #app .fd-best__copy {
    padding: 18px;
  }

  #app .fd-best__label,
  #app .fd-best__station {
    font-size: 16px;
  }

  #app .fd-best__price {
    font-size: 47px;
  }
}

/* R45 performance: off-screen station rows do not participate in paint work. */
#app .result-list {
  contain: layout style;
}

#app .station-result {
  content-visibility: auto;
  contain-intrinsic-size: 96px;
}

#app .search-field,
#app .search-suggestion-panel {
  touch-action: manipulation;
}

/* R47: compact, non-duplicated primary station on the dashboard. */
#app .primary-station-card {
  margin: 14px 0 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 59, 69, 0.22);
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(29, 25, 27, 0.82), rgba(10, 10, 11, 0.9));
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.07), 0 12px 28px rgba(0, 0, 0, 0.24);
}

#app .primary-station-card > button {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto 16px;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 76px;
  padding: 12px 14px;
  color: #fff;
  text-align: left;
  background: transparent;
  border: 0;
  font: inherit;
}

#app .primary-station-card .station-logo {
  width: 34px;
  height: 34px;
  border-radius: 10px;
}

#app .primary-station-card__copy {
  min-width: 0;
}

#app .primary-station-card__copy small,
#app .primary-station-card__copy strong,
#app .primary-station-card__copy > span {
  display: block;
}

#app .primary-station-card__copy small {
  margin-bottom: 2px;
  color: #ff535d;
  font-size: 9px;
  font-weight: 720;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

#app .primary-station-card__copy strong {
  overflow: hidden;
  font-size: 14px;
  font-weight: 690;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#app .primary-station-card__copy > span {
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 10px;
}

#app .primary-station-card__price {
  color: #ff3b45;
  font-size: 18px;
  font-weight: 760;
  white-space: nowrap;
}

#app .primary-station-card > button > svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: rgba(255, 255, 255, 0.42);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#app .primary-station-badge {
  display: inline-flex !important;
  width: fit-content;
  margin: 0 0 4px;
  padding: 3px 7px;
  color: #ff5a64;
  font-size: 8px !important;
  font-weight: 730;
  line-height: 1;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(255, 59, 69, 0.1);
  border: 1px solid rgba(255, 59, 69, 0.24);
  border-radius: 999px;
}

#app .favorites-screen-card.is-primary-station {
  border-color: rgba(255, 59, 69, 0.3) !important;
}

#app .primary-station-action {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin: -2px 0 14px;
  padding: 10px 12px;
  color: rgba(255, 255, 255, 0.88);
  text-align: left;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 14px;
  font: inherit;
}

#app .primary-station-action.is-active {
  color: #fff;
  background: rgba(255, 59, 69, 0.09);
  border-color: rgba(255, 59, 69, 0.28);
}

#app .primary-station-action > svg {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: #ff4a54;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#app .primary-station-action > span,
#app .primary-station-action strong,
#app .primary-station-action small {
  display: block;
}

#app .primary-station-action strong {
  font-size: 11px;
  font-weight: 680;
}

#app .primary-station-action small {
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.43);
  font-size: 9px;
}

@media (hover: hover) {
  #app .primary-station-card > button:hover,
  #app .primary-station-action:hover {
    background-color: rgba(255, 255, 255, 0.045);
  }
}

/* R48: expanded primary station decision card. */
#app .primary-station-card {
  border-color: color-mix(in srgb, var(--brand-red) 30%, transparent);
}

#app .primary-station-card__head {
  border-bottom: 1px solid rgba(255, 255, 255, 0.07) !important;
}

#app .primary-station-card__copy small,
#app .primary-station-card__price,
#app .primary-station-badge,
#app .primary-station-action > svg {
  color: var(--brand-red) !important;
  stroke: var(--brand-red) !important;
}

#app .primary-station-card__insights {
  display: grid;
  gap: 13px;
  padding: 14px;
}

#app .primary-station-card__insights > div:first-child > small,
#app .primary-station-card__insights > div:first-child > strong,
#app .primary-station-card__insights > div:first-child > span {
  display: block;
}

#app .primary-station-card__insights > div:first-child > small {
  color: rgba(255, 255, 255, 0.43);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
}

#app .primary-station-card__insights > div:first-child > strong {
  margin-top: 4px;
  color: var(--brand-red);
  font-size: 17px;
  line-height: 1.2;
}

#app .primary-station-card__insights > div:first-child > span {
  margin-top: 5px;
  color: rgba(255, 255, 255, .66);
  font-size: 11px;
  line-height: 1.45;
}

#app .primary-station-card__facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

#app .primary-station-card__facts > span {
  min-width: 0;
  padding: 9px 8px;
  background: rgba(255, 255, 255, .035);
  border: 1px solid rgba(255, 255, 255, .07);
  border-radius: 11px;
}

#app .primary-station-card__facts small,
#app .primary-station-card__facts b {
  display: block;
}

#app .primary-station-card__facts small {
  min-height: 22px;
  color: rgba(255, 255, 255, .4);
  font-size: 8px;
  line-height: 1.25;
}

#app .primary-station-card__facts b {
  margin-top: 4px;
  overflow: hidden;
  color: rgba(255, 255, 255, .88);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 370px) {
  #app .primary-station-card__facts {
    grid-template-columns: 1fr;
  }
  #app .primary-station-card__facts small { min-height: 0; }
}
