/* ============================================================
   mkTankManager – Styles (dark automotive theme)
   ============================================================ */

/* --- CSS Variables ---------------------------------------- */
:root {
  --bg:            #080b12;
  --surface:       #0f1520;
  --surface-2:     #161e2e;
  --surface-3:     #1a2438;
  --border:        #1e2d42;
  --border-soft:   #162034;

  --text:          #e2e8f0;
  --text-muted:    #6b7fa0;
  --text-subtle:   #3d5070;

  --primary:       #f59e0b;
  --primary-dim:   #f59e0b22;
  --primary-glow:  #f59e0b44;

  --diesel:        #f59e0b;
  --e10:           #3b82f6;
  --e5:            #10b981;

  --diesel-dim:    #f59e0b18;
  --e10-dim:       #3b82f618;
  --e5-dim:        #10b98118;

  --nav-bg:        #060810;
  --nav-height:    58px;

  --radius-sm:     6px;
  --radius-md:     12px;
  --radius-lg:     20px;
  --radius-xl:     28px;

  --shadow-card:   0 4px 24px rgba(0,0,0,0.4);
  --shadow-glow:   0 0 30px rgba(245,158,11,0.15);

  --transition:    0.2s ease;

  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', 'Courier New', monospace;
}

/* --- Reset ------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  padding-top: var(--nav-height);
  overscroll-behavior: none;
}

/* --- Navigation -------------------------------------------- */
.app-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-height);
  background: var(--nav-bg);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.nav-inner {
  max-width: 900px;
  margin: 0 auto;
  height: 100%;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-logo {
  width: 28px;
  height: 28px;
  color: var(--primary);
  flex-shrink: 0;
}

.nav-title {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  background: linear-gradient(135deg, var(--text) 0%, var(--primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-actions {
  display: flex;
  gap: 4px;
}

.nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  text-decoration: none;
}

.nav-btn:hover { background: var(--surface); color: var(--text); }
.nav-btn svg { width: 18px; height: 18px; }

.nav-btn.spinning svg {
  animation: spin 1s linear infinite;
}

/* --- Loading Screen ---------------------------------------- */
.loading-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100dvh - var(--nav-height));
  gap: 16px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.loading-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* --- Home Page -------------------------------------------- */
.home-page {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 0 32px;
}

/* --- Meta Info Bar ---------------------------------------- */
.meta-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 16px;
  padding: 12px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border-soft);
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.meta-item svg {
  width: 13px;
  height: 13px;
  opacity: 0.7;
  flex-shrink: 0;
}

.meta-item strong {
  color: var(--text);
  font-weight: 600;
}

.meta-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--border);
  flex-shrink: 0;
}

/* --- Meta-Bar: editierbare Felder & Popovers -------------- */
.meta-bar {
  position: relative;
}

.meta-editable {
  background: transparent;
  border: none;
  border-bottom: 1px dashed var(--border);
  color: var(--text);
  font-weight: 600;
  font-size: inherit;
  font-family: inherit;
  cursor: pointer;
  padding: 0 1px;
  transition: border-color var(--transition), color var(--transition);
}

.meta-editable:hover {
  border-bottom-color: var(--primary);
  color: var(--primary);
}

.gps-loc-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  transition: color var(--transition);
}

.gps-loc-btn svg {
  width: 13px;
  height: 13px;
}

.gps-loc-btn:hover {
  color: var(--primary);
}

.meta-popover {
  position: absolute;
  top: calc(100% + 6px);
  left: 16px;
  z-index: 60;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  min-width: 240px;
  box-shadow: var(--shadow-card);
}

.meta-popover-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}

.meta-popover-row {
  display: flex;
  gap: 6px;
  align-items: center;
}

.meta-input {
  flex: 1;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  padding: 6px 10px;
  outline: none;
  transition: border-color var(--transition);
}

.meta-input:focus {
  border-color: var(--primary);
}

.gps-fill-btn {
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  transition: all var(--transition);
  flex-shrink: 0;
}

.gps-fill-btn svg {
  width: 14px;
  height: 14px;
}

.gps-fill-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.gps-coords {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  margin-top: 6px;
  min-height: 14px;
}

.meta-popover-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}

.meta-btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.8rem;
  padding: 5px 12px;
  cursor: pointer;
  transition: all var(--transition);
}

.meta-btn-ghost:hover {
  color: var(--text);
  border-color: var(--text-muted);
}

.meta-btn-save {
  background: var(--primary);
  border: 1px solid var(--primary);
  border-radius: var(--radius-sm);
  color: #000;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 5px 14px;
  cursor: pointer;
  transition: opacity var(--transition);
}

.meta-btn-save:hover {
  opacity: 0.85;
}

.distanz-grid {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.distanz-opt {
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.82rem;
  padding: 6px 12px;
  cursor: pointer;
  transition: all var(--transition);
}

.distanz-opt:hover,
.distanz-opt.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #000;
  font-weight: 600;
}

/* --- Interval Selector ------------------------------------ */
.interval-bar {
  display: flex;
  gap: 4px;
  padding: 10px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border-soft);
}

.interval-btn {
  flex: 1;
  padding: 7px 4px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 500;
  font-family: var(--font);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
}

.interval-btn:hover {
  background: var(--surface-2);
  color: var(--text);
}

.interval-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #000;
  font-weight: 700;
}

.interval-btn--raw {
  border-left: 1px solid var(--border-soft);
  margin-left: 4px;
  color: #6b7fa0;
  font-style: italic;
}

.interval-btn--raw.active {
  background: #1e3a5f;
  border-color: #3b82f6;
  color: #93c5fd;
  font-style: italic;
}

/* --- Period Navigator ------------------------------------- */
.period-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 7px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border-soft);
}

.period-nav.hidden {
  display: none;
}

.period-arrow {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  width: 28px;
  height: 28px;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  flex-shrink: 0;
}

