/* ══════════════════════════════════════════════════════════
       VehicleIQ — Design „Cockpit"
       Alle bisherigen Klassennamen bleiben erhalten, damit die
       bestehende Logik unverändert weiterläuft.
       ══════════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* Kein CSS-Sanftscrollen: smoothScrollTo animiert selbst per rAF.
   Beides zusammen kaempft gegeneinander — das Ziel wurde dann
   ueberschossen (Tankbuch landete teils ausserhalb des Bildes).
   Aufrufe mit ausdruecklichem behavior:"smooth" laufen weiterhin sanft. */
html { scroll-behavior: auto; -webkit-text-size-adjust: 100%; }

.highlight { animation: pulse 1s ease; }

@keyframes pulse {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.02); }
    100% { transform: scale(1); }
}

:root {
    /* Flächen */
    --bg-base:      #070a12;
    --bg-surface:   #0e1422;
    --bg-card:      #131a2b;
    --bg-elevated:  #ffffff0e;
    --border:       #1e2740;
    --border-light: #2c3a5e;

    /* Akzente */
    --accent:       #5b8cff;
    --accent-dim:   #5b8cff1f;
    --accent-hover: #7ba4ff;
    --cy:           #34d9ff;
    --cy-dim:       #34d9ff1a;
    --vi:           #a97bff;
    --green:        #3ee08f;
    --green-dim:    #3ee08f18;
    --amber:        #ffb340;
    --amber-dim:    #ffb34018;
    --red:          #ff5c6b;
    --red-dim:      #ff5c6b18;

    /* Text — für helles Umgebungslicht (Werkstatt) angehoben.
       Kontrast auf --bg-surface: faint 7,5:1 · muted 12:1 · primary 17:1 */
    --text-primary: #f5f7fd;
    --text-muted:   #c9d1e4;
    --text-faint:   #9aa5c2;
    --text-dim:     #c9d1e4;

    --radius-sm:    10px;
    --radius-md:    16px;
    --radius-lg:    22px;
    --radius-xl:    28px;

    --ease: cubic-bezier(.22,.9,.28,1);
    --safe-b: env(safe-area-inset-bottom, 0px);

    /* Logo in der Kopfleiste — hier einstellen.
       App.png bringt durchsichtige Ränder mit, deshalb ist die Bildhöhe
       deutlich größer als die Leiste. Die Leiste bleibt trotzdem
       --topbar-hoehe hoch, das Bild ragt nur unsichtbar darüber hinaus. */
    --logo-hoehe:   112px;   /* größer = größeres Logo */
    --logo-links:   -14px;   /* negativ = weiter nach links */
    --topbar-hoehe: 60px;
}
@media (max-width: 480px) {
    :root { --logo-hoehe: 92px; }
}

