/* Aufnahme-Seite (Paket D2). Ergänzt basis.css, überschreibt keine Basis-Klassen. */

.seite-aufnahme { --kopf-hoehe: 60px; }
body.modus-kamera { overflow: hidden; overscroll-behavior: none; }
/* Meldung in der Kamera-Ansicht über der Knopfleiste statt darauf */
.toast.ueber-leiste { bottom: calc(var(--sicher-unten) + 132px); }

.unsichtbar {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  opacity: 0;
}

/* ---------- Kamera-Ansicht ---------- */
.ansicht-kamera {
  position: fixed;
  top: var(--kopf-hoehe);
  left: 0; right: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  background: #000;
}
.kamera-buehne { position: relative; flex: 1 1 auto; overflow: hidden; background: #000; }
.kamera-video {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  width: 100%; height: 100%;
  max-width: none;
  object-fit: cover;
  background: #000;
}
/* Hilfsrahmen – blockiert nichts */
.kamera-rahmen {
  position: absolute;
  top: 9%; bottom: 7%; left: 7%; right: 7%;
  border: 3px solid var(--akzent);
  box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.28);
  pointer-events: none;
  transition: opacity 0.2s;
}
/* Live-Umriss des Blattes (AUF-3) – ersetzt den festen Rahmen, solange ein Blatt erkannt ist */
.kamera-umriss {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
}
.kamera-buehne.umriss-an .kamera-rahmen { opacity: 0; }
.kamera-hinweis {
  position: absolute;
  top: 10px; left: 12px; right: 96px;
  margin: 0;
  padding: 8px 12px;
  background: rgba(17, 17, 17, 0.78);
  color: var(--text);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.3;
  pointer-events: none;
}
.kamera-suche {
  position: absolute;
  top: 6px; right: 8px;
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0 14px;
  background: rgba(17, 17, 17, 0.78);
  border: 1px solid var(--linie);
  color: var(--akzent);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
}
.stillhalte-leiste {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 10px;
  background: rgba(255, 255, 255, 0.18);
  pointer-events: none;
}
.stillhalte-balken {
  width: 100%; height: 100%;
  background: var(--akzent);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 90ms linear;
}
.kamera-blitz { position: absolute; top: 0; right: 0; bottom: 0; left: 0; background: #fff; opacity: 0; pointer-events: none; }
.kamera-blitz.an { animation: ls-blitz 260ms ease-out; }
@keyframes ls-blitz { 0% { opacity: 0.95; } 100% { opacity: 0; } }
.kamera-haken {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.kamera-haken span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 132px; height: 132px;
  background: var(--akzent);
  color: var(--akzent-text);
  font-size: 88px;
  font-weight: 700;
  line-height: 1;
}
.kamera-haken.an span { animation: ls-haken 420ms cubic-bezier(0.2, 1.4, 0.4, 1); }
@keyframes ls-haken { 0% { transform: scale(0.3); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }

.kamera-fehler {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  overflow-y: auto;
  padding: 24px var(--abstand);
  background: var(--hg);
}
.kamera-fehler p { margin: 0 0 var(--abstand); font-size: 17px; }
.kamera-fehler a { word-break: break-all; font-weight: 700; }

.kamera-leiste {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 12px var(--abstand) calc(12px + var(--sicher-unten));
  background: var(--hg);
  border-top: 2px solid var(--linie);
}
.kamera-auto { justify-self: start; min-width: 104px; padding: 0 12px; font-size: 15px; }
.kamera-auto b { margin-left: 4px; color: var(--akzent); }
.kamera-auto[aria-pressed="false"] b { color: var(--text-2); }
.kamera-app-knopf { justify-self: end; padding: 0 12px; font-size: 15px; }
.ausloeser {
  width: 84px; height: 84px;
  padding: 8px;
  border: 4px solid var(--akzent);
  border-radius: 0;
  background: transparent;
  cursor: pointer;
  touch-action: manipulation;
}
.ausloeser span { display: block; width: 100%; height: 100%; background: var(--akzent); }
.ausloeser:active span { background: var(--akzent-dunkel); }
.ausloeser:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }

/* ---------- Prüfansicht ---------- */
.seite-aufnahme { --leiste-hoehe: 100px; }
.ansicht-pruefung { padding-bottom: calc(var(--leiste-hoehe) + 16px); }
.pruef-foto { position: relative; background: #000; }
.pruef-foto img {
  display: block;
  width: 100%;
  height: 34vh;
  max-height: 340px;
  object-fit: contain;
}
/* Umschalten zugeschnitten ↔ ganzes Foto */
.pruef-zuschnitt {
  position: absolute;
  top: 8px; right: 8px;
  min-height: var(--tipp);
  padding: 0 16px;
  background: rgba(17, 17, 17, 0.82);
  color: var(--akzent);
  border: 2px solid var(--akzent);
}
.ocr-status {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 8px var(--abstand) 0;
  background: rgba(17, 17, 17, 0.86);
  font-size: 15px;
  font-weight: 700;
}
.ocr-status.ocr-fertig { color: var(--ok); }
.ocr-status.ocr-eintippen, .ocr-status.ocr-fehler { color: var(--akzent); }
.ocr-leiste { height: 6px; margin-top: 6px; background: rgba(255, 255, 255, 0.16); }
.ocr-balken {
  width: 100%; height: 100%;
  background: var(--akzent);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 200ms linear;
}
.ocr-fertig .ocr-balken { background: var(--ok); }
.pruef-formular { padding-top: 20px; }
.pruef-formular .chips + .input { margin-top: var(--abstand-klein); }
.pruef-formular .chip { min-height: 60px; font-size: 19px; }
.chip.vorschlag { border-style: dashed; border-color: var(--akzent); }
.chip.vorschlag.aktiv { border-style: solid; }
.feld-meldung { display: block; margin-top: 4px; color: var(--fehler); font-size: 15px; font-weight: 700; }
.feld-meldung:empty { display: none; }
.feld-quelle:empty { display: none; }
.feld.bitte-waehlen { padding-left: 10px; border-left: 4px solid var(--akzent); }
.feld.fehlt { padding-left: 10px; border-left: 4px solid var(--fehler); }
.feld.fehlt .chips .chip:not(.aktiv) { border-color: var(--fehler); }
.feld-paar { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.feld-paar .input { min-width: 0; }
.pruef-formular textarea.input { resize: vertical; min-height: 96px; }

.mehr { margin: 0 0 var(--abstand); }
.mehr > summary { list-style: none; width: 100%; }
.mehr > summary::-webkit-details-marker { display: none; }
.mehr > summary::after { content: "+"; margin-left: auto; padding-left: 12px; font-size: 22px; }
.mehr[open] > summary::after { content: "–"; }
.mehr-inhalt { padding-top: var(--abstand); }
.positionen-anzahl {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px; height: 28px;
  padding: 0 6px;
  background: var(--akzent);
  color: var(--akzent-text);
}
.position {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
  margin-bottom: var(--abstand);
  padding: 12px;
  background: var(--flaeche);
  border: 1px solid var(--linie);
}
.position-feld { display: block; min-width: 0; }
.position-feld > span {
  display: block;
  margin-bottom: 4px;
  color: var(--text-2);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.position-bezeichnung { grid-column: 1 / -1; }
.position-weg { grid-column: 1 / -1; }

.speicher-fehler {
  grid-column: 1 / -1;
  padding: 10px 12px;
  background: var(--flaeche);
  border-left: 6px solid var(--fehler);
}
.speicher-fehler p { margin: 0; font-size: 16px; line-height: 1.35; }
.speicher-fehler .btn { width: 100%; margin-top: 10px; }

.pruef-aktionen {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 15;
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 10px;
  padding: 12px var(--abstand) calc(12px + var(--sicher-unten));
  background: var(--hg);
  border-top: 2px solid var(--linie);
}
.pruef-aktionen .btn { padding: 0 10px; }
.pruef-aktionen .btn-outline { font-size: 15px; letter-spacing: 0.06em; }

/* ---------- Fertig ---------- */
.fertig-inhalt { padding-top: 36px; padding-bottom: calc(24px + var(--sicher-unten)); text-align: left; }
.fertig-haken {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 96px; height: 96px;
  margin-bottom: 20px;
  background: var(--ok);
  color: var(--hg);
  font-size: 64px;
  font-weight: 700;
  line-height: 1;
}
.fertig-datei { overflow-wrap: anywhere; font-size: 22px; letter-spacing: 0.02em; text-transform: none; }
.fertig-zusammenfassung { margin: 0 0 var(--abstand); color: var(--text-2); font-size: 18px; }
.fertig-hinweise { margin: 0 0 var(--abstand); padding: 12px 12px 12px 32px; background: var(--flaeche); border-left: 6px solid var(--akzent); }
.fertig-hinweise li + li { margin-top: 6px; }

@media (min-width: 761px) {
  .pruef-aktionen { left: 50%; right: auto; width: 760px; transform: translateX(-50%); }
}
@media (max-width: 360px) {
  .kamera-leiste { gap: 6px; padding-left: 10px; padding-right: 10px; }
  .kamera-auto, .kamera-app-knopf { font-size: 13px; padding: 0 8px; letter-spacing: 0.04em; }
  .ausloeser { width: 76px; height: 76px; }
  .feld-paar { grid-template-columns: 1fr; }
}
