:root {
  --bg: #f4f1ea; --karte: #ffffff; --text: #23302b; --muted: #6b746f; --rand: #ddd6c8;
  --gruen: #2f5d50; --gruen-h: #3d7666; --warn-bg: #fff3d6; --warn: #8a5a00; --ok-bg: #e3f1e8; --ok: #1f6b3c; --rot: #a2341f;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #161a18; --karte: #20262a; --text: #e8ece9; --muted: #9aa49f; --rand: #33403b;
          --gruen: #5fa28c; --gruen-h: #74b7a1; --warn-bg: #3a2f14; --warn: #f0c46b; --ok-bg: #173022; --ok: #8fd6a8; --rot: #ff8a73; }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--gruen); }
main { max-width: 760px; margin: 0 auto; padding: 12px 16px 40px; }
.top { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; background: var(--gruen); color: #fff; position: sticky; top: 0; z-index: 5; }
.top a { color: #fff; text-decoration: none; }
.brand { font-weight: 700; letter-spacing: .02em; }
.top nav { display: flex; gap: 14px; align-items: center; }
.top .btn.small { background: rgba(255,255,255,.18); color: #fff; }
.foot { text-align: center; color: var(--muted); font-size: 13px; padding: 20px 16px 30px; }
.card { background: var(--karte); border: 1px solid var(--rand); border-radius: 14px; padding: 18px; margin: 14px 0; }
.card.center { text-align: center; }
h1 { font-size: 1.35rem; margin: 0 0 12px; }
h2 { font-size: 1.05rem; margin: 22px 0 10px; }
.muted { color: var(--muted); } .klein { font-size: 14px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: 10px; padding: 11px 16px; font: inherit; font-weight: 600;
       background: var(--gruen); color: #fff; text-decoration: none; cursor: pointer; min-height: 44px; }
.btn:hover { background: var(--gruen-h); }
.btn.ghost { background: transparent; color: var(--gruen); border: 1.5px solid var(--gruen); }
.btn.big { width: 100%; font-size: 1.1rem; padding: 15px; margin-top: 8px; }
.btn.small { min-height: 34px; padding: 6px 12px; }
.btn:disabled { opacity: .5; cursor: default; }
.knoepfe { display: flex; flex-wrap: wrap; gap: 8px; }
.note { border-radius: 10px; padding: 10px 12px; margin: 12px 0; background: var(--ok-bg); color: var(--ok); }
.note.warn { background: var(--warn-bg); color: var(--warn); }
.wahl { border: 0; padding: 0; margin: 0 0 10px; display: grid; gap: 6px; }
.wahl label, .check, .einger label { display: flex; gap: 8px; align-items: center; padding: 8px 10px; border: 1px solid var(--rand); border-radius: 10px; cursor: pointer; }
.check { margin-top: 14px; }
.einger { margin: 6px 0 0 18px; display: grid; gap: 6px; }
.feld { display: block; font-weight: 600; margin: 14px 0 6px; }
select, textarea, input[type=text] { width: 100%; font: inherit; padding: 10px; border-radius: 10px; border: 1px solid var(--rand); background: var(--karte); color: var(--text); }
.einger input[type=text] { width: auto; padding: 6px 8px; }
select + select { margin-top: 8px; }
progress { width: 100%; margin-top: 10px; }
.seiten { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0; }
.seite { position: relative; width: 96px; height: 128px; border-radius: 8px; overflow: hidden; border: 2px solid var(--rand); background: #0001; }
.seite.warnrand { border-color: var(--warn); }
.seite img { width: 100%; height: 100%; object-fit: cover; }
.seite .pdf { display: grid; place-content: center; height: 100%; text-align: center; font-weight: 700; padding: 4px; word-break: break-all; }
.seite button { position: absolute; top: 3px; right: 3px; width: 28px; height: 28px; border-radius: 50%; border: 0; background: #000a; color: #fff; font-size: 18px; cursor: pointer; }
.seite .snr { position: absolute; left: 4px; bottom: 3px; background: #000a; color: #fff; font-size: 12px; border-radius: 6px; padding: 0 6px; }
.seiten img { max-width: 100%; border-radius: 8px; }
.overlay { position: fixed; inset: 0; z-index: 50; background: #000; display: flex; flex-direction: column; }
.overlay.hell { background: var(--bg); }
.overlay video { flex: 1; width: 100%; min-height: 0; object-fit: contain; background: #000; }
.leiste { display: flex; align-items: center; justify-content: space-around; gap: 10px; padding: 14px 16px calc(14px + env(safe-area-inset-bottom)); }
.overlay:not(.hell) .btn.ghost { color: #fff; border-color: #fff8; }
#kamLicht.an { background: #ffd54a; color: #000; border-color: #ffd54a; }
.ausloeser { width: 74px; height: 74px; border-radius: 50%; border: 5px solid #fff; background: #fff4; cursor: pointer; }
.ausloeser:active { background: #fff; }
.ed-kopf { padding: 12px 16px; font-weight: 600; }
.ed-flaeche { flex: 1; min-height: 0; position: relative; display: flex; align-items: center; justify-content: center; overflow: hidden; padding: 0 8px; }
.ed-flaeche canvas.vorschau { max-width: 100%; max-height: 100%; }
#edQualitaet { margin: 8px 16px 0; }
.liste { list-style: none; margin: 0; padding: 0; }
.liste li a { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; padding: 10px 4px; border-bottom: 1px solid var(--rand); text-decoration: none; color: var(--text); }
.liste .nr { color: var(--muted); grid-row: span 2; }
.liste .wann { color: var(--muted); font-size: 13px; grid-column: 2; }
.liste .status { justify-self: start; }
.status { font-size: 13px; padding: 2px 8px; border-radius: 99px; background: var(--rand); white-space: nowrap; }
.s-verarbeitet, .s-abgelegt { background: var(--ok-bg); color: var(--ok); }
.s-pruefen, .s-neu { background: var(--warn-bg); color: var(--warn); }
.s-fehler { background: #f8d7d0; color: var(--rot); }
.daten { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; }
.daten dt { color: var(--muted); } .daten dd { margin: 0; }
.warn { color: var(--rot); }
.filter { display: flex; flex-wrap: wrap; gap: 8px; }
.filter a { padding: 4px 10px; border-radius: 99px; border: 1px solid var(--rand); text-decoration: none; }
.filter a.aktiv { background: var(--gruen); color: #fff; border-color: var(--gruen); }
.tab { width: 100%; border-collapse: collapse; font-size: 14px; }
.tab th, .tab td { text-align: left; padding: 7px 6px; border-bottom: 1px solid var(--rand); }
.tab tbody tr { cursor: pointer; } .tab tbody tr:hover { background: #0000000a; }
.tab .r { text-align: right; }
.card { overflow-x: auto; }
pre { white-space: pre-wrap; font-size: 12px; }