.period-arrow:hover:not(:disabled) {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--primary);
}

.period-arrow:disabled {
  opacity: 0.3;
  cursor: default;
}

.period-label {
  font-size: 0.82rem;
  color: var(--text);
  font-family: var(--font-mono);
  min-width: 150px;
  text-align: center;
  white-space: nowrap;
}

/* --- Chart Container -------------------------------------- */
.chart-section {
  padding: 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border-soft);
}

.chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.chart-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.points-toggle {
  display: flex;
  align-items: center;
  gap: 5px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.72rem;
  font-family: var(--font);
  padding: 3px 9px;
  cursor: pointer;
  transition: all var(--transition);
}

.points-toggle svg {
  width: 10px;
  height: 10px;
  opacity: 0.5;
}

.points-toggle.active {
  border-color: var(--primary);
  color: var(--primary);
}

.points-toggle.active svg {
  opacity: 1;
}

.chart-container {
  position: relative;
  height: 220px;
  overflow: hidden;
}

.chart-no-data {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 220px;
  color: var(--text-muted);
  font-size: 0.85rem;
  background: var(--surface-2);
  border-radius: var(--radius-md);
  border: 1px dashed var(--border);
  flex-direction: column;
  gap: 8px;
}

.chart-no-data svg {
  width: 32px;
  height: 32px;
  opacity: 0.3;
}

/* --- Current Prices --------------------------------------- */
.prices-section {
  padding: 20px 16px 8px;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.section-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

.section-line {
  flex: 1;
  height: 1px;
  background: var(--border-soft);
}

/* --- Price Cards ------------------------------------------ */
.prices-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.price-card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  position: relative;
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
}

.price-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.price-card[data-sorte="Diesel"]::before    { background: var(--diesel); box-shadow: 0 0 12px var(--diesel-dim); }
.price-card[data-sorte="Super E10"]::before { background: var(--e10); box-shadow: 0 0 12px var(--e10-dim); }
.price-card[data-sorte="Super E5"]::before  { background: var(--e5); box-shadow: 0 0 12px var(--e5-dim); }

.price-card--featured[data-sorte="Diesel"]    { border-color: var(--diesel); box-shadow: 0 0 0 1px var(--diesel),    inset 0 0 20px rgba(245,158,11,0.04); }
.price-card--featured[data-sorte="Super E10"] { border-color: var(--e10);    box-shadow: 0 0 0 1px var(--e10),    inset 0 0 20px rgba(59,130,246,0.04);  }
.price-card--featured[data-sorte="Super E5"]  { border-color: var(--e5);     box-shadow: 0 0 0 1px var(--e5),     inset 0 0 20px rgba(16,185,129,0.04); }

.price-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
}

.fuel-icon {
  font-size: 1.4rem;
  line-height: 1;
}

.fuel-name {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  text-align: center;
}

.fuel-price {
  font-size: 1.65rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--text);
}

.price-card[data-sorte="Diesel"]    .fuel-price { color: var(--diesel); }
.price-card[data-sorte="Super E10"] .fuel-price { color: var(--e10); }
.price-card[data-sorte="Super E5"]  .fuel-price { color: var(--e5); }

.price-sup {
  font-size: 0.6em;
  vertical-align: super;
  line-height: 0;
}

.price-unit {
  font-size: 0.65rem;
  color: var(--text-subtle);
  font-weight: 500;
}

/* Preisänderungs-Badge */
.price-trend {
  font-size: 0.62rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 999px;
}

