/* =========================================================
   0) Design-Variablen
   ========================================================= */
:root{
  --bg:#0e0e11;
  --card:#13151a;
  --fg:#f4f4f4;
  --muted:#9aa4b2;
  --acc:#cc196d;

  --cold:#2980b9;
  --warming:#00e676;
  --ready:#2ecc71;

  --border:#1a1c22;
  --field-bg:#101016;
  --field-border:#444;
  --field-bg-focus:#15171f;

  --badge-on-dark:#e9edf6;
  --badge-on-light:#18141c;
  --badge-border:rgba(255,255,255,.18);

  --fuel-e5:#f3c623;
  --fuel-plus:#1e945a;
  --fuel-e10:#c93b34;

  --status-voll:#2ecc71;
  --status-teil:#f0a324;
  
  --action-h: 34px;
  --action-w: 136px;
  
}

/* =========================================================
   1) Reset & Grundlayout
   ========================================================= */
*{ box-sizing:border-box; }

html,body{
  margin:0; padding:0; height:100%;
  background:var(--bg); color:var(--fg);
  font-family:'VT323', monospace;
  font-weight:400; font-size:20px; letter-spacing:.3px;
  overflow-x:hidden; max-width:100%;
}
body{ display:flex; flex-direction:column; }
#app{ flex:1; display:flex; flex-direction:column; }

/* Utilities */
.center{ display:flex; justify-content:center; width:100%; }
.grid{ display:grid; gap:10px; }
.hidden{ display:none !important; }
.mt{ margin-top:12px; }
.muted{ color:var(--muted); }

/* =========================================================
   2) Topbar & Footer
   ========================================================= */
.topbar{
  display:flex; align-items:center; justify-content:space-between;
  padding:12px 16px; background:#111;
}
.topbar h1{ font-size:22px; margin:0; letter-spacing:.6px; }
.top-actions{ display:flex; gap:8px; }

footer.footer{
  margin-top:auto;           /* darf bleiben */
  font-size:14px;
  /* KEIN display/justify hier – das kommt von .topbar */
}
footer.footer a{ color:inherit; text-decoration:none; }

/* Explizit wie Header */
footer.topbar.footer{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:12px 16px;           /* wie .topbar */
  background:#111;             /* wie .topbar */
  margin-top:auto;
}

footer.topbar.footer .top-actions{
  display:flex;
  gap:8px;
}

.version-label{ color:#fff; font-weight:400; font-size:.95rem; margin-top:1rem; letter-spacing:.6px; }

/* =========================================================
   3) Karten & Seiten-Layout
   ========================================================= */
.view{ padding:16px; }

.card{
  background:var(--card);
  border:1px solid var(--border);
  border-radius:14px;
  padding:16px;
  max-width:900px;
  margin:0 auto;
}
.card.dash{ padding:18px 16px; }

/* =========================================================
   4) Formulare (global)
   ========================================================= */
label{ display:grid; gap:6px; font-size:16px; letter-spacing:.4px; }

input,select{
  background:var(--field-bg);
  border:1px solid var(--field-border);
  color:var(--fg);
  font-family:'VT323', monospace;
  font-size:1.05rem; letter-spacing:.4px;
  height:54px; border-radius:12px; padding:10px 14px;
  transition:border-color .15s, box-shadow .15s, background .15s;
}
input::placeholder{ color:var(--muted); opacity:.85; }
input:focus,select:focus{
  outline:none; border-color:var(--acc);
  box-shadow:0 0 0 2px rgba(204,25,109,.18);
  background:var(--field-bg-focus);
}

/* =========================================================
   5) Buttons
   ========================================================= */
.btn{
  font-family:'VT323', monospace; font-size:1em; letter-spacing:.4px;
  background:#1e1e26; border:2px solid #2b2f3a; color:var(--fg);
  padding:12px 16px; border-radius:14px; cursor:pointer;
  transition:filter .15s, transform .04s, box-shadow .15s;
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.04), 0 2px 8px rgba(0,0,0,.35);
}
.btn:hover{ filter:brightness(1.06); }
.btn:active{ transform:translateY(1px); }
.btn:focus{ outline:none; }
.btn:focus-visible{ outline:2px solid rgba(204,25,109,.45); outline-offset:3px; }

