/* Susis Saftladen: Handy zuerst.
   Grundsaetze: grosse Tippflaechen (nichts unter 48 Pixel), wenig auf einem Bildschirm,
   Zahlen gross und in Tabellenziffern, damit Spalten untereinander stehen.
   Die Farbe kommt vom Namen: Saft, also Bernstein auf warmem Grau. */

:root {
    color-scheme: light;
    --grund: #faf7f2;
    --karte: #ffffff;
    --rand: #e6ded2;
    --text: #241f1a;
    --leise: #766c60;
    --akzent: #d9730d;
    --akzent-dunkel: #b45c05;
    --akzent-leise: #fdf1e3;
    --gut: #2b7a48;
    --gut-leise: #eaf6ee;
    --warn: #a8410a;
    --warn-leise: #fdefe6;
    --r: 14px;
    --schatten: 0 1px 2px rgba(36, 31, 26, .06), 0 4px 14px rgba(36, 31, 26, .05);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--grund);
    color: var(--text);
    font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    -webkit-text-size-adjust: 100%;
}

.huelle { max-width: 640px; margin: 0 auto; padding: 0 16px 96px; }

/* ── Kopf ─────────────────────────────────────────────────────────────── */
header.kopf {
    position: sticky; top: 0; z-index: 20;
    background: var(--grund);
    border-bottom: 1px solid var(--rand);
    padding: 12px 0 10px;
    margin-bottom: 18px;
}
.kopf-innen {
    max-width: 640px; margin: 0 auto; padding: 0 16px;
    display: flex; align-items: center; gap: 10px;
}
.marke { font-weight: 700; font-size: 1.05rem; letter-spacing: -.01em; text-decoration: none; color: var(--text); }
.marke span { color: var(--akzent); }
.kopf-rest { margin-left: auto; display: flex; gap: 6px; }

/* ── Karten ───────────────────────────────────────────────────────────── */
.karte {
    background: var(--karte);
    border: 1px solid var(--rand);
    border-radius: var(--r);
    padding: 16px;
    margin-bottom: 14px;
    box-shadow: var(--schatten);
}
.karte h2 { margin: 0 0 12px; font-size: 1rem; letter-spacing: .02em; text-transform: uppercase; color: var(--leise); }
h1 { font-size: 1.5rem; margin: 0 0 16px; letter-spacing: -.02em; text-wrap: balance; }