.price-trend.up   { background: #ff444422; color: #ff6b6b; }
.price-trend.down { background: #10b98122; color: #10b981; }
.price-trend.flat { background: var(--surface-3); color: var(--text-muted); }

.price-minmax {
  display: flex;
  justify-content: space-between;
  width: 100%;
  margin-top: 6px;
  font-size: 0.72rem;
  font-family: var(--font-mono, monospace);
  color: var(--text-subtle);
}

.price-min { color: #10b981; display: flex; flex-direction: column; align-items: flex-start; gap: 1px; }
.price-max { color: #ff6b6b; display: flex; flex-direction: column; align-items: flex-end; gap: 1px; }

.minmax-meta {
  font-size: 0.60rem;
  color: var(--text-subtle);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
}

/* --- Error Banner ----------------------------------------- */
.error-banner {
  margin: 16px;
  padding: 12px 16px;
  background: #ff44441a;
  border: 1px solid #ff444433;
  border-radius: var(--radius-sm);
  color: #ff8888;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* --- Alert Action Button ----------------------------------- */
.alert-action {
  display: flex;
  justify-content: flex-end;
  margin: 0 0 8px;
}

.alert-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 20px;
  background: var(--primary-dim);
  border: 1px solid var(--primary);
  border-radius: var(--radius-xl);
  color: var(--primary);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.alert-action-btn svg {
  width: 16px;
  height: 16px;
}

.alert-action-btn:hover {
  background: var(--primary-glow);
}

.alert-dialog {
  max-width: 380px;
}

/* --- Price Alert Badge ------------------------------------- */
.price-alert-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
  padding: 4px 8px;
  background: var(--primary-dim);
  border: 1px solid var(--primary);
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  color: var(--primary);
  font-weight: 600;
}

.price-alert-badge.hidden {
  display: none;
}

.price-alert-badge svg {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}

/* --- Tankstellen-Favoriten -------------------------------- */
.stations-section.hidden { display: none; }
.stations-section { margin-top: 24px; }

.stations-empty {
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
  padding: 20px 0;
}

.stations-add-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px;
  margin-top: 12px;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 0.85rem;
  font-family: var(--font);
  cursor: pointer;
  transition: all 0.15s;
}
.stations-add-btn:hover { border-color: var(--primary); color: var(--primary); }
.stations-add-btn svg { width: 18px; height: 18px; }

/* Station Card (Favorit) */
.station-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 10px;
  transition: border-color 0.15s;
}
.station-card--cheapest {
  border-color: var(--e5);
  box-shadow: 0 0 0 1px var(--e5, #22c55e)22;
}

.station-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}
.station-card-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.station-brand {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--primary);
}
.station-name {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.station-address {
  font-size: 0.75rem;
  color: var(--muted);
}
.station-card-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
  padding-right: 36px;
}
.station-dist {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 600;
}
.station-open  { font-size: 0.68rem; color: #22c55e; font-weight: 600; }
.station-closed { font-size: 0.68rem; color: #ef4444; font-weight: 600; }

.station-card-prices {
  display: flex;
  gap: 8px;
}
.station-price {
  flex: 1;
  background: var(--surface-alt, #0c1322);
  border-radius: 8px;
  padding: 8px 10px;
  text-align: center;
}
.station-price--na { opacity: 0.4; }
.station-price-label {
  display: block;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 3px;
}
.station-price-val {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text);
}

.station-remove-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  background: #ef444418;
  border: 1px solid #ef444430;
  border-radius: 50%;
  color: #ef4444;
  cursor: pointer;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: all 0.15s;
}
.station-remove-btn:hover { background: #ef444430; border-color: #ef4444; }

.station-cheapest-badge {
  position: absolute;
  bottom: 10px;
  right: 10px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #22c55e;
  background: #22c55e18;
  padding: 2px 8px;
  border-radius: 99px;
}

/* Station Dialog / List */
.station-dialog .refuel-dialog-body { max-height: 70vh; overflow-y: auto; }

.station-list { margin-top: 12px; }

.station-list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 6px;
  cursor: pointer;
  transition: all 0.15s;
}
.station-list-item:hover {
  border-color: var(--primary);
  background: var(--surface-alt, #0c1322);
}

.station-list-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.station-list-brand {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--primary);
}
.station-list-name {
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.station-list-addr {
  font-size: 0.72rem;
  color: var(--muted);
}

.station-list-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex-shrink: 0;
}
.station-list-price {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text);
}
.station-list-dist {
  font-size: 0.72rem;
  color: var(--muted);
}
.station-list-status {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.station-list-status.station-open { background: #22c55e; }
.station-list-status.station-closed { background: #ef4444; }

/* --- Tankstellen-Karte ------------------------------------ */
.map-section.hidden { display: none; }
.map-section { margin-top: 24px; }

.map-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 8px;
}
.map-locate-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted);
  font-family: var(--font);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.map-locate-btn svg { width: 16px; height: 16px; }
.map-locate-btn:hover { border-color: var(--primary); color: var(--primary); }

.map-container {
  width: 100%;
  height: 350px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  background: var(--surface);
}

@media (min-width: 600px) {
  .map-container { height: 450px; }
}

.map-legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
  padding: 10px 0 4px;
}
.map-legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  color: var(--muted);
}
.map-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.map-legend-dot--cheap     { background: #22c55e; }
.map-legend-dot--mid       { background: #f59e0b; }
.map-legend-dot--expensive { background: #ef4444; }
.map-legend-dot--fav       { background: #3b82f6; border: 2px solid #60a5fa; }

/* Eigene Position – blinkender Marker */
.map-my-location {
  background: none !important;
  border: none !important;
}
.map-my-location-dot {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  background: #ef4444;
  border: 3px solid #fff;
  border-radius: 50%;
  z-index: 2;
  box-shadow: 0 0 8px rgba(239,68,68,0.6);
}
.map-my-location-pulse {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  background: #ef444455;
  border-radius: 50%;
  z-index: 1;
  animation: location-pulse 1.5s ease-out infinite;
}
@keyframes location-pulse {
  0%   { transform: scale(1);   opacity: 1; }
  100% { transform: scale(4); opacity: 0; }
}

/* Leaflet Popup Styling (dark theme) */
.leaflet-popup-content-wrapper {
  background: var(--surface, #0f1520) !important;
  color: var(--text, #e2e8f0) !important;
  border: 1px solid var(--border, #1e2d42) !important;
  border-radius: 10px !important;
  box-shadow: 0 8px 30px rgba(0,0,0,0.4) !important;
}
.leaflet-popup-tip {
  background: var(--surface, #0f1520) !important;
  border: 1px solid var(--border, #1e2d42) !important;
}
.leaflet-popup-content {
  margin: 12px 14px !important;
  font-family: var(--font) !important;
  font-size: 0.82rem !important;
  line-height: 1.5 !important;
}
.map-popup-brand {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--primary, #f59e0b);
}
.map-popup-name {
  font-size: 0.92rem;
  font-weight: 600;
  margin-bottom: 2px;
}
.map-popup-addr {
  font-size: 0.72rem;
  color: var(--muted, #6b7fa0);
  margin-bottom: 8px;
}
.map-popup-prices {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}
.map-popup-price {
  text-align: center;
  flex: 1;
}
.map-popup-price-label {
  display: block;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--muted, #6b7fa0);
}
.map-popup-price-val {
  font-size: 0.95rem;
  font-weight: 800;
}
.map-popup-fav-btn {
  display: block;
  width: 100%;
  padding: 6px;
  border: 1px solid var(--border, #1e2d42);
  border-radius: 6px;
  background: none;
  color: var(--text, #e2e8f0);
  font-family: var(--font);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
}
.map-popup-fav-btn:hover { border-color: var(--primary, #f59e0b); color: var(--primary, #f59e0b); }
.map-popup-fav-btn--active { color: #3b82f6; border-color: #3b82f6; }

/* --- Tankstellen-Statistiken ------------------------------ */
.stats-section.hidden { display: none; }
.stats-section { margin-top: 24px; }

.stats-filter {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}
.stats-select {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: var(--font);
  font-size: 0.82rem;
  padding: 7px 12px;
  cursor: pointer;
}
.stats-select:focus { outline: none; border-color: var(--primary); }

.stats-card-title {
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text);
}

/* Ranking */
.stats-rank-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}
.stats-rank-row:last-child { border-bottom: none; }
.stats-rank-row:hover { background: var(--surface); }
.stats-rank-row--top { background: var(--surface); }

.stats-rank-pos {
  width: 30px;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 700;
  flex-shrink: 0;
}
.stats-rank-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.stats-rank-brand {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--primary);
}
.stats-rank-name {
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stats-rank-place {
  font-size: 0.72rem;
  color: var(--muted);
}
.stats-rank-prices {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  flex-shrink: 0;
}
.stats-rank-avg {
  font-size: 0.95rem;
  font-weight: 800;
}
.stats-rank-range {
  font-size: 0.68rem;
  color: var(--muted);
}

/* Marken-Vergleich */
#statsBrands { margin-top: 20px; }

.stats-brand-row {
  margin-bottom: 8px;
}
.stats-brand-name {
  font-size: 0.78rem;
  font-weight: 600;
  margin-bottom: 3px;
  display: block;
}
.stats-brand-count {
  font-weight: 400;
  color: var(--muted);
}
.stats-brand-bar-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 22px;
}
.stats-brand-bar {
  height: 100%;
  border-radius: 4px;
  background: var(--primary);
  opacity: 0.7;
  transition: width 0.3s;
}
.stats-brand-bar--best  { background: #22c55e; opacity: 1; }
.stats-brand-bar--worst { background: #ef4444; opacity: 0.8; }
.stats-brand-val {
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Preisschwankung */
#statsVolatility { margin-top: 20px; }

.stats-vol-group { margin-bottom: 14px; }
.stats-vol-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 8px;
}
.stats-vol-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}
.stats-vol-row:last-child { border-bottom: none; }
.stats-vol-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.stats-vol-brand {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--primary);
}
.stats-vol-name {
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stats-vol-vals {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  flex-shrink: 0;
}
.stats-vol-avg {
  font-size: 0.82rem;
  font-weight: 700;
}
.stats-vol-spread {
  font-size: 0.68rem;
  color: var(--muted);
}

/* Station Confirm Dialog */
.station-confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.station-confirm-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px;
  max-width: 340px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}
.station-confirm-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: #ef444418;
  display: flex;
  align-items: center;
  justify-content: center;
}
.station-confirm-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 8px;
}
.station-confirm-brand {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--primary);
}
.station-confirm-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}
.station-confirm-text {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 22px;
}
.station-confirm-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}
.station-confirm-cancel,
.station-confirm-delete {
  padding: 9px 20px;
  border-radius: 8px;
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  min-width: 110px;
  transition: all 0.15s;
}
.station-confirm-cancel {
  background: var(--surface-alt, #0c1322);
  color: var(--text);
  border: 1px solid var(--border);
}
.station-confirm-cancel:hover { background: var(--border); }
.station-confirm-delete {
  background: #ef444420;
  color: #ff7878;
  border: 1px solid #ef444430;
}
.station-confirm-delete:hover { background: #ef444430; }

/* --- Sparrechner ------------------------------------------ */
.savings-section.hidden { display: none; }
.savings-section { margin-top: 24px; }

.savings-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 8px;
}

.savings-stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 8px;
  text-align: center;
}

.savings-stat-val {
  display: block;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  font-family: var(--font-mono);
}

.savings-stat-lbl {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.savings-pos .savings-stat-val { color: var(--e5); }
.savings-neg .savings-stat-val { color: #ef4444; }

.savings-hint {
  font-size: 0.72rem;
  color: var(--text-subtle);
  text-align: center;
  margin-bottom: 16px;
}

/* Trends */
.savings-trends-title,
.savings-monthly-title,
.savings-details-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.savings-trends-period {
  font-weight: 400;
  font-size: 0.7rem;
  color: var(--text-subtle);
  text-transform: none;
  letter-spacing: 0;
}

.savings-trends-grid {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.savings-trend-card {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

.savings-trend-icon { font-size: 1.3rem; }
.savings-trend-val { font-size: 0.95rem; font-weight: 700; color: var(--text); }
.savings-trend-lbl { font-size: 0.72rem; color: var(--text-muted); }
.savings-trend-price { font-size: 0.78rem; font-weight: 400; color: var(--e5); }

/* Wochentag-Balken */
.trend-bars {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 60px;
  margin-bottom: 16px;
  padding: 0 4px;
}

.trend-bar-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
}

.trend-bar {
  width: 100%;
  background: var(--surface-3);
  border-radius: 3px 3px 0 0;
  transition: height 0.3s ease;
}

.trend-bar--best  { background: var(--e5); }
.trend-bar--worst { background: #ef4444; }

.trend-bar-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 3px;
}

/* Monatsübersicht */
.savings-monthly { margin-bottom: 16px; }

.savings-month-row {
  display: flex;
  align-items: center;
  padding: 8px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 4px;
  font-size: 0.82rem;
}

.savings-month-label {
  flex: 1;
  color: var(--text-muted);
}

.savings-month-paid {
  font-family: var(--font-mono);
  color: var(--text);
  margin-right: 12px;
}

.savings-month-diff {
  font-family: var(--font-mono);
  font-weight: 600;
  min-width: 70px;
  text-align: right;
}

.savings-month-diff.savings-pos { color: var(--e5); }
.savings-month-diff.savings-neg { color: #ef4444; }

/* Detail-Liste */
.savings-details { margin-bottom: 8px; }

.savings-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 4px;
}

.savings-detail-date {
  font-size: 0.82rem;
  color: var(--text);
  font-weight: 600;
}

.savings-detail-info {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.savings-detail-right { text-align: right; }

.savings-detail-diff {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
}

.savings-detail-diff.savings-pos { color: var(--e5); }
.savings-detail-diff.savings-neg { color: #ef4444; }

.savings-detail-hint {
  font-size: 0.68rem;
  color: var(--text-subtle);
}

@media (max-width: 380px) {
  .savings-summary-grid { grid-template-columns: 1fr; }
  .savings-trends-grid { flex-direction: column; }
}

/* --- Save Toast ------------------------------------------- */
.save-toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--e5);
  color: #fff;
  padding: 10px 24px;
  border-radius: var(--radius-xl);
  font-size: 0.9rem;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 9999;
  pointer-events: none;
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.4);
}

.save-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* --- Offline Badge ---------------------------------------- */
.offline-badge {
  display: none;
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 18px;
  font-size: 0.8rem;
  color: var(--text-muted);
  z-index: 200;
  box-shadow: var(--shadow-card);
}

body.offline .offline-badge { display: block; }

/* --- Responsive -------------------------------------------- */
@media (max-width: 480px) {
  .fuel-price { font-size: 1.35rem; }
  .prices-grid { gap: 8px; }
  .price-card { padding: 12px 8px; }
  .fuel-icon { font-size: 1.1rem; }
  .chart-container { height: 180px; }
}

@media (max-width: 360px) {
  .fuel-price { font-size: 1.15rem; }
  .fuel-name { font-size: 0.62rem; }
}

/* --- Chart.js Tooltip Override ----------------------------- */
.chartjs-tooltip {
  background: var(--surface-2) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-sm) !important;
  color: var(--text) !important;
  font-family: var(--font) !important;
  font-size: 12px !important;
}

/* ---- Footer ----------------------------------------------- */

#appFooter {
  text-align: center;
  padding: 24px 0 calc(8px + env(safe-area-inset-bottom));
  font-size: 11px;
  color: var(--text-subtle);
  line-height: 1.9;
  font-family: var(--font-mono, monospace);
}

.footer-link {
  color: var(--text-muted);
  text-decoration: none;
}

.footer-link:hover {
  color: var(--primary);
}

.footer-legal {
  display: block;
  margin-top: 4px;
}

/* ---- Install Banner --------------------------------------- */

.install-banner {
  display: none;
  align-items: center;
  gap: 12px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  padding: 10px 16px;
  font-size: 13px;
}

.install-banner.visible {
  display: flex;
}

.install-banner-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.install-banner-text strong {
  color: var(--text);
  font-size: 13px;
}

.install-banner-text span {
  color: var(--text-muted);
  font-size: 11px;
}

.install-btn {
  background: var(--primary);
  color: #080b12;
  border: none;
  border-radius: var(--radius-sm);
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

.install-dismiss {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
  padding: 4px;
  flex-shrink: 0;
}

/* ---- About Overlay & Panel -------------------------------- */

.about-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 200;
}

.about-overlay.visible {
  display: block;
}

.about-panel {
  display: none;
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(420px, 100vw);
  background: var(--surface);
  border-left: 1px solid var(--border);
  z-index: 201;
  overflow-y: auto;
  padding: 24px 20px 40px;
  -webkit-overflow-scrolling: touch;
}

.about-panel.visible {
  display: block;
}

body.overlay-open {
  overflow: hidden;
}

.about-close {
  display: block;
  margin-left: auto;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  margin-bottom: 24px;
}

.about-close:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.about-logo {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.5px;
  text-align: center;
  color: var(--text);
  margin-bottom: 4px;
}

.about-logo span {
  color: var(--primary);
}

.about-version {
  text-align: center;
  font-size: 11px;
  color: var(--text-subtle);
  font-family: var(--font-mono, monospace);
  margin-bottom: 28px;
}

.about-section {
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-soft);
}

.about-section:last-of-type {
  border-bottom: none;
}

.about-section h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.about-section p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
}

.about-privacy {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: var(--surface-2);
  border: 1px solid var(--primary);
  border-radius: var(--radius-md);
  padding: 16px;
  margin: 24px 0;
}

.about-privacy-icon {
  font-size: 20px;
  flex-shrink: 0;
  line-height: 1;
  margin-top: 2px;
}

.about-privacy-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 4px;
}

.about-privacy-text {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
}

.about-links {
  text-align: center;
  font-size: 12px;
  color: var(--text-subtle);
  margin-top: 8px;
  display: flex;
  justify-content: center;
  gap: 8px;
}

.about-links a {
  color: var(--text-muted);
  text-decoration: none;
}

.about-links a:hover {
  color: var(--primary);
}

/* ---- Settings Overlay & Panel ----------------------------- */

.settings-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 200;
}

.settings-overlay.visible {
  display: block;
}

.settings-panel {
  display: none;
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(400px, 100vw);
  background: var(--surface);
  border-left: 1px solid var(--border);
  z-index: 201;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.settings-panel.visible {
  display: block;
}

.settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 0;
  margin-bottom: 24px;
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 1;
  border-bottom: 1px solid var(--border-soft);
  padding-bottom: 16px;
}

.settings-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.settings-title svg {
  width: 18px;
  height: 18px;
  color: var(--primary);
  flex-shrink: 0;
}

.settings-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  flex-shrink: 0;
}

.settings-close svg {
  width: 16px;
  height: 16px;
}

.settings-close:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.settings-section {
  padding: 0 20px 24px;
  border-bottom: 1px solid var(--border-soft);
  margin-bottom: 0;
}

.settings-section:last-child {
  border-bottom: none;
}

.settings-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-subtle);
  margin-bottom: 16px;
}