.btn.primary{
  background:var(--acc); border-color:var(--acc); color:#fff;
  text-shadow:0 1px 0 rgba(0,0,0,.35);
  box-shadow:inset 0 -2px 0 rgba(0,0,0,.15), 0 0 18px rgba(204,25,109,.28);
}
.btn.primary:hover{ box-shadow:inset 0 -2px 0 rgba(0,0,0,.15), 0 0 22px rgba(204,25,109,.38); }
.btn.small{ padding:8px 12px; font-size:.95em; }
.btn.tiny{ padding:.2rem .5rem; font-size:.8rem; }
.btn.xl{ padding:16px 20px; font-size:1.15em; min-width:240px; }
.btn.ghost{ background:transparent; border:2px dashed #3a465a; }
.btn.pill{ border-radius:9999px; padding:10px 16px; }
#engineBtn{ width:100%; }

/* =========================================================
   6) Gauge & Status
   ========================================================= */
.gauge{ margin-top:14px; }
.bar{
  position:relative; height:28px; background:#0e1115;
  border:1px solid #1b1e24; border-radius:8px; overflow:hidden;
}
.bar .fill{
  position:absolute;
  left:0;
  top:0;
  height:100%;
  width:0%;                 /* JS setzt das prozentual */
  transform:none;
  transform-origin:left;
  transition:width .25s ease;
}

.gauge .marker {
  position:absolute;
  left:50%;
  top:50%;
  transform:translate(-50%,-50%);
  
  font-size:1.05em;
  font-weight:600;
  letter-spacing:.6px;
  color:#fff;

  /* dezenter Kontrastschatten für Lesbarkeit */
  text-shadow:0 1px 2px rgba(0,0,0,.8);

  pointer-events:none;
}

.status{ margin-top:8px; color:#cdd6e3; letter-spacing:.4px; }
.banner{
  margin-top:12px; background:#153e2b; color:#a2f5c6; border:1px solid #1e5b3d;
  padding:10px; border-radius:10px; text-align:center; font-weight:700;
}

/* Gauge-Farben */
.gauge-fill{ transition:background .3s ease; }
.gauge-fill.cold{ background:var(--cold); }
.gauge-fill.warmup{ background:#00e676; }
.gauge-fill.orange{ background:var(--warming); }
.gauge-fill.red{ background:#e74c3c; }
.gauge-fill.darkgreen{ background:#00964c; }
.gauge-fill.miniparts{ background:#ff8635; }
.gauge-fill.pink{ background:#d61272; }
.gauge-fill.steady{ background:#1abc9c; }
.gauge-fill.green{ background:var(--ready); }
.gauge-fill.grey{ background:#666; }

/* =========================================================
   7) History (Fahrten)
   ========================================================= */
#historySection summary{
  cursor:pointer; font-weight:600; list-style:none; outline:none; letter-spacing:.6px;
}
#historySection summary::marker{ display:none; }
#historySection[open] summary{ opacity:.95; }

#history{
  list-style:none; margin:8px 0 0 0; padding:0;
  display:grid; gap:.75rem;
}
#history li{ display:block; padding:0; border:0; color:inherit; }

.drive-card{
  background:var(--card);
  border:1px solid rgba(255,255,255,.08);
  border-radius:12px;
  padding:.9rem 1rem;
  color:var(--fg);
}
.drive-grid{
  display:grid;
  grid-template-columns:1fr 1.2fr 1fr; /* Start | Stats | Ende */
  gap:1rem;
}
@media (max-width:700px){
  .drive-grid{ grid-template-columns:1fr; gap:.6rem; }
}
.drive-card .hd{
  color:var(--muted);
  font-size:.95rem;        /* statt .8rem -> wie Stats */
  font-weight:400;         /* normal, nicht bold */
  text-transform:none;     /* kein Uppercase */
  letter-spacing:.02em;
  margin-bottom:.25rem;
}
.drive-card .dt{ font-weight:700; line-height:1.25; }
.drive-card .loc{ color:var(--muted); margin-top:.1rem; }
.drive-card .stats{ display:grid; gap:.3rem; align-content:start; }
.drive-card .stats .row{ display:flex; align-items:baseline; gap:.35rem; white-space:nowrap; }
.drive-card .stats span{ color:var(--muted); }
.drive-card .stats b, .drive-card .stats strong{ font-weight:700; color:var(--fg); }
#history .muted{ color:var(--muted); padding:.25rem 0 .5rem; }

/* =========================================================
   8) Dialoge (Basis)
   ========================================================= */
dialog{
  border:none; padding:0; background:transparent; max-width:100vw;
  overflow-x:hidden; z-index:10000 !important;
}
dialog::backdrop{ background:rgba(0,0,0,.5); z-index:9999; }

dialog .card{
  width:min(94vw, 520px);
  max-width:min(520px, 100vw - 16px);
  border-radius:14px; padding:12px 12px 14px;
  max-height:92vh; overflow:hidden; margin:0 auto; box-sizing:border-box;
}
dialog .card h2{ margin:0; }
dialog .card h3{ margin:12px 0 6px; }

/* =========================================================
   9) Settings-Dialog
   ========================================================= */
#settingsDlg .grid{
  display:grid; grid-template-columns:1fr 1fr; grid-auto-rows:44px;
  gap:8px; width:100%; max-width:100%;
}
#settingsDlg .btn{ height:44px; padding:0 12px; font-size:16px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; min-width:0; }
#settingsDlg .btn.small{ padding:8px 10px; font-size:15px; }
#settingsDlg .mt{ margin-top:10px; }
#settingsDlg .version-label{ margin-top:8px; font-size:.9rem; }

#settingsDlg .grid > *:nth-child(3),
#settingsDlg .grid > *:nth-child(4){ grid-column:1 / -1; }

#settingsDlg .card{ max-height:90vh; padding:10px 10px 12px; overflow:hidden; }

@media (max-width:380px),(max-height:700px){
  #settingsDlg .grid{ grid-auto-rows:40px; gap:6px; }
  #settingsDlg .btn{ height:40px; padding:0 10px; font-size:14px; }
  #settingsDlg .card{ padding:8px 8px 10px; }
  #settingsDlg .version-label{ margin-top:6px; font-size:.85rem; }
}

/* =========================================================
   10) Leaderboard-Dialog
   ========================================================= */
#leaderboardDlg .card{
  background:var(--card);
  color:var(--fg);
  box-shadow:0 0 15px rgba(0,0,0,.6);
  border-radius:1rem;
  padding:1rem;
  width:min(94vw, 520px);
}

/* Controls: IMMER untereinander */
#leaderboardDlg .controls{
  display:flex;
  flex-direction:column;
  align-items:stretch;
  gap:.75rem;
  margin-bottom:.9rem;
}

/* Label über dem Select */
#leaderboardDlg .controls label{
  display:block;
  color:var(--muted);
  font-size:.85rem;
  margin-bottom:.25rem;
}

/* Dark-Theme Selects */
#leaderboardDlg .controls select{
  width:100%;
  height:44px;
  padding:.45rem .7rem;
  color:var(--fg);
  background:#12141a;
  border:1px solid rgba(255,255,255,.15);
  border-radius:.6rem;
  color-scheme: dark;              /* system UI dunkel halten */
}
#leaderboardDlg .controls select:focus{
  outline:2px solid rgba(255,255,255,.25);
}

/* Dropdown-Optionen (besser lesbar im Dark-Theme) */
#leaderboardDlg select option{
  background:#0f1218;
  color:var(--fg);
}