/* ── Tasten ───────────────────────────────────────────────────────────── */
.taste, button.taste, a.taste {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    width: 100%; min-height: 56px; padding: 14px 18px;
    border: 1px solid var(--rand); border-radius: var(--r);
    background: var(--karte); color: var(--text);
    font: inherit; font-weight: 600; text-decoration: none; text-align: center;
    cursor: pointer;
}
.taste:active { transform: translateY(1px); }
.taste.gross { min-height: 84px; font-size: 1.2rem; }
.taste.haupt { background: var(--akzent); border-color: var(--akzent); color: #fff; }
.taste.haupt:hover { background: var(--akzent-dunkel); }
.taste.still { min-height: 44px; font-weight: 500; color: var(--leise); }
.taste.gefahr { color: #a01b1b; border-color: #f0d5d5; background: #fdf3f3; }
.taste + .taste { margin-top: 10px; }
.tastenreihe { display: flex; gap: 10px; }
.tastenreihe .taste + .taste { margin-top: 0; }

/* ── Formulare ────────────────────────────────────────────────────────── */
label { display: block; font-weight: 600; margin: 0 0 6px; font-size: .92rem; }
.hint { color: var(--leise); font-weight: 400; font-size: .85rem; display: block; margin-top: 2px; }
input[type=text], input[type=number], input[type=password],
input[type=date], input[type=datetime-local], select, textarea {
    width: 100%; min-height: 52px; padding: 12px 14px;
    border: 1px solid var(--rand); border-radius: 10px;
    background: var(--karte); color: var(--text);
    font: inherit; font-variant-numeric: tabular-nums;
}
input:focus-visible, select:focus-visible, textarea:focus-visible, .taste:focus-visible {
    outline: 3px solid var(--akzent); outline-offset: 2px;
}
textarea { min-height: 76px; resize: vertical; }
.feld { margin-bottom: 14px; }
.paar { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* Prozentfelder: gross, weil das die wichtigste Eingabe ist */
input.prozent { font-size: 2rem; font-weight: 700; text-align: center; min-height: 76px; }

/* Auswahl der Ladeorte als antippbare Kacheln statt Aufklappliste */
.wahl { display: grid; gap: 8px; }
.wahl label {
    display: flex; align-items: center; gap: 12px; margin: 0;
    padding: 14px; min-height: 56px;
    border: 1px solid var(--rand); border-radius: 10px; background: var(--karte);
    font-weight: 500; cursor: pointer;
}
.wahl input { position: absolute; opacity: 0; pointer-events: none; }
.wahl label:has(input:checked) {
    border-color: var(--akzent); background: var(--akzent-leise); font-weight: 600;
    box-shadow: inset 0 0 0 1px var(--akzent);
}
.wahl .nebensache { margin-left: auto; color: var(--leise); font-size: .85rem; font-weight: 400; }

/* ── Zahlen zeigen ────────────────────────────────────────────────────── */
.zahlen { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.zahl { padding: 12px 14px; border-radius: 10px; background: var(--grund); border: 1px solid var(--rand); }
.zahl .wert { font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.zahl .was { color: var(--leise); font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; }
.zahl.betont { background: var(--akzent-leise); border-color: #f3ddc2; }
.zahl.betont .wert { color: var(--akzent-dunkel); }

/* ── Liste ────────────────────────────────────────────────────────────── */
.eintrag {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 16px; border-bottom: 1px solid var(--rand);
    text-decoration: none; color: inherit;
}
.eintrag:last-child { border-bottom: 0; }
.eintrag:active { background: var(--grund); }
.eintrag .haupt { min-width: 0; }
.eintrag .wo { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.eintrag .wann { color: var(--leise); font-size: .85rem; }
.eintrag .rechts { margin-left: auto; text-align: right; white-space: nowrap; }
.eintrag .rechts .kwh { font-weight: 700; font-variant-numeric: tabular-nums; }
.eintrag .rechts .geld { color: var(--leise); font-size: .85rem; font-variant-numeric: tabular-nums; }
.karte.blank { padding: 0; overflow: hidden; }

/* ── Marken ───────────────────────────────────────────────────────────── */
.marker {
    display: inline-block; padding: 2px 8px; border-radius: 999px;
    font-size: .75rem; font-weight: 600; letter-spacing: .02em;
    background: var(--grund); border: 1px solid var(--rand); color: var(--leise);
}
.marker.geschaetzt { background: var(--warn-leise); border-color: #f3d8c6; color: var(--warn); }
.marker.gemessen { background: var(--gut-leise); border-color: #cfe7d8; color: var(--gut); }
.marker.laeuft { background: var(--akzent); border-color: var(--akzent); color: #fff; }

/* ── Meldungen ────────────────────────────────────────────────────────── */
.meldung { padding: 12px 14px; border-radius: 10px; margin-bottom: 14px; font-weight: 500; }
.meldung.gut { background: var(--gut-leise); border: 1px solid #cfe7d8; color: var(--gut); }
.meldung.fehler { background: #fdeaea; border: 1px solid #f2cfcf; color: #a01b1b; }
.meldung.warn { background: var(--warn-leise); border: 1px solid #f3d8c6; color: var(--warn); }

/* ── Fusszeile mit den Hauptwegen ─────────────────────────────────────── */
nav.fuss {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    display: flex; background: var(--karte); border-top: 1px solid var(--rand);
    padding-bottom: env(safe-area-inset-bottom, 0);
}
nav.fuss a {
    flex: 1; text-align: center; padding: 12px 4px 14px;
    text-decoration: none; color: var(--leise); font-size: .78rem; font-weight: 600;
}
nav.fuss a.hier { color: var(--akzent); box-shadow: inset 0 2px 0 var(--akzent); }
nav.fuss a .zeichen { display: block; font-size: 1.25rem; line-height: 1.3; }

table.daten { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
table.daten th, table.daten td { padding: 8px 6px; text-align: left; border-bottom: 1px solid var(--rand); font-size: .9rem; }
table.daten th { color: var(--leise); font-weight: 600; font-size: .78rem; text-transform: uppercase; }
table.daten td.zahl-r, table.daten th.zahl-r { text-align: right; }
.rollt { overflow-x: auto; }

.leer { text-align: center; color: var(--leise); padding: 28px 12px; }
.klein { font-size: .85rem; color: var(--leise); }
hr.trenn { border: 0; border-top: 1px solid var(--rand); margin: 18px 0; }

@media (min-width: 560px) {
    .zahlen { grid-template-columns: repeat(4, 1fr); }
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        color-scheme: dark;
        --grund: #171512;
        --karte: #201d19;
        --rand: #362f27;
        --text: #f0ebe4;
        --leise: #a2988a;
        --akzent: #f08c2e;
        --akzent-dunkel: #d9730d;
        --akzent-leise: #2e2318;
        --gut: #6ac48a;
        --gut-leise: #1b2b20;
        --warn: #e8a06a;
        --warn-leise: #2e2318;
        --schatten: 0 1px 2px rgba(0, 0, 0, .3);
    }
    :root:not([data-theme="light"]) .taste.haupt { color: #171512; }
    :root:not([data-theme="light"]) .taste.gefahr { color: #f0a0a0; border-color: #4a2b2b; background: #2a1c1c; }
    :root:not([data-theme="light"]) .meldung.fehler { background: #2a1c1c; border-color: #4a2b2b; color: #f0a0a0; }
    :root:not([data-theme="light"]) nav.fuss a.hier { color: var(--akzent); }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation: none !important; }
}
