/* ==========================================================================
   Tankpreise Umkreis — Design-System "Liquid Glass"
   Mehrschichtiges Glasmaterial im Stil von iOS 26/27: Tiefe durch Blur,
   Specular-Kanten, sanfte Refraktions-Tönung statt harter Flächen.
   Tokens, Basislayout, Komponenten. Mobile-first, iOS/Android-optimiert.
   ========================================================================== */

/* ---- Tokens (Light) ---- */
:root {
  --color-bg: #F2F4F7;
  --color-bg-elevated: #FFFFFF;
  --color-bg-subtle: #EAEDF1;
  --color-text: #0E1518;
  --color-text-secondary: #57646C;
  --color-text-tertiary: #8B979E;
  --color-border: rgba(16, 23, 26, 0.07);
  --color-border-strong: rgba(16, 23, 26, 0.13);

  --color-brand: #0D7A73;
  --color-brand-strong: #085E58;
  --color-brand-tint: rgba(13, 122, 115, 0.12);
  --color-accent: #FFB020;
  --color-accent-strong: #E29200;

  --color-cheap: #1E9E5A;
  --color-cheap-tint: rgba(30, 158, 90, 0.14);
  --color-mid: #C98A00;
  --color-mid-tint: rgba(201, 138, 0, 0.14);
  --color-expensive: #D64545;
  --color-expensive-tint: rgba(214, 69, 69, 0.14);

  --color-danger: #D64545;
  --color-danger-tint: rgba(214, 69, 69, 0.1);

  /* ---- Liquid Glass: Materialschichten ----
     Jedes Glasmaterial besteht aus drei Ebenen:
     1) --glass-*-tint: die durchscheinende Grundfarbe (halbtransparent)
     2) --glass-*-sheen: ein diagonaler Lichtreflex (oberer Rand)
     3) --glass-*-edge: die feine, helle Konturlinie ("refraction rim")
  */
  --glass-toolbar-tint: rgba(255, 255, 255, 0.55);
  --glass-toolbar-sheen: rgba(255, 255, 255, 0.65);
  --glass-toolbar-edge: rgba(255, 255, 255, 0.9);
  --glass-toolbar-edge-bottom: rgba(16, 23, 26, 0.06);

  --glass-sheet-tint: rgba(255, 255, 255, 0.68);
  --glass-sheet-sheen: rgba(255, 255, 255, 0.55);
  --glass-sheet-edge: rgba(255, 255, 255, 0.85);

  --glass-card-tint: rgba(255, 255, 255, 0.62);
  --glass-card-edge: rgba(255, 255, 255, 0.75);
  --glass-card-shadow: 0 1px 1px rgba(16, 23, 26, 0.04), 0 10px 24px -8px rgba(16, 23, 26, 0.14);

  --glass-chip-tint: rgba(255, 255, 255, 0.5);
  --glass-chip-edge: rgba(255, 255, 255, 0.7);

  --glass-fab-tint: rgba(255, 255, 255, 0.22);
  --glass-fab-edge: rgba(255, 255, 255, 0.55);

  --glass-modal-tint: rgba(255, 255, 255, 0.78);
  --glass-modal-edge: rgba(255, 255, 255, 0.85);

  --glass-specular: linear-gradient(135deg, rgba(255,255,255,0.85) 0%, rgba(255,255,255,0.15) 28%, rgba(255,255,255,0) 55%);
  --glass-specular-soft: linear-gradient(160deg, rgba(255,255,255,0.5) 0%, rgba(255,255,255,0) 45%);

  --scrim: rgba(20, 26, 28, 0.32);

  --shadow-sheet: 0 -12px 40px -8px rgba(16, 23, 26, 0.22), 0 -1px 0 rgba(255,255,255,0.6) inset;
  --shadow-fab: 0 10px 24px -6px rgba(13, 122, 115, 0.4), 0 2px 6px rgba(13, 122, 115, 0.18);
  --scroll-edge-fade: rgba(16, 23, 26, 0.08);

  --radius-s: 12px;
  --radius-m: 18px;
  --radius-l: 28px;
  --radius-pill: 999px;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 28px;
  --space-7: 36px;

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);

  --ease-standard: cubic-bezier(0.32, 0.72, 0, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --dur-fast: 150ms;
  --dur-standard: 340ms;

  --blur-toolbar: blur(26px) saturate(190%);
  --blur-sheet: blur(34px) saturate(190%);
  --blur-card: blur(18px) saturate(170%);
  --blur-fab: blur(22px) saturate(180%);
  --blur-modal: blur(38px) saturate(190%);

  color-scheme: light;
}

