/* FuelDash R190 — compact dashboard and unified semantic green. */
:root {
  --fd-r190-accent: #ff3b30;
  --fd-r190-surface: #0a0a0c;
  --fd-r190-surface-raised: #121216;
  --fd-r190-border: #2b2b31;
  --fd-r190-muted: #9d9da5;
}

/* Keep below-fold sections out of the first layout/paint pass. */
html body #app :is(
  .favorites-block,
  .primary-station-card,
  .chart-block,
  .detail-chart,
  .detail-advice-card,
  .result-list,
  .menu-card
) {
  content-visibility: auto;
  contain-intrinsic-size: auto 220px;
}

/* Dashboard hero: branded depth without reintroducing glass. */
html body #app .fd-best {
  min-height: 250px !important;
  background-color: #08080a !important;
}

html body #app .fd-best::after {
  background-color: rgba(0, 0, 0, .72) !important;
  background-image:
    radial-gradient(circle at 1px 1px, rgba(255, 59, 48, .17) 1.15px, transparent 1.3px) !important;
  background-size: 18px 18px !important;
  mask-image: linear-gradient(90deg, #000 0%, rgba(0,0,0,.82) 45%, rgba(0,0,0,.20) 100%);
  opacity: 1 !important;
}

html body #app .fd-best__copy {
  align-self: center !important;
  padding: 20px 8px 20px 22px !important;
}

html body #app .fd-best__station {
  margin-top: 12px !important;
}

html body #app .fd-best__trend,
html body #app .price-change {
  font-variant-numeric: tabular-nums;
  letter-spacing: .005em;
}

html body #app .fd-best__trend.fd-price-change-enter,
html body #app .price-change.fd-price-change-enter {
  animation: fd-r190-price-enter 440ms cubic-bezier(.2,.75,.2,1) both;
}

/* Tank recommendation: clearer hierarchy and larger brand identity. */
html body #app .primary-station-card__head .station-logo {
  width: 34px !important;
  height: 34px !important;
  min-width: 34px !important;
  border-radius: 10px !important;
}

html body #app .primary-station-card__facts > span {
  align-content: start;
  min-height: 72px !important;
  padding: 9px !important;
}


html body #app :is(
  .station-copy strong,
  .primary-station-card__copy strong,
  .fd-best__station,
  .detail-card h2
) {
  letter-spacing: -.015em;
}

html body #app :is(
  .station-logo,
  .favorite-toggle,
  .detail-favorite,
  .round-button,
  .map-location-control
) svg {
  width: 20px;
  height: 20px;
}

/* Favorite feedback: one short pulse only after a real tap. */
html body #app .favorite-toggle.fd-favorite-pulse,
html body #app .detail-favorite.fd-favorite-pulse {
  animation: fd-r190-favorite-pulse 420ms cubic-bezier(.2,.8,.2,1);
}

/* Map marker depth and selected-state precision. */
html body #app .fuel-map[data-map-state="ready"] .fuel-map-marker {
  animation: fd-r190-marker-enter 360ms cubic-bezier(.2,.8,.2,1) both;
}

html body #app .map-price-marker {
  box-shadow: 0 8px 22px rgba(0, 0, 0, .48), 0 0 0 1px rgba(255, 59, 48, .18) !important;
  transform-origin: 50% 100%;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

html body #app .map-price-marker.is-selected {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 10px 26px rgba(0, 0, 0, .56), 0 0 0 2px rgba(255, 255, 255, .22) !important;
}

html body #app .fuel-map-canvas {
  background: #0a0a0c;
}

/* History: extrema and compact numerical summary. */
html body #app .fd-chart-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin: 10px 0 12px;
}

html body #app .fd-chart-summary > span {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 9px 8px;
  border: 1px solid var(--fd-r190-border);
  border-radius: 13px;
  background: var(--fd-r190-surface-raised);
  text-align: center;
}

html body #app .fd-chart-summary small {
  color: var(--fd-r190-muted) !important;
  font-size: 9px;
  font-weight: 650;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: .055em;
}

html body #app .fd-chart-summary strong {
  color: #f5f5f7 !important;
  font-size: 12px;
  font-weight: 720;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

html body #app .chart-extreme-marker {
  stroke: #050506;
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

html body #app .chart-extreme-marker.is-low {
  fill: #30d158;
}

html body #app .chart-extreme-marker.is-high {
  fill: #ff453a;
}

html body #app .chart-selection-line {
  stroke-width: 1.25 !important;
  stroke-dasharray: 3 3;
}

html body #app .chart-selection-readout {
  min-height: 28px;
  padding: 6px 8px !important;
}

/* Consistent card rhythm and touch targets across iPhone and Android. */
html body #app .app-content > :is(section, div[data-search-map], div[data-sort-controls]) + :is(section, div[data-search-map], div[data-sort-controls]) {
  margin-top: 14px;
}

html body #app :is(button, a, input, select) {
  touch-action: manipulation;
}