.settings-uid {
  font-size: 10px;
  font-family: var(--font-mono, monospace);
  color: var(--text-muted);
  padding: 0 20px 8px;
  opacity: 0.5;
  word-break: break-all;
}

.settings-field {
  margin-bottom: 16px;
}

.settings-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.settings-input-row {
  display: flex;
  gap: 8px;
}

.settings-input {
  flex: 1;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 13px;
  font-family: var(--font-mono, monospace);
  padding: 8px 10px;
  outline: none;
  min-width: 0;
}

.settings-input:focus {
  border-color: var(--primary);
}

.settings-gps-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  flex-shrink: 0;
}

.settings-gps-btn svg {
  width: 16px;
  height: 16px;
}

.settings-gps-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.settings-info {
  font-size: 11px;
  color: var(--text-subtle);
  font-family: var(--font-mono, monospace);
  margin-top: 6px;
  min-height: 16px;
}

.settings-km-grid {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.settings-km-btn {
  padding: 6px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.settings-km-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.settings-km-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #000;
}

.settings-save-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 16px;
  background: var(--primary);
  border: none;
  border-radius: var(--radius-sm);
  color: #000;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  justify-content: center;
  margin-top: 4px;
}

.settings-save-btn svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.settings-save-btn:hover {
  background: var(--primary-hover, #d97706);
}

.settings-input--sans {
  font-family: var(--font, sans-serif);
}

.settings-select {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 13px;
  font-family: var(--font, sans-serif);
  padding: 8px 10px;
  outline: none;
  appearance: none;
  cursor: pointer;
}

.settings-select:focus {
  border-color: var(--primary);
}

.settings-field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 380px) {
  .settings-field-grid {
    grid-template-columns: 1fr;
  }
}