/* System dark mode (only when the user hasn't explicitly forced light) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --color-bg: #08090A;
    --color-bg-elevated: #17191B;
    --color-bg-subtle: #1E2123;
    --color-text: #F2F4F5;
    --color-text-secondary: #A7B1B5;
    --color-text-tertiary: #767F83;
    --color-border: rgba(255, 255, 255, 0.08);
    --color-border-strong: rgba(255, 255, 255, 0.15);

    --color-brand: #4FCFC7;
    --color-brand-strong: #7BDDD6;
    --color-brand-tint: rgba(79, 207, 199, 0.16);
    --color-accent: #FFC24D;
    --color-accent-strong: #FFD37A;

    --color-cheap: #43C57F;
    --color-cheap-tint: rgba(67, 197, 127, 0.16);
    --color-mid: #E0AC3A;
    --color-mid-tint: rgba(224, 172, 58, 0.16);
    --color-expensive: #E9706E;
    --color-expensive-tint: rgba(233, 112, 110, 0.16);

    --color-danger: #E9706E;
    --color-danger-tint: rgba(233, 112, 110, 0.14);

    --glass-toolbar-tint: rgba(28, 32, 34, 0.5);
    --glass-toolbar-sheen: rgba(255, 255, 255, 0.07);
    --glass-toolbar-edge: rgba(255, 255, 255, 0.14);
    --glass-toolbar-edge-bottom: rgba(0, 0, 0, 0.3);

    --glass-sheet-tint: rgba(24, 27, 29, 0.62);
    --glass-sheet-sheen: rgba(255, 255, 255, 0.06);
    --glass-sheet-edge: rgba(255, 255, 255, 0.12);

    --glass-card-tint: rgba(255, 255, 255, 0.045);
    --glass-card-edge: rgba(255, 255, 255, 0.09);
    --glass-card-shadow: 0 1px 1px rgba(0, 0, 0, 0.3), 0 10px 26px -8px rgba(0, 0, 0, 0.5);

    --glass-chip-tint: rgba(255, 255, 255, 0.05);
    --glass-chip-edge: rgba(255, 255, 255, 0.12);

    --glass-fab-tint: rgba(255, 255, 255, 0.08);
    --glass-fab-edge: rgba(255, 255, 255, 0.2);

    --glass-modal-tint: rgba(23, 25, 27, 0.72);
    --glass-modal-edge: rgba(255, 255, 255, 0.12);

    --glass-specular: linear-gradient(135deg, rgba(255,255,255,0.14) 0%, rgba(255,255,255,0.03) 28%, rgba(255,255,255,0) 55%);
    --glass-specular-soft: linear-gradient(160deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0) 45%);

    --scrim: rgba(0, 0, 0, 0.55);

    --shadow-sheet: 0 -12px 40px -8px rgba(0, 0, 0, 0.55), 0 -1px 0 rgba(255,255,255,0.08) inset;
    --shadow-fab: 0 10px 26px -6px rgba(79, 207, 199, 0.3), 0 2px 8px rgba(0,0,0,0.4);
    --scroll-edge-fade: rgba(0, 0, 0, 0.35);

    color-scheme: dark;
  }
}

/* Explicit dark override (JS-set data-theme, independent of system) */
:root[data-theme="dark"] {
  --color-bg: #08090A;
  --color-bg-elevated: #17191B;
  --color-bg-subtle: #1E2123;
  --color-text: #F2F4F5;
  --color-text-secondary: #A7B1B5;
  --color-text-tertiary: #767F83;
  --color-border: rgba(255, 255, 255, 0.08);
  --color-border-strong: rgba(255, 255, 255, 0.15);
  --color-brand: #4FCFC7;
  --color-brand-strong: #7BDDD6;
  --color-brand-tint: rgba(79, 207, 199, 0.16);
  --color-accent: #FFC24D;
  --color-accent-strong: #FFD37A;
  --color-cheap: #43C57F;
  --color-cheap-tint: rgba(67, 197, 127, 0.16);
  --color-mid: #E0AC3A;
  --color-mid-tint: rgba(224, 172, 58, 0.16);
  --color-expensive: #E9706E;
  --color-expensive-tint: rgba(233, 112, 110, 0.16);
  --color-danger: #E9706E;
  --color-danger-tint: rgba(233, 112, 110, 0.14);

  --glass-toolbar-tint: rgba(28, 32, 34, 0.5);
  --glass-toolbar-sheen: rgba(255, 255, 255, 0.07);
  --glass-toolbar-edge: rgba(255, 255, 255, 0.14);
  --glass-toolbar-edge-bottom: rgba(0, 0, 0, 0.3);

  --glass-sheet-tint: rgba(24, 27, 29, 0.62);
  --glass-sheet-sheen: rgba(255, 255, 255, 0.06);
  --glass-sheet-edge: rgba(255, 255, 255, 0.12);

  --glass-card-tint: rgba(255, 255, 255, 0.045);
  --glass-card-edge: rgba(255, 255, 255, 0.09);
  --glass-card-shadow: 0 1px 1px rgba(0, 0, 0, 0.3), 0 10px 26px -8px rgba(0, 0, 0, 0.5);

  --glass-chip-tint: rgba(255, 255, 255, 0.05);
  --glass-chip-edge: rgba(255, 255, 255, 0.12);

  --glass-fab-tint: rgba(255, 255, 255, 0.08);
  --glass-fab-edge: rgba(255, 255, 255, 0.2);

  --glass-modal-tint: rgba(23, 25, 27, 0.72);
  --glass-modal-edge: rgba(255, 255, 255, 0.12);

  --glass-specular: linear-gradient(135deg, rgba(255,255,255,0.14) 0%, rgba(255,255,255,0.03) 28%, rgba(255,255,255,0) 55%);
  --glass-specular-soft: linear-gradient(160deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0) 45%);

  --scrim: rgba(0, 0, 0, 0.55);
  --shadow-sheet: 0 -12px 40px -8px rgba(0, 0, 0, 0.55), 0 -1px 0 rgba(255,255,255,0.08) inset;
  --shadow-fab: 0 10px 26px -6px rgba(79, 207, 199, 0.3), 0 2px 8px rgba(0,0,0,0.4);
  --scroll-edge-fade: rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}

