/* FuelDash R102 — harmonized component rhythm without touching core behavior. */
:root {
  --fd-r102-red: #ff3b30;
  --fd-r102-light-page: #f5f5f7;
  --fd-r102-light-surface: #ffffff;
  --fd-r102-light-control: #ececf0;
  --fd-r102-light-border: #d2d2d8;
  --fd-r102-dark-page: #050505;
  --fd-r102-dark-surface: #141416;
  --fd-r102-dark-control: #242428;
  --fd-r102-dark-border: rgba(255,255,255,.11);
  --fd-r102-section-gap: 16px;
  --fd-r102-card-radius: 24px;
  --fd-r102-control-radius: 16px;
  --fd-r102-control-height: 48px;
}

/* Dashboard cards use the same vertical rhythm above and below the primary station. */
#app .primary-station-card + .favorites-block {
  margin-top: var(--fd-r102-section-gap) !important;
}

/* Feature header is a fixed top row; the navigation control matches Details and sits right. */
.fd-feature-header {
  grid-template-columns: minmax(0,1fr) 48px !important;
  align-items: start !important;
  gap: 14px !important;
}
.fd-feature-heading {
  grid-column: 1 !important;
  grid-row: 1 !important;
  min-width: 0 !important;
}
.fd-feature-back {
  grid-column: 2 !important;
  grid-row: 1 !important;
  justify-self: end !important;
}
.fd-feature-header,
.fd-feature-heading,
.fd-feature-back {
  transform: none !important;
}

/* Tankbook is one vertical card system with equal spacing in both themes. */
.fd-feature-page[data-fd-feature-view="tankbook"] .fd-feature-content {
  display: flex !important;
  flex-direction: column !important;
  gap: var(--fd-r102-section-gap) !important;
}
.fd-feature-page[data-fd-feature-view="tankbook"] .fd-feature-content > section {
  flex: 0 0 auto !important;
  width: 100% !important;
  margin: 0 !important;
  border-radius: var(--fd-r102-card-radius) !important;
  box-sizing: border-box !important;
}
.fd-feature-page[data-fd-feature-view="tankbook"] :is(.fd-overall-card,.fd-tank-history) {
  padding: 20px !important;
  overflow: hidden !important;
}
html[data-fd-theme="light"] .fd-feature-page[data-fd-feature-view="tankbook"] :is(.fd-overall-card,.fd-tank-history) {
  border: 1px solid var(--fd-r102-light-border) !important;
  background: var(--fd-r102-light-surface) !important;
  color: #171719 !important;
  box-shadow: 0 8px 24px rgba(20,20,24,.055) !important;
}
html[data-fd-theme="dark"] .fd-feature-page[data-fd-feature-view="tankbook"] :is(.fd-overall-card,.fd-tank-history) {
  border: 1px solid var(--fd-r102-dark-border) !important;
  background: var(--fd-r102-dark-surface) !important;
  color: #f7f7f8 !important;
  box-shadow: none !important;
}
.fd-overall-card .fd-feature-card__head,
.fd-tank-history__head {
  margin: 0 0 16px !important;
}
.fd-overall-card .fd-tank-summary {
  display: grid !important;
  grid-template-columns: repeat(2,minmax(0,1fr)) !important;
  gap: 12px !important;
  margin: 0 !important;
}
.fd-overall-card .fd-tank-summary article {
  min-width: 0 !important;
  min-height: 92px !important;
  margin: 0 !important;
  border-radius: 18px !important;
  box-shadow: none !important;
}
.fd-tank-history .fd-tank-list { margin: 0 !important; }

/* Additional fields always show a clear disclosure arrow. */
.fd-feature-page[data-fd-feature-view="tankbook"] .fd-tank-extras summary {
  position: relative !important;
  justify-content: flex-start !important;
  gap: 8px !important;
  list-style: none !important;
  padding-right: 30px !important;
}
.fd-feature-page[data-fd-feature-view="tankbook"] .fd-tank-extras summary::-webkit-details-marker { display: none !important; }
.fd-feature-page[data-fd-feature-view="tankbook"] .fd-tank-extras summary::after {
  content: "›" !important;
  position: absolute !important;
  right: 4px !important;
  top: 50% !important;
  display: block !important;
  font-size: 25px !important;
  font-weight: 500 !important;
  line-height: 1 !important;
  transform: translateY(-50%) rotate(90deg) !important;
  transform-origin: center !important;
  transition: none !important;
}
.fd-feature-page[data-fd-feature-view="tankbook"] .fd-tank-extras[open] summary::after {
  transform: translateY(-50%) rotate(-90deg) !important;
}

/* Cloud card follows the same typography scale and separates login from registration. */
.fd-account-card__copy h2 {
  margin: 8px 0 10px !important;
  font-size: 22px !important;
  line-height: 1.15 !important;
  letter-spacing: -.35px !important;
}
.fd-account-card__copy p {
  margin: 0 !important;
  font-size: 14px !important;
  line-height: 1.5 !important;
}
.fd-account-card__actions {
  display: grid !important;
  grid-template-columns: repeat(2,minmax(0,1fr)) !important;
  gap: 10px !important;
  margin-top: 18px !important;
}
.fd-account-card__actions button,
.fd-account-card__action {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  height: var(--fd-r102-control-height) !important;
  min-height: var(--fd-r102-control-height) !important;
  padding: 0 14px !important;
  border-radius: var(--fd-r102-control-radius) !important;
  text-align: center !important;
  font-size: 14px !important;
  font-weight: 680 !important;
  line-height: 1.15 !important;
  box-shadow: none !important;
}
html[data-fd-theme="light"] .fd-account-card__actions .fd-auth-secondary {
  border: 1px solid var(--fd-r102-light-border) !important;
  background: var(--fd-r102-light-control) !important;
  color: #4f4f56 !important;
}
html[data-fd-theme="dark"] .fd-account-card__actions .fd-auth-secondary {
  border: 1px solid var(--fd-r102-dark-border) !important;
  background: var(--fd-r102-dark-control) !important;
  color: #f7f7f8 !important;
}
.fd-account-card__actions .fd-auth-primary,
.fd-account-card__action.fd-auth-primary {
  border: 1px solid var(--fd-r102-red) !important;
  background: var(--fd-r102-red) !important;
  color: #fff !important;
}

/* Inactive segmented controls use a tinted glass control, not plain white. */
html[data-fd-theme="light"] #app :where(
  .fuel-preference,.nearby-radius,.fuel-filter,.station-sort,.chart-range,.favorites-filter,.favorite-filter
) button:not(.is-active):not([aria-pressed="true"]):not([aria-selected="true"]) {
  border: 1px solid var(--fd-r102-light-border) !important;
  background: var(--fd-r102-light-control) !important;
  background-image: none !important;
  color: #505057 !important;
  box-shadow: none !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}
html[data-fd-theme="light"] #app :where(
  .fuel-preference,.nearby-radius,.fuel-filter,.station-sort,.chart-range,.favorites-filter,.favorite-filter
) button:is(.is-active,[aria-pressed="true"],[aria-selected="true"]) {
  border-color: var(--fd-r102-red) !important;
  background: var(--fd-r102-red) !important;
  color: #fff !important;
}

@media (max-width: 360px) {
  .fd-account-card__actions { grid-template-columns: 1fr !important; }
  .fd-feature-header { grid-template-columns: minmax(0,1fr) 48px !important; }
}
