/* Zähler-App Areal Gnaier – Gestaltung. Keine externen Schriften (DSGVO): Systemschrift. */
:root {
  --blau: #1d3557;
  --blau-hell: #e8eef6;
  --akzent: #2f7a4f;
  --akzent-hell: #e3f2e8;
  --orange: #b85c00;
  --orange-hell: #fff1e0;
  --rot: #b3261e;
  --rot-hell: #fbeaea;
  --text: #1b1b1b;
  --grau: #6b6f73;
  --grau-hell: #c9ced3;
  --linie: #dde1e5;
  --flaeche: #f4f5f7;
  --karte: #ffffff;
  --radius: 14px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--flaeche); color: var(--text);
  font: 17px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  padding-bottom: calc(90px + env(safe-area-inset-bottom));
}
button, input, textarea { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

/* Kopf */
.kopf { position: sticky; top: 0; z-index: 5; background: var(--blau); color: #fff;
  padding-top: env(safe-area-inset-top); box-shadow: 0 1px 6px rgba(0,0,0,.15); }
.kopf-innen { display: flex; justify-content: space-between; align-items: center; gap: 8px;
  max-width: 760px; margin: 0 auto; padding: 12px 16px 8px; }
.kopf-text { min-width: 0; }
.kopf-titel { font-size: 22px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kopf-unter { font-size: 13px; opacity: .8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kopf-aktionen { display: flex; gap: 6px; flex: none; }
.knopf-flach { background: rgba(255,255,255,.12); color: #fff; border: 0; border-radius: 10px;
  padding: 8px 12px; font-size: 15px; min-height: 40px; }
.knopf-flach:active { background: rgba(255,255,255,.25); }

.tabs { display: flex; max-width: 760px; margin: 0 auto; padding: 0 8px; }
.tabs a { flex: 1; text-align: center; color: rgba(255,255,255,.75); text-decoration: none; padding: 10px 8px 12px;
  font-weight: 600; border-bottom: 3px solid transparent; }
.tabs a[aria-current="page"] { color: #fff; border-bottom-color: #fff; }
.tabs .zahl:not(:empty) { background: var(--orange); color: #fff; border-radius: 999px; padding: 0 7px; margin-left: 4px; font-size: 13px; }

.warteschlange { display: block; width: 100%; border: 0; background: var(--orange-hell); color: var(--orange);
  font-weight: 600; padding: 10px 16px; text-align: center; }
.warteschlange.fehler { background: var(--rot-hell); color: var(--rot); }
.offline { background: #3a3f45; color: #fff; text-align: center; font-size: 14px; padding: 6px 12px; }

main { max-width: 760px; margin: 0 auto; padding: 8px 12px; }

/* Karten, Formulare */
.karte { background: var(--karte); border-radius: var(--radius); padding: 16px; margin: 12px 0;
  box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.anmeldung { margin-top: 24px; }
.anmeldung h1 { margin: 0 0 12px; font-size: 22px; }
label { display: block; margin: 12px 0; font-size: 15px; color: var(--grau); }
input, textarea { display: block; width: 100%; margin-top: 4px; padding: 12px;
  border: 1px solid var(--linie); border-radius: 10px; background: #fff; color: var(--text); }
textarea { min-height: 70px; resize: vertical; }
.knopf-haupt { display: block; width: 100%; background: var(--akzent); color: #fff; border: 0; border-radius: 12px;
  padding: 14px; font-weight: 700; font-size: 18px; margin-top: 10px; min-height: 56px; }
.knopf-haupt:disabled { opacity: .55; }
.knopf-zweit { display: block; width: 100%; background: var(--blau-hell); color: var(--blau); border: 0; border-radius: 12px;
  padding: 12px; font-weight: 600; margin-top: 10px; min-height: 50px; }
.knopf-klein { background: none; border: 1px solid var(--linie); border-radius: 10px; padding: 8px 12px;
  color: var(--blau); font-size: 15px; min-height: 40px; }
.fehler { color: var(--rot); min-height: 1.4em; margin: 10px 0 0; }
.hinweis { text-align: center; color: var(--grau); font-size: 13px; }

/* Rundgang */
.fortschritt { margin: 14px 4px 6px; }
.fortschritt-zeile { display: flex; justify-content: space-between; font-weight: 600; }
.balken { height: 10px; background: var(--grau-hell); border-radius: 999px; overflow: hidden; margin-top: 6px; }
.balken > div { height: 100%; background: var(--akzent); }
.abschnitt { margin: 20px 4px 8px; font-size: 14px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .04em; color: var(--grau); display: flex; justify-content: space-between; }
.zeile { display: flex; gap: 12px; align-items: center; width: 100%; text-align: left; color: inherit;
  background: var(--karte); border: 0; border-radius: var(--radius); padding: 12px; margin: 8px 0;
  box-shadow: 0 1px 3px rgba(0,0,0,.06); min-height: 64px; }
.zeile:active { background: var(--blau-hell); }
.punkt { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  border: 2px solid var(--grau-hell); color: transparent; font-weight: 700; }
.punkt.fertig { background: var(--akzent); border-color: var(--akzent); color: #fff; }
.punkt.wartet { background: var(--orange-hell); border-color: var(--orange); color: var(--orange); }
.zeile-text { flex: 1; min-width: 0; }
.zeile-titel { font-weight: 600; overflow-wrap: anywhere; }
.code { font-family: ui-monospace, Menlo, monospace; font-weight: 700; margin-right: 6px; }
.meta { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 3px; font-size: 14px; color: var(--grau); }
.etikett { border-radius: 6px; padding: 1px 7px; font-size: 13px; font-weight: 700; }
.etikett.strom { background: #fff4d6; color: #7a5600; }
.etikett.wasser { background: #e2efff; color: #1a4f8f; }
.etikett.gas { background: #fde7e5; color: #8f2318; }
.etikett.pv_einspeisung { background: #e3f2e8; color: #1f5a37; }
.etikett.warnung { background: var(--orange-hell); color: var(--orange); }
.pfeil { color: var(--grau); font-size: 22px; }

/* Zählerseite */
.zurueck { background: none; border: 0; color: var(--blau); font-weight: 600; padding: 10px 4px; font-size: 16px; }
.zaehler-kopf h1 { margin: 0; font-size: 26px; }
.zaehler-kopf .bez { font-size: 18px; font-weight: 600; margin-top: 2px; }
.zaehler-kopf .meta { font-size: 15px; }
.foto-knopf { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 64px;
  background: var(--blau); color: #fff; border-radius: 12px; font-weight: 700; font-size: 18px; margin: 0; cursor: pointer; }
.foto-knopf input { display: none; }
.vorschau { display: block; width: 100%; max-height: 320px; object-fit: contain; border-radius: 12px; margin-top: 10px; background: #000; }
.stand-feld { font-size: 34px; font-weight: 700; text-align: right; padding: 14px 16px;
  font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.echo { text-align: right; color: var(--grau); font-size: 15px; margin-top: 4px; min-height: 1.3em; }
.pruefung { border-radius: 12px; padding: 12px 14px; margin-top: 12px; background: var(--blau-hell); font-size: 15px; }
.pruefung p { margin: 4px 0; }
.pruefung.warnung { background: var(--orange-hell); color: #6b3500; }
.pruefung.alarm { background: var(--rot-hell); color: var(--rot); }
.pruefung strong { font-weight: 700; }
.klein { font-size: 13px; color: var(--grau); }
.ergebnis { border-left: 5px solid var(--akzent); }

/* Verlauf */
.verlauf { list-style: none; margin: 0; padding: 0; }
.verlauf li { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--linie); }
.verlauf li:first-child { border-top: 0; }
.daumen { flex: none; width: 64px; height: 64px; border-radius: 8px; object-fit: cover; background: var(--flaeche); border: 0; padding: 0; }
.daumen-leer { flex: none; width: 64px; height: 64px; border-radius: 8px; background: var(--flaeche);
  display: grid; place-items: center; color: var(--grau); font-size: 12px; text-align: center; }
.verlauf .wert { font-weight: 700; font-variant-numeric: tabular-nums; }

/* Hinweise */
.hinweis-karte { border-left: 5px solid var(--orange); }
.hinweis-karte.stand_kleiner, .hinweis-karte.pv_minderleistung, .hinweis-karte.nachttest { border-left-color: var(--rot); }
.hinweis-karte.nicht_abgelesen { border-left-color: var(--grau-hell); }
.hinweis-karte p { margin: 6px 0 10px; overflow-wrap: anywhere; }
.leer { text-align: center; color: var(--grau); padding: 40px 12px; }
.leer strong { display: block; color: var(--text); font-size: 20px; margin-bottom: 6px; }
.stoerung { background: var(--rot-hell); color: var(--rot); border-radius: var(--radius); padding: 12px 14px; margin: 12px 0; }

/* Großansicht Foto */
.bild-gross { position: fixed; inset: 0; z-index: 20; background: rgba(0,0,0,.92); display: flex; flex-direction: column;
  padding: calc(12px + env(safe-area-inset-top)) 12px calc(12px + env(safe-area-inset-bottom)); }
.bild-gross img { flex: 1; min-height: 0; width: 100%; object-fit: contain; }

/* Meldung unten */
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(18px + env(safe-area-inset-bottom));
  background: #222; color: #fff; border-radius: 12px; padding: 12px 12px 12px 16px; display: flex; gap: 12px;
  align-items: center; max-width: calc(100% - 24px); width: 520px; box-shadow: 0 4px 18px rgba(0,0,0,.25); z-index: 10; }
.toast span { flex: 1; }
.toast-knopf { background: none; border: 0; color: #9ee2b6; font-weight: 700; padding: 8px; min-height: 40px; }

@media (prefers-color-scheme: dark) {
  :root { --flaeche: #121417; --karte: #1d2024; --text: #eceef0; --grau: #a3a9af; --grau-hell: #4a5057; --linie: #34393f;
          --blau-hell: #1f2a3a; --akzent-hell: #1f3328; --orange-hell: #3a2a17; --rot-hell: #3a1d1b; color-scheme: dark; }
  input, textarea { background: #15181b; color: var(--text); }
  .knopf-zweit, .zurueck, .knopf-klein { color: #a9c5ee; }
  .pruefung.warnung { color: #ffd6a8; }
  .etikett.strom { background: #3a3014; color: #f3d27a; }
  .etikett.wasser { background: #16263d; color: #a9c9f5; }
  .etikett.gas { background: #3a1a17; color: #f3a69c; }
  .etikett.pv_einspeisung { background: #1a3324; color: #a7dcb9; }
}