@media (max-width: 370px) {
  html body #app .fd-best {
    min-height: 250px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  html body #app *,
  html body #app *::before,
  html body #app *::after {
    scroll-behavior: auto !important;
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

@keyframes fd-r190-price-enter {
  from { opacity: .35; transform: translateY(3px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fd-r190-favorite-pulse {
  0% { transform: scale(1); }
  45% { transform: scale(1.18); }
  100% { transform: scale(1); }
}

@keyframes fd-r190-marker-enter {
  from { opacity: 0; transform: translateY(7px) scale(.92); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}


/* FuelDash R190 — dashboard card and recommendation refinements. */
html body #app .primary-station-card__head {
  grid-template-columns: 34px minmax(0, 1fr) auto 16px !important;
  min-height: 76px !important;
  padding: 12px 14px !important;
}
html body #app .primary-station-card .station-logo {
  width: 34px !important;
  height: 34px !important;
  min-width: 34px !important;
  border-radius: 10px !important;
}
html body #app .primary-station-card__facts > span {
  background: rgba(255,255,255,.035) !important;
  border-color: rgba(255,255,255,.07) !important;
}
html body #app .primary-station-card__facts > span b {
  color: #f5f5f7 !important;
}


/* R190: one semantic green across price decreases, sync/cloud and opening states. */
:root {
  --fd-r90-green: #30d158;
  --fd-r106-green: #30d158;
  --fd-r107-mint: #30d158;
  --fd-r114-mint: #30d158;
  --fd-r117-mint: #30d158;
  --fd-r119-mint: #30d158;
  --fd-positive: #30d158;
}
html body #app :is(
  .price-change.is-lower,
  .fd-best__trend.is-lower,
  .fd-best__trend.is-lower i,
  .station-opening.is-open,
  .station-meta .is-open,
  .detail-opening .opening-status strong.is-open,
  .fd-form-status[data-type="success"],
  .fd-auth-form-status[data-type="success"],
  .fd-cloud-message.is-success,
  .fd-cloud-badge.is-success,
  .fd-backup-status[data-type="success"]
),
html[data-fd-theme="light"] body #app :is(
  .price-change.is-lower,
  .fd-best__trend.is-lower,
  .fd-best__trend.is-lower i,
  .station-opening.is-open,
  .station-meta .is-open
),
html body :is(
  [data-cloud-tone="active"],
  .fd-account-page-status[data-cloud-tone="active"] h2,
  .fd-alert-status[data-tone="active"]
) {
  color: #30d158 !important;
  fill: #30d158 !important;
  stroke: #30d158 !important;
  text-shadow: none !important;
}
html body #app :is(.station-opening.is-open i, .station-meta .is-open::before) {
  background: #30d158 !important;
  box-shadow: 0 0 8px rgba(48,209,88,.48) !important;
}


/* FuelDash R190 — startup/runtime navigation parity and rounded search selection. */
:root {
  --fd-r190-nav-bg: #111113;
  --fd-r190-nav-border: #2b2b31;
}

html body #app .fuel-tab-bar,
html body .fd-startup-cover .fd-fast-nav {
  border-color: var(--fd-r190-nav-border) !important;
  background: var(--fd-r190-nav-bg) !important;
  background-color: var(--fd-r190-nav-bg) !important;
  background-image: none !important;
  box-shadow: none !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

html body #app .result-list .station-result.is-selected {
  border-color: var(--fd-accent) !important;
  box-shadow: inset 0 0 0 1px var(--fd-accent) !important;
}

html body #app .result-list .station-result.is-selected > .station-card.is-selected {
  border: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
  background-image: none !important;
}


/* FuelDash R190 — search and header controls use the navigation surface. */
:root {
  --fd-r190-control-bg: #111113;
  --fd-r190-control-border: #2b2b31;
}

html:not([data-fd-theme="light"]) body #app .search-field,
html:not([data-fd-theme="light"]) body #app .fd-profile-button,
html:not([data-fd-theme="light"]) body #app .fd-app-reload,
html:not([data-fd-theme="light"]) body .fd-startup-cover .fd-fast-profile-placeholder,
html:not([data-fd-theme="light"]) body .fd-startup-cover .fd-app-reload {
  border-color: var(--fd-r190-control-border) !important;
  background: var(--fd-r190-control-bg) !important;
  background-color: var(--fd-r190-control-bg) !important;
  background-image: none !important;
  box-shadow: none !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  filter: none !important;
}


/* FuelDash R190 — definitive cascade fix for shared dark controls and selected search cards. */
:root {
  --fd-r190-shared-control-bg: #111114;
  --fd-r190-shared-control-border: #26262b;
  --fd-r190-selection: #ff3b30;
}

/* Match the actual navigation/filter surface. The :not(#id) specificity intentionally
   outranks legacy release seals that also use !important. */
html[data-fd-theme] body:not(#fd-r190-control-scope) #app .fuel-tab-bar,
html[data-fd-theme] body:not(#fd-r190-control-scope) #app .station-sort,
html[data-fd-theme] body:not(#fd-r190-control-scope) #app .search-field,
html[data-fd-theme] body:not(#fd-r190-control-scope) #app .brand-header :is(.fd-profile-button, .fd-app-reload),
html[data-fd-theme] body:not(#fd-r190-control-scope) .fd-startup-cover .fd-fast-nav,
html[data-fd-theme] body:not(#fd-r190-control-scope) .fd-startup-cover .fd-fast-header :is(.fd-fast-profile-placeholder, .fd-app-reload) {
  border-color: var(--fd-r190-shared-control-border) !important;
  background: var(--fd-r190-shared-control-bg) !important;
  background-color: var(--fd-r190-shared-control-bg) !important;
  background-image: none !important;
  box-shadow: none !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  filter: none !important;
}

/* The outer result owns the complete rounded red selection border. */
html[data-fd-theme] body:not(#fd-r190-search-selection-scope) #app .result-list > .station-result.is-selected {
  border: 1px solid var(--fd-r190-selection) !important;
  border-color: var(--fd-r190-selection) !important;
  border-radius: 22px !important;
  box-shadow: inset 0 0 0 1px var(--fd-r190-selection) !important;
  overflow: hidden !important;
}

/* Remove every competing inner outline/shadow so the corners cannot be clipped. */
html[data-fd-theme] body:not(#fd-r190-search-selection-scope) #app .result-list > .station-result.is-selected > .station-card.is-selected {
  border: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
  background-color: transparent !important;
  background-image: none !important;
}