.settings-save-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.settings-add-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 10px 16px;
  background: transparent;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition);
  margin-bottom: 12px;
}

.settings-add-btn svg {
  width: 16px;
  height: 16px;
}

.settings-add-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.settings-section-subtitle {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  margin: 12px 0 10px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.settings-btn-row {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.settings-btn-row .settings-save-btn {
  flex: 1;
}

.settings-cancel-btn {
  padding: 10px 20px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition);
}

.settings-cancel-btn:hover {
  color: var(--text);
  border-color: var(--text-muted);
}

.settings-export-btns {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.settings-export-btns .settings-save-btn {
  flex: 1;
  min-width: 140px;
}
.settings-import-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 140px;
  padding: 10px 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  justify-content: center;
  margin-top: 4px;
  transition: all 0.15s;
}
.settings-import-btn svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}
.settings-import-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.settings-vehicle-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}

.settings-vehicle-item img {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
}

.settings-vehicle-item-info {
  flex: 1;
  min-width: 0;
}

.settings-vehicle-item-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.settings-vehicle-item-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.settings-vehicle-item-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.settings-vehicle-item-actions button {
  padding: 4px 8px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.75rem;
  cursor: pointer;
  transition: var(--transition);
}

.settings-vehicle-item-actions button:hover {
  color: var(--text);
  border-color: var(--text-muted);
}

