: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; }
