/* Erfassung im Objekt. Ein Daumen, eine Hand, schlechtes Licht im Keller:
   grosse Flaechen, kraeftiger Kontrast, nichts Kleines zum Zielen. */

:root {
  --rot: #821535;
  --dunkel: #5A0E24;
  --hell: #FBF5F0;
  --text: #2A1A1A;
  --linie: #C9BDB4;
  --gruen: #2E7D32;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
  margin: 0;
  font: 17px/1.45 -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: #fff;
  padding-bottom: env(safe-area-inset-bottom);
}

header {
  position: sticky; top: 0; z-index: 10;
  background: #fff; border-bottom: 1px solid var(--linie);
  padding-top: env(safe-area-inset-top);
}

.kopf {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 14px 6px; font-weight: 600; color: var(--dunkel);
}

.puffer {
  font-size: 13px; font-weight: 400; color: #fff; background: var(--rot);
  border-radius: 10px; padding: 2px 9px;
}

/* Der Fortschritt ist oben sichtbar, und jeder Schritt bleibt erreichbar —
   auch ein abgeschlossener. Es gibt keinen Punkt, hinter den man nicht
   zurueckkann. */
nav { display: flex; overflow-x: auto; gap: 6px; padding: 0 10px 10px; }
/* `display: flex` schlaegt sonst das hidden-Attribut — die Schrittleiste stand
   noch da, wo es gar keinen Durchgang gibt. */
nav[hidden] { display: none; }

/* Wer angemeldet ist, und der Weg hinaus — in beiden Flaechen sichtbar. Ein
   Abmelden-Knopf ohne Namen daneben beantwortet die halbe Frage. */