@media (prefers-contrast: more) {
  :root {
    --color-border: rgba(16, 23, 26, 0.35);
    --glass-toolbar-tint: #FFFFFF;
    --glass-sheet-tint: #FFFFFF;
    --glass-card-tint: #FFFFFF;
  }
  :root[data-theme="dark"] {
    --color-border: rgba(255, 255, 255, 0.4);
    --glass-toolbar-tint: #17191B;
    --glass-sheet-tint: #17191B;
    --glass-card-tint: #17191B;
  }
}

/* ---- Reset & base ---- */
* { box-sizing: border-box; }
html, body { height: 100%; }
html { scroll-padding-top: var(--safe-top); -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font: 400 16px/1.5 -apple-system, "SF Pro Text", system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  overscroll-behavior: none;
  padding-top: var(--safe-top);
  padding-bottom: var(--safe-bottom);
  /* Weicher, atmosphärischer Untergrund: zwei sehr dezente Farbflecken sorgen
     dafür, dass die Glas-Layer darüber tatsächlich etwas zu brechen haben. */
  background-image:
    radial-gradient(680px 420px at 12% -6%, var(--color-brand-tint), transparent 60%),
    radial-gradient(560px 360px at 100% 0%, rgba(255, 176, 32, 0.10), transparent 55%);
  background-attachment: fixed;
  transition: background-color 240ms ease, color 240ms ease;
}

img, svg { max-width: 100%; display: block; }
button { font: inherit; color: inherit; }

:focus-visible {
  outline: 2px solid var(--color-brand);
  outline-offset: 2px;
  border-radius: var(--radius-s);
}

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

/* ---- App shell ---- */
#app {
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Toolbar: mehrschichtiges Glasmaterial mit oberem Lichtsaum.
   Der Inhalt scrollt darunter durch — die Transluzenz macht das sichtbar. */
.toolbar {
  position: relative;
  z-index: 20;
  padding: var(--space-3) var(--space-4) var(--space-3);
  padding-left: calc(var(--space-4) + var(--safe-left));
  padding-right: calc(var(--space-4) + var(--safe-right));
  background:
    linear-gradient(to bottom, var(--glass-toolbar-sheen), transparent 60%),
    var(--glass-toolbar-tint);
  backdrop-filter: var(--blur-toolbar);
  -webkit-backdrop-filter: var(--blur-toolbar);
  box-shadow: inset 0 1px 0 var(--glass-toolbar-edge);
  transition: background-color 240ms ease;
}
/* Scroll-Edge-Effekt statt hartem 1px-Divider: der Übergang zum darunter scrollenden
   Inhalt fällt weich ab, statt mit einer harten Linie zu enden. */