body {
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    background: var(--bg-base);
    color: var(--text-primary);
    min-height: 100vh;
    padding: 0 0 calc(104px + var(--safe-b));
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Atmosphärisches Licht */
body::before {
    content: '';
    position: fixed; inset: 0; pointer-events: none; z-index: 0;
    background:
            radial-gradient(900px 500px at 12% -8%,  #1d3aa044 0%, transparent 62%),
            radial-gradient(700px 460px at 92% 4%,   #0d6f8f3a 0%, transparent 60%),
            radial-gradient(800px 700px at 50% 110%, #2a1a6633 0%, transparent 62%);
}

/* ─── Kopfleiste ─────────────────────────────────────────── */
.topbar {
    position: sticky; top: 0; z-index: 100;
    display: flex; flex-direction: column;
    padding: 8px 14px;
    /* Android zeichnet unter die Systemleiste; ohne gemeldeten
       Abstand bleibt es bei 0 und aendert nichts. */
    padding-top: calc(8px + env(safe-area-inset-top, 0px));
    min-height: var(--topbar-hoehe);
    background: linear-gradient(180deg, #070a12f5 62%, #070a1200);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}
.topbar-oben {
    display: flex; align-items: center; gap: 10px;
    min-height: var(--topbar-hoehe);
}
.topbar-title {
    display: flex; align-items: center; gap: 9px;
    flex: 0 1 auto; min-width: 80px; overflow: hidden;
    /* Höhe der Leiste unabhängig vom großen Logo halten */
    margin-top:    calc((var(--logo-hoehe) - var(--topbar-hoehe)) / -2);
    margin-bottom: calc((var(--logo-hoehe) - var(--topbar-hoehe)) / -2);
    pointer-events: none;   /* durchsichtiger Überstand fängt keine Klicks ab */
}
.topbar-title img {
    height: var(--logo-hoehe);
    width: auto; max-width: 100%;   /* schrumpft mit, statt das Menü zu verdecken */
    margin-left: var(--logo-links);
    display: block;
    object-fit: contain; object-position: left center;
}
.topbar-title svg { color: var(--cy); }
.topbar-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; flex: 0 0 auto; }

/* OBD/Bluetooth (nur in der Android-App) stehen in einer eigenen Zeile,
   damit sie das Logo nicht wegdrücken. Ohne sie gibt es keine Zeile. */
.topbar-status { display: none; align-items: center; gap: 8px; padding-top: 6px; }
.topbar.hat-status .topbar-status { display: flex; }

#menuSelect {
    appearance: none; -webkit-appearance: none;
    background: #ffffff0a;
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 9px 12px;
    font-size: 12.5px;
    font-family: inherit;
    font-weight: 500;
    /* Das Auswahlfeld richtet sich sonst nach der laengsten Option
       und wird ueber 200px breit — dann bleibt kein Platz fuers Logo. */
    width: auto; min-width: 96px; max-width: 132px;
    cursor: pointer;
    transition: .18s var(--ease);
}
#menuSelect:hover { color: var(--text-primary); border-color: var(--border-light); background: #ffffff14; }
#menuSelect option { background: var(--bg-card); color: var(--text-primary); }

.status-badge {
    display: none; align-items: center; gap: 5px;
    font-size: 11px; color: var(--text-muted);
    padding: 5px 10px;
    border: 1px solid var(--border); border-radius: 99px;
    background: #ffffff06;
}
.status-badge span:first-child { font-size: 9px; }

button { font-family: inherit; cursor: pointer; border: none; transition: all .18s var(--ease); }

/* ─── Buttons ────────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 13px; font-weight: 500;
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    color: var(--text-muted);
    cursor: pointer;
}
.btn:hover { color: var(--text-primary); border-color: var(--border-light); background: #ffffff16; transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.98); }
.btn-ghost { background: #ffffff08; color: var(--text-muted); border: 1px solid var(--border); }
.btn-ghost:hover { background: #ffffff14; color: var(--text-primary); border-color: var(--border-light); }
.btn-primary { background: linear-gradient(135deg, var(--cy), var(--accent)); color: #04121c; border-color: transparent; font-weight: 600; }
.btn-primary:hover { filter: brightness(1.08); color: #04121c; }
.btn-success { background: var(--green-dim); color: var(--green); border: 1px solid #3ee08f30; }
.btn-success:hover { background: #3ee08f28; color: var(--green); }
.btn-warning { background: var(--amber-dim); color: var(--amber); border: 1px solid #ffb34030; }
.btn-warning:hover { background: #ffb34028; color: var(--amber); }
.btn-danger { background: transparent; color: var(--text-faint); font-size: 12px; padding: 6px 8px; border: 1px solid transparent; }
.btn-danger:hover { background: var(--red-dim); color: var(--red); border-color: #ff5c6b30; }
.btn-icon { width: 38px; height: 38px; padding: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: 12px; }
.btn-bearbeiten { background: transparent; border: 1px solid transparent; }
.btn-bearbeiten:hover { background: var(--amber-dim); border-color: #ffb34030; }

/* ─── Seitenrahmen ───────────────────────────────────────── */
.content { max-width: 560px; margin: 0 auto; padding: 4px 14px 1rem; position: relative; z-index: 2; }
@media (min-width: 900px) { .content { max-width: 900px; } }

.page-header {
    display: flex; align-items: center; gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}
.page-header h1 {
    font-size: 21px; font-weight: 700; letter-spacing: -.02em;
    color: var(--text-primary); flex: 1 1 auto;
}
.page-header .btn-primary { padding: 10px 14px; }

#besitzerSuchen {
    width: 100%;
    background: #ffffff08;
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 13px;
    padding: 10px 13px;
    transition: .18s var(--ease);
}
#besitzerSuchen::placeholder { color: var(--text-faint); }
#besitzerSuchen:focus { outline: none; border-color: var(--accent); background: #ffffff0f; box-shadow: 0 0 0 3px var(--accent-dim); }

#besitzerListe {
    display: flex;
    overflow-x: scroll;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    gap: 1rem;
    padding: .5rem 0 0;
    scrollbar-width: none;
}
#besitzerListe::-webkit-scrollbar { display: none; }

@keyframes dots {
    0%   { content: '.'; }
    33%  { content: '..'; }
    66%  { content: '...'; }
    100% { content: '.'; }
}
#iRefresh.laden::after { content: '.'; animation: dots 1.2s steps(1) infinite; }
#iRefresh.laden .refresh-icon { display: none; }
#iRefresh.laden { pointer-events: none; opacity: .6; }

/* ─── Besitzerkarte ──────────────────────────────────────── */
.owner-card { flex: 0 0 100%; scroll-snap-align: center; max-width: 900px; margin-bottom: 0; }

.carousel-wrapper { position: relative; }
.carousel-arrow {
    display: flex;
    position: absolute;
    top: 210px;
    transform: translateY(-50%);
    z-index: 10;
    width: 34px; height: 34px;
    border-radius: 50%;
    background: #131a2bd9;
    border: 1px solid var(--border-light);
    color: var(--text-primary);
    align-items: center; justify-content: center;
    font-size: 17px;
    cursor: pointer;
    backdrop-filter: blur(6px);
}
.carousel-arrow:hover { background: var(--cy-dim); border-color: var(--cy); color: var(--cy); }
.carousel-arrow-left  { left: -6px; }
.carousel-arrow-right { right: -6px; }

.owner-header {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 10px 12px;
    margin-bottom: 12px;
    border: 1px solid var(--border);
    border-radius: 99px;
    background: linear-gradient(135deg, #34d9ff14, #5b8cff10);
}
.owner-name-row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.owner-avatar {
    width: 34px; height: 34px; flex: 0 0 auto;
    border-radius: 50%;
    background: linear-gradient(140deg, var(--cy), var(--accent));
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 700; color: #05141d;
    cursor: default;
}
.owner-name { font-size: 14.5px; font-weight: 600; color: var(--text-primary); cursor: default; display: block; }
.owner-meta { font-size: 11px; color: var(--text-faint); margin-top: 1px; }
.owner-actions { display: flex; gap: 4px; align-items: center; }
.owner-actions .btn-icon { width: 34px; height: 34px; }
.owner-body { padding: 0; }

/* ─── Fahrzeug: Hero-Karte in 3D ─────────────────────────── */
/* Jedes Fahrzeug als eigener Block: Rahmen um Karte, Kennzahlen,
   Aktionen und Stammdaten. Zwischen zwei Fahrzeugen eine Linie mit
   der laufenden Nummer (CSS-Zähler, kein Text → keine i18n nötig). */
[id^="autos_"] { counter-reset: fahrzeug; }
.auto-card {
    position: relative;
    counter-increment: fahrzeug;
    background: #ffffff05;
    border: 1px solid var(--border);
    border-radius: calc(var(--radius-xl) + 3px);
    padding: 3px 3px 10px;              /* so schmal wie möglich */
    margin-bottom: 26px;
    transition: border-color .3s var(--ease), background-color .3s var(--ease);
}
.auto-card + .auto-card { margin-top: 48px; }   /* Ränder fallen zusammen → 48 px Abstand */
.auto-card + .auto-card::after {          /* Trennlinie */
    content: ''; position: absolute; left: 12px; right: 12px;
    top: -25px; height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-light) 18%, var(--border-light) 82%, transparent);
    pointer-events: none;
}
.auto-card + .auto-card::before {         /* Nummer */
    content: counter(fahrzeug);
    position: absolute; left: 50%; top: -37px; transform: translateX(-50%);
    z-index: 1;
    min-width: 24px; height: 24px; padding: 0 7px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 99px;
    background: var(--bg-base); border: 1px solid var(--border-light);
    font-size: 11px; font-weight: 700; color: var(--text-faint);
    font-variant-numeric: tabular-nums;
    pointer-events: none;
}

.deck { perspective: 1400px; perspective-origin: 50% 42%; }

.hero {
    position: relative;
    --gx: 30%;              /* wird von der 3D-Neigung ueberschrieben */
    --gy: 0%;
    border-radius: var(--radius-xl);
    padding: 16px 16px 14px;
    transform-style: preserve-3d;
    transition: transform .5s var(--ease), box-shadow .5s var(--ease);
    background: linear-gradient(160deg, #16213c 0%, #0d1424 46%, #0a1020 100%);
    border: 1px solid #26314f;
    box-shadow:
            0 30px 60px -24px #000c,
            0 2px 0 0 #ffffff10 inset,
            0 -30px 60px -50px var(--cy) inset;
    overflow: hidden;
}
.hero::after {
    content: ''; position: absolute; inset: 0; pointer-events: none;
    background: radial-gradient(420px 280px at var(--gx,30%) var(--gy,0%), #ffffff1c, transparent 68%);
    transition: background .12s linear;
}

.auto-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; transform: translateZ(38px); }
.auto-title-row { display: flex; align-items: flex-start; gap: 10px; min-width: 0; }
.auto-icon {
    width: 34px; height: 34px; flex: 0 0 auto;
    border-radius: 11px;
    background: #ffffff0d; border: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center; font-size: 16px;
}
.auto-titles { min-width: 0; }
.hero-eyebrow { font-size: 9.5px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--cy); margin-bottom: 3px; }
.auto-name { font-size: 21px; font-weight: 700; letter-spacing: -.02em; color: var(--text-primary); cursor: default; display: block; line-height: 1.15; word-break: break-word; }
.auto-sub { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.auto-actions { display: flex; gap: 4px; align-items: center; flex: 0 0 auto; }

.car-wrap { position: relative; height: 116px; margin: 4px -4px 0; transform: translateZ(58px); }
.car-wrap svg { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); width: 96%; max-width: 360px; }
.car-glow {
    position: absolute; left: 50%; top: 66%; transform: translate(-50%,-50%);
    width: 74%; height: 46px; border-radius: 50%;
    background: radial-gradient(closest-side, #34d9ff55, transparent 72%);
    filter: blur(14px);
}
.road {
    position: absolute; left: 8%; right: 8%; bottom: 6px; height: 1px;
    background: linear-gradient(90deg, transparent, #34d9ff77, transparent);
}

/* Eigenes Fahrzeugbild statt Grafik.
   Gleiches Seitenverhältnis wie der Zuschnitt (2:1) und kein Rahmen im
   Layout (nur box-shadow), damit nichts abgeschnitten wird. */
.car-wrap.mit-bild { height: auto; aspect-ratio: 2 / 1; max-width: 640px; margin: 12px auto 0; }
.car-wrap.mit-bild .fahrzeug-foto {
    position: absolute; inset: 0; width: 100%; height: 100%;
    object-fit: fill; display: block;
    border-radius: 14px;
    box-shadow: 0 0 0 1px var(--border), 0 18px 30px -18px #000c;
    user-select: none; -webkit-user-drag: none;
}

/* Fahrzeugbild im Fahrzeug-Dialog */
.fahrzeug-bild-feld { display: flex; align-items: center; gap: 12px; }
.fahrzeug-bild-vorschau {
    flex: 0 0 auto; width: 128px; height: 64px; overflow: hidden;
    border-radius: 10px; border: 1px solid var(--border); background: #0c1220;
    display: flex; align-items: center; justify-content: center;
    font-size: 11px; color: var(--text-faint);
}
.fahrzeug-bild-vorschau img { width: 100%; height: 100%; object-fit: cover; }
.fahrzeug-bild-knoepfe { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 0; }
.fahrzeug-bild-knoepfe .btn { width: 100%; font-size: 12.5px; padding: 8px 12px; }

/* Zuschnitt-Fenster */
.zuschnitt-overlay {
    position: fixed; inset: 0; z-index: 550;          /* über den Dialogen (500), unter den Hinweisen (600) */
    display: none; align-items: center; justify-content: center;
    padding: 16px; background: #02050bf2;
}
.zuschnitt-overlay.offen { display: flex; }
.zuschnitt-box {
    width: 100%; max-width: 640px;
    background: var(--bg-card); border: 1px solid var(--border-light);
    border-radius: var(--radius-lg); padding: 16px;
}
.zuschnitt-box h3 { margin: 0 0 4px; font-size: 17px; color: var(--text-primary); }
.zuschnitt-hinweis { margin: 0 0 12px; font-size: 12.5px; color: var(--text-muted); }
.zuschnitt-leinwand {
    display: block; width: 100%; height: auto; aspect-ratio: 2 / 1;
    border-radius: 14px; box-shadow: 0 0 0 1px var(--cy);
    touch-action: none; cursor: grab; background: #0d1424;
}
.zuschnitt-leinwand:active { cursor: grabbing; }
.zuschnitt-zoom { display: flex; align-items: center; gap: 12px; margin: 14px 0 4px; font-size: 12.5px; color: var(--text-muted); }
.zuschnitt-zoom input { flex: 1; min-width: 0; accent-color: var(--cy); }
.zuschnitt-fuss { display: flex; gap: 10px; margin-top: 12px; }
.zuschnitt-fuss button { flex: 1; padding: 12px; font-size: 13.5px; font-weight: 600; border-radius: 12px; border: 1px solid var(--border); cursor: pointer; }
.zuschnitt-fuss .btn-primary { border-color: transparent; }

/* Status-Ringe */
.rings { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; transform: translateZ(44px); }
.ring-card {
    flex: 1 1 190px;
    display: flex; align-items: center; gap: 11px;
    background: #0a101ec9; border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 10px 11px;
    backdrop-filter: blur(6px);
}
.ring { position: relative; width: 46px; height: 46px; flex: 0 0 auto; }
.ring svg { transform: rotate(-90deg); width: 46px; height: 46px; }
.ring .track { stroke: #1c2740; stroke-width: 5; fill: none; }
.ring .bar {
    stroke-width: 5; fill: none; stroke-linecap: round;
    transition: stroke-dashoffset 1.2s var(--ease) .2s;
}
.ring-val { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; }
.ring-val b { font-size: 13px; font-weight: 700; }
.ring-val i { font-size: 7.5px; font-style: normal; letter-spacing: .06em; text-transform: uppercase; color: var(--text-faint); margin-top: 1px; }
.ring-meta { min-width: 0; flex: 1; }
.ring-meta .k { font-size: 9.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--text-faint); }
.ring-meta .badge { margin-top: 3px; }
.ring-meta .btn { margin-top: 6px; font-size: 11.5px; padding: 5px 10px; border-radius: 9px; }
/* Der Erinnerungsknopf trägt nur noch die Glocke. Damit er auf dem
   Handy trotzdem sicher zu treffen ist, bleibt die Fläche bei 44x44 px
   — das ist die Untergrenze, die Apple und Google gleichermaßen nennen.
   Muss nach .ring-meta .btn stehen: gleiche Spezifität, die spätere
   Regel gewinnt. */
.ring-meta .btn-glocke {
    min-width: 44px; min-height: 44px;
    padding: 0; font-size: 18px; line-height: 1;
    border-radius: 12px; gap: 0;
    margin-top: 0; flex: none;
}
/* Abzeichen und zugehoerige Glocke bleiben auf einer Zeile. Ohne das
   bricht bei 360 px jedes Paar auf zwei Zeilen um und die Ringkarte
   wird doppelt so hoch. Der Text darf stattdessen im Abzeichen
   umbrechen — min-width:0 erlaubt dem Flex-Element zu schrumpfen. */
.ring-zeile { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.ring-zeile .badge { margin-top: 0; min-width: 0; }

.badge { display: inline-block; padding: 3px 9px; border-radius: 99px; font-size: 11px; font-weight: 600; }
.badge-amber { background: var(--amber-dim); color: var(--amber); border: 1px solid #ffb34030; cursor: default; }
.badge-green { background: var(--green-dim); color: var(--green); border: 1px solid #3ee08f30; cursor: default; }
.badge-red   { background: var(--red-dim); color: var(--red); border: 1px solid #ff5c6b30; }

/* ─── KPI-Reihe ──────────────────────────────────────────── */
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0 4px; }
.kpi {
    background: linear-gradient(165deg, var(--bg-surface), #0a101c);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px 8px;
    text-align: center;
    transition: .22s var(--ease);
}
.kpi:hover { transform: translateY(-3px); border-color: #2b3757; }
.kpi .k { font-size: 9px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-faint); }
.kpi .v { font-size: 18px; font-weight: 700; margin-top: 5px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi .s { font-size: 9.5px; color: var(--text-faint); margin-top: 2px; }
.kpi .v.cy { color: var(--cy); } .kpi .v.gr { color: var(--green); } .kpi .v.am { color: var(--amber); }

/* ─── Abschnitte ─────────────────────────────────────────── */
#auto_stammdaten, .stammbox { border: none; padding: 0; }

.sec-title {
    font-size: 10.5px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase;
    color: var(--text-faint);
    display: flex; align-items: center; gap: 8px;
    margin: 18px 0 10px;
}
.sec-title::before { content: ''; width: 3px; height: 12px; border-radius: 2px; background: linear-gradient(180deg, var(--cy), var(--accent)); }

.stamm-grid {
    display: grid; grid-template-columns: 132px 1fr;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    font-size: 13px;
    cursor: default;
    margin-bottom: 10px;
}
.stamm-grid .label {
    display: flex; align-items: center;
    background: #0c1220;
    padding: 9px 12px;
    border-bottom: 1px solid var(--border);
    font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
    color: var(--text-faint);
}
.stamm-grid .value {
    display: flex; align-items: center;
    background: var(--bg-surface);
    padding: 9px 12px;
    border-bottom: 1px solid var(--border);
    font-size: 13px; color: var(--text-primary);
    word-break: break-word; overflow-wrap: anywhere;
}
.stamm-grid .label:nth-last-child(2),
.stamm-grid .value:last-child { border-bottom: none; }

.infotext {
    width: 100%;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 13px;
    padding: 12px 13px;
    resize: vertical;
    font-family: inherit;
    line-height: 1.55;
    margin: 0;
    transition: .18s var(--ease);
}
.infotext::placeholder { color: var(--text-faint); }
.infotext:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }

/* Aufklappbarer Block */
.fold { background: linear-gradient(165deg, var(--bg-surface), #0a101c); border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; }
.fold-head { display: flex; align-items: center; gap: 10px; padding: 13px 14px; cursor: pointer; user-select: none; }
.fold-head .t { flex: 1; font-size: 13.5px; font-weight: 600; }
.fold-head .chev { width: 17px; height: 17px; color: var(--text-faint); transition: .3s var(--ease); flex: 0 0 auto; }
.fold.open .fold-head .chev { transform: rotate(180deg); }
.fold-body { max-height: 0; overflow: hidden; transition: max-height .45s var(--ease); }
.fold.open .fold-body { max-height: 1200px; }
.fold-in { padding: 0 12px 12px; }

/* ─── Aktions-Kacheln ────────────────────────────────────── */
.aktion-gruppe { margin-top: 10px; }
.aktion-gruppe-titel {
    font-size: 10px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase;
    color: var(--text-faint); margin-bottom: 8px;
}
.aktion-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
@media (min-width: 700px) { .aktion-grid { grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); } }
.aktion-grid .btn {
    position: relative;
    flex-direction: column;
    gap: 7px;
    padding: 13px 6px 11px;
    width: 100%;
    font-size: 11.5px;
    line-height: 1.25;
    text-align: center;
    background: linear-gradient(165deg, var(--bg-surface), #0a101c);
    border-radius: var(--radius-md);
    transform-style: preserve-3d;
}
.aktion-grid .btn:hover { transform: translateY(-4px) rotateX(7deg); border-color: #33406a; box-shadow: 0 16px 30px -18px #000; }
.aktion-grid .btn .ic {
    width: 34px; height: 34px; border-radius: 11px;
    display: flex; align-items: center; justify-content: center;
    background: #ffffff08; border: 1px solid var(--border);
    font-size: 15px; transition: .2s var(--ease);
}
.aktion-grid .btn:hover .ic { background: var(--cy-dim); border-color: #34d9ff44; transform: translateZ(12px); }
.aktion-grid .btn-voll { grid-column: auto; }

.aktion-pro { background: transparent; border: none; border-radius: 0; padding: 0; }
.aktion-pro .aktion-gruppe-titel { color: var(--amber); }
.aktion-pro .aktion-grid .btn .ic { background: var(--amber-dim); border-color: #ffb34033; }
.aktion-pro .aktion-grid .btn::after {
    content: 'PRO';
    position: absolute; top: 5px; right: 5px;
    font-size: 7px; font-weight: 800; letter-spacing: .09em;
    color: var(--amber); background: #ffb34018; border: 1px solid #ffb34033;
    border-radius: 99px; padding: 1.5px 5px;
}

/* ─── OBD-Info ───────────────────────────────────────────────
   i im Kopf des Diagnose-Fensters (Grundform siehe .sheet-head #iRefresh) */
.sheet-head #diagnoseInfoBtn { color: var(--text-muted); cursor: pointer; }
.sheet-head #diagnoseInfoBtn:hover { color: var(--text-primary); border-color: var(--border-light); background: #ffffff16; }
.sheet-head #diagnoseInfoBtn svg { width: 16px; height: 16px; }


.empty-state { text-align: center; padding: 2rem 1rem; color: var(--text-faint); font-size: 13px; }

/* ─── Wartungen / Timeline ───────────────────────────────── */
.wartung-item {
    position: relative;
    background: linear-gradient(165deg, var(--bg-surface), #0a101c);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 13px 14px;
    margin: 0 0 8px 22px;
    display: grid;
    grid-template-columns: 128px 1fr;
    gap: 5px 12px;
    font-size: 12.5px;
    transition: .2s var(--ease);
}
.wartung-item::before {
    content: ''; position: absolute; left: -22px; top: 18px;
    width: 9px; height: 9px; border-radius: 50%;
    background: var(--bg-base); border: 2px solid var(--cy);
    box-shadow: 0 0 0 4px #34d9ff18;
}
.wartung-item::after {
    content: ''; position: absolute; left: -18px; top: 27px; bottom: -12px;
    width: 1.5px; background: linear-gradient(180deg, #34d9ff55, #34d9ff11);
}
.wartung-item:last-child::after { display: none; }
.wartung-item:hover { border-color: #33406a; transform: translateX(3px); }
.wartung-item .wlabel { color: var(--text-faint); font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding-top: 2px; padding-right: 8px; overflow-wrap: anywhere; hyphens: auto; }
.wartung-item .wval { color: var(--text-primary); word-break: break-word; overflow-wrap: break-word; white-space: pre-wrap; }
.wartung-item .actions-row { grid-column: 1 / -1; display: flex; gap: 6px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); }

.tank-item {
    background: linear-gradient(165deg, var(--bg-surface), #0a101c);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 13px 14px;
    margin-bottom: 8px;
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 5px 12px;
    font-size: 12.5px;
    transition: .2s var(--ease);
}
.tank-item:hover { border-color: #33406a; }
.tank-item .tlabel { color: var(--text-faint); font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding-top: 2px; padding-right: 8px; overflow-wrap: anywhere; hyphens: auto; }
.tank-item .tval   { color: var(--text-primary); }
.tank-item .actions-row { grid-column: 1 / -1; display: flex; gap: 6px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); }

.verbrauch-badge {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 99px;
    font-size: 11px; font-weight: 600;
    background: var(--cy-dim); color: var(--cy);
    border: 1px solid #34d9ff30;
}

/* ─── Modale Dialoge ─────────────────────────────────────── */
.modal-overlay {
    position: fixed; inset: 0;
    background: #02050bd9;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: none;
    justify-content: center; align-items: center;
    z-index: 500;
    padding: 12px;
}
.modal {
    background: linear-gradient(180deg, #1a2133, #10162492);
    background-color: #131a2b;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 18px;
    width: 460px;
    max-width: 100%;
    max-height: 92vh;
    max-height: 92dvh;
    overflow-y: auto;
    overscroll-behavior: contain;
    box-shadow: 0 30px 80px -20px #000e;
}
@keyframes modalRise { from { opacity: 0; transform: translateY(18px) scale(.98); } to { opacity: 1; transform: none; } }

.modal h1 { font-size: 20px; font-weight: 700; margin-bottom: 14px; }
.modal h3 { font-size: 16.5px; font-weight: 700; color: var(--text-primary); margin-bottom: 1.1rem; text-align: center; letter-spacing: -.01em; }
.modal input, .modal textarea, .modal select {
    background: #0f1524;
    border: 1px solid var(--border);
    border-radius: 11px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 13.5px;
    padding: 10px 12px;
    width: 100%;
    margin-bottom: 8px;
    transition: .18s var(--ease);
}
.modal input:focus, .modal textarea:focus, .modal select:focus {
    outline: none; border-color: var(--accent); background: #111729;
    box-shadow: 0 0 0 3px var(--accent-dim);
}
.modal input[type="checkbox"] { width: auto; margin: 0; accent-color: var(--cy); width: 18px; height: 18px; }
.modal input[type="radio"] { width: auto; margin: 0; accent-color: var(--cy); }
.modal input[type="range"] { padding: 0; accent-color: var(--cy); }
.modal input::placeholder, .modal textarea::placeholder { color: var(--text-faint); }
.modal select option { background: var(--bg-card); }
.modal label { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-muted); margin-bottom: 8px; }
.modal label input[type="text"], .modal label input[type="number"], .modal label input[type="month"] { width: 150px; margin-bottom: 0; }
.month-row span:first-child { width: 150px; flex-shrink: 0; }
.modal-footer { display: flex; gap: 8px; margin-top: 1.1rem; position: sticky; bottom: -18px; padding: 10px 0 0; background: linear-gradient(180deg, #131a2b00, #131a2b 34%); }
.modal-footer button { flex: 1; padding: 12px; font-size: 13.5px; font-weight: 600; border-radius: 12px; border: 1px solid var(--border); background: #ffffff0a; color: var(--text-muted); }
.modal-footer button:hover { color: var(--text-primary); border-color: var(--border-light); }
.modal-footer .btn-primary { background: linear-gradient(135deg, var(--cy), var(--accent)); color: #04121c; border-color: transparent; }
.modal-footer .btn-primary:hover { filter: brightness(1.08); color: #04121c; }
.modal-footer .btn-ghost { background: transparent; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-items: start; }
.form-row input { margin-bottom: 0; }

.field-label {
    font-size: 10px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
    color: var(--text-faint); margin-bottom: 4px; display: block;
}
.field-group { display: flex; flex-direction: column; margin-bottom: 10px; }
.field-group input, .field-group textarea { margin-bottom: 0; }
.form-row .field-group { margin-bottom: 0; }

.toggle-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 9px 14px;
    border-radius: 11px;
    font-size: 13px; font-weight: 600;
    cursor: pointer;
    border: 1px solid var(--border);
    background: #0f1524;
    color: var(--text-muted);
    margin-bottom: 10px; margin-right: 8px;
    transition: all .18s var(--ease);
}
.toggle-btn:hover { border-color: var(--border-light); color: var(--text-primary); }
.toggle-btn.pressed { background: linear-gradient(135deg, var(--cy), var(--accent)); border-color: transparent; color: #04121c; box-shadow: 0 6px 18px -8px var(--cy); }
.toggle-btn:disabled { opacity: .4; cursor: not-allowed; }

.oil-section, .tuev-section, .hv-section { display: none; }
.lade-stecker { font-size: 10px; padding: 2px 7px; border-radius: 99px;
    background: var(--bg-surface); border: 1px solid var(--border-light);
    color: var(--text-muted); white-space: nowrap; }
.oil-select-row { display: flex; gap: 8px; margin-bottom: 8px; align-items: center; flex-wrap: wrap; }
.oil-select-row select { margin-bottom: 0; width: auto; }
.oil-select-row .liter-input { width: 80px; margin-bottom: 0; }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-faint); }

.status-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }

/* ─── Diagramme ──────────────────────────────────────────── */
.chart-container { background: linear-gradient(165deg, var(--bg-surface), #0a101c); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 14px; margin-top: 10px; }
.chart-title { font-size: 10.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 10px; }
.chart-empty { text-align: center; color: var(--text-faint); font-size: 12px; padding: 1rem 0; }
.chart-label { font-size: .8rem; fill: var(--text-faint); }
.chart-dot:hover { r: 6px; cursor: pointer; }

/* ─── Kostenauswertung ───────────────────────────────────── */
.ka-hero {
    background: linear-gradient(160deg, #16213c, #0d1424);
    border: 1px solid #26314f;
    border-radius: var(--radius-lg);
    padding: 18px 14px 16px;
    text-align: center;
    margin-bottom: 8px;
}
.ka-hero-label { font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 6px; }
.ka-hero-value { font-family: inherit; font-size: clamp(30px, 9vw, 40px); font-weight: 700; line-height: 1.05; letter-spacing: -.03em; color: var(--text-primary); }
.ka-hero-sub { font-size: 12px; color: var(--text-muted); margin-top: 5px; }

.ka-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 8px; }
.ka-kpi { background: linear-gradient(165deg, var(--bg-surface), #0a101c); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 11px 8px; text-align: center; }
.ka-kpi-label { font-size: 9.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 4px; }
.ka-kpi-value { font-size: 16px; font-weight: 700; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.ka-kpi-sub { font-size: 10px; color: var(--text-faint); margin-top: 2px; }

.ka-card { background: linear-gradient(165deg, var(--bg-surface), #0a101c); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 14px; margin-bottom: 8px; }
.ka-card-title { font-size: 10.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 10px; }
.ka-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; }
.ka-legend-item { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted); }
.ka-legend-dot { width: 9px; height: 9px; border-radius: 3px; flex-shrink: 0; }
.ka-legend-val { color: var(--text-primary); font-weight: 600; }

.ka-tabelle-wrap { overflow-x: auto; margin-top: 10px; }
.ka-table { width: 100%; border-collapse: collapse; font-size: 11px; font-variant-numeric: tabular-nums; }
.ka-table th {
    text-align: right; font-size: 9.5px; font-weight: 700; letter-spacing: .05em;
    text-transform: uppercase; color: var(--text-faint); white-space: nowrap;
    padding: 0 0 6px 8px; border-bottom: 1px solid var(--border);
}
.ka-table th:first-child, .ka-table td:first-child { text-align: left; padding-left: 0; }
.ka-table td { text-align: right; padding: 7px 0 7px 8px; white-space: nowrap; color: var(--text-muted); border-bottom: 1px solid var(--border); }
.ka-table tr:last-child td { border-bottom: none; }
.ka-table th:last-child, .ka-table td:last-child { color: var(--text-primary); }
.ka-table .ka-summe td { color: var(--text-primary); font-weight: 700; }
.ka-th-dot { display: inline-block; width: 7px; height: 7px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.ka-axis { font-size: 9px; fill: var(--text-faint); font-variant-numeric: tabular-nums; }
.ka-caplabel { font-size: 9px; fill: var(--text-muted); font-variant-numeric: tabular-nums; }
.ka-grid { stroke: var(--border); stroke-width: 1; }
.ka-hinweis { font-size: 11px; color: var(--text-muted); line-height: 1.55; margin: 2px 2px 0; }

/* ─── Impressum / Karten ─────────────────────────────────── */
.card { background: linear-gradient(165deg, var(--bg-surface), #0a101c); border-radius: var(--radius-md); padding: 16px; margin-bottom: 12px; border: 1px solid var(--border); }
.card h2 { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .09em; color: var(--text-faint); margin-bottom: 10px; }
.card p { font-size: 14px; color: var(--text-primary); margin-bottom: 4px; }
.card a { color: var(--cy); text-decoration: none; }
.note { font-size: 13px; color: var(--text-muted); line-height: 1.55; }

.inhaber-row { display: flex; align-items: flex-start; gap: 30px; }
.inhaber-row p { margin: 0; }

/* ─── Untere Navigation ──────────────────────────────────── */
body.hat-autoschalter { padding-bottom: calc(156px + var(--safe-b)); }

/* Beim Herunterscrollen weichen Kopf- und Fußleiste aus dem Bild.
   Wird nur in der Webversion aktiviert (siehe leistenBeimScrollen). */
.topbar, .navbar {
    transition: transform .32s cubic-bezier(.4, 0, .2, 1),
    opacity   .32s cubic-bezier(.4, 0, .2, 1);
}
body.leisten-weg .topbar {
    transform: translateY(-100%); opacity: 0; pointer-events: none;
}
body.leisten-weg .navbar {
    transform: translateY(100%);  opacity: 0; pointer-events: none;
}
@media (prefers-reduced-motion: reduce) {
    .topbar, .navbar { transition: none; }
}

.navbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 300;
    padding: 8px 12px calc(8px + var(--safe-b));
    background: linear-gradient(180deg, #070a1200, #070a12ec 34%);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}
/* Fahrzeug-Umschalter über der Leiste — nur bei mehr als einem Auto */
.auto-switch {
    display: flex; align-items: center; gap: 10px;
    width: 100%; max-width: 520px; margin: 0 auto 8px;
    padding: 9px 13px;
    border-radius: 16px;
    border: 1px solid #34d9ff44;
    background: linear-gradient(135deg, #34d9ff1f, #5b8cff14), #0d1322e6;
    color: var(--text-primary);
    font-family: inherit; font-size: 13px; font-weight: 600;
    cursor: pointer;
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 -4px 24px -10px #000;
}
.auto-switch[hidden] { display: none; }
.auto-switch:active { transform: scale(.985); }
.auto-switch .nr {
    flex: 0 0 auto;
    font-size: 11px; font-weight: 800; letter-spacing: .02em;
    background: linear-gradient(135deg, var(--cy), var(--accent));
    color: #04121c; border-radius: 99px; padding: 3px 9px;
    font-variant-numeric: tabular-nums;
}
.auto-switch .nm {
    flex: 1; min-width: 0; text-align: left;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.auto-switch .pfeil { width: 17px; height: 17px; color: var(--cy); flex: 0 0 auto; }

/* Das gesteuerte Fahrzeug hervorheben */
.auto-card.aktiv { border-color: #34d9ff55; background-color: #34d9ff08; }
.auto-card.aktiv::before { color: var(--cy); border-color: #34d9ff70; }
.auto-card.aktiv .hero {
    border-color: #34d9ff70;
    box-shadow: 0 30px 60px -24px #000c,
    0 0 0 1px #34d9ff40,
    0 2px 0 0 #ffffff10 inset,
    0 -30px 60px -50px var(--cy) inset;
}

.nav-inner {
    max-width: 520px; margin: 0 auto;
    display: grid; grid-template-columns: repeat(5, 1fr);
    background: #0d1322e6;
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 6px;
    box-shadow: 0 -6px 34px -10px #000;
}
.nav-btn {
    background: none; border: none; cursor: pointer; font-family: inherit;
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    padding: 8px 2px; border-radius: 14px;
    color: var(--text-faint);
    font-size: 9.5px; font-weight: 600;
}
.nav-btn svg { width: 19px; height: 19px; }
.nav-btn.on { color: var(--cy); background: linear-gradient(180deg, #34d9ff16, #34d9ff06); }
.nav-btn:not(.on):hover { color: var(--text-muted); }

/* ─── Kurzhinweis (statt alert) ──────────────────────────── */
.hinweis-box {
    position: fixed; left: 0; right: 0; bottom: calc(96px + var(--safe-b)); z-index: 600;
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    pointer-events: none; padding: 0 16px;
}
.hinweis {
    display: flex; align-items: center; gap: 10px;
    background: #1f2536; border: 1px solid var(--border-light);
    border-radius: 13px; padding: 11px 15px; font-size: 13px;
    box-shadow: 0 16px 40px -14px #000;
    transform: translateY(14px); opacity: 0; transition: .3s var(--ease);
    max-width: 420px;
}
.hinweis.on { transform: none; opacity: 1; }
.hinweis i { width: 8px; height: 8px; border-radius: 50%; background: var(--cy); flex: 0 0 auto; }

/* ─── Einblenden ─────────────────────────────────────────── */
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.rise { animation: rise .55s var(--ease) both; }

@media (prefers-reduced-motion: reduce) {
    * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ══════════════════════════════════════════════════════════
   POPUPS — Variante C
   Bottom-Sheet auf dem Handy, zentrierter Dialog ab 640 px.
   Kopf und Fuss bleiben stehen, nur der Inhalt scrollt.
   Der Aufbau wird zur Laufzeit erzeugt (siehe popupsAufbereiten),
   alle bestehenden IDs bleiben unveraendert.
   ══════════════════════════════════════════════════════════ */

.modal-overlay { align-items: flex-end; padding: 0; }
@media (min-width: 640px) { .modal-overlay { align-items: center; padding: 12px; } }

.modal {
    display: flex; flex-direction: column;
    width: 100%; max-width: 100%;
    max-height: 92vh; max-height: 92dvh;
    padding: 0;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    border-bottom: none;
    overflow: hidden;
    overscroll-behavior: contain;
    animation: sheetRauf .38s var(--ease);
}
@keyframes sheetRauf { from { transform: translateY(100%); } to { transform: none; } }

@media (min-width: 640px) {
    .modal {
        width: 520px; max-width: 94vw;
        max-height: 88vh; max-height: 88dvh;
        border-radius: var(--radius-lg);
        border-bottom: 1px solid var(--border-light);
        animation: sheetAuf .3s var(--ease);
    }
    @keyframes sheetAuf { from { opacity: 0; transform: translateY(16px) scale(.97); } to { opacity: 1; transform: none; } }
    .grip { display: none; }
}

.grip {
    flex: 0 0 auto;
    width: 38px; height: 4px; border-radius: 99px;
    background: #3a4260; margin: 9px auto 2px;
    cursor: grab; touch-action: none;
}

.sheet-head {
    flex: 0 0 auto;
    display: flex; align-items: flex-start; gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}
.sheet-head .sheet-titel { flex: 1; min-width: 0; }
.sheet-head h1, .sheet-head h3 {
    font-size: 17px; font-weight: 700; letter-spacing: -.01em;
    text-align: left; margin: 0; line-height: 1.3;
}
.sheet-unter { font-size: 12px; color: var(--text-muted); margin-top: 3px; }
.sheet-x {
    flex: 0 0 auto; width: 32px; height: 32px; border-radius: 10px;
    border: 1px solid var(--border); background: #ffffff08; color: var(--text-muted);
    display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.sheet-x:hover { color: var(--text-primary); border-color: var(--border-light); background: #ffffff16; }
.sheet-x svg { width: 16px; height: 16px; }
.sheet-head #iRefresh,
.sheet-head #assistentStimmeBtn,
.sheet-head #diagnoseInfoBtn {
    flex: 0 0 auto; width: 32px; height: 32px; margin: 0; padding: 0;
    font-size: 16px; border-radius: 10px;
    border: 1px solid var(--border); background: #ffffff08;
    display: flex; align-items: center; justify-content: center;
}

.sheet-body {
    flex: 1 1 auto; min-height: 0;
    overflow-y: auto; -webkit-overflow-scrolling: touch;
    padding: 16px;
}
.sheet-body > :last-child { margin-bottom: 0; }

.sheet-foot {
    flex: 0 0 auto;
    display: flex; gap: 9px;
    margin: 0;
    padding: 12px 16px calc(14px + var(--safe-b));
    border-top: 1px solid var(--border);
    background: #151b2a;
    position: static;
}
.sheet-foot button { flex: 1; margin: 0; }

/* ─── Fortschritt im Assistenten ─────────────────────────── */
.wiz-prog { flex: 0 0 auto; height: 3px; background: #ffffff0d; }
.wiz-prog i { display: block; height: 100%; width: 33.33%;
    background: linear-gradient(90deg, var(--cy), var(--accent));
    transition: width .45s var(--ease); }

.step { display: none; }
.step.on { display: block; animation: stepRein .3s var(--ease) both; }
@keyframes stepRein { from { opacity: 0; transform: translateX(12px); } to { opacity: 1; transform: none; } }
.step-tag {
    display: inline-flex; align-items: center; gap: 7px;
    font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
    color: var(--cy); background: var(--cy-dim); border: 1px solid #34d9ff33;
    border-radius: 99px; padding: 4px 11px; margin-bottom: 14px;
}
.wiz-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; align-items: start; }
.wiz-grid > .month-row, .wiz-grid > .voll { grid-column: 1 / -1; }
.wiz-grid > .field-group { margin-bottom: 0; }
.wiz-grid .month-row { margin-bottom: 0; }

/* ─── Aufklappbare Bloecke im Dialog ─────────────────────── */
.acc { border: 1px solid var(--border); border-radius: 12px; margin-bottom: 9px; overflow: hidden; background: #0f1524; }
.acc-h { display: flex; align-items: center; gap: 10px; padding: 13px 14px; cursor: pointer; user-select: none; }
.acc-h .t { flex: 1; font-size: 13.5px; font-weight: 600; color: var(--text-primary); }
.acc-h .c { font-size: 11px; color: var(--text-faint); }
.acc-h .chev { width: 16px; height: 16px; color: var(--text-faint); transition: .28s var(--ease); flex: 0 0 auto; }
.acc.open .acc-h .chev { transform: rotate(180deg); }
.acc-b { max-height: 0; overflow: hidden; transition: max-height .4s var(--ease); }
.acc.open .acc-b { max-height: 900px; }
.acc-in { padding: 2px 14px 12px; border-top: 1px solid var(--border); }
.acc-in > :last-child { margin-bottom: 0; }

/* ─── Segmented Control statt Haekchen-Paaren ────────────── */
.seg {
    display: flex; gap: 4px;
    background: #0f1524; border: 1px solid var(--border);
    border-radius: 12px; padding: 4px; margin-bottom: 8px;
}
.seg button {
    flex: 1; border: none; background: transparent; color: var(--text-muted);
    font-family: inherit; font-size: 13px; font-weight: 600;
    padding: 9px 6px; border-radius: 9px; cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 6px;
}
.seg button:hover { color: var(--text-primary); }
.seg button.on { background: linear-gradient(135deg, var(--cy), var(--accent)); color: #04121c; }
.seg.gruen button.on { background: var(--green); color: #06251a; }
.seg.rot   button.on { background: var(--red);   color: #2a0708; }
.seg-original { display: none !important; }

/* ─── Schalter statt Kaestchen ───────────────────────────── */
.modal input[type="checkbox"] {
    appearance: none; -webkit-appearance: none;
    position: relative; flex: 0 0 auto;
    /* wichtig: einige Kaestchen tragen ein inline width:auto aus dem Altbestand */
    width: 44px !important; height: 26px !important; border-radius: 99px;
    background: #2a3048; border: none; cursor: pointer;
    transition: background .22s var(--ease);
}
.modal input[type="checkbox"]::after {
    content: ''; position: absolute; top: 3px; left: 3px;
    width: 20px; height: 20px; border-radius: 50%;
    background: #8b93ad; transition: .22s var(--ease);
}
.modal input[type="checkbox"]:checked { background: var(--accent); }
.modal input[type="checkbox"]:checked::after { left: 21px; background: #fff; }
.modal input[type="checkbox"]:focus-visible { outline: 2px solid var(--cy); outline-offset: 2px; }

/* Zeilen mit Schalter ruhiger setzen */
.modal label:has(> input[type="checkbox"]) {
    flex-direction: row-reverse;
    justify-content: space-between;
    background: #0f1524; border: 1px solid var(--border);
    border-radius: 12px; padding: 10px 12px;
}

/* Monatsfelder duerfen die Zeile ausfuellen */
.modal label.month-row input[type="month"] { width: auto; flex: 1; }

/* Getriebeart-Segment ueber die ganze Breite */
.wiz-grid > .field-group.voll { grid-column: 1 / -1; }

/* ─── Reifendaten je Reifensatz in der Fahrzeugkarte ─────── */
.fold.open .fold-body.fold-lang { max-height: 2400px; }
.reifen-satz { display: contents; }
.reifen-wert { display: flex; align-items: center; gap: 8px; width: 100%; }
.reifen-wert .rw-text { flex: 1; min-width: 0; }
.reifen-warn { flex: 0 0 auto; width: 8px; height: 8px; border-radius: 50%; }
.reifen-warn.rot { background: var(--red); }
.reifen-warn.gelb { background: var(--amber); }
.reifen-pfeil {
    flex: 0 0 auto; width: 30px; height: 30px; padding: 0; margin: -4px 0;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 9px; border: 1px solid var(--border); background: #0c1220;
    color: var(--text-muted); cursor: pointer;
}
.reifen-pfeil svg { width: 15px; height: 15px; transition: transform .3s var(--ease); }
.reifen-pfeil[aria-expanded="true"] svg { transform: rotate(180deg); }
.stamm-grid .reifen-detail {
    grid-column: 1 / -1; background: #0a101c;
    border-bottom: 1px solid var(--border); padding: 10px 12px 12px;
}
.stamm-grid .reifen-detail[hidden] { display: none; }
.reifen-detail dl { display: grid; grid-template-columns: auto 1fr; gap: 7px 14px; margin: 0 0 10px; }
.reifen-detail dt { font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-faint); align-self: center; }
.reifen-detail dd { margin: 0; font-size: 13px; color: var(--text-primary); }
.reifen-detail .leer { margin: 0 0 10px; font-size: 12.5px; color: var(--text-faint); }
.reifen-detail .reifen-bearbeiten { width: 100%; padding: 8px 12px; font-size: 12.5px; }
.field-label .einheit-reifen { text-transform: none; }
#reifenPopup .form-row { margin-bottom: 12px; }

/* ─── Abgleich beim Einschalten der Synchronisierung ─────── */
.abgleich-overlay {
    position: fixed; inset: 0; z-index: 560;          /* über Dialogen (500), unter Hinweisen (600) */
    display: flex; align-items: center; justify-content: center;
    padding: 16px; background: #02050bf2;
}
.abgleich-box {
    width: 100%; max-width: 520px; max-height: 92vh; overflow: auto;
    background: var(--bg-card); border: 1px solid var(--border-light);
    border-radius: var(--radius-lg); padding: 18px;
}
.abgleich-box h3 { margin: 0 0 6px; font-size: 17px; color: var(--text-primary); }
.abgleich-text, .abgleich-hinweis { margin: 0 0 12px; font-size: 13px; color: var(--text-muted); line-height: 1.45; }
.abgleich-hinweis { margin: 12px 0 0; font-size: 12px; color: var(--text-faint); }
.abgleich-seiten { display: grid; gap: 8px; }
.abgleich-seite { background: #0f1524; border: 1px solid var(--border); border-radius: var(--radius-md); padding: 10px 12px; }
.abgleich-seite-titel { font-size: 13.5px; font-weight: 700; color: var(--text-primary); margin-bottom: 4px; }
.abgleich-stand, .abgleich-umfang { font-size: 12.5px; color: var(--text-muted); }
.abgleich-namen { font-size: 12px; color: var(--text-faint); margin-top: 2px; word-break: break-word; }
.abgleich-fuss { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.abgleich-fuss button { width: 100%; padding: 12px; font-size: 13.5px; font-weight: 600; border-radius: 12px; border: 1px solid var(--border); cursor: pointer; }
.abgleich-fuss .btn-primary { border-color: transparent; }
.abgleich-abbrechen {
    background: none; border: none; padding: 8px; cursor: pointer;
    color: var(--text-faint); font-size: 12.5px; text-decoration: underline;
}
.abgleich-fuss .abgleich-abbrechen { border: none; padding: 8px; font-weight: 400; font-size: 12.5px; }

/* ─── Lesbarkeit (Werkstatt, helles Umgebungslicht) ─────────
   Kleinste Beschriftungen etwas größer. Steht bewusst am Ende,
   damit es die gleichnamigen Regeln weiter oben überschreibt.
   Zum Zurücknehmen einfach diesen ganzen Block löschen. */
.field-label,
.stamm-grid .label,
.wartung-item .wlabel,
.tank-item .tlabel,
.aktion-gruppe-titel,
.reifen-detail dt,
.ka-hero-label        { font-size: 11px; }

.sec-title,
.chart-title,
.ka-card-title,
.card h2              { font-size: 11.5px; }

.kpi .k, .kpi .s,
.ring-meta .k,
.ka-kpi-label, .ka-kpi-sub,
.ka-table th,
.hero-eyebrow,
.nav-btn              { font-size: 10.5px; }

/* Längere Feldnamen dürfen umbrechen, statt aus der Spalte zu laufen */
.stamm-grid .label    { overflow-wrap: anywhere; hyphens: auto; }

/* ─── Kein seitliches Scrollen bei schmalem Handy / großer Systemschrift ───
   Die Besitzerkarte ist ein Flex-Element im Karussell und wurde sonst so
   breit wie ihr breitester Inhalt (min-width:auto). Lange Wörter wie
   "Kostenauswertung" oder "2.873 €" haben die Raster gesprengt, das
   Karussell hat die zu breite Karte zentriert und links abgeschnitten. */
.owner-card { min-width: 0; }
.kpis, .aktion-grid, .ka-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (min-width: 700px) { .aktion-grid { grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); } }
.kpi, .ka-kpi, .aktion-grid .btn { min-width: 0; overflow-wrap: anywhere; hyphens: auto; }
.ring-card { min-width: 0; }