/* Liste: mittig + dezente Trenner */
.lb-list{ list-style:none; margin:0; padding:0; }
.lb-list li{
  text-align:center;
  padding:.55rem 0;
  border-bottom:1px dashed rgba(255,255,255,.12);
}
.lb-list li:last-child{ border-bottom:0; }


/* =========================================================
   11) Tank – Dashboard/Head/Stats
   ========================================================= */
.tank-stats{
  display:grid; grid-template-columns:1fr; gap:12px; margin-bottom:1rem;
}
.tank-stat{
  background:#13151a; border:1px solid #2b2f3a; border-radius:10px;
  padding:10px 14px; display:flex; flex-direction:column; justify-content:center;
}
.tank-stat .label{ font-size:13px; color:var(--muted); margin-bottom:4px; }
.tank-stat .value{ font-size:18px; font-weight:600; color:var(--fg); }
.tank-stat.col-2{ grid-column:1 / -1; }
@media (min-width:640px){ .tank-stats{ grid-template-columns:1fr 1fr; } }

.tank-head{
  display:grid; gap:12px;
  grid-template-columns:1fr;
  grid-template-areas:
    "period"
    "stops"
    "cons"
    "eurkm"
    "cost"
    "lit";
  margin-bottom:.6rem; align-items:start;
}
.tank-head .period{ grid-area:period; }
.tank-head .period select{
  width:100%; height:54px;
  background:#0f1218; border:1px solid #2b2f3a; color:var(--fg);
  border-radius:12px; padding:10px 14px;
}
.tank-head .tank-stats{ display:contents; }
.tank-head .stat-stops{ grid-area:stops; }
.tank-head .stat-cons { grid-area:cons;  }
.tank-head .stat-eurkm{ grid-area:eurkm; }
.tank-head .stat-cost { grid-area:cost;  }
.tank-head .stat-lit  { grid-area:lit;   }
.tank-head .tank-stat{
  background:#13151a; border:1px solid #2b2f3a; border-radius:10px; padding:10px 14px;
}
@media (min-width:820px){
  .tank-head{
    grid-template-columns:1fr 1fr;
    grid-template-areas:
      "period stops"
      "cons   eurkm"
      "cost   lit";
  }
}

