/* =====================================================================
   CF Performance IoT Dashboard – Gestaltung

   Leitbild: Werkzeug für draußen. Helle, verzinkte Flächen, dunkle
   Schrift, gut lesbar bei Sonne. Eine einzige Signalfarbe: das Gelb
   einer Ohrmarke. Sie markiert, wo man gerade ist und was an ist.
   Farbe in den Diagrammen gehört allein den Messwerten.
   ===================================================================== */

/* ---- Schrift (liegt lokal, es wird nichts aus dem Internet geladen) ---- */
@font-face { font-family: 'Barlow'; font-weight: 400; font-display: swap; src: url('/static/fonts/barlow-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Barlow'; font-weight: 500; font-display: swap; src: url('/static/fonts/barlow-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Barlow'; font-weight: 600; font-display: swap; src: url('/static/fonts/barlow-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Barlow Semi Condensed'; font-weight: 600; font-display: swap; src: url('/static/fonts/barlow-semi-condensed-latin-600-normal.woff2') format('woff2'); }

/* ---- Farben und Maße ---- */
:root {
    color-scheme: light;
    --grund: #E8ECE9;            /* Zink: die Fläche hinter allem */
    --flaeche: #FBFCFB;          /* Blech: Kacheln, Listen, Fenster */
    --tinte: #14201B;
    --tinte-2: #4A5650;
    --tinte-3: #6F7B74;
    --linie: rgba(20, 32, 27, 0.12);
    --linie-stark: rgba(20, 32, 27, 0.28);
    --marke: #F5C400;            /* Ohrmarke */
    --marke-tinte: #1A1600;
    --wasser: #2a78d6;
    --wasser-bahn: #cde2fb;
    --gut: #0ca30c;              /* Zustand: alles in Ordnung */
    --warnung: #fab219;          /* Zustand: Warngrenze verletzt */
    --kritisch: #d03b3b;         /* Zustand: Fehler */
    --kritisch-text: #A92626;
    --hinweis-grund: #FFF3C2;
    --gitter: #e1e4e0;
    --serie-1: #2a78d6;
    --serie-2: #eb6834;
    --serie-3: #1baf7a;
    --serie-4: #eda100;
    --schrift: 'Barlow', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --schrift-zahl: 'Barlow Semi Condensed', 'Barlow', system-ui, sans-serif;
}

@media (prefers-color-scheme: dark) {
    :root {
        color-scheme: dark;
        --grund: #0E1311;
        --flaeche: #18201C;
        --tinte: #ECF0ED;
        --tinte-2: #B9C2BC;
        --tinte-3: #8D9892;
        --linie: rgba(255, 255, 255, 0.10);
        --linie-stark: rgba(255, 255, 255, 0.26);
        --wasser: #3987e5;
        --wasser-bahn: #1B3A60;
        --gut: #0ca30c;
        --warnung: #fab219;
        --kritisch: #d03b3b;
        --kritisch-text: #F29A9A;
        --hinweis-grund: #3A3110;
        --gitter: #29322D;
        --serie-1: #3987e5;
        --serie-2: #d95926;
        --serie-3: #199e70;
        --serie-4: #c98500;
    }
}

/* ---- Grundlagen ---- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--grund);
    color: var(--tinte);
    font: 400 1rem/1.45 var(--schrift);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p { margin: 0; }
h1 { font-size: 1.5rem; font-weight: 600; line-height: 1.2; }
h2 { font-size: 1.125rem; font-weight: 600; line-height: 1.25; }
h3 { font-size: 1rem; font-weight: 600; }
p { max-width: 62ch; }
a { color: inherit; }

:focus-visible { outline: 2px solid var(--tinte); outline-offset: 2px; }

[hidden] { display: none !important; }

.symbol { flex: none; }

.ohne-js { padding: 24px; }

/* ---- Rahmen und Navigation ---- */
.rahmen { min-height: 100dvh; padding-bottom: calc(68px + env(safe-area-inset-bottom)); }

.ansicht { max-width: 1180px; margin: 0 auto; padding: 16px 14px 24px; }

.haupt-nav {
    position: fixed; z-index: 5; left: 0; right: 0; bottom: 0;
    display: flex; justify-content: space-around;
    padding-bottom: env(safe-area-inset-bottom);
    background: var(--flaeche); border-top: 1px solid var(--linie);
}
.nav-name { display: none; }
.nav-eintrag {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
    padding: 9px 4px 8px; border-top: 3px solid transparent;
    color: var(--tinte-2); font-size: 0.75rem; font-weight: 500; text-decoration: none;
}
.nav-eintrag[aria-current] { color: var(--tinte); border-top-color: var(--marke); font-weight: 600; }

@media (min-width: 900px) {
    .rahmen { display: grid; grid-template-columns: 208px minmax(0, 1fr); padding-bottom: 0; }
    .haupt-nav {
        position: sticky; top: 0; bottom: auto; height: 100dvh;
        flex-direction: column; justify-content: flex-start; gap: 2px;
        padding: 20px 12px; border-top: 0; border-right: 1px solid var(--linie);
    }
    .nav-name {
        display: block; align-self: flex-start; margin: 0 0 20px;
        position: relative; padding: 7px 14px 7px 30px; border-radius: 10px;
        background: var(--marke); color: var(--marke-tinte); font-weight: 600; font-size: 1.0625rem;
    }
    .nav-name::before {
        content: ''; position: absolute; left: 11px; top: 50%; width: 9px; height: 9px;
        border-radius: 50%; background: var(--flaeche); transform: translateY(-50%);
    }
    .nav-eintrag {
        flex: none; flex-direction: row; gap: 10px; padding: 10px 12px;
        border-top: 0; border-left: 3px solid transparent; border-radius: 0 8px 8px 0; font-size: 0.9375rem;
    }
    .nav-eintrag[aria-current] { border-left-color: var(--marke); background: var(--grund); }
    .ansicht { padding: 24px 28px 40px; margin: 0; }
}

/* ---- Seitenkopf ---- */
.kopf { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }

.zurueck { display: inline-flex; align-items: center; gap: 2px; margin-bottom: 8px; color: var(--tinte-2); text-decoration: none; font-weight: 500; }

/* Die Dashboards als Marken. Das gewählte sieht aus wie eine Ohrmarke: gelb, mit Loch. */
.marken { display: flex; align-items: center; gap: 2px; min-width: 0; overflow-x: auto; scrollbar-width: none; padding: 2px; margin: -2px; }
.marken::-webkit-scrollbar { display: none; }
.marke {
    position: relative; flex: none; padding: 7px 12px; border-radius: 10px;
    color: var(--tinte-2); font-weight: 500; text-decoration: none; white-space: nowrap;
}
.marke.aktiv { padding-left: 30px; background: var(--marke); color: var(--marke-tinte); font-weight: 600; }
.marke.aktiv::before {
    content: ''; position: absolute; left: 11px; top: 50%; width: 9px; height: 9px;
    border-radius: 50%; background: var(--grund); transform: translateY(-50%);
}

.bearbeiten-leiste { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }

/* ---- Knöpfe ---- */
.knopf {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    min-height: 40px; padding: 0 14px; border: 1px solid var(--linie-stark); border-radius: 8px;
    background: var(--flaeche); color: var(--tinte);
    font: 500 0.9375rem/1 var(--schrift); white-space: nowrap; cursor: pointer;
}
.knopf:disabled { opacity: 0.5; cursor: default; }
.knopf-haupt { background: var(--tinte); border-color: var(--tinte); color: var(--flaeche); }
.knopf-leise { background: transparent; border-color: transparent; }
.knopf-gefahr { color: var(--kritisch-text); border-color: currentColor; }
.knopf-nur-symbol { width: 40px; padding: 0; }
.knopf[aria-pressed='true'] { background: var(--grund); border-color: var(--linie-stark); }

.knopfzeile { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.knopfzeile-links { justify-content: flex-start; margin-top: 10px; }
.knopfzeile + .feld-hilfe { margin-top: 10px; }

/* ---- Formulare ---- */
.feld { display: grid; gap: 4px; margin-bottom: 12px; }
.feld-name { font-size: 0.875rem; font-weight: 500; }
.feld-hilfe { font-size: 0.8125rem; color: var(--tinte-3); margin: -4px 0 12px; }
.feld > .feld-hilfe { margin: 0; }
.feldpaar { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.feldpaar > .feld { min-width: 0; }
.haken-feld { display: flex; align-items: center; gap: 8px; margin: 2px 0 12px; }
.haken-feld input { width: 20px; height: 20px; accent-color: var(--tinte); }

input[type='text'], input[type='password'], select, textarea {
    width: 100%; height: 44px; padding: 0 12px;
    border: 1px solid var(--linie-stark); border-radius: 8px;
    background: var(--flaeche); color: var(--tinte);
    font: 400 1rem var(--schrift);          /* 16 px: so zoomt das iPhone beim Antippen nicht hinein */
}
input::placeholder, textarea::placeholder { color: var(--tinte-3); }
textarea { height: auto; padding: 10px 12px; line-height: 1.4; resize: vertical; }
.tabellen-feld, .formel-feld { font-family: ui-monospace, 'SF Mono', Consolas, monospace; font-size: 0.9375rem; tab-size: 8; }
.token { font-family: ui-monospace, 'SF Mono', Consolas, monospace; font-size: 0.9375rem; }

.formular h3 { margin: 24px 0 4px; }
.ansicht > .feld-hilfe { margin-top: 20px; }

.formular-fehler { margin-top: 12px; color: var(--kritisch-text); font-size: 0.9375rem; font-weight: 500; }

.hinweis-kasten { display: flex; gap: 8px; align-items: flex-start; margin: 12px 0 0; padding: 10px 12px; border-radius: 8px; background: var(--hinweis-grund); font-size: 0.9375rem; }

/* ---- Fenster ---- */
.fenster {
    width: min(480px, calc(100vw - 24px)); max-height: 88dvh; padding: 0;
    border: 0; border-radius: 16px; background: var(--flaeche); color: var(--tinte);
}
.fenster[open] { display: flex; flex-direction: column; }
.fenster::backdrop { background: rgba(10, 16, 13, 0.5); }
.fenster-kopf { display: flex; align-items: center; justify-content: space-between; padding: 8px 8px 8px 16px; border-bottom: 1px solid var(--linie); }
.fenster-inhalt { padding: 16px; overflow-y: auto; }
.fenster-inhalt > p + p, .fenster-inhalt > p + input { margin-top: 10px; }
.fenster-art { margin-bottom: 12px; font-weight: 600; }

@media (max-width: 599px) {
    /* Auf dem Handy kommt das Fenster von unten, dort wo der Daumen ist */
    .fenster { width: 100%; max-width: 100%; margin: auto 0 0; border-radius: 16px 16px 0 0; }
    .fenster-inhalt { padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
}

.art-liste { display: grid; gap: 8px; }
.art-eintrag {
    display: grid; gap: 2px; padding: 12px; text-align: left; cursor: pointer;
    border: 1px solid var(--linie-stark); border-radius: 10px; background: var(--flaeche); color: var(--tinte);
    font: inherit;
}
.art-eintrag span { font-size: 0.8125rem; color: var(--tinte-3); }

/* ---- Listen ---- */
.liste { border: 1px solid var(--linie); border-radius: 12px; background: var(--flaeche); overflow: hidden; }
.zeile { display: flex; align-items: center; gap: 12px; padding: 12px; }
.zeile + .zeile { border-top: 1px solid var(--linie); }
.zeile-link { width: 100%; border-left: 0; border-right: 0; border-bottom: 0; background: none; color: inherit; font: inherit; text-align: left; text-decoration: none; cursor: pointer; }
.liste > .zeile-link:first-child { border-top: 0; }
.zeile-haupt { flex: 1; min-width: 0; display: grid; }
.zeile-haupt strong { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zeile-haupt span { font-size: 0.8125rem; color: var(--tinte-3); }
.zeile-neben { font-size: 0.8125rem; color: var(--tinte-3); white-space: nowrap; }
.zeile-wert { font: 600 1.1875rem/1 var(--schrift-zahl); white-space: nowrap; }

.block { margin-top: 28px; }
.block > h2 { margin-bottom: 10px; }
.block > h3 { margin: 18px 0 4px; }
.block > p { margin-bottom: 10px; color: var(--tinte-2); }
.block > .liste + .formular, .block > .liste + .feld-hilfe { margin-top: 12px; }

.geraet-zustand { display: flex; align-items: center; gap: 8px; color: var(--tinte-2); }

.leer { padding: 28px 0; display: grid; gap: 12px; justify-items: start; }
.leer p { color: var(--tinte-2); }

/* ---- Lampe der An/Aus-Anzeige: gefüllt = an, hohl = aus ---- */
.lampe { flex: none; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--tinte-3); }
.lampe.an { background: var(--tinte); border-color: var(--tinte); }

/* ---- Zustand eines Geräts: jede Stufe hat eine Farbe und eine eigene Form ---- */
.zeichen { flex: none; }
.zeichen-ok .zeichen-form { fill: var(--gut); }
.zeichen-warnung .zeichen-form { fill: var(--warnung); stroke: var(--warnung); stroke-width: 1.5; }
.zeichen-fehler .zeichen-form { fill: var(--kritisch); }
.zeichen-hell { stroke: #fff; }
.zeichen-dunkel { stroke: #1A1600; }
.zeichen-ring { fill: none; stroke: var(--tinte-3); stroke-width: 2.4; }

.zustand-kasten { display: flex; align-items: flex-start; gap: 12px; padding: 12px; border: 1px solid var(--linie); border-radius: 12px; background: var(--flaeche); }
.zustand-kasten > div { display: grid; gap: 2px; min-width: 0; }
.zustand-kasten strong { font-size: 1.0625rem; font-weight: 600; }
.zustand-neben { font-size: 0.8125rem; color: var(--tinte-3); }
.zustand-neben:empty { display: none; }
.zustand-zeilen { margin: 2px 0; padding: 0; list-style: none; font-size: 0.9375rem; color: var(--tinte-2); overflow-wrap: anywhere; }
.zustand-zeilen li + li { margin-top: 2px; }

/* ---- Nicht mehr aktuelle Werte: ausgegraut, mit Hinweis ---- */
.ist-veraltet .wert-zahl, .ist-veraltet .wert-einheit, .ist-veraltet .status-text, .ist-veraltet .balken-prozent, .zeile-wert.ist-veraltet { color: var(--tinte-3); }
.ist-veraltet .wert-zahl, .zeile-wert.ist-veraltet { text-decoration: line-through; text-decoration-thickness: 1.5px; text-decoration-color: var(--tinte-3); }
.ist-veraltet .tank, .ist-veraltet .zeiger, .ist-veraltet .lampe { opacity: 0.35; filter: grayscale(1); }
.kachel-fuss.fuss-veraltet { align-items: flex-start; color: var(--tinte-2); font-weight: 500; }
.kachel-fuss.fuss-veraltet .symbol { color: var(--tinte-2); margin-top: -1px; }

/* ---- Einstellungen am Gerät ---- */
.einstellungen-raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0 12px; }
.haken-liste { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; margin-top: 12px; }

/* ---- Zeitraum der Diagramme ---- */
.zeitraum { display: flex; gap: 6px; margin-bottom: 12px; overflow-x: auto; scrollbar-width: none; padding: 2px; margin-left: -2px; }
.zeitraum::-webkit-scrollbar { display: none; }
.zeitraum-knopf {
    flex: none; min-height: 34px; padding: 0 13px; border: 1px solid var(--linie-stark); border-radius: 999px;
    background: transparent; color: var(--tinte-2); font: 500 0.8125rem var(--schrift); cursor: pointer;
}
.zeitraum-knopf[aria-pressed='true'] { background: var(--tinte); border-color: var(--tinte); color: var(--flaeche); }

/* ---- Raster und Kacheln ---- */
.raster { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 640px) { .raster { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; } }
@media (min-width: 1200px) { .raster { grid-template-columns: repeat(6, minmax(0, 1fr)); } }

.kachel {
    display: flex; flex-direction: column; min-width: 0; padding: 12px;
    border: 1px solid var(--linie); border-radius: 12px; background: var(--flaeche);
}
.kachel.groesse-2 { grid-column: span 2; }
.kachel.groesse-3 { grid-column: 1 / -1; }
.im-bearbeiten .kachel { border-style: dashed; border-color: var(--linie-stark); }

.kachel-titel { margin-bottom: 8px; font-size: 0.875rem; font-weight: 500; line-height: 1.25; color: var(--tinte-2); overflow-wrap: anywhere; }
.kachel-geraet { display: block; font-size: 0.75rem; font-weight: 400; color: var(--tinte-3); }
.kachel-inhalt { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.kachel-inhalt > div { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.kachel-fehlt { font-size: 0.8125rem; color: var(--tinte-3); }

.kachel-fuss { display: flex; align-items: center; gap: 4px; margin-top: auto; padding-top: 10px; font-size: 0.75rem; line-height: 1.2; color: var(--tinte-3); }
.kachel-fuss.fuss-alarm { color: var(--kritisch-text); font-weight: 600; }

.kachel-werkzeuge { display: flex; justify-content: space-between; margin: 10px -8px -8px; padding-top: 4px; border-top: 1px solid var(--linie); }
.kachel-werkzeuge .knopf { width: 36px; min-height: 36px; }

/* Die große Zahl */
.wert-zeile { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 5px; }
.wert-zahl { font: 600 2.125rem/1 var(--schrift-zahl); letter-spacing: -0.01em; }
.wert-einheit { font-size: 1rem; font-weight: 500; color: var(--tinte-2); }

/* Füllstand */
.kachel-inhalt > .k-balken { flex-direction: row; align-items: stretch; gap: 12px; }
.tank { flex: none; align-self: center; }
.tank-wand { fill: var(--wasser-bahn); }
.tank-fuellung { fill: var(--wasser); transition: y 0.5s ease, height 0.5s ease; }
.tank-strich { stroke: var(--flaeche); stroke-width: 2; opacity: 0.75; }
.ist-alarm .tank-fuellung { fill: var(--kritisch); }
.balken-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.balken-text .wert-zahl { font-size: 1.75rem; }
.balken-prozent { margin-top: 4px; font-size: 0.875rem; font-weight: 500; color: var(--tinte-2); }

/* Zeigeranzeige */
.zeiger-bild { position: relative; width: 100%; max-width: 190px; margin: 0 auto; }
.zeiger { display: block; width: 100%; height: auto; }
.zeiger-bahn, .zeiger-stand { fill: none; stroke-width: 11; stroke-linecap: round; }
.zeiger-bahn { stroke: var(--wasser-bahn); }
.zeiger-stand { stroke: var(--wasser); transition: stroke-dasharray 0.5s ease; }
.ist-alarm .zeiger-stand { stroke: var(--kritisch); }
.zeiger-wert { position: absolute; left: 0; right: 0; bottom: -2px; justify-content: center; }
.zeiger-wert .wert-zahl { font-size: 1.625rem; }
.zeiger-wert .wert-einheit { font-size: 0.875rem; }
.zeiger-enden { display: flex; justify-content: space-between; width: 100%; max-width: 190px; margin: 2px auto 0; padding: 0 2px; font-size: 0.75rem; color: var(--tinte-3); font-variant-numeric: tabular-nums; }

/* Status und Schalter */
.status-zeile { display: flex; align-items: center; gap: 10px; min-height: 34px; }
.k-geraet .zustand-zeilen { margin: 4px 0 2px; font-size: 0.875rem; }
.status-text { font-size: 1.375rem; font-weight: 600; line-height: 1.1; overflow-wrap: anywhere; }

.schalter { flex: none; position: relative; width: 54px; height: 32px; padding: 0; border: 0; border-radius: 16px; background: var(--tinte-3); cursor: pointer; transition: background 0.15s; }
.schalter-knauf { position: absolute; top: 4px; left: 4px; width: 24px; height: 24px; border-radius: 50%; background: var(--flaeche); transition: transform 0.15s, background 0.15s; }
.schalter[aria-checked='true'] { background: var(--tinte); }
.schalter[aria-checked='true'] .schalter-knauf { transform: translateX(22px); background: var(--marke); }
.schalter:disabled { opacity: 0.6; }

/* Gerätestatus */
.geraet-zeilen { margin-top: 6px; font-size: 0.875rem; color: var(--tinte-2); }
.k-geraet .knopf { align-self: flex-start; margin-top: 12px; }

/* ---- Verlaufsdiagramm ---- */
.verlauf-halter { height: 210px; transition: opacity 0.2s; }
.groesse-1 .verlauf-halter { height: 150px; }
.verlauf-halter.laedt { opacity: 0.5; }
.verlauf { display: flex; flex-direction: column; }
.verlauf-legende { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-bottom: 6px; font-size: 0.8125rem; color: var(--tinte-2); }
.verlauf-legende-eintrag { display: inline-flex; align-items: center; gap: 6px; }
.verlauf-schluessel { flex: none; display: inline-block; width: 14px; height: 3px; border-radius: 2px; }
.verlauf-flaeche { position: relative; flex: 1; min-height: 0; }
.verlauf-flaeche svg { display: block; touch-action: pan-y; outline-offset: 0; }
.verlauf-leer { padding-top: 40px; text-align: center; color: var(--tinte-3); font-size: 0.875rem; max-width: none; }

.verlauf-gitter { stroke: var(--gitter); stroke-width: 1; }
.verlauf-achse { fill: var(--tinte-3); font: 400 11px var(--schrift); font-variant-numeric: tabular-nums; }
.verlauf-faden { stroke: var(--tinte-3); stroke-width: 1; }
.verlauf-linie { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.verlauf-spanne { stroke: none; opacity: 0.12; }
.verlauf-ende, .verlauf-punkt { stroke: var(--flaeche); stroke-width: 2; }

.verlauf-linie.serie-1 { stroke: var(--serie-1); }
.verlauf-linie.serie-2 { stroke: var(--serie-2); }
.verlauf-linie.serie-3 { stroke: var(--serie-3); }
.verlauf-linie.serie-4 { stroke: var(--serie-4); }
.verlauf-spanne.serie-1, .verlauf-ende.serie-1, .verlauf-punkt.serie-1 { fill: var(--serie-1); }
.verlauf-spanne.serie-2, .verlauf-ende.serie-2, .verlauf-punkt.serie-2 { fill: var(--serie-2); }
.verlauf-spanne.serie-3, .verlauf-ende.serie-3, .verlauf-punkt.serie-3 { fill: var(--serie-3); }
.verlauf-spanne.serie-4, .verlauf-ende.serie-4, .verlauf-punkt.serie-4 { fill: var(--serie-4); }
.serie-bg-1 { background: var(--serie-1); }
.serie-bg-2 { background: var(--serie-2); }
.serie-bg-3 { background: var(--serie-3); }
.serie-bg-4 { background: var(--serie-4); }

.verlauf-tipp {
    position: absolute; top: 2px; z-index: 2; pointer-events: none;
    padding: 6px 9px; border: 1px solid var(--linie-stark); border-radius: 8px; background: var(--flaeche);
    font-size: 0.8125rem; line-height: 1.35; white-space: nowrap;
}
.verlauf-tipp-zeit { color: var(--tinte-3); }
.verlauf-tipp-zeile { display: flex; align-items: center; gap: 6px; }
.verlauf-tipp-zeile span:last-child { color: var(--tinte-2); }

.verlauf-fuss { display: flex; justify-content: flex-end; margin: 4px -6px -6px 0; }
.verlauf-fuss .knopf { min-height: 34px; font-size: 0.8125rem; color: var(--tinte-2); }
.verlauf-tabelle { max-height: 260px; margin-top: 10px; overflow: auto; border-top: 1px solid var(--linie); }
.verlauf-tabelle table { width: 100%; border-collapse: collapse; font-size: 0.8125rem; font-variant-numeric: tabular-nums; }
.verlauf-tabelle th, .verlauf-tabelle td { padding: 5px 8px 5px 0; text-align: right; white-space: nowrap; }
.verlauf-tabelle th:first-child, .verlauf-tabelle td:first-child { text-align: left; }
.verlauf-tabelle th { position: sticky; top: 0; background: var(--flaeche); font-weight: 500; color: var(--tinte-2); }
.verlauf-tabelle tbody tr { border-top: 1px solid var(--linie); }

/* ---- Rückmeldung am unteren Rand ---- */
.meldung {
    position: fixed; z-index: 20; left: 50%; bottom: calc(80px + env(safe-area-inset-bottom));
    max-width: calc(100vw - 32px); padding: 10px 16px; border-radius: 10px;
    background: var(--tinte); color: var(--flaeche); font-weight: 500; font-size: 0.9375rem;
    transform: translate(-50%, 8px); opacity: 0; pointer-events: none; transition: opacity 0.15s, transform 0.15s;
}
.meldung.sichtbar { opacity: 1; transform: translate(-50%, 0); }
.meldung-fehler { background: var(--kritisch); color: #fff; }
@media (min-width: 900px) { .meldung { bottom: 28px; } }

/* ---- Anmeldung ---- */
.anmeldung { min-height: 100dvh; display: grid; align-content: center; justify-content: center; grid-template-columns: min(340px, 100%); gap: 22px; padding: 24px; }
.wortmarke { font-size: 1.375rem; line-height: 1.15; }
.wortmarke .marke { display: inline-block; padding: 10px 18px 10px 36px; }
.wortmarke small { display: block; font-size: 0.9375rem; font-weight: 500; }
.wortmarke .marke::before { left: 13px; width: 10px; height: 10px; }
.anmeldung .knopf-haupt { width: 100%; min-height: 46px; margin-top: 4px; }

/* ---- Wer Bewegung am Gerät reduziert hat, bekommt keine ---- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; }
}

/* ---- Umrechnung in Liter ---- */
.block-erster { margin-top: 8px; }
.tabellen-hinweis .hinweis-kasten { margin: 0 0 8px; }

/* Tankformen zum Antippen. Das Bild zeigt, welche Maße gemeint sind. */
.tank-wahl { display: grid; grid-template-columns: repeat(auto-fill, minmax(138px, 1fr)); gap: 8px; margin-bottom: 16px; }
.tank-kachel {
    display: grid; justify-items: center; gap: 0; padding: 8px 6px 10px;
    border: 1px solid var(--linie-stark); border-radius: 12px; background: var(--flaeche);
    color: var(--tinte); font: inherit; text-align: center; cursor: pointer;
}
.tank-kachel strong { font-weight: 600; font-size: 0.9375rem; }
.tank-kachel span { font-size: 0.8125rem; color: var(--tinte-3); }
.tank-kachel[aria-checked='true'] { border-color: var(--tinte); box-shadow: inset 0 0 0 1px var(--tinte), inset 0 -5px 0 var(--marke); }
.tankbild { width: 100%; max-width: 170px; height: auto; }
.tb-wand { fill: none; stroke: var(--tinte); stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
.tb-wand:not(.tb-leer):is(ellipse) { fill: var(--flaeche); }
.tb-wasser { fill: var(--wasser-bahn); }
.tb-kante { fill: none; stroke: var(--wasser); stroke-width: 1.2; }
.tb-mass { fill: none; stroke: var(--tinte-3); stroke-width: 1; }
.tb-buchstabe { fill: var(--tinte); font: 600 13px var(--schrift); }
.tb-formel { fill: var(--tinte); font: 600 20px var(--schrift); }

.tank-masse { display: grid; gap: 4px 20px; align-items: start; }
.tank-masse > .tankbild { max-width: 230px; justify-self: center; }
@media (min-width: 620px) { .tank-masse { grid-template-columns: 230px 1fr; } }
.ist-errechnet { border-style: dashed; background: var(--grund); }
.einstellungen-raster .feld-hilfe { margin: 0; min-height: 1.1em; }

.probe { padding: 12px 14px; border: 1px solid var(--linie); border-radius: 12px; background: var(--flaeche); display: grid; gap: 6px; }
.probe-zeile { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.probe-zeile span { color: var(--tinte-2); }
.probe-zeile strong { font: 600 1.0625rem var(--schrift-zahl); text-align: right; }
.probe-offen { color: var(--tinte-2); }
.probe-tabelle { width: 100%; margin-top: 6px; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.probe-tabelle th { font-weight: 500; font-size: 0.8125rem; color: var(--tinte-3); text-align: right; padding: 4px 0; border-bottom: 1px solid var(--linie); }
.probe-tabelle td { text-align: right; padding: 4px 0; border-bottom: 1px solid var(--linie); }
.probe-tabelle tr:last-child td { border-bottom: 0; }
a.knopf { text-decoration: none; }
.einstellungen-raster { align-items: start; }
.probe { max-width: 560px; }
