:root {
  --gruen: #1f7a3d;
  --gruen-hell: #e3f4e8;
  --gelb: #b07d00;
  --gelb-hell: #fdf1d6;
  --grau: #6b6b6b;
  --linie: #dcdcdc;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; margin: 0; }
body {
  font: 17px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif;
  color: #1a1a1a;
  background: #fff;
  overscroll-behavior: none;
}

.ansicht { display: none; height: 100%; }
.ansicht.aktiv { display: flex; flex-direction: column; }

header {
  padding: max(1rem, env(safe-area-inset-top)) 1.25rem .8rem;
  display: flex; align-items: baseline; justify-content: space-between;
  border-bottom: 1px solid var(--linie);
}
h1 { margin: 0; font-size: 1.35rem; }
.slot { color: var(--grau); font-size: .9rem; }

.mitte {
  flex: 1; display: flex; flex-direction: column; justify-content: center;
  padding: 1.5rem; gap: .8rem;
}
.hilfe { color: var(--grau); font-size: .9rem; margin: .4rem 0 0; }
.hinweis-block { padding: 1.25rem 1.25rem 0; }

/* Nur-Lade-Modus: Die Punkte-Liste ist ausgeblendet, damit fehlt das dehnbare Element.
   Die Aktionen sollen trotzdem am unteren Bildschirmrand sitzen (Daumen-Reichweite). */
body.nur-stapler #ansicht-start .aktionen { margin-top: auto; }
/* Die Ladeabfrage ist jetzt die Hauptaktion und gehoert nach oben. */
body.nur-stapler #btn-stapler { order: -1; }

/* Punkte-Liste */
ul.punkte { list-style: none; margin: 0; padding: 1rem 1.25rem; flex: 1; }
ul.punkte li {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.1rem; margin-bottom: .6rem;
  border: 2px solid var(--linie); border-radius: 12px;
  font-size: 1.15rem;
}
ul.punkte li.ok { background: var(--gruen-hell); border-color: var(--gruen); color: var(--gruen); font-weight: 600; }
ul.punkte li.problem { background: var(--gelb-hell); border-color: var(--gelb); color: var(--gelb); font-weight: 600; }
ul.punkte li .haken { font-size: 1.4rem; }
ul.punkte.klein li { padding: .5rem .8rem; margin-bottom: .35rem; font-size: 1rem; background: rgba(255,255,255,.9); }

.wartet {
  margin: 0 1.25rem; padding: .7rem 1rem;
  background: var(--gelb-hell); border-left: 4px solid var(--gelb);
  color: var(--gelb); font-size: .9rem; font-weight: 600;
}

/* Knöpfe */
.aktionen { padding: 1rem 1.25rem max(1.25rem, env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: .6rem; }
.aktionen.spalte { gap: .8rem; }
button {
  font: inherit; border: 0; border-radius: 12px; cursor: pointer;
}
button.gross {
  padding: 1.15rem; font-size: 1.2rem; font-weight: 600;
  background: var(--gruen); color: #fff;
}
button.warnung { background: var(--gelb); color: #fff; }
button.zweit {
  padding: .8rem; background: #f0f0ef; color: #333; font-size: 1rem;
}

/* Scanner */
#ansicht-scanner { position: relative; background: #000; }
#video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.scanner-overlay {
  position: relative; z-index: 2; height: 100%;
  display: flex; flex-direction: column;
  padding: max(1rem, env(safe-area-inset-top)) 1rem max(1rem, env(safe-area-inset-bottom));
  background: linear-gradient(rgba(0,0,0,.35), rgba(0,0,0,.1) 30%, rgba(0,0,0,.55));
}
.rahmen {
  align-self: center; margin-top: 1rem;
  width: min(62vw, 260px); aspect-ratio: 1;
  border: 3px solid rgba(255,255,255,.9); border-radius: 20px;
}
.scanner-status {
  margin-top: 1rem; text-align: center; color: #fff;
  font-size: 1.05rem; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,.6);
  min-height: 1.5em;
}
#scanner-punkte { flex: 1; padding: 1rem 0 0; }
.scanner-aktionen { display: flex; flex-direction: column; gap: .5rem; }

/* Problem */
textarea {
  width: 100%; padding: .8rem; font: inherit;
  border: 2px solid var(--linie); border-radius: 12px; resize: none;
}
.wahl { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.wahl-knopf {
  padding: .9rem; background: #f0f0ef; color: #333;
  border: 2px solid transparent; font-size: 1rem;
}
.wahl-knopf.gewaehlt { background: var(--gelb-hell); border-color: var(--gelb); color: var(--gelb); font-weight: 600; }
.sicherheitshinweis {
  background: var(--gelb-hell); border-left: 4px solid var(--gelb);
  padding: .7rem .9rem; font-size: .9rem; border-radius: 4px;
}

/* Fertig */
.haken-gross {
  align-self: center; width: 88px; height: 88px; border-radius: 50%;
  background: var(--gruen-hell); color: var(--gruen);
  display: grid; place-items: center; font-size: 3rem; font-weight: 700;
}
#ansicht-fertig h1, #ansicht-fertig p { text-align: center; }
#ansicht-fertig p { color: var(--grau); margin: 0; }

/* ---------------------------------------------- Brandschutz-Abendrundgang */
.bs-balken { display: flex; gap: 2px; padding: 0 1.25rem; margin-top: .6rem; }
.bs-balken i { flex: 1; height: 4px; border-radius: 2px; background: var(--linie); }
.bs-balken i.ok { background: var(--gruen); }
.bs-balken i.mangel { background: #b03a1c; }
.bs-balken i.jetzt { background: #1a1a1a; }

#ansicht-bs .mitte { justify-content: flex-start; padding-top: 2rem; }
#bs-frage { font-size: 1.6rem; line-height: 1.2; }
#bs-frage .ort { color: var(--gruen); }
#bs-liste { font-size: 1rem; }

.bs-foto {
  border: 1px solid #c8461a; border-radius: 8px; padding: 1rem; margin-top: .4rem;
}
.bs-foto-knopf {
  display: block; text-align: center; padding: .9rem;
  border: 1px solid var(--linie); border-radius: 6px; background: #f6f6f6; font-size: 1.05rem;
}
.bs-foto.fertig { border-color: var(--gruen); }
.bs-foto.fertig .bs-foto-knopf { background: var(--gruen-hell); color: var(--gruen); }
#bs-foto-vorschau { display: block; width: 100%; margin-top: .7rem; border-radius: 6px; }
#bs-foto-vorschau[hidden] { display: none; }

#bs-antworten button[disabled] { opacity: .4; }
#bs-maengel li { align-items: flex-start; gap: .6rem; }
#bs-frage.blass { color: var(--grau); font-size: 1.15rem; }
.bs-folge { font-size: 1.5rem; line-height: 1.2; margin-top: .3rem; }

/* Schaubild: falsch / richtig nebeneinander */
.bs-schaubild { display: flex; gap: .5rem; margin-top: .8rem; }
/* display:flex schlaegt sonst das hidden-Attribut - das Bild blieb bei den Folgefragen stehen */
.bs-schaubild[hidden] { display: none; }
.bs-puffer { margin: .4rem 1.25rem 0; font-size: .85rem; color: #8a5a00; }
.bs-notiz { width: 100%; box-sizing: border-box; margin-top: .6rem; padding: .6rem; font: inherit;
  font-size: 1rem; border: 1px solid #c8461a; border-radius: 6px; }
.bs-notiz[hidden] { display: none; }
.pruef-hinweis { margin: .3rem 1.25rem; }
.pruef-liste { list-style: none; margin: 0; padding: 0 1.25rem; overflow-y: auto; flex: 1; }
.pruef-zeile { display: flex; justify-content: space-between; gap: .8rem; padding: .7rem 0;
  border-bottom: 1px solid #e3e3e3; cursor: pointer; font-size: .95rem; }
.pruef-zeile .pa { white-space: nowrap; color: var(--gruen); }
.pruef-zeile.mangel .pa { color: #c8461a; }
.pruef-zeile.offen .pa { color: #8a5a00; }
button[disabled] { opacity: .4; }
.bs-schaubild figure { flex: 1; margin: 0; }
.bs-schaubild img { width: 100%; border-radius: 6px; display: block; }
.bs-schaubild figcaption { font-size: .8rem; color: var(--grau); text-align: center; margin-top: .2rem; }