.new-entry-btn{
  width:100%;
  margin:.5rem 0 1rem;     /* <— bottom vergrößert */
}

/* =========================================================
   12) Tank – Einträge (Liste als Karten)  (bereinigt)
   ========================================================= */
.tank-list{
  display:grid; gap:.75rem; margin:0; padding:0; list-style:none;
}
.tank-entry{
  background:var(--card);
  border:1px solid rgba(255,255,255,.08);
  border-radius:12px;
  padding:12px 14px;
  line-height:1.35; color:var(--fg);
}

/* Kopfzeile: links Textblock, rechts Actions-Spalte */
.entry-head{
  display:flex; justify-content:space-between; align-items:flex-start; gap:.75rem;
}

/* Linke Spalte: Datum + Text direkt darunter (ohne Lücken) */
.entry-head .left{ flex:1 1 auto; }
.entry-head .left .datum{
  margin:0; font-weight:700; font-size:1rem; line-height:1.2;
}
.entry-head .left .details{ margin-top:0; }
.entry-head .left .subdetails{
  margin-top:.1rem; font-size:.85rem; color:var(--muted);
}
.entry-head .left .comment{
  margin-top:.3rem; font-style:italic; font-size:.85rem; color:var(--muted);
}

/* Rechte Spalte: Bearbeiten → Voll/Teil → Typ (untereinander, rechtsbündig) */
.entry-head .actions{
  display:flex; flex-direction:column; align-items:flex-end; gap:.45rem;
  min-width:max-content;
}
/* auch mobil rechtsbündig */
@media (max-width:520px){
  .entry-head .actions{ align-items:flex-end; }
}

/* Einheitliche Pillen-Größe/Optik für Button + Badges */
.entry-head .actions .btn.tiny,
.entry-head .actions .badge{
  display:inline-flex; align-items:center; justify-content:center;
  height:var(--action-h); min-width:var(--action-w); padding:0 .9rem;
  border-radius:9999px; font-size:.9rem; line-height:1;
  border:1px solid var(--badge-border);
  background:#1e1e26; color:var(--fg);
  box-shadow:0 1px 1px rgba(0,0,0,.25);
}
.entry-head .actions .btn.tiny:hover,
.entry-head .actions .badge:hover{ filter:brightness(1.06); }
.entry-head .actions .btn.tiny:focus-visible,
.entry-head .actions .badge:focus-visible{
  outline:2px solid rgba(204,25,109,.35); outline-offset:2px;
}

/* ——— Action-Pills: dunkel + Farbpunkte (VT323-freundlich) ——— */
.entry-head .actions .btn.tiny{
  background:#222733;
  color:#fff;
  border-color:rgba(255,255,255,.22);
}

.entry-head .actions .badge{
  background:#222733;                  /* dunkel wie Footer-Buttons */
  color:#fff;
  border:1px solid rgba(255,255,255,.22);
  position:relative;
  padding-left:calc(.9rem + 1rem);     /* Platz für den Chip */
  text-shadow:none;
}

