/* Prüfansicht: Scan links (bleibt stehen), Felder rechts, Fußleiste mit Fortschritt und Aktionen. */

.seite.seite-pruefung { max-width: none; gap: 1rem; padding-bottom: 0; }

.pruef-kopf { display: flex; flex-direction: column; gap: .5rem; }
.zurueck { display: inline-flex; align-items: center; gap: .3rem; align-self: flex-start; color: var(--gedaempft-tief); font-weight: 600; font-size: .8125rem; text-decoration: none; }
.zurueck .icon { width: 1rem; height: 1rem; }
.zurueck:hover { color: var(--tinte); }
.pruef-titel { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem .85rem; }
.vorgangsnr-gross { font-variant-numeric: tabular-nums; }
.pruef-meta { display: flex; flex-wrap: wrap; gap: .15rem 0; color: var(--gedaempft-tief); font-size: .8125rem; }
.pruef-meta li:not(:last-child)::after { content: "·"; margin: 0 .55rem; color: #a3b0a9; }
.pruef-hinweise { display: flex; flex-direction: column; gap: .75rem; }
.pruef-hinweise:empty { display: none; }

.pruef-flaeche { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(24rem, 1fr); gap: 1.5rem; align-items: start; }

/* ---- Scan ---- */

.scan {
  position: sticky; top: 1rem; display: flex; flex-direction: column; min-width: 0;
  height: 70vh; height: calc(100cqh - 8.75rem); min-height: 22rem;
  border-radius: var(--radius-karte); background: #e7e1d3; box-shadow: var(--schatten-karte), inset 0 0 0 1px rgba(18, 36, 31, .06); overflow: hidden;
}
.scan-leer { background: var(--weiss); justify-content: center; }
.scan-leiste { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .4rem .75rem; padding: .5rem .65rem; background: var(--weiss); border-bottom: 1px solid var(--linie); }
.scan-seiten { display: inline-flex; padding: .2rem; border-radius: .75rem; background: var(--neutral-flaeche); }
.scan-seite { min-height: 2rem; padding: .25rem .85rem; border: 0; border-radius: .55rem; background: none; color: var(--gedaempft-tief); font-weight: 650; font-size: .8125rem; cursor: pointer; }
.scan-seite.aktiv { background: var(--weiss); color: var(--tinte); box-shadow: var(--schatten-klein); }
.scan-zoom { display: flex; align-items: center; gap: .1rem; }
.scan-zoomwert { min-width: 3.4rem; text-align: center; font-size: .8125rem; font-weight: 600; color: var(--gedaempft-tief); }
.scan-rahmen { flex: 1; min-height: 0; overflow: auto; padding: .75rem; scrollbar-color: #a9a391 transparent; }
.scan-rahmen:focus-visible { outline-offset: -3px; }
.scan-blatt { position: relative; width: 100%; margin-inline: auto; background: #fff; box-shadow: 0 1px 2px rgba(11, 42, 36, .12), 0 8px 24px rgba(11, 42, 36, .14); }
.scan-blatt.laedt { background: linear-gradient(100deg, #f4f1ea 30%, #fff 50%, #f4f1ea 70%) 0 0 / 300% 100%; animation: schimmern 1.6s linear infinite; }
.scan-bild { width: 100%; height: 100%; user-select: none; -webkit-user-drag: none; }
.scan-marken { position: absolute; inset: 0; }
.scan-bildfehler { display: none; position: absolute; inset: 0; place-content: center; padding: 2rem; text-align: center; color: var(--fehler); font-weight: 600; }
.scan-blatt.bildfehler .scan-bildfehler { display: grid; }
.scan-fuss { padding: .35rem .85rem; background: var(--weiss); border-top: 1px solid var(--linie); color: var(--gedaempft-tief); font-size: .75rem; }

@keyframes schimmern { to { background-position: -300% 0; } }

/* Feldrahmen auf dem Scan. Ruhend kaum sichtbar; offen = gestrichelt; aktiv = Passermarken-Ecken. */
.marke-feld { position: absolute; padding: 0; border: 0; border-radius: 3px; background: transparent; cursor: pointer; outline: 1px solid transparent; outline-offset: 2px; transition: background-color .15s, outline-color .15s; }
.marke-feld:hover { outline-color: rgba(14, 125, 109, .6); background: rgba(14, 125, 109, .06); }
.marke-feld.offen { outline: 1.5px dashed #b8770a; background: rgba(246, 190, 70, .13); }
.marke-feld.bestaetigt { outline-color: rgba(11, 98, 71, .28); }
.marke-feld.aktiv { outline: 2px solid var(--teal); background: rgba(14, 125, 109, .1); z-index: 2; box-shadow: 0 0 0 5px rgba(14, 125, 109, .14); }
.marke-feld.aktiv.offen { outline-color: #b8770a; background: rgba(246, 190, 70, .2); box-shadow: 0 0 0 5px rgba(246, 190, 70, .22); }
.marke-ecke { position: absolute; width: 9px; height: 9px; border: 0 solid var(--tanne); opacity: 0; transition: opacity .15s; pointer-events: none; }
.marke-feld.aktiv .marke-ecke { opacity: 1; }
.marke-ecke.e1 { left: -7px; top: -7px; border-left-width: 2.5px; border-top-width: 2.5px; }
.marke-ecke.e2 { right: -7px; top: -7px; border-right-width: 2.5px; border-top-width: 2.5px; }
.marke-ecke.e3 { right: -7px; bottom: -7px; border-right-width: 2.5px; border-bottom-width: 2.5px; }
.marke-ecke.e4 { left: -7px; bottom: -7px; border-left-width: 2.5px; border-bottom-width: 2.5px; }

/* ---- Felder ---- */

.felder { display: flex; flex-direction: column; gap: 1.25rem; min-width: 0; padding-bottom: 1.5rem; }
.feldgruppe-kat { background: var(--weiss); border-radius: var(--radius-karte); box-shadow: var(--schatten-karte); overflow: clip; }
.kat-kopf { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: .15rem 1rem; padding: 1rem 1.35rem .85rem; border-bottom: 1px solid var(--linie); }
.kat-kopf h2 { font-size: 1.125rem; }
.kat-hinweis { grid-column: 1; display: flex; align-items: center; gap: .4rem; color: var(--gedaempft-tief); font-size: .8125rem; }
.kat-hinweis .icon { width: .95rem; height: .95rem; }
.kat-stand { grid-column: 2; grid-row: 1 / span 2; align-self: center; padding: .2rem .65rem; border-radius: var(--radius-pille); background: var(--warn-flaeche); color: var(--warn); font-size: .75rem; font-weight: 700; }
.kat-stand.fertig { background: var(--ok-flaeche); color: var(--ok); }
.kat-stand:empty { display: none; }

.feld { display: flex; flex-direction: column; gap: .55rem; padding: 1rem 1.35rem 1.05rem; border-top: 1px solid var(--linie); position: relative; scroll-margin-block: 5rem 9rem; transition: background-color .2s; }
.feld:first-child { border-top: 0; }
.feld.pruefen { background: #fffaf0; }
.feld.entwurf { background: #f3f8fc; }
.feld.im-fokus { box-shadow: inset 0 0 0 2px var(--teal); border-radius: 2px; }
.feld:focus { outline: none; }
.feld-kopf { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: .35rem 1rem; }
.feld-name { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .3px; color: var(--gedaempft-tief); max-width: 60ch; }
/* Lange Bezeichnungen (ausformulierte Fragen) als Satz statt in Versalien */
.feld-name-lang { font-size: .875rem; font-weight: 650; text-transform: none; letter-spacing: 0; color: var(--tinte); line-height: 1.4; }
.feld-pflicht { text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--gedaempft); }
.feld-pflicht::before { content: "·"; margin: 0 .35rem 0 .15rem; }
.feld-status { display: flex; flex-wrap: wrap; gap: .35rem; }

.marker { display: inline-flex; align-items: center; gap: .3rem; padding: .15rem .55rem .15rem .4rem; border-radius: var(--radius-pille); font-size: .75rem; font-weight: 700; white-space: nowrap; }
.marker .icon { width: .875rem; height: .875rem; stroke-width: 2.2; }
.marker-warn { background: #f6c453; color: #3d2a00; }
.marker-pflicht { background: var(--warn-flaeche); color: var(--warn); }
.marker-ok { background: var(--ok-flaeche); color: var(--ok); }
.marker-entwurf { background: var(--lauf); color: #fff; }
.marker-fehlt { background: var(--gefahr); color: #fff; }
.feld.pflicht-fehlt { background: #fdf3f1; }
.feld.pflicht-fehlt .eingabe-feld { border-color: var(--fehler-rand); }
.feld-fehlt { display: flex; gap: .45rem; align-items: flex-start; color: var(--fehler); font-size: .8125rem; font-weight: 600; max-width: 70ch; }
.feld-fehlt .icon { width: 1rem; height: 1rem; margin-top: .1rem; }
.fuss-hinweis.ton-fehler { color: var(--fehler); font-weight: 600; }
.marke-feld.fehlt { outline: 2px solid var(--gefahr); background: rgba(179, 38, 28, .08); }
.marker-geaendert { background: transparent; box-shadow: inset 0 0 0 1px var(--lauf-rand); color: var(--lauf); }

.eingabe-feld { font-size: 1rem; font-weight: 550; }
.feld.pruefen .eingabe-feld { border-color: #dcb968; }
.feld.pruefen .eingabe-feld:focus { border-color: var(--teal); }
.feld-wert { font-size: 1rem; font-weight: 600; overflow-wrap: anywhere; white-space: pre-wrap; }
.feld-wert.leerwert { color: var(--gedaempft-tief); font-weight: 500; }

.optionen { display: flex; flex-wrap: wrap; gap: .5rem; }
.option {
  display: inline-flex; align-items: center; gap: .55rem; min-height: 2.75rem; padding: .45rem 1rem .45rem .75rem; border: 1px solid var(--sand-linie); border-radius: var(--radius-feld);
  background: var(--weiss); font-weight: 600; cursor: pointer; transition: border-color .15s, background-color .15s, box-shadow .15s;
}
.option:hover { border-color: #b7c2ba; }
.option input { appearance: none; width: 1.15rem; height: 1.15rem; margin: 0; border: 1.5px solid #8d9b94; border-radius: 50%; background: #fff; flex: none; transition: border-color .15s, box-shadow .15s; }
.option input:checked { border-color: var(--teal); box-shadow: inset 0 0 0 4px #fff, inset 0 0 0 10px var(--teal); }
.option:has(input:checked) { border-color: var(--teal); background: var(--teal-hauch); }
.option:has(input:focus-visible) { outline: 2px solid var(--teal); outline-offset: 2px; }
.option input:focus-visible { outline: none; }
.option-leer { font-weight: 500; color: var(--gedaempft-tief); }
.option-leer:has(input:checked) { border-color: #b8770a; background: var(--warn-flaeche); color: #4d3200; }
.option-leer input:checked { border-color: #b8770a; box-shadow: inset 0 0 0 4px #fff, inset 0 0 0 10px #b8770a; }
.feld-roh { flex-basis: 100%; color: var(--warn); font-size: .8125rem; font-weight: 550; }

.feld-meta { display: flex; flex-direction: column; gap: .4rem; }
.konfidenz { display: inline-flex; align-items: center; gap: .55rem; color: var(--gedaempft-tief); font-size: .75rem; font-weight: 600; }
.konfidenz-balken { width: 4.5rem; height: 5px; border-radius: var(--radius-pille); background: rgba(18, 36, 31, .12); overflow: hidden; }
.konfidenz-balken span { display: block; height: 100%; border-radius: inherit; background: var(--teal); }
.konfidenz.unsicher { color: var(--warn); }
.konfidenz.unsicher .konfidenz-balken span { background: #c98510; }
.feld-gruende { display: grid; gap: .2rem; }
.feld-gruende li { display: flex; gap: .4rem; align-items: flex-start; color: #5c3900; font-size: .8125rem; font-weight: 550; }
.feld-gruende .icon { width: .95rem; height: .95rem; margin-top: .13rem; color: #b8770a; }
.feld-ocr { color: var(--lauf); font-size: .8125rem; }
.feld-ocr q { font-weight: 650; overflow-wrap: anywhere; }
.feld-fehler { padding: .5rem .75rem; border-radius: var(--radius-m); background: var(--fehler-flaeche); color: var(--fehler); font-weight: 600; font-size: .875rem; }
.feld-fuss { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; min-height: 2.25rem; }
.feld-vermerk { color: var(--gedaempft-tief); font-size: .8125rem; }
.feld-aktionen { display: flex; align-items: center; gap: .9rem; margin-left: auto; }
.feld-aktionen .textlink { font-size: .8125rem; }

/* ---- Fußleiste ---- */

.pruef-fuss {
  position: sticky; bottom: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 1.5rem;
  margin: auto -2rem 0; padding: .8rem 2rem; background: rgba(255, 255, 255, .94); backdrop-filter: blur(10px); border-top: 1px solid var(--sand-linie);
  box-shadow: 0 -6px 24px rgba(11, 42, 36, .07);
}
.fuss-stand { display: grid; grid-template-columns: auto minmax(8rem, 14rem); align-items: center; gap: .2rem 1rem; min-width: 0; }
.fuss-zahl strong { font-family: var(--schrift-display); font-size: 1.0625rem; letter-spacing: -.01em; }
.fuss-hinweis { grid-column: 1 / -1; color: var(--gedaempft-tief); font-size: .8125rem; }
.fuss-hinweis.ton-ok { color: var(--ok); font-weight: 600; }
.fuss-hinweis.ton-warn { color: var(--lauf); font-weight: 600; }
.fuss-aktionen { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-left: auto; }
.knopf-freigeben { min-width: 9rem; }

@media (max-width: 1100px) {
  .pruef-flaeche { grid-template-columns: minmax(0, 1fr) minmax(20rem, 1fr); gap: 1rem; }
}

/* Schmal: Scan bleibt oben stehen, die Felder laufen darunter durch. */
@media (max-width: 900px) {
  .pruef-flaeche { grid-template-columns: minmax(0, 1fr); }
  .scan { top: 0; z-index: 4; height: 42vh; height: 40cqh; min-height: 15rem; border-radius: 1rem; margin-inline: -.25rem; }
  .scan-zoom .mit-text span { display: none; }
  .scan-zoom .mit-text:last-child { display: none; }
  .scan-rahmen { padding: .5rem; }
  .feld { padding-inline: 1.1rem; scroll-margin-block: calc(40cqh + 1rem) 9rem; }
  .kat-kopf { padding-inline: 1.1rem; }
  .pruef-fuss { margin-inline: -1rem; padding: .65rem 1rem; }
  .fuss-stand { grid-template-columns: auto minmax(0, 1fr); flex: 1 1 100%; }
  .fuss-aktionen { flex: 1 1 100%; }
  .fuss-aktionen .knopf { flex: 1 1 auto; min-height: 2.5rem; padding-inline: .7rem; }
}

/* Schwache Zweitmarkierung (Mauszeiger über einem anderen Feld, während ein Feld Tastaturfokus hat) */
.marke-feld.zweit:not(.aktiv) { outline: 1px solid rgba(14, 125, 109, .65); background: rgba(14, 125, 109, .05); }
/* Feld während einer laufenden Aktion */
.feld.gesperrt { opacity: .75; }
.feld.gesperrt .option { cursor: progress; }
