:root {
  color-scheme: dark;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", system-ui, sans-serif;
  --bg: #151518;
  --bg-elevated: #1c1c1f;
  --panel: #202024;
  --panel-2: #29292f;
  --panel-3: #34343c;
  --text: #f7f7f8;
  --muted: #9a9aa2;
  --line: #3d3d45;
  --blue: #1494f3;
  --blue-2: #0d7fda;
  --heart: #f23878;
  --green: #34c759;
  --yellow: #ffcc00;
  --red: #ff453a;
  --shadow: 0 12px 34px rgba(0,0,0,.35);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); }
body { min-height: 100vh; min-height: 100dvh; overflow-x: hidden; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: #3da8ff; }
svg { width: 1.4em; height: 1.4em; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }

.app-shell { min-height: 100dvh; padding-bottom: calc(92px + env(safe-area-inset-bottom)); }
.app-main { width: min(900px, 100%); margin: 0 auto; }
.app-view { display: none; min-height: calc(100dvh - 92px - env(safe-area-inset-bottom)); }
.app-view.active { display: block; }
.muted { color: var(--muted); }
.status { margin: 10px 18px 20px; font-size: .82rem; }
.status.error { color: #ff8d8d; }

.sticky-top { position: sticky; top: 0; z-index: 500; background: linear-gradient(var(--bg) 78%, rgba(21,21,24,.92)); padding: calc(8px + env(safe-area-inset-top)) 12px 8px; }
.search-controls { display: grid; gap: 8px; }
.toolbar { display: grid; align-items: center; gap: 8px; }
.primary-toolbar { grid-template-columns: 48px minmax(0, 1fr) 48px; }
.filter-toolbar { grid-template-columns: minmax(0, 1fr) auto 44px; }
.round-control { width: 48px; height: 48px; border-radius: 50%; border: 1px solid #34343a; background: #202024; display: grid; place-items: center; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(255,255,255,.02); }
.round-control.small { width: 44px; height: 44px; }
.round-control:active, .pill-select:active, .search-field-button:active { transform: scale(.98); }
.icon-refresh { font-size: 1.8rem; line-height: 1; }
.sliders-icon { width: 25px; height: 25px; stroke-width: 1.7; }
.search-field-button { min-width: 0; height: 48px; border-radius: 24px; border: 1px solid #2d2d32; background: #1c1c1f; display: flex; align-items: center; gap: 10px; padding: 0 16px; color: var(--muted); cursor: pointer; text-align: left; }
.search-field-button svg { flex: 0 0 auto; font-size: 1.05rem; }
.search-field-button span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: clamp(1rem, 4vw, 1.25rem); }
.pill-select { min-width: 0; height: 44px; border: 0; border-radius: 22px; background: var(--blue); color: white; padding: 0 14px 0 18px; display: flex; justify-content: space-between; align-items: center; gap: 12px; font-weight: 750; cursor: pointer; }
.pill-select span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pill-select svg { flex: 0 0 auto; width: 20px; }
.segmented-control { height: 44px; padding: 3px; border-radius: 22px; background: #303038; display: grid; grid-template-columns: 1fr 1fr; min-width: 108px; }
.segmented-control button { min-width: 50px; border: 0; border-radius: 19px; background: transparent; color: #efeff2; cursor: pointer; font-size: 1.15rem; }
.segmented-control button.active { background: var(--blue); color: white; box-shadow: 0 3px 10px rgba(0,0,0,.25); }

.map-section { position: relative; height: clamp(310px, 46vh, 520px); background: #252a2e; border-top: 1px solid #28282d; border-bottom: 1px solid #35353d; overflow: hidden; }
.map { width: 100%; height: 100%; background: #24282c; }
.map-action { position: absolute; z-index: 450; border: 0; cursor: pointer; box-shadow: var(--shadow); }
.search-area-button { top: 14px; left: 50%; transform: translateX(-50%); border-radius: 18px; background: rgba(28,28,31,.94); color: #2aa4ff; padding: 10px 16px; font-weight: 700; white-space: nowrap; }
.recenter-button { right: 14px; bottom: 18px; width: 52px; height: 52px; border-radius: 16px; background: rgba(28,28,31,.95); color: #159cff; display: grid; place-items: center; }
.recenter-button svg { width: 27px; height: 27px; }
.leaflet-control-attribution { background: rgba(15,15,17,.78) !important; color: #ccc !important; font-size: 10px !important; }
.leaflet-control-attribution a { color: #9fd4ff !important; }
.leaflet-control-zoom a { background: #242429 !important; color: #fff !important; border-bottom-color: #444 !important; }
.leaflet-control-zoom { border-color: #444 !important; box-shadow: var(--shadow) !important; }
.user-location-marker { width: 18px; height: 18px; background: #0a84ff; border: 3px solid #fff; border-radius: 50%; box-shadow: 0 0 0 5px rgba(10,132,255,.22), 0 2px 10px rgba(0,0,0,.45); }
.station-map-marker { position: relative; min-width: 74px; max-width: 108px; border-radius: 8px 8px 8px 2px; padding: 6px 8px 7px; color: #fff; border: 1px solid rgba(255,255,255,.65); box-shadow: 0 4px 12px rgba(0,0,0,.35); transform: translate(-4px,-4px); }
.station-map-marker::after { content: ""; position: absolute; left: 6px; bottom: -8px; border: 8px solid transparent; border-left-color: currentColor; transform: rotate(45deg); opacity: .88; }
.station-map-marker .marker-brand { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 11px; line-height: 1.1; }
.station-map-marker .marker-price { display: block; font-size: 17px; line-height: 1.1; font-weight: 800; }
.station-map-marker.cheap { background: #20b84a; color: #20b84a; }
.station-map-marker.mid { background: #e9b400; color: #e9b400; }
.station-map-marker.expensive { background: #ff453a; color: #ff453a; }
.station-map-marker.closed { background: #66666e; color: #66666e; }
.station-map-marker > * { color: #fff; position: relative; z-index: 1; }
.station-map-marker.favorite { outline: 2px solid var(--heart); outline-offset: 1px; }

.results-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; padding: 18px 18px 10px; }
.results-heading h1, .simple-header h1 { margin: 0; font-size: clamp(1.4rem, 5.5vw, 2rem); }
.results-heading p { margin: 5px 0 0; font-size: .82rem; }
.text-button, .link-button { border: 0; background: none; color: #24a2ff; padding: 6px; cursor: pointer; }
.station-list { border-top: 1px solid var(--line); }
.station-row { position: relative; display: grid; grid-template-columns: minmax(94px, 24%) minmax(0, 1fr) minmax(86px, 24%); min-height: 126px; gap: 10px; align-items: center; padding: 18px 16px; background: var(--bg-elevated); border-bottom: 1px solid #66666b; cursor: pointer; outline: none; }
.station-row:focus-visible { box-shadow: inset 0 0 0 2px var(--blue); }
.station-price-col { align-self: center; }
.station-price { font-size: clamp(2rem, 8vw, 3.4rem); font-weight: 380; letter-spacing: -.04em; line-height: .95; white-space: nowrap; }
.station-price sup { font-size: .42em; vertical-align: top; position: relative; top: -.15em; margin-left: 1px; }
.station-price-note { margin-top: 10px; font-size: clamp(.78rem, 3.2vw, 1rem); }
.station-main-col { min-width: 0; }
.station-title-line { display: flex; align-items: center; gap: 9px; min-width: 0; }
.station-name { font-size: clamp(1.05rem, 4.7vw, 1.6rem); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-badge { display: none; flex: 0 0 auto; min-width: 34px; height: 34px; border-radius: 8px; background: #2c2c32; color: #fff; place-items: center; font-size: .72rem; font-weight: 800; padding: 0 6px; }
.brand-badge.has-brand { display: grid; }
.station-address { margin-top: 6px; white-space: pre-line; font-size: clamp(.8rem, 3.6vw, 1.05rem); line-height: 1.25; }
.station-side-col { min-height: 90px; display: flex; flex-direction: column; align-items: flex-end; justify-content: center; gap: 8px; }
.station-distance { font-size: clamp(1.05rem, 4.7vw, 1.55rem); white-space: nowrap; }
.heart-button { position: absolute; top: 12px; right: 12px; border: 0; background: transparent; color: #6d6d75; font-size: 1.75rem; line-height: 1; padding: 2px; cursor: pointer; }
.heart-button.active { color: var(--heart); }
.motorway-badge { color: #2d91ff; font-size: 1.25rem; }
.empty-state { padding: 42px 22px; text-align: center; color: var(--muted); background: var(--bg-elevated); }

.simple-header { padding: calc(26px + env(safe-area-inset-top)) 22px 20px; text-align: center; }
.settings-card { margin: 12px 16px 22px; padding: 20px; border-radius: 22px; background: #0d0d0f; }
.settings-card h2 { margin: 0 0 10px; font-size: clamp(1.25rem, 5vw, 1.8rem); }
.settings-card p { line-height: 1.38; font-size: 1rem; }
.primary-wide, .secondary-wide { width: 100%; min-height: 52px; border-radius: 26px; border: 0; padding: 10px 18px; font-weight: 750; cursor: pointer; }
.primary-wide { background: var(--blue); color: white; }
.secondary-wide { background: #34343a; color: white; margin-top: 12px; }
.alert-fuel-row { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 12px 0; }
.alert-remove { width: 34px; height: 34px; border-radius: 50%; border: 0; background: #ff3b3b; color: #111; font-size: 1.6rem; line-height: 1; }
.alert-fuel-name { font-size: 1.25rem; }
.alert-threshold { font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.alert-stepper { background: #1d1d21; border-radius: 18px; overflow: hidden; display: grid; grid-template-columns: 42px 1px 42px; }
.alert-stepper button { height: 38px; border: 0; background: transparent; font-size: 1.6rem; }
.alert-stepper span { background: #56565d; margin: 6px 0; }
.time-row { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 13px 0; border-bottom: 1px solid #333; font-size: 1.25rem; }
.time-row:last-child { border-bottom: 0; }
.time-row input { border: 0; border-radius: 20px; background: #29292f; color: #fff; padding: 8px 12px; }
.push-status-card { margin-bottom: 20px; }
.route-add { width: min(520px, calc(100% - 44px)); margin: 54px auto 58px; display: block; }
.section-title-block { padding: 0 22px 12px; }
.section-title-block h2 { margin: 0; font-size: 1.45rem; }
.route-history { padding: 0 20px 30px; }
.route-empty { font-size: 1.15rem; line-height: 1.35; }
.route-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; padding: 16px 0; border-bottom: 1px solid #3e3e45; }
.route-row strong { display: block; font-size: 1.1rem; }
.route-row small { display: block; color: var(--muted); margin-top: 4px; }
.route-row-actions { display: flex; gap: 8px; }
.route-row-actions button { border: 0; border-radius: 18px; background: #303038; padding: 8px 10px; }
.menu-list { margin: 20px 16px; border-radius: 18px; overflow: hidden; border: 1px solid #2f2f35; }
.menu-row { width: 100%; min-height: 58px; border: 0; border-bottom: 1px solid #34343a; background: var(--bg-elevated); display: flex; align-items: center; justify-content: space-between; padding: 0 18px; font-size: 1.05rem; text-align: left; }
.menu-row:last-child { border-bottom: 0; }
.menu-row.placeholder { color: #ddd; }

.bottom-nav { position: fixed; left: 50%; bottom: calc(8px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 900; width: min(760px, calc(100% - 18px)); height: 78px; border-radius: 39px; padding: 5px; display: grid; grid-template-columns: repeat(5, 1fr); background: rgba(53,53,59,.96); border: 1px solid #626268; box-shadow: 0 10px 30px rgba(0,0,0,.45); backdrop-filter: blur(18px); }
.nav-item { min-width: 0; border: 0; border-radius: 33px; background: transparent; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: #f1f1f3; cursor: pointer; }
.nav-item.active { background: #5a5a61; color: #21a3ff; }
.nav-item svg { width: 27px; height: 27px; }
.nav-item span { font-size: clamp(.62rem, 2.8vw, .82rem); white-space: nowrap; }

.overlay { position: fixed; inset: 0; z-index: 1200; background: rgba(0,0,0,.55); }
.overlay-panel { width: min(900px, 100%); margin: 0 auto; background: var(--bg); }
.full-panel { min-height: 100dvh; padding: calc(10px + env(safe-area-inset-top)) 16px calc(30px + env(safe-area-inset-bottom)); overflow-y: auto; }
.overlay-topbar { display: grid; grid-template-columns: 48px minmax(0,1fr) 48px; gap: 8px; align-items: center; }
.search-input-wrap { height: 48px; display: flex; align-items: center; gap: 8px; border-radius: 24px; border: 1px solid #29292e; background: #1c1c1f; padding: 0 14px; }
.search-input-wrap input { min-width: 0; width: 100%; border: 0; outline: 0; background: transparent; color: #fff; font-size: 1.05rem; }
.search-input-wrap input::placeholder { color: #818189; }
.current-position-row { width: 100%; display: flex; align-items: center; gap: 12px; border: 0; background: transparent; padding: 22px 6px 16px; text-align: left; font-size: 1.15rem; }
.gps-dot { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--blue); color: white; transform: rotate(-25deg); }
.radius-block { padding: 16px 0 8px; }
.radius-block.compact { padding-top: 24px; }
.radius-title { display: flex; gap: 8px; font-size: 1.1rem; }
.radius-title strong { font-weight: 500; }
.radius-block input[type="range"] { width: 100%; accent-color: var(--blue); margin: 22px 0 6px; }
.range-labels { display: flex; justify-content: space-between; color: #eee; }
.history-section { margin-top: 26px; }
.history-section h2 { margin-bottom: 8px; }
.history-item { min-height: 54px; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px; border-bottom: 1px solid #34343a; }
.history-item button { border: 0; background: transparent; text-align: left; padding: 12px 0; }
.history-item .history-delete { color: #ff453a; padding: 8px 12px; }
.provider-note { color: #777; font-size: .72rem; margin-top: 24px; }
.sheet-overlay { display: flex; align-items: end; justify-content: center; }
.sheet-panel { position: relative; width: min(900px, 100%); max-height: 82dvh; overflow-y: auto; background: #1d1d20; border-radius: 28px 28px 0 0; padding: 9px 20px calc(26px + env(safe-area-inset-bottom)); box-shadow: 0 -10px 30px rgba(0,0,0,.5); }
.sheet-panel.tall { max-height: 92dvh; }
.sheet-handle { width: 110px; height: 5px; border-radius: 3px; background: #b4b4b8; margin: 0 auto 12px; opacity: .8; }
.sheet-header { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 16px; padding: 4px 0 14px; }
.sheet-header h2 { margin: 0; font-size: 1.55rem; text-align: center; padding-left: 54px; }
.sheet-header button { min-width: 54px; border: 0; background: transparent; color: #21a3ff; font-size: 1.15rem; }
.fuel-option-row { display: grid; grid-template-columns: minmax(0,1fr) auto auto; gap: 8px; align-items: center; padding: 14px 0; border-bottom: 1px solid #3c3c42; }
.fuel-option-select { border: 0; background: transparent; text-align: left; font-size: 1.2rem; font-weight: 700; }
.fuel-option-select.active { color: #2aa7ff; }
.fuel-star-btn, .fuel-default-btn { border: 0; background: #2b2b31; border-radius: 16px; padding: 7px 9px; color: #b9b9bf; font-size: .78rem; }
.fuel-star-btn.active { color: #ffcc00; }
.fuel-default-btn.active { color: #74e894; }
.filter-title-row { display: flex; justify-content: space-between; align-items: center; }
.filter-title-row h3 { font-size: 1.2rem; text-transform: uppercase; font-weight: 500; }
.filter-title-row button { border: 0; background: transparent; color: #1d9fff; font-size: 1.05rem; }
.brand-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; margin: 18px 0 22px; }
.brand-choice { min-height: 64px; border: 1px solid #3c3c43; border-radius: 15px; background: #232328; display: grid; grid-template-columns: 36px 1fr 28px; align-items: center; gap: 8px; padding: 8px 10px; }
.brand-choice .brand-logo-fallback { width: 34px; height: 34px; border-radius: 8px; background: #34343b; display: grid; place-items: center; font-size: .68rem; font-weight: 800; }
.brand-choice input { width: 20px; height: 20px; accent-color: var(--blue); }
.switch-row { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 68px; border-top: 1px solid #4a4a50; font-size: 1.05rem; }
.switch-row input { position: absolute; opacity: 0; pointer-events: none; }
.switch-ui { flex: 0 0 auto; width: 54px; height: 32px; border-radius: 16px; background: #63636a; padding: 3px; transition: .18s; }
.switch-ui::before { content: ""; display: block; width: 26px; height: 26px; border-radius: 50%; background: #fff; transition: .18s; }
.switch-row input:checked + .switch-ui { background: var(--blue); }
.switch-row input:checked + .switch-ui::before { transform: translateX(22px); }

.detail-overlay { background: rgba(0,0,0,.18); pointer-events: auto; }
.detail-panel { max-height: 78dvh; padding: 9px 0 calc(28px + env(safe-area-inset-bottom)); }
.detail-close { position: absolute; right: 14px; top: 20px; z-index: 2; width: 46px; height: 46px; border-radius: 50%; border: 0; background: transparent; font-size: 2.5rem; line-height: 1; }
.detail-hero { padding: 26px 20px 18px; }
.detail-name-line { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 10px; align-items: start; padding-right: 48px; }
.detail-name-line h2 { margin: 0; font-size: 1.7rem; }
.detail-fav { border: 0; background: transparent; color: #666; font-size: 2rem; }
.detail-fav.active { color: var(--heart); }
.detail-address { margin: 8px 0 0; line-height: 1.35; font-size: 1.1rem; }
.detail-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; }
.detail-distance { font-size: 1.2rem; font-weight: 700; }
.detail-route { border: 0; border-radius: 20px; background: var(--blue); color: white; padding: 9px 15px; font-weight: 750; }
.opening-status { margin-top: 18px; font-size: 1.15rem; font-weight: 750; }
.detail-price-list { border-top: 1px solid #0f93f5; }
.detail-fuel-row { display: grid; grid-template-columns: 116px 1fr; gap: 15px; align-items: center; min-height: 86px; padding: 12px 20px; border-bottom: 1px solid #0f93f5; }
.detail-fuel-price { font-size: 2rem; white-space: nowrap; }
.detail-fuel-price sup { font-size: .42em; vertical-align: top; }
.detail-fuel-name { font-size: 1.25rem; font-weight: 800; }
.detail-fuel-note { margin-top: 4px; color: var(--muted); }
.opening-times { padding: 18px 20px; }
.opening-times h3 { margin: 0 0 8px; }
.opening-time-row { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; color: #d0d0d4; }
.detail-unavailable { padding: 18px 20px; color: var(--muted); }

.info-panel { padding-left: 28px; padding-right: 28px; }
.info-header { display: grid; grid-template-columns: 54px 1fr 54px; align-items: center; gap: 8px; margin-bottom: 18px; }
.info-header h1 { margin: 0; text-align: center; font-size: 1.45rem; }
.back-button { width: 48px; height: 48px; border-radius: 50%; border: 1px solid #3c3c42; background: #222226; font-size: 2.3rem; line-height: 1; }
.info-copy { max-width: 720px; margin: 0 auto; font-size: clamp(1rem, 4.1vw, 1.18rem); line-height: 1.42; }
.info-copy h2 { margin: 22px 0 8px; font-size: 1.35rem; }
.legend-row { display: grid; grid-template-columns: 42px 1fr; gap: 10px; align-items: center; padding: 8px 0; }
.legend-symbol { font-size: 1.6rem; text-align: center; }
.legend-symbol.heart { color: var(--heart); }
.legend-symbol.motorway { color: #2f95ff; }

@media (min-width: 680px) {
  .sticky-top { padding-left: 18px; padding-right: 18px; }
  .brand-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .station-row { grid-template-columns: 170px minmax(0,1fr) 150px; padding-left: 24px; padding-right: 24px; }
  .brand-badge { display: grid; }
}

@media (max-width: 390px) {
  .bottom-nav { height: 72px; }
  .nav-item svg { width: 24px; height: 24px; }
  .station-row { grid-template-columns: 88px minmax(0,1fr) 78px; gap: 7px; padding-left: 12px; padding-right: 12px; }
  .brand-badge { display: none !important; }
  .alert-fuel-row { grid-template-columns: 36px minmax(0,1fr) auto; }
  .alert-stepper { grid-column: 2 / -1; justify-self: end; }
}
/* Detail- und Infoansichten lassen die feste Hauptnavigation sichtbar. */
.detail-overlay, #dataSourceOverlay { z-index: 850; }
.detail-panel { padding-bottom: calc(104px + env(safe-area-inset-bottom)); }
.info-panel { padding-bottom: calc(112px + env(safe-area-inset-bottom)); }