/* kleiner Farbpuck links – behält deine Status-/Fuel-Farben */
.entry-head .actions .badge::before{
  content:"";
  position:absolute;
  left:.6rem; top:50%;
  transform:translateY(-50%);
  width:.66rem; height:.66rem; border-radius:50%;
  background:var(--chip, #666);
  box-shadow:0 0 0 2px rgba(0,0,0,.25) inset;
}

/* Zuordnung der Farben zum Chip (nicht zur Fläche) */
.badge-voll     { --chip: var(--status-voll); }
.badge-teil     { --chip: var(--status-teil); }
.badge.fuel-plus{ --chip: var(--fuel-plus); }
.badge.fuel-e5  { --chip: var(--fuel-e5); }
.badge.fuel-e10 { --chip: var(--fuel-e10); }

/* =========================================================
   13) Tank – Dialog (Neuer Eintrag)
   ========================================================= */
.dialog-form .form-grid{ display:grid; grid-template-columns:1fr; gap:10px; }
.dialog-form .col-2{ grid-column:1 / -1; }

@media (min-width:560px){
  .dialog-form .form-grid{ grid-template-columns:1fr 1fr; gap:12px; }
}

dialog .card .dialog-form label{
  color:#cfd7e6; font-size:16px; letter-spacing:.4px;
}
dialog .card .dialog-form input:not(.switch-big),
dialog .card .dialog-form select{
  background:#0f1218; border:1px solid #2b2f3a; color:var(--fg);
  height:52px; border-radius:12px; padding:10px 14px;
}
dialog .card .dialog-form input:not(.switch-big):focus,
dialog .card .dialog-form select:focus{
  outline:none; border-color:var(--acc);
  box-shadow:0 0 0 2px rgba(204,25,109,.18);
  background:#151922;
}
dialog .card .dialog-form input::placeholder{ color:#a7b0bf; opacity:.95; }

/* großer Switch (Voll getankt?) */
.switch-big{
  appearance:none; -webkit-appearance:none;
  display:block; width:100%; height:52px; margin:0; padding:0;
  border-radius:12px; background:#222833; border:1px solid #3a4457;
  position:relative; cursor:pointer;
  transition:background .2s, border-color .2s, box-shadow .2s;
}
.switch-big::after{
  content:""; position:absolute; top:3px; left:3px;
  width:46px; height:46px; border-radius:10px; background:#fff;
  box-shadow:0 1px 3px rgba(0,0,0,.35); transition:left .18s ease;
}
.switch-big:checked{ background:var(--acc); border-color:var(--acc); }
.switch-big:checked::after{ left:calc(100% - 49px); }
.switch-big:focus{ outline:none; box-shadow:0 0 0 3px rgba(204,25,109,.25); }

.form-actions{ display:flex; gap:10px; justify-content:flex-end; margin-top:12px; }
@media (max-width:420px){ .form-actions{ justify-content:center; } }

/* =========================================================
   14) Auth-View
   ========================================================= */
#authView .card{
  padding:28px 28px 24px; box-shadow:0 8px 24px rgba(0,0,0,.25); max-width:100%;
}
#authView h2{ margin:0 0 16px; font-size:26px; line-height:1.2; letter-spacing:.6px; }
#authView form{ display:grid; gap:16px; margin-top:8px; }
#authView form label{ display:grid; gap:6px; font-size:15px; color:var(--muted); letter-spacing:.4px; }
#authView input{
  width:100%; height:54px; border-radius:12px; padding:10px 14px;
  background:#111218; border:1px solid #242730; color:var(--fg);
}
#authView input:focus{
  outline:none; border-color:var(--acc);
  box-shadow:0 0 0 2px rgba(227,28,121,.15); background:#15171f;
}
#authView .btn{ width:100%; height:54px; border-radius:12px; font-weight:400; padding:0 16px; }
#authView details{ margin-top:18px; border-top:1px dashed #2a3347; padding-top:16px; }
#authView details > summary{
  list-style:none; cursor:pointer; user-select:none; font-weight:600;
  margin:-2px 0 12px; color:var(--fg); outline:none; letter-spacing:.6px;
}
#authView details > summary::-webkit-details-marker{ display:none; }
#authView details > summary::after{ content:'▸'; font-size:12px; margin-left:8px; opacity:.85; transition:transform .2s; }
#authView details[open] > summary::after{ transform:rotate(90deg); }
#authView .subtle{ color:var(--muted); font-size:12px; margin-top:4px; }

/* =========================================================
   15) Toast
   ========================================================= */