.toolbar::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  bottom: -14px;
  height: 14px;
  background: linear-gradient(to bottom, var(--scroll-edge-fade), transparent);
  opacity: 0.5;
  pointer-events: none;
}

.toolbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.brand {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  min-width: 0;
}

.brand-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-sub {
  font-size: 13px;
  color: var(--color-text-secondary);
  white-space: nowrap;
}

/* Glaskapsel-Buttons: transluzent statt blickdicht, mit feiner Konturlinie
   und einem Specular-Highlight, das die Lichtquelle oben simuliert. */
.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-pill);
  border: none;
  position: relative;
  background: var(--glass-chip-tint);
  box-shadow: inset 0 0 0 1px var(--glass-chip-edge), inset 0 1px 1px rgba(255,255,255,0.5);
  backdrop-filter: var(--blur-card);
  -webkit-backdrop-filter: var(--blur-card);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  overflow: hidden;
  transition: transform var(--dur-fast) var(--ease-spring), background var(--dur-fast) var(--ease-standard), box-shadow var(--dur-fast);
}
.icon-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--glass-specular-soft);
  pointer-events: none;
}
.icon-btn:active { transform: scale(0.90); box-shadow: inset 0 0 0 1px var(--glass-chip-edge), inset 0 1px 6px rgba(16,23,26,0.12); }
.icon-btn svg { position: relative; width: 20px; height: 20px; stroke: var(--color-text); }

/* Segmented control: Glaskapsel mit einem "glasigen" Thumb, der wie ein
   Glaströpfchen unter dem Finger herzieht (Spring-Easing). */
.segmented {
  display: flex;
  background: var(--glass-chip-tint);
  box-shadow: inset 0 0 0 1px var(--glass-chip-edge);
  backdrop-filter: var(--blur-card);
  -webkit-backdrop-filter: var(--blur-card);
  border-radius: var(--radius-pill);
  padding: 3px;
  margin-top: var(--space-3);
  position: relative;
  gap: 2px;
}
.segmented button {
  flex: 1;
  border: none;
  background: transparent;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-secondary);
  position: relative;
  z-index: 1;
  transition: color var(--dur-fast) var(--ease-standard);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.segmented button[aria-selected="true"] { color: var(--color-brand-strong); }
.segmented-thumb {
  position: absolute;
  top: 3px; bottom: 3px;
  left: 3px;
  width: calc(50% - 4px);
  background: var(--color-bg-elevated);
  background-image: var(--glass-specular-soft);
  border-radius: var(--radius-pill);
  box-shadow: 0 1px 1px rgba(16,23,26,0.06), 0 3px 10px rgba(16,23,26,0.14), inset 0 1px 0 rgba(255,255,255,0.8);
  transition: transform var(--dur-standard) var(--ease-spring);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .segmented-thumb { box-shadow: 0 1px 1px rgba(0,0,0,0.3), 0 3px 10px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.12); }
}
:root[data-theme="dark"] .segmented-thumb { box-shadow: 0 1px 1px rgba(0,0,0,0.3), 0 3px 10px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.12); }

/* Status strip (last update / offline) */
.status-strip {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-2);
  font-size: 12.5px;
  color: var(--color-text-tertiary);
  min-height: 18px;
}
.status-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--color-cheap);
  flex-shrink: 0;
  box-shadow: 0 0 0 3px var(--color-cheap-tint);
}
.status-strip[data-state="offline"] .status-dot { background: var(--color-danger); box-shadow: 0 0 0 3px var(--color-danger-tint); }
.status-strip[data-state="loading"] .status-dot { background: var(--color-mid); box-shadow: 0 0 0 3px var(--color-mid-tint); animation: pulse 1.2s ease-in-out infinite; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

/* ---- Views ---- */
.view {
  flex: 1;
  min-height: 0;
  position: relative;
}
.view[hidden] { display: none; }

/* List view */
#list-scroll {
  height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  padding: var(--space-4);
  padding-left: calc(var(--space-4) + var(--safe-left));
  padding-right: calc(var(--space-4) + var(--safe-right));
  padding-bottom: calc(var(--space-7) + var(--safe-bottom) + 64px);
}

.pull-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 0;
  overflow: hidden;
  color: var(--color-text-tertiary);
  font-size: 13px;
  gap: var(--space-2);
}
.pull-indicator .spinner { width: 16px; height: 16px; }