.settings-vehicle-item-actions .btn-del:hover {
  color: #ff4444;
  border-color: #ff4444;
}

/* --- Toggle Switch ----------------------------------------- */
.settings-label--toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}

.toggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.toggle-input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--surface-3);
  border-radius: 12px;
  border: 1px solid var(--border);
  transition: var(--transition);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 2px;
  bottom: 2px;
  background: var(--text-muted);
  border-radius: 50%;
  transition: var(--transition);
}

.toggle-input:checked + .toggle-slider {
  background: var(--primary-dim);
  border-color: var(--primary);
}

.toggle-input:checked + .toggle-slider::before {
  transform: translateX(20px);
  background: var(--primary);
}

/* --- Alert Thresholds -------------------------------------- */
.alert-thresholds {
  margin-top: 12px;
}

.alert-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 4px;
  vertical-align: middle;
}

.alert-dot--diesel { background: var(--diesel); }
.alert-dot--e10    { background: var(--e10); }
.alert-dot--e5     { background: var(--e5); }

.settings-unit {
  font-size: 13px;
  color: var(--text-muted);
  white-space: nowrap;
  padding-left: 6px;
}

.settings-input-row {
  display: flex;
  align-items: center;
  gap: 0;
}

.settings-input-row .settings-input {
  flex: 1;
  min-width: 0;
}

/* ============================================================
   Fahrzeug-Sektion & Betankung
   ============================================================ */

.vehicle-section {
  margin-top: 24px;
}

.vehicle-section.hidden {
  display: none;
}

.vehicle-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 16px;
}

.vehicle-card:last-child {
  margin-bottom: 12px;
}