.toast{
  position:fixed; top:10%; left:50%; transform:translate(-50%);
  background:#1d1d1d; color:#f4f4f4; padding:14px 24px; border-radius:10px;
  font-size:15px; font-weight:400; opacity:0; pointer-events:none;
  transition:opacity .25s; z-index:2147483647;
}
.toast.show{ opacity:1; pointer-events:auto; }

/* =========================================================
   16) Responsive Feinschliff & Helfer
   ========================================================= */
@media (min-width:700px){ .btn.xl{ font-size:22px; } }

@media (max-height:700px){
  dialog .card{ width:min(96vw, 420px); padding:10px; }
  #settingsDlg .btn{ padding:8px 10px; font-size:14.5px; }
  #settingsDlg .btn.small{ padding:7px 10px; font-size:14px; }
  #settingsDlg .version-label{ margin-top:6px; font-size:.85rem; }
}

.kacheln{ display:grid; grid-template-columns:repeat(auto-fit, minmax(180px, 1fr)); gap:.75rem; }
.du-badge{
  display:inline-block; margin-right:.4rem; padding:.05rem .4rem;
  border:1px solid rgba(255,255,255,.35); border-radius:.35rem; font-size:.8em;
}

/* History-Container als Card */
#historySection{
  background:var(--card);
  border:1px solid var(--border);
  border-radius:14px;
  padding:16px;
  max-width:900px;
  margin:12px auto;             /* Abstand zu Nachbarsektionen */
}

/* Überschrift im History-Card hübsch absetzen */
#historySection summary{
  display:block;
  margin-bottom:.6rem;
  padding-bottom:.25rem;
  border-bottom:1px dashed rgba(255,255,255,.12);
}

/* --- Jeder History-Eintrag als eigene Karte --- */
#history{
  list-style:none;
  margin:8px auto 0;
  padding:0;
  max-width:900px;
  display:grid;
  gap:.75rem;
}

/* Falls deine <li> KEINE .drive-card-Klasse haben: Style direkt auf li */
#history > li{
  background:var(--card);
  border:1px solid rgba(255,255,255,.08);
  border-radius:12px;
  padding:.9rem 1rem;
  color:var(--fg);
}

/* Wenn du bereits .drive-card nutzt, gleiche Optik sicherstellen */
.drive-card{
  background:var(--card);
  border:1px solid rgba(255,255,255,.08);
  border-radius:12px;
  padding:.9rem 1rem;
  color:var(--fg);
}

/* Dezente Spalten-Trenner innerhalb der Karte (nur Desktop) */
@media (min-width:701px){
  .drive-grid > div{ padding:0 .25rem; }
  .drive-grid > div:not(:last-child){
    border-right:1px dashed rgba(255,255,255,.12);
  }
}

/* Überschrift „Letzte Fahrten“ ohne extra Card-Rahmen */
#historySection{
  background:transparent;
  border:0;
  padding:0;
  max-width:900px;
  margin:12px auto;
}
#historySection summary{
  display:block;
  margin-bottom:.6rem;
  padding-bottom:.25rem;
  border-bottom:1px dashed rgba(255,255,255,.12);
}

/* =========================================================
   Custom Scrollbar (Dark passend zum Design)
   ========================================================= */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: #0e0e11;             /* Hintergrund wie Body */
  border-left: 1px solid #1a1c22;  /* dezente Kante */
}

::-webkit-scrollbar-thumb {
  background: #2b2f3a;             /* dunkler Balken */
  border-radius: 8px;
  border: 2px solid #0e0e11;       /* damit er „eingelassen“ wirkt */
}

::-webkit-scrollbar-thumb:hover {
  background: var(--acc);          /* Hover = Akzentfarbe */
}

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: #2b2f3a #0e0e11;
}
/* Details/Summary Reset rund um den Toggle */
.history-wrap { width:100%; }
.history-wrap > summary { list-style:none; }               /* Firefox */
.history-wrap > summary::marker,
.history-wrap > summary::-webkit-details-marker { display:none; }
.history-wrap { border:0; }                                /* falls global Styles drauf liegen */
.history-wrap summary { border:0; }                        /* Dotted-Unterkante sicher killen */

/* Vollbreiten-Button, Text perfekt mittig */
.history-toggle{
  display:flex; align-items:center; justify-content:center;
  width:100%;
  min-height:52px;
  margin:.5rem 0;
  padding:0 1rem;
  box-sizing:border-box;
  font-weight:700; text-align:center;
  background:var(--card);
  border:1px solid rgba(255,255,255,.25);
  border-radius:12px;
  cursor:pointer; user-select:none; outline:none; box-shadow:none;
}
details[open] .history-toggle{ border-color:rgba(255,255,255,.4); }