.station-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.filter-row {
  display: flex;
  gap: var(--space-2);
  overflow-x: auto;
  padding-bottom: 2px;
  margin-bottom: var(--space-4);
  scrollbar-width: none;
}
.filter-row::-webkit-scrollbar { display: none; }

/* Chips: kleine Glaspillen mit Kontur statt Volltonfarbe */
.chip {
  flex-shrink: 0;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-pill);
  border: none;
  position: relative;
  background: var(--glass-chip-tint);
  box-shadow: inset 0 0 0 1px var(--glass-chip-edge);
  backdrop-filter: var(--blur-card);
  -webkit-backdrop-filter: var(--blur-card);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--color-text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  transition: transform var(--dur-fast) var(--ease-spring), background var(--dur-fast), color var(--dur-fast), box-shadow var(--dur-fast);
}
.chip::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--glass-specular-soft);
  pointer-events: none;
  opacity: 0.7;
}
.chip:active { transform: scale(0.95); }
.chip[aria-pressed="true"] {
  background: var(--color-brand);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.3), 0 4px 14px -4px var(--color-brand);
  color: white;
}
.chip[aria-pressed="true"]::before { background: linear-gradient(135deg, rgba(255,255,255,0.35), rgba(255,255,255,0) 55%); }
.chip svg { position: relative; width: 14px; height: 14px; }

/* Stationskarten: Glasflächen, die auf dem atmosphärischen Hintergrund
   "schweben" — Blur + feine Kontur statt harter weißer Fläche + Border. */
.station-card {
  background: var(--glass-card-tint);
  backdrop-filter: var(--blur-card);
  -webkit-backdrop-filter: var(--blur-card);
  border: none;
  position: relative;
  border-radius: var(--radius-m);
  padding: var(--space-4);
  box-shadow: inset 0 0 0 1px var(--glass-card-edge), var(--glass-card-shadow);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  overflow: hidden;
  transition: transform var(--dur-fast) var(--ease-standard), background-color 240ms ease, box-shadow var(--dur-fast) var(--ease-standard);
}
.station-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--glass-specular-soft);
  pointer-events: none;
}
.station-card:active { transform: scale(0.985); box-shadow: inset 0 0 0 1px var(--glass-card-edge), 0 1px 1px rgba(16,23,26,0.04), 0 4px 12px -6px rgba(16,23,26,0.16); }

.station-card-top {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-3);
}

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

.open-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--color-cheap);
  flex-shrink: 0;
  box-shadow: 0 0 0 2.5px var(--color-cheap-tint);
}
.open-dot[data-open="false"] { background: var(--color-text-tertiary); box-shadow: none; }

.station-name {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.005em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.station-meta {
  font-size: 13px;
  color: var(--color-text-secondary);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.fav-btn {
  position: relative;
  border: none;
  background: transparent;
  padding: 4px;
  flex-shrink: 0;
  transition: transform var(--dur-fast) var(--ease-spring);
}
.fav-btn:active { transform: scale(0.82); }
.fav-btn svg { width: 22px; height: 22px; stroke: var(--color-text-tertiary); fill: none; transition: fill var(--dur-fast), stroke var(--dur-fast); }
.fav-btn[aria-pressed="true"] svg { fill: var(--color-accent); stroke: var(--color-accent-strong); }

.price-row {
  position: relative;
  display: flex;
  gap: var(--space-2);
}

.price-pill {
  flex: 1;
  border-radius: var(--radius-s);
  padding: 8px 10px;
  text-align: center;
  background: var(--color-bg-subtle);
}
.price-pill .fuel-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--color-text-tertiary);
  display: block;
  margin-bottom: 2px;
}
.price-pill .fuel-value {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}
.price-pill.na .fuel-value { color: var(--color-text-tertiary); font-weight: 500; font-size: 14px; }
.price-pill.cheap { background: var(--color-cheap-tint); }
.price-pill.cheap .fuel-value { color: var(--color-cheap); }
.price-pill.mid { background: var(--color-mid-tint); }
.price-pill.mid .fuel-value { color: var(--color-mid); }
.price-pill.expensive { background: var(--color-expensive-tint); }
.price-pill.expensive .fuel-value { color: var(--color-expensive); }