.vehicle-info {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 2px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.vehicle-info-photo {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.vehicle-info-text {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.vehicle-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.vehicle-sorte {
  font-size: 12px;
  color: var(--text-muted);
  background: var(--surface-2);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

/* Refuel Stats */

.refuel-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}

.refuel-stat {
  background: var(--surface);
  border: 1px solid var(--border-soft, var(--border));
  border-radius: var(--radius-md);
  padding: 12px 10px;
  text-align: center;
}

.refuel-stat-val {
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: var(--primary);
  font-family: var(--font-mono, monospace);
}

.refuel-stat-lbl {
  display: block;
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.refuel-stats-empty {
  font-size: 13px;
  color: var(--text-muted);
  padding: 12px 0;
}

/* Refuel List */

.refuel-list {
  margin-bottom: 16px;
}

.refuel-list-title {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  font-weight: 600;
}

.refuel-entry {
  background: var(--surface);
  border: 1px solid var(--border-soft, var(--border));
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 6px;
  position: relative;
}

.refuel-entry-main {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.refuel-entry-date {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  font-family: var(--font-mono, monospace);
  min-width: 60px;
}

.refuel-entry-detail {
  font-size: 12px;
  color: var(--text-muted);
  flex: 1;
}

.refuel-entry-amount {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  font-family: var(--font-mono, monospace);
}

.refuel-entry-sub {
  font-size: 11px;
  color: var(--text-subtle, var(--text-muted));
  margin-top: 4px;
}

.refuel-entry--clickable {
  cursor: pointer;
  transition: border-color 0.15s;
}

.refuel-entry--clickable:hover {
  border-color: var(--primary);
}

.refuel-entry--clickable:active {
  background: var(--surface-2);
}

.refuel-list-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 8px;
  margin-top: 4px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.refuel-list-toggle svg {
  width: 14px;
  height: 14px;
}

.refuel-list-toggle:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* Refuel Detail View */

.refuel-detail {
  margin-bottom: 20px;
}

.refuel-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.refuel-detail-row:last-child {
  border-bottom: none;
}

.refuel-detail-label {
  font-size: 12px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.refuel-detail-val {
  font-size: 13px;
  color: var(--text);
  font-weight: 600;
  text-align: right;
}

.refuel-detail-val--highlight {
  color: var(--primary);
  font-size: 15px;
}

.refuel-detail-val--mono {
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  font-weight: 400;
  color: var(--text-muted);
}

.refuel-detail-photos {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.refuel-detail-photo {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.refuel-detail-actions {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

.refuel-detail-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: 1;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
}

.refuel-detail-btn svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.refuel-detail-btn--edit:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.refuel-detail-btn--del:hover {
  border-color: #ff6b6b;
  color: #ff6b6b;
}

.refuel-detail-btn--cancel {
  background: none;
}

.refuel-detail-btn--cancel:hover {
  border-color: var(--text-muted);
}

/* ============================================================
   Confirm Dialog
   ============================================================ */

.confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  z-index: 300;
  opacity: 0;
  transition: opacity 0.2s;
}

.confirm-overlay.visible {
  opacity: 1;
}

.confirm-dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.92);
  opacity: 0;
  z-index: 301;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 28px 24px 20px;
  width: calc(100% - 48px);
  max-width: 360px;
  text-align: center;
  transition: transform 0.2s ease, opacity 0.15s;
}

.confirm-dialog.visible {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
}

.confirm-icon {
  margin-bottom: 12px;
}

.confirm-icon svg {
  width: 36px;
  height: 36px;
  color: #ff6b6b;
}

.confirm-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.confirm-msg {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 20px;
}

.confirm-actions {
  display: flex;
  gap: 10px;
}

.confirm-btn {
  flex: 1;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid var(--border);
  transition: background 0.15s, border-color 0.15s;
}

.confirm-btn--cancel {
  background: var(--surface-2);
  color: var(--text);
}

.confirm-btn--cancel:hover {
  border-color: var(--text-muted);
}

.confirm-btn--danger {
  background: #dc2626;
  border-color: #dc2626;
  color: #fff;
}

.confirm-btn--danger:hover {
  background: #b91c1c;
  border-color: #b91c1c;
}

/* Toast */

.app-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  opacity: 0;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 13px;
  padding: 10px 20px;
  z-index: 400;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  white-space: nowrap;
}

.app-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Add Button */

.refuel-add-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 16px;
  background: var(--primary);
  border: none;
  border-radius: var(--radius-md);
  color: #000;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.refuel-add-btn svg {
  width: 18px;
  height: 18px;
}

.refuel-add-btn:hover {
  background: var(--primary-hover, #d97706);
}

/* Refuel Dialog */

.refuel-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.refuel-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.refuel-dialog {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-height: 90vh;
  background: var(--bg);
  border-top: 1px solid var(--border);
  border-radius: 16px 16px 0 0;
  z-index: 201;
  transform: translateY(100%);
  transition: transform 0.25s ease;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  pointer-events: none;
}

.refuel-dialog.visible {
  transform: translateY(0);
  pointer-events: auto;
}

.refuel-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 0;
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 1;
}

.refuel-dialog-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.refuel-dialog-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
}

.refuel-dialog-close svg {
  width: 20px;
  height: 20px;
}

.refuel-dialog-close:hover {
  color: var(--text);
}

.refuel-dialog-body {
  padding: 16px 20px 32px;
}

/* Refuel Field Layout */

.refuel-field-row {
  display: flex;
  gap: 12px;
  margin-bottom: 0;
}

.refuel-field-half {
  flex: 1;
  min-width: 0;
}

.refuel-dialog .settings-input,
.refuel-dialog .settings-select,
.refuel-dialog .refuel-textarea {
  width: 100%;
  box-sizing: border-box;
}

.refuel-textarea {
  resize: vertical;
  min-height: 52px;
  line-height: 1.4;
}

/* Refuel Photos */

.refuel-photos {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.refuel-photo-add {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 80px;
  height: 80px;
  background: var(--surface-2);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 10px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.refuel-photo-add svg {
  width: 22px;
  height: 22px;
}

.refuel-photo-add:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.refuel-photo-file {
  display: none;
}

.vehicle-photo-wrap {
  display: flex;
  gap: 10px;
}

.vehicle-photo-add {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 80px;
  height: 80px;
  background: var(--surface-2);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 10px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.vehicle-photo-add svg {
  width: 22px;
  height: 22px;
}

.vehicle-photo-add:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.vehicle-photo-preview {
  position: relative;
  width: 80px;
  height: 80px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
}

.vehicle-photo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.refuel-photo-thumb {
  position: relative;
  width: 80px;
  height: 80px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
}

.refuel-photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.refuel-photo-del {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 20px;
  height: 20px;
  background: rgba(0,0,0,0.7);
  border: none;
  border-radius: 50%;
  color: #fff;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.refuel-photo-del:hover {
  background: #ff6b6b;
}

@media (min-width: 600px) {
  .refuel-dialog {
    left: 50%;
    right: auto;
    bottom: 50%;
    transform: translate(-50%, 50%) scale(0.95);
    opacity: 0;
    max-width: 480px;
    width: 100%;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    max-height: 85vh;
    transition: transform 0.25s ease, opacity 0.2s;
  }
  .refuel-dialog.visible {
    transform: translate(-50%, 50%) scale(1);
    opacity: 1;
    pointer-events: auto;
  }
}

/* ── Lizenz-Sektion (Settings) ──────────────────────────── */
.settings-input--mono {
  font-family: 'SF Mono', 'Fira Code', 'Courier New', monospace;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.settings-upgrade-link {
  display: inline-block;
  margin-top: 12px;
  color: var(--primary);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  transition: opacity 0.15s;
}
.settings-upgrade-link:hover { opacity: 0.8; }

.license-status-card {
  background: var(--surface-2, #161e2e);
  border: 1px solid var(--primary);
  border-radius: var(--radius-md, 12px);
  padding: 18px;
  text-align: center;
}
.license-status-badge {
  display: inline-block;
  background: var(--primary);
  color: #000;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 3px 14px;
  border-radius: 20px;
  letter-spacing: 0.1em;
  margin-bottom: 8px;
}
.license-status-text {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}
.license-status-key {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.78rem;
  color: var(--text-muted, #6b7fa0);
  letter-spacing: 0.08em;
}

/* ── Upgrade-Hint Modal ─────────────────────────────────── */
.upgrade-hint-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.upgrade-hint-card {
  background: var(--surface, #0f1520);
  border: 1px solid var(--border, #1e2d42);
  border-radius: 16px;
  padding: 32px 24px;
  max-width: 360px;
  width: 100%;
  text-align: center;
}
.upgrade-hint-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 14px;
  background: rgba(245,158,11,0.15);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.upgrade-hint-icon svg {
  width: 24px;
  height: 24px;
  color: var(--primary, #f59e0b);
}
.upgrade-hint-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text, #e2e8f0);
  margin-bottom: 8px;
}
.upgrade-hint-text {
  font-size: 0.88rem;
  color: var(--text-muted, #6b7fa0);
  line-height: 1.6;
  margin-bottom: 20px;
}
.upgrade-hint-btns {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.upgrade-hint-btn-pro {
  display: block;
  padding: 12px 20px;
  background: var(--primary, #f59e0b);
  color: #000;
  font-weight: 800;
  font-size: 0.95rem;
  border: none;
  border-radius: 10px;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  transition: opacity 0.15s;
}
.upgrade-hint-btn-pro:hover { opacity: 0.88; }
.upgrade-hint-btn-close {
  padding: 10px 20px;
  background: transparent;
  color: var(--text-muted, #6b7fa0);
  font-size: 0.85rem;
  border: 1px solid var(--border, #1e2d42);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.15s;
}
.upgrade-hint-btn-close:hover { border-color: var(--text-muted); }

/* ══════════════════════════════════════════════════════════════
   Mobile Tab Bar & View System (nur < 768px)
   ══════════════════════════════════════════════════════════════ */

/* Tab-Bar: am unteren Bildschirmrand fixiert */
.mobile-tabbar {
  display: none;
}

@media (max-width: 767px) {
  /* Views: nur aktiver View sichtbar */
  .home-page.mobile-mode .mobile-view {
    display: none;
  }
  .home-page.mobile-mode .mobile-view.active {
    display: block;
  }

  /* Platz unten für Tab-Bar */
  body.has-tabbar {
    padding-bottom: 68px;
  }
  body.has-tabbar #appFooter {
    padding-bottom: 68px;
  }

  /* Tab-Bar */
  .mobile-tabbar {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 900;
    background: var(--surface, #0f1520);
    border-top: 1px solid var(--border, #1e2d42);
    padding: 0;
    padding-bottom: env(safe-area-inset-bottom, 0);
    height: auto;
  }

  .mobile-tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 8px 2px 6px;
    background: none;
    border: none;
    color: var(--text-muted, #6b7fa0);
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: color 0.15s;
    -webkit-tap-highlight-color: transparent;
    position: relative;
  }
  .mobile-tab svg {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
  }
  .mobile-tab span {
    display: block;
    line-height: 1;
  }
  .mobile-tab.active {
    color: var(--primary, #f59e0b);
  }
  .mobile-tab.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 32px;
    height: 2px;
    background: var(--primary, #f59e0b);
    border-radius: 0 0 2px 2px;
  }
  .mobile-tab:active {
    opacity: 0.7;
  }

  /* Swipe-Indikator (Dots) */
  .mobile-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    padding: 10px 0 6px;
  }
  .mobile-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--border, #1e2d42);
    transition: background 0.2s, transform 0.2s;
  }
  .mobile-dot.active {
    background: var(--primary, #f59e0b);
    transform: scale(1.3);
  }

  /* Swipe-Transition */
  .home-page.mobile-mode .mobile-view {
    animation: none;
  }
  .home-page.mobile-mode .mobile-view.active.slide-in-left {
    animation: slideInLeft 0.25s ease forwards;
  }
  .home-page.mobile-mode .mobile-view.active.slide-in-right {
    animation: slideInRight 0.25s ease forwards;
  }

  @keyframes slideInLeft {
    from { transform: translateX(-30px); opacity: 0.6; }
    to   { transform: translateX(0); opacity: 1; }
  }
  @keyframes slideInRight {
    from { transform: translateX(30px); opacity: 0.6; }
    to   { transform: translateX(0); opacity: 1; }
  }

  /* Nav: Settings & About Buttons auf Mobile ausblenden (Tab-Bar ersetzt sie) */
  .app-nav #btnSettings,
  .app-nav #btnAbout {
    display: none;
  }

  /* Mobile-View-Content (Settings / About inline) */
  .mobile-view-content {
    padding: 0 4px;
  }
  .mobile-view-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text, #e2e8f0);
    padding: 16px 0 12px;
    display: flex;
    align-items: center;
    gap: 8px;
  }

  /* Settings-Elemente im Mobile-View brauchen keinen Header-Abstand */
  .mobile-view-content .settings-uid {
    padding-top: 0;
  }
}