.history-toggle:hover,
.history-toggle:focus-visible{ border-color:rgba(255,255,255,.45); }

/* Klarer State-Text (kein Pfeil) */
details:not([open]) .history-toggle::after { content:" anzeigen"; }
details[open]        .history-toggle::after { content:" ausblenden"; }

/* Panel: sanftes Ein-/Ausblenden (optional) */
.history-panel{ overflow:hidden; transition: grid-template-rows .25s ease; display:grid; grid-template-rows:0fr; }
.history-panel > * { min-height:0; }
details[open] .history-panel{ grid-template-rows:1fr; }


/* Killt alle globalen Summary-Styles hier */
#historySection{ border:0 !important; }
#historySection > summary{
  border:0 !important;
  border-bottom:0 !important;
  box-shadow:none !important;
  background:none !important;
  padding:0 !important;
}

/* Vollbreiten-Button, Mitte Mitte */
#historySection > summary.history-toggle{
  display:flex !important;
  align-items:center !important;      /* vertikal zentriert */
  justify-content:center !important;  /* horizontal zentriert */
  width:100% !important;
  min-height:56px !important;
  margin:.5rem 0 !important;
  padding:0 1rem !important;
  box-sizing:border-box !important;
  font-weight:700 !important;
  text-align:center !important;
  background:var(--card) !important;                  /* wie deine Cards */
  border:1px solid rgba(255,255,255,.28) !important;  /* klarer Rand */
  border-radius:14px !important;
  cursor:pointer !important;
  user-select:none !important;
  outline:none !important;
}

#historySection > summary.history-toggle::marker,
#historySection > summary.history-toggle::-webkit-details-marker{ display:none !important; }

/* Klarer State-Text – kein Pfeil */
#historySection:not([open]) > summary.history-toggle::after {
  content: "Letzte Fahrten anzeigen";   /* Leerzeichen vorne! */
}
#historySection[open] > summary.history-toggle::after {
  content: "Letzte Fahrten ausblenden"; /* Leerzeichen vorne! */
}

/* Beim Öffnen Rand etwas kräftiger */
#historySection[open] > summary.history-toggle{
  border-color:rgba(255,255,255,.42) !important;
}

/* Abstand über der Liste, kein „dotted“-Separator */
#historySection > ul.history{
  margin-top:.75rem !important;
  border-top:0 !important;
}

/* Desktop: alles wie gehabt */
.entry-head .left .datum{ display:flex; gap:.35rem; flex-wrap:wrap; }
.entry-head .left .details{ display:flex; gap:.4rem .6rem; flex-wrap:wrap; align-items:center; }

/* Mobil: Striche weg + Zeilenumbruch */
@media (max-width:520px){
  .entry-head .left .datum{ display:block; }
  .entry-head .left .datum .dash{ display:none; }   /* "–" zwischen Datum/Zeit ausblenden */
  .entry-head .left .datum .d-time{ display:block; margin-top:.05rem; }

  .entry-head .left .details{ display:grid; gap:.1rem; }
  .entry-head .left .details .sep{ display:none; }  /* Striche zwischen Werten ausblenden */
  .entry-head .left .details .d-item{ display:block; } /* jedes Item eigene Zeile */
}

/* ================================
   GPS Gate – Pill-Buttons mit Farbpunkten
   ================================ */

/* Overlay */
.gps-overlay{
  position:fixed; inset:0;
  background:rgba(10,12,16,.78);
  backdrop-filter: blur(6px) saturate(1.05);
  -webkit-backdrop-filter: blur(6px) saturate(1.05);
  display:flex; align-items:center; justify-content:center;
  z-index:9999;
}
.gps-overlay.hidden{ display:none; }