/* Empty / error states */
.state-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-3);
  padding: var(--space-7) var(--space-5);
  color: var(--color-text-secondary);
}
.state-panel .state-icon {
  width: 52px; height: 52px;
  border-radius: var(--radius-pill);
  background: var(--glass-chip-tint);
  box-shadow: inset 0 0 0 1px var(--glass-chip-edge);
  backdrop-filter: var(--blur-card);
  -webkit-backdrop-filter: var(--blur-card);
  display: grid;
  place-items: center;
}
.state-panel .state-icon svg { width: 26px; height: 26px; stroke: var(--color-text-secondary); }
.state-panel h2 { font-size: 17px; margin: 0; color: var(--color-text); }
.state-panel p { margin: 0; font-size: 14px; max-width: 30ch; }
.state-panel .btn { margin-top: var(--space-2); }

.skeleton-card {
  height: 118px;
  border-radius: var(--radius-m);
  background: linear-gradient(100deg, var(--color-bg-subtle) 30%, var(--color-border-strong) 45%, var(--color-bg-subtle) 60%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}
@keyframes shimmer {
  0% { background-position: 140% 0; }
  100% { background-position: -40% 0; }
}

/* Map view */
#map { position: absolute; inset: 0; background: var(--color-bg-subtle); }
.map-controls {
  position: absolute;
  right: calc(var(--space-4) + var(--safe-right));
  bottom: calc(var(--space-6) + var(--safe-bottom));
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  z-index: 15;
}
/* FAB: dickeres, "nasseres" Glas mit Farbtönung durch die Markenfarbe hindurch */
.fab {
  width: 48px; height: 48px;
  border-radius: var(--radius-pill);
  border: none;
  position: relative;
  background:
    linear-gradient(160deg, rgba(255,255,255,0.35), rgba(255,255,255,0) 45%),
    var(--color-brand);
  color: white;
  box-shadow: var(--shadow-fab), inset 0 0 0 1px rgba(255,255,255,0.25);
  backdrop-filter: var(--blur-fab);
  -webkit-backdrop-filter: var(--blur-fab);
  display: grid;
  place-items: center;
  overflow: hidden;
  transition: transform var(--dur-fast) var(--ease-spring), box-shadow var(--dur-fast);
}
.fab:active { transform: scale(0.90); box-shadow: 0 4px 12px -4px var(--color-brand), inset 0 0 0 1px rgba(255,255,255,0.25); }
.fab svg { position: relative; width: 22px; height: 22px; stroke: white; }

.map-price-badge {
  background: var(--glass-modal-tint);
  backdrop-filter: var(--blur-card);
  -webkit-backdrop-filter: var(--blur-card);
  box-shadow: inset 0 0 0 1.5px var(--color-brand), var(--glass-card-shadow);
  border-radius: var(--radius-pill);
  padding: 4px 10px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--color-brand-strong);
  white-space: nowrap;
}
.map-price-badge.user-marker {
  box-shadow: inset 0 0 0 1.5px var(--color-accent), var(--glass-card-shadow);
  color: var(--color-accent-strong);
  padding: 6px;
  border-radius: 50%;
}

/* ---- Bottom sheet ---- */
.sheet-scrim {
  position: fixed; inset: 0;
  background: var(--scrim);
  z-index: 40;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-standard) var(--ease-standard);
}
.sheet-scrim.visible { opacity: 1; pointer-events: auto; }

/* Bottom Sheet: dickstes Glasmaterial der App — hoher Blur, breiter
   Lichtsaum oben, Radius wie ein iOS-Kontextmenü. */
.sheet {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 41;
  background:
    linear-gradient(to bottom, var(--glass-sheet-sheen), transparent 22%),
    var(--glass-sheet-tint);
  backdrop-filter: var(--blur-sheet);
  -webkit-backdrop-filter: var(--blur-sheet);
  box-shadow: inset 0 1px 0 var(--glass-sheet-edge), var(--shadow-sheet);
  border-radius: var(--radius-l) var(--radius-l) 0 0;
  padding-bottom: calc(var(--space-5) + var(--safe-bottom));
  transform: translateY(100%);
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  touch-action: none;
  transition: background-color 240ms ease;
}

.sheet-handle-area {
  display: flex;
  justify-content: center;
  padding: 10px 0 4px;
  cursor: grab;
  flex-shrink: 0;
}
.sheet-handle {
  width: 36px; height: 5px;
  border-radius: var(--radius-pill);
  background: var(--color-border-strong);
}

.sheet-body {
  overflow-y: auto;
  padding: 0 var(--space-5) var(--space-4);
  touch-action: pan-y;
}