.wer {
  display: flex; justify-content: space-between; align-items: center;
  gap: 10px; padding: 0 14px 8px; font-size: 13px; color: #7A6A62;
}
.wer a { color: var(--dunkel); }
.wer button {
  border: 1px solid var(--linie); background: #fff; color: var(--dunkel);
  border-radius: 8px; padding: 5px 12px; font-size: 13px; font-family: inherit;
}
nav button {
  flex: 0 0 auto; border: 1px solid var(--linie); background: #fff;
  color: var(--dunkel); border-radius: 18px; padding: 8px 14px;
  font-size: 14px; font-family: inherit;
}
nav button[aria-current="true"] { background: var(--rot); color: #fff; border-color: var(--rot); }
nav button.fertig { border-color: var(--gruen); color: var(--gruen); }
/* **Angewaehlt schlaegt fertig.** `.fertig` steht hier nach der Regel fuer die
   aktive Pille und setzte deren Schriftfarbe zurueck: gruen auf Weinrot, kaum
   zu lesen. Gefunden im Durchlauf am 03.09.2026 an „3.2 Baulicher Brandschutz
   ✓". Ausdruecklich statt ueber die Reihenfolge — die verschiebt sich beim
   naechsten Einschub wieder. */
nav button.fertig[aria-current="true"] { color: #fff; border-color: var(--rot); }

main { padding: 14px 14px 90px; }
h2 { color: var(--rot); font-size: 21px; margin: 4px 0 10px; }
h3 { color: var(--dunkel); font-size: 16px; margin: 22px 0 8px; }
.leise { color: #7A6A62; font-size: 14px; margin: 0 0 12px; }

input, textarea, select, button {
  font-family: inherit; font-size: 17px;
}
input, textarea, select {
  width: 100%; padding: 11px 12px; border: 1px solid var(--linie);
  border-radius: 10px; background: #fff; margin-bottom: 10px;
}
textarea { resize: vertical; }

button.haupt {
  width: 100%; background: var(--rot); color: #fff; border: 0;
  border-radius: 12px; padding: 15px; font-weight: 600; margin-bottom: 14px;
}
#freigeben {
  width: 100%; background: #fff; color: var(--rot); border: 2px solid var(--rot);
  border-radius: 12px; padding: 15px; font-weight: 600;
}

/* Ein Feld im Gespraech: Beschriftung darueber, Wert direkt daneben aenderbar.
   Geaenderte Werte bleiben sichtbar markiert. */
.feld { border-bottom: 1px solid var(--linie); padding: 10px 0; }
.feld label { display: block; font-size: 13px; color: #7A6A62; margin-bottom: 3px; }
.feld input { margin: 0; border: 0; border-radius: 0; padding: 4px 0; }
.feld.geaendert { border-left: 3px solid var(--rot); padding-left: 9px; }
.feld.geaendert label::after { content: " · geändert"; color: var(--rot); }

.zeile {
  border: 1px solid var(--linie); border-radius: 12px;
  padding: 12px 14px; margin-bottom: 8px; background: #fff;
}
.zeile .name { font-weight: 600; }
.zeile .wert { color: var(--dunkel); font-size: 15px; margin-top: 4px; }
.zeile .wert.leer { color: #A08F86; }
.zeile.vorjahr { border-left: 3px solid var(--linie); }
.zeile.erledigt { border-left: 3px solid var(--gruen); }
.zeile.offen { border-left: 3px solid var(--rot); }

.wahl { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.wahl button {
  flex: 1 1 auto; border: 1px solid var(--linie); background: var(--hell);
  border-radius: 10px; padding: 10px; font-size: 14px; color: var(--dunkel);
}
.wahl button[aria-pressed="true"] { background: var(--rot); color: #fff; border-color: var(--rot); }

.marke {
  display: inline-block; background: var(--rot); color: #fff; font-weight: 700;
  border-radius: 5px; padding: 1px 7px; font-size: 13px; margin-right: 6px;
}
.marke.gering { background: #EFE2D8; color: var(--dunkel); }

.baustein {
  border: 1px solid var(--linie); border-radius: 12px; padding: 12px 14px;
  margin-bottom: 8px;
}
.baustein .zahl { float: right; color: #7A6A62; font-size: 13px; }
/* Was sich von selbst ergibt, sieht anders aus als das, was man sucht. */
.baustein.vorschlag { border-color: var(--rot); background: var(--hell); }

.fotos { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; align-items: center; }
.fotos img { width: 76px; height: 76px; object-fit: cover; border-radius: 8px;
             border: 1px solid var(--linie); background: var(--hell); }
.fotoknopf {
  border: 1px dashed var(--linie); border-radius: 8px; width: 76px; height: 76px;
  background: var(--hell); color: var(--dunkel); font-size: 14px;
  font-family: inherit;
}

/* Was im Text noch offen steht, wird im Objekt gefragt — nicht im Bericht.
   Ein ungefuellter Platzhalter erreicht die Freigabe nicht. */
.offen:not(:empty) {
  margin-top: 10px; border-left: 3px solid var(--rot); background: var(--hell);
  border-radius: 8px; padding: 9px 11px;
}
.offen .warnung { color: var(--rot); font-weight: 600; margin: 0 0 6px; }
.offen .stelle { margin-bottom: 8px; }
.offen .stelle .klein { color: #7A6A62; font-size: 13px; margin-bottom: 4px; }
.offen textarea {
  width: 100%; padding: 8px; border: 1px solid var(--linie); border-radius: 8px;
  font-size: 14px; font-family: inherit; box-sizing: border-box;
}
.offen .knopfreihe { display: flex; gap: 8px; margin-top: 6px; }
.offen .knopfreihe button {
  border: 1px solid var(--linie); background: #fff; color: var(--dunkel);
  border-radius: 8px; padding: 7px 13px; font-size: 13px; font-family: inherit;
}

/* Ein Eintrag laesst sich zuruecknehmen — im Objekt, ohne Begruendung. Der
   Knopf steht abgesetzt und traegt die Handlung, nicht den Zustand. */
button.entfernen {
  margin-top: 10px; border: 1px solid var(--linie); background: #fff;
  color: #7A6A62; border-radius: 8px; padding: 7px 13px; font-size: 13px;
  font-family: inherit;
}

.ortleiste { display: flex; gap: 8px; }
.sprechen { display: block; font-size: 14px; color: var(--dunkel); margin-bottom: 6px; }
.sprechen .leise { display: block; }

.meldung {
  position: fixed; left: 12px; right: 12px; bottom: calc(14px + env(safe-area-inset-bottom));
  background: var(--dunkel); color: #fff; padding: 13px 16px; border-radius: 12px;
  font-size: 15px; z-index: 20;
}
.meldung.fehler { background: var(--rot); }

.summe { display: flex; justify-content: space-between; padding: 9px 0;
         border-bottom: 1px solid var(--linie); }
.summe b { color: var(--dunkel); }
.rating { font-size: 30px; font-weight: 700; color: var(--rot); margin: 12px 0 2px; }

/* Was ansteht: antippen, nicht abtippen. Wer heute dran ist, steht zuoberst
   und sieht auch so aus — das ist fast immer der gemeinte. */
.karte.anliegend {
  border: 1px solid var(--linie); border-radius: 12px; background: #fff;
  padding: 14px 16px; margin-bottom: 10px;
}
.karte.anliegend .name { font-weight: 600; font-size: 18px; }
.karte.anliegend .wert { color: #7A6A62; font-size: 15px; margin-top: 3px; }
.karte.anliegend.heute { border-color: var(--rot); border-left-width: 4px; }
.karte.anliegend.heute .wert { color: var(--rot); }

#uebernummer { margin-top: 22px; }
#uebernummer summary { cursor: pointer; }
#uebernummer form { margin-top: 10px; }

/* Verweise im Fliesstext tragen die Hausfarbe, nicht das Browserblau. */
main a { color: var(--dunkel); }

/* Die Kapitelleiste in Schritt 3 — dasselbe Muster wie die Schrittleiste und
   die Leiste im Buero: Pillen, die waagerecht rollen. Ein Kapitel wird
   angewaehlt, nicht gescrollt. Die Ueberschriften sind die des Berichts, und
   sie sind lang; deshalb rollt die Leiste, statt zu brechen. */
nav.unter { padding: 0 0 4px; margin-bottom: 4px; }
nav.unter button { font-size: 13px; padding: 7px 12px; }
#kapiteltitel { margin-top: 12px; }

/* Was eine gesetzte Zeile aufgenommen hat, steht unter der Zeile — mit
   Kennung und Text. Ohne das bleibt die Frage offen, ob derselbe Mangel vor
   Ort noch einmal aufzunehmen ist (03.09.2026). */
.folge { margin-top: 10px; }
.aufgenommen {
  border-left: 3px solid var(--gruen); background: var(--hell);
  border-radius: 8px; padding: 8px 11px; margin-top: 6px; font-size: 14px;
}
.aufgenommen .leise { margin: 3px 0 0; }
.zeile .herkunft { margin: 4px 0 0; font-style: italic; }

/* Schritt 5: die Aufteilung nach Herkunft steht eingerueckt unter der Summe. */
.summe.unter span { padding-left: 14px; color: #7A6A62; }
.massnahmenliste { margin-top: 12px; }

/* Eine 3.3-Zeile traegt drei Angaben: Wartung, Faelligkeit, Zustand. Jede mit
   eigener Beschriftung — sonst stehen zwei Knopfreihen ohne Frage darueber. */
.angabe { margin-top: 10px; }
.angabe .klein { font-size: 13px; color: #7A6A62; margin-bottom: 3px; }
.angabe input[type="date"] {
  width: 100%; padding: 10px; border: 1px solid var(--linie);
  border-radius: 10px; font-size: 15px; background: #fff; color: var(--dunkel);
}

/* Ein Weg daneben, immer: Was kein Baustein trifft, geht wortgleich in den
   Bericht. Vorher gab es dafuer gar keinen Knopf (Sascha, 03.09.2026). */
#freitexthinweis { margin: 8px 0 4px; font-size: 13px; color: #7A6A62; }
#freitextangaben { margin: 0; }
#freitextangaben select {
  flex: 1 1 0; padding: 10px; border: 1px solid var(--linie);
  border-radius: 10px; font-size: 14px; background: #fff; color: var(--dunkel);
}
button.freitext {
  width: 100%; margin-top: 10px; border: 1px dashed var(--linie);
  background: #fff; color: var(--dunkel); border-radius: 10px; padding: 12px;
  font-size: 15px;
}