/* Box */
.gps-box{
  background:#191c23;
  border:1px solid rgba(255,255,255,.10);
  border-radius:14px;
  width:min(540px, 92vw);
  padding:18px 20px;
  color:var(--fg,#e9edf6);
  box-shadow:0 8px 22px rgba(0,0,0,.45);
  text-align:center;
}

.gps-box h2{
  margin:0 0 8px; font-size:20px; color:#fff;
}
.gps-box p{
  margin:0 0 10px; font-size:15px; line-height:1.45; color:var(--muted,#c0c7d4);
}

/* Button-Reihe */
.gps-actions{
  display:flex; justify-content:center; align-items:center;
  gap:10px; margin-top:20px; flex-wrap:wrap;
}

/* Pillen-Buttons mit Farbpunkten links */
.gps-actions .pill{
  position:relative;
  display:inline-flex; align-items:center; justify-content:center;
  height:40px; min-width:170px;
  padding:0 16px 0 40px;                /* Platz für den Punkt */
  border-radius:9999px;
  background:#222733;
  color:#fff;
  border:1px solid rgba(255,255,255,.22);
  font-size:15px; font-weight:700; letter-spacing:.02em;
  cursor:pointer; user-select:none;
  transition:filter .15s, transform .04s, background .18s, border-color .18s;
}
.gps-actions .pill:hover{
  background:#262d3a; filter:brightness(1.04);
}
.gps-actions .pill:active{ transform:translateY(1px); }

/* der kleine Farbpuck links */
.gps-actions .pill::before{
  content:"";
  position:absolute; left:12px; top:50%; transform:translateY(-50%);
  width:.7rem; height:.7rem; border-radius:50%;
  background:var(--chip,#888);
  box-shadow: inset 0 0 0 2px rgba(0,0,0,.35);
}

/* Varianten – nur der Chip wechselt die Farbe */
.gps-actions .pill.ok    { --chip:#2ecc71; }
.gps-actions .pill.retry { --chip:#f0a324; }
.gps-actions .pill.deny  { --chip:#e74c3c; }

/* Fokus sichtbar (A11y) */
.gps-actions .pill:focus-visible{
  outline:2px solid rgba(255,255,255,.28);
  outline-offset:2px;
}

/* Hilfe-Block deutlicher absetzen */
.gate-help{
  margin-top:20px; padding-top:12px;
  color:var(--muted,#c0c7d4);
  font-size:14px; line-height:1.4;
}

/* Mobile: Buttons untereinander */
@media (max-width:560px){
  .gps-actions{ flex-direction:column; gap:8px; }
  .gps-actions .pill{ width:100%; min-width:0; }
}

.logo-link {
  color: inherit;         /* übernimmt die H1-Farbe */
  text-decoration: none;  /* kein Unterstrich */
  cursor: pointer;        /* wie normales H1, kein Zeiger */
}

/* === Spritpreis-Widget === */
.fuelbar{
  padding:0;                 /* kein zusätzlicher Innenabstand am Wrapper */
  margin-bottom:14px;
}

.fuelbar-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  flex-wrap:wrap;
  gap:6px;
  margin-bottom:8px;
  padding:0;
}

.select.micro{
  height:28px;
  padding:0 8px;
  font-size:.9rem;
}

/* Anzeige-Box: volle Kartenbreite, gleiche Optik wie deine Cards */
.fuelbox.single{
  display:flex;
  flex-direction:column;
  justify-content:center;
  align-items:center;

  width:100%;
  box-sizing:border-box;
  background:var(--card);
  border:1px solid var(--border);
  border-radius:12px;
  padding:18px;
  margin-top:8px;

  text-align:center;
  cursor:pointer;
  transition:background .15s ease, transform .06s ease;
}
.fuelbox.single:hover{ background:rgba(255,255,255,.05); }
.fuelbox.single:active{ transform:scale(.99); }

/* Preis prominent */
.fuelbox-price{
  font-family:"VT323", ui-monospace, monospace;
  font-size:2.6rem;
  line-height:1;
  margin-bottom:6px;
}
.fuelbox-meta{
  font-size:.95rem;
  color:var(--muted);
  line-height:1.4;
}

@media (max-width:560px){
  .fuelbox-price{ font-size:2.2rem; }
}

/* Falls die umgebende .card als Grid läuft: Box über die ganze Zeile */
.card.dash .fuelbox.single{ grid-column:1 / -1; }

/* Superscript für die 1/10 Cent */
.fuelbox-price sup{
  font-size:60%;
  vertical-align:super;
  opacity:.85;
  margin-left:2px;
}

/* Offline/Stale-Cache-Badge */
.fuelbox.single.stale{
  outline:2px dashed rgba(255,255,255,.18);
}