.sheet-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}
.sheet-title { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; }
.sheet-address { font-size: 14px; color: var(--color-text-secondary); margin-top: 2px; }

.sheet-status-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-4);
}

.sheet-prices {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-2);
  margin-bottom: var(--space-5);
}

.sheet-actions {
  display: flex;
  gap: var(--space-3);
}

/* Buttons: primär bleibt eine satte Glasfläche in Markenfarbe mit
   Lichtreflex, sekundär ist echtes helles Glas. */
.btn {
  flex: 1;
  border: none;
  position: relative;
  border-radius: var(--radius-m);
  padding: 14px 16px;
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  overflow: hidden;
  transition: transform var(--dur-fast) var(--ease-spring), background var(--dur-fast), box-shadow var(--dur-fast);
}
.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--glass-specular-soft);
  pointer-events: none;
}
.btn:active { transform: scale(0.97); }
.btn svg { position: relative; width: 18px; height: 18px; }
.btn span, .btn-label { position: relative; }
.btn-primary { background: var(--color-brand); color: white; box-shadow: 0 6px 16px -6px var(--color-brand), inset 0 0 0 1px rgba(255,255,255,0.18); }
.btn-secondary {
  background: var(--glass-chip-tint);
  color: var(--color-text);
  box-shadow: inset 0 0 0 1px var(--glass-chip-edge);
  backdrop-filter: var(--blur-card);
  -webkit-backdrop-filter: var(--blur-card);
}
.btn-danger { background: var(--color-danger-tint); color: var(--color-danger); }
.btn-block { width: 100%; }

/* ---- Modal (settings / onboarding) ---- */
.modal-scrim {
  position: fixed; inset: 0;
  background: var(--scrim);
  z-index: 50;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-standard) var(--ease-standard);
}
.modal-scrim.visible { opacity: 1; pointer-events: auto; }
@media (min-width: 640px) {
  .modal-scrim { align-items: center; }
}

.modal {
  width: 100%;
  max-width: 480px;
  position: relative;
  background:
    linear-gradient(to bottom, var(--glass-sheet-sheen), transparent 30%),
    var(--glass-modal-tint);
  backdrop-filter: var(--blur-modal);
  -webkit-backdrop-filter: var(--blur-modal);
  box-shadow: inset 0 1px 0 var(--glass-modal-edge), var(--shadow-sheet);
  border-radius: var(--radius-l) var(--radius-l) 0 0;
  padding: var(--space-6) var(--space-5) calc(var(--space-5) + var(--safe-bottom));
  transform: translateY(24px);
  opacity: 0;
  transition: transform var(--dur-standard) var(--ease-out), opacity var(--dur-standard) var(--ease-out), background-color 240ms ease;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-scrim.visible .modal { transform: translateY(0); opacity: 1; }
@media (min-width: 640px) {
  .modal { border-radius: var(--radius-l); }
}

.modal-icon {
  width: 56px; height: 56px;
  border-radius: var(--radius-m);
  position: relative;
  background: var(--color-brand-tint);
  box-shadow: inset 0 0 0 1px var(--glass-chip-edge);
  overflow: hidden;
  display: grid;
  place-items: center;
  margin-bottom: var(--space-4);
}
.modal-icon::before { content: ""; position: absolute; inset: 0; background: var(--glass-specular-soft); }
.modal-icon svg { position: relative; width: 28px; height: 28px; stroke: var(--color-brand); }

.modal h2 { font-size: 20px; margin: 0 0 var(--space-2); letter-spacing: -0.01em; }
.modal p { font-size: 14.5px; color: var(--color-text-secondary); margin: 0 0 var(--space-4); }

.field {
  margin-bottom: var(--space-4);
}
.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-secondary);
  margin-bottom: 6px;
}
.field input {
  width: 100%;
  padding: 13px 14px;
  border-radius: var(--radius-s);
  border: none;
  background: var(--color-bg-subtle);
  box-shadow: inset 0 0 0 1px var(--color-border-strong);
  color: var(--color-text);
  font-size: 16px;
  transition: box-shadow var(--dur-fast);
}
.field input:focus { box-shadow: inset 0 0 0 1.5px var(--color-brand); outline: none; }
.field-hint { font-size: 12.5px; color: var(--color-text-tertiary); margin-top: 6px; }
.field-error { font-size: 12.5px; color: var(--color-danger); margin-top: 6px; display: none; }
.field.invalid input { box-shadow: inset 0 0 0 1.5px var(--color-danger); }
.field.invalid .field-error { display: block; }

.field-row { display: flex; gap: var(--space-3); }
.field-row .field { flex: 1; }

.link-inline {
  color: var(--color-brand-strong);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}

.modal-footer { display: flex; gap: var(--space-3); margin-top: var(--space-2); }

/* Toast: dunkles Glas statt Volltonfläche */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(90px + var(--safe-bottom));
  transform: translate(-50%, 12px);
  background: rgba(14, 21, 24, 0.82);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.14), 0 8px 24px rgba(0,0,0,0.28);
  color: #FFFFFF;
  padding: 12px 18px;
  border-radius: var(--radius-pill);
  font-size: 13.5px;
  font-weight: 600;
  z-index: 60;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-standard) var(--ease-standard), transform var(--dur-standard) var(--ease-out);
  max-width: calc(100vw - 48px);
  text-align: center;
}
:root[data-theme="dark"] .toast { background: rgba(40, 44, 46, 0.85); box-shadow: inset 0 1px 0 rgba(255,255,255,0.1), 0 8px 24px rgba(0,0,0,0.5); }
.toast.visible { opacity: 1; transform: translate(-50%, 0); }

/* Spinner */
.spinner {
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 2.5px solid var(--color-border-strong);
  border-top-color: var(--color-brand);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Sort menu: Glas-Flyout mit Spring-Pop statt reinem Scale */
.sort-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background:
    linear-gradient(160deg, var(--glass-sheet-sheen), transparent 40%),
    var(--glass-modal-tint);
  backdrop-filter: var(--blur-modal);
  -webkit-backdrop-filter: var(--blur-modal);
  box-shadow: inset 0 0 0 1px var(--glass-modal-edge), var(--glass-card-shadow);
  border-radius: var(--radius-m);
  padding: 6px;
  min-width: 180px;
  z-index: 25;
  transform-origin: top right;
  transform: scale(0.9) translateY(-4px);
  opacity: 0;
  pointer-events: none;
  transition: transform var(--dur-fast) var(--ease-spring), opacity var(--dur-fast) var(--ease-out);
}
.sort-menu.visible { transform: scale(1) translateY(0); opacity: 1; pointer-events: auto; }
.sort-menu button {
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border: none;
  background: transparent;
  border-radius: var(--radius-s);
  font-size: 14.5px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.sort-menu button:active { background: var(--color-bg-subtle); }
.sort-menu button[aria-checked="true"] { color: var(--color-brand-strong); font-weight: 700; }
.sort-menu-wrap { position: relative; }

/* Responsive: tablet / desktop */
@media (min-width: 720px) {
  #app { max-width: 720px; margin: 0 auto; box-shadow: 0 0 0 1px var(--color-border); }
  body { overflow: auto; }
}
@media (min-width: 1100px) {
  #app { max-width: 900px; }
  .station-list { display: grid; grid-template-columns: 1fr 1fr; }
}

/* Reduced motion & transparency */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 120ms !important; }
  .sheet { transition: opacity 160ms ease, transform 160ms ease !important; }
}
@media (prefers-reduced-transparency: reduce) {
  .toolbar, .sheet, .modal, .station-card, .chip, .icon-btn, .segmented, .fab, .btn-secondary, .sort-menu, .map-price-badge, .toast, .material-blur {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  .toolbar { background: var(--color-bg-elevated); box-shadow: none; }
  .sheet { background: var(--color-bg-elevated); box-shadow: var(--shadow-sheet); }
  .modal { background: var(--color-bg-elevated); box-shadow: var(--shadow-sheet); }
  .station-card { background: var(--color-bg-elevated); box-shadow: 0 1px 2px rgba(16,23,26,0.06), 0 6px 16px rgba(16,23,26,0.06); }
  .station-card::before, .icon-btn::before, .chip::before, .btn::before, .modal-icon::before { display: none; }
  .chip { background: var(--color-bg-elevated); box-shadow: inset 0 0 0 1px var(--color-border-strong); }
  .icon-btn { background: var(--color-bg-subtle); box-shadow: none; }
  .segmented { background: var(--color-bg-subtle); box-shadow: none; }
  .fab { background: var(--color-brand); box-shadow: var(--shadow-fab); }
  .btn-secondary { background: var(--color-bg-subtle); box-shadow: none; }
  .sort-menu { background: var(--color-bg-elevated); box-shadow: var(--glass-card-shadow); }
  .map-price-badge { background: var(--color-bg-elevated); }
  .toast { background: var(--color-text); box-shadow: none; }
}
