/* Web-App Anonymisierung. Ruhig und klar wie eine Mac- oder iPhone-App: Systemschrift, gruppierte Listen,
   ein Grün (Maschinenring) für Handlungen, Farben sonst nur für Zustände: blau = in Arbeit, orange = bitte
   prüfen, rot = zurückgehalten/gesperrt, grünes Häkchen = bereit. Keine externen Dateien, kein Inline-CSS
   (strenge CSP). Hell und dunkel nach Systemeinstellung. Bewegung nur als Rückmeldung, bei „Bewegung
   reduzieren“ aus. */
:root {
  --grund: #f5f5f7;
  --flaeche: #ffffff;
  --flaeche-2: #f0f0f3;
  --leiste: #ececef;
  --text: #1d1d1f;
  --leise: #6e6e73;
  --zart: #86868b;
  --trenner: rgb(60 60 67 / .15);
  --rand: rgb(60 60 67 / .26);
  --akzent: #448424;              /* Maschinenring-Grün, Knöpfe (weiße Schrift 4,6:1) */
  --akzent-hover: #3b761f;
  --akzent-tief: #33681a;         /* Grün als Schrift auf hellem Grund */
  --akzent-zart: rgb(68 132 36 / .12);
  --akzent-text: #ffffff;
  --blau: #0062c4; --blau-zart: rgb(0 113 227 / .1); --blau-voll: #0a7cff;
  --gruen: #2a7a1d; --gruen-zart: rgb(52 168 64 / .14); --gruen-voll: #34a853;
  --orange: #a44a00; --orange-zart: rgb(255 149 0 / .16); --orange-voll: #ff9500;
  --rot: #c4001a; --rot-zart: rgb(255 59 48 / .12); --rot-voll: #ff3b30;
  --glas: rgb(250 250 252 / .78);
  --schatten: 0 1px 2px rgb(0 0 0 / .04), 0 2px 10px rgb(0 0 0 / .04);
  --schatten-hoch: 0 10px 30px rgb(0 0 0 / .14), 0 2px 6px rgb(0 0 0 / .06);
  --band: #ffd13a; --band-text: #0e2d00;
  --r: 14px;
  --r-klein: 10px;
  --kurve: cubic-bezier(.23, 1, .32, 1);
  --band-hoehe: 1.875rem;
  color-scheme: light dark;
  accent-color: var(--akzent);
}
@media (prefers-color-scheme: dark) {
  :root {
    --grund: #000000;
    --flaeche: #1c1c1e;
    --flaeche-2: #2c2c2e;
    --leiste: #141416;
    --text: #f5f5f7;
    --leise: #a1a1a6;
    --zart: #8e8e93;
    --trenner: rgb(84 84 88 / .55);
    --rand: rgb(120 120 128 / .5);
    --akzent: #7cc85a;
    --akzent-hover: #8fd46f;
    --akzent-tief: #8fd46f;
    --akzent-zart: rgb(124 200 90 / .16);
    --akzent-text: #0e2d00;
    --blau: #5aaeff; --blau-zart: rgb(10 132 255 / .2); --blau-voll: #0a84ff;
    --gruen: #6fd67f; --gruen-zart: rgb(48 209 88 / .16); --gruen-voll: #30d158;
    --orange: #ffb340; --orange-zart: rgb(255 159 10 / .16); --orange-voll: #ff9f0a;
    --rot: #ff6b61; --rot-zart: rgb(255 69 58 / .17); --rot-voll: #ff453a;
    --glas: rgb(30 30 32 / .78);
    --schatten: none;
    --schatten-hoch: 0 10px 30px rgb(0 0 0 / .6), 0 0 0 1px rgb(255 255 255 / .06);
    --band: #3a3000; --band-text: #ffd13a;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--band-hoehe) + 1rem); }
body {
  margin: 0; min-height: 100vh; background: var(--grund); color: var(--text);
  font: 400 1rem/1.5 -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI Variable Text", "Segoe UI",
    Roboto, "Helvetica Neue", sans-serif;
  letter-spacing: -.008em; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
  caret-color: var(--akzent);
}
::selection { background: color-mix(in srgb, var(--akzent) 28%, transparent); }
h1, h2, h3 { text-wrap: balance; }
:where(h1, h2, h3, p, form, ul, ol, dl, pre, figure) { margin: 0; }
h1 { font-size: 2rem; line-height: 1.15; font-weight: 700; letter-spacing: -.024em; overflow-wrap: anywhere; }
h2 { font-size: 1.25rem; line-height: 1.3; font-weight: 650; letter-spacing: -.016em; }
h3 { font-size: 1.0625rem; line-height: 1.35; font-weight: 600; }
a { color: var(--akzent-tief); text-decoration: none; text-underline-offset: .2em; }
a:hover { text-decoration: underline; }
code, pre { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--akzent) 60%, transparent); outline-offset: 2px; }
.ico {
  width: 1.25em; height: 1.25em; flex: none; vertical-align: -.25em;
  fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round;
}
.leise { color: var(--leise); }
.klein { font-size: .875rem; }
.zahl { font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }
.unsichtbar { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.sprung { position: absolute; left: .75rem; top: -12rem; z-index: 50; background: var(--flaeche); padding: .6rem 1rem; border-radius: var(--r-klein); box-shadow: var(--schatten-hoch); }
.sprung:focus { top: .5rem; }

/* --- Rahmen ---------------------------------------------------------------------------------------------- */

.testbetrieb {
  position: sticky; top: 0; z-index: 40; min-height: var(--band-hoehe);
  display: flex; align-items: center; justify-content: center; gap: .45rem; padding: .3rem 1rem;
  background: var(--band); color: var(--band-text); font-size: .8125rem; font-weight: 600; line-height: 1.3; text-align: center;
}
.testbetrieb .ico { width: 1rem; height: 1rem; }

@property --leistenbreite { syntax: "<length>"; inherits: true; initial-value: 15.5rem; }
.rahmen {
  --leistenbreite: 15.5rem;
  transition: --leistenbreite 260ms var(--kurve);
  display: grid; grid-template-columns: var(--leistenbreite) minmax(0, 1fr); min-height: calc(100vh - var(--band-hoehe));
  /* Fläche der Seitenleiste auch unterhalb der (klebenden) Leiste, bei langen Seiten */
  background: linear-gradient(90deg, var(--leiste) calc(var(--leistenbreite) - 1px), var(--trenner) calc(var(--leistenbreite) - 1px) var(--leistenbreite), transparent var(--leistenbreite));
}
.seitenleiste {
  position: sticky; top: var(--band-hoehe); height: calc(100vh - var(--band-hoehe)); overflow-y: auto;
  display: flex; flex-direction: column; gap: 2px; padding: 1rem .75rem .75rem;
  background: var(--leiste); border-right: 1px solid var(--trenner);
}
.app-name {
  display: flex; align-items: center; gap: .6rem; padding: .25rem .5rem 1rem;
  font-weight: 700; font-size: 1.0625rem; letter-spacing: -.02em; color: var(--text);
}
.app-name:hover { text-decoration: none; }
.app-icon {
  width: 1.9rem; height: 1.9rem; border-radius: 8px; flex: none; display: grid; place-items: center; color: #fff;
  background: linear-gradient(165deg, #5a9e36, #3a7420); box-shadow: inset 0 0 0 .5px rgb(0 0 0 / .12);
}
.app-icon .ico { width: 1.3rem; height: 1.3rem; }
.seitenleiste .abschnitt { font-size: .75rem; font-weight: 600; color: var(--zart); padding: 1rem .6rem .3rem; }
.seitenleiste a, .seitenleiste button.nav {
  display: flex; align-items: center; gap: .65rem; width: 100%; min-height: 2.25rem; padding: .45rem .6rem;
  border-radius: 8px; color: var(--text); font: inherit; font-weight: 500; font-size: .9375rem; text-align: left;
  justify-content: flex-start; letter-spacing: -.008em;
  background: none; border: 0; cursor: pointer; transition: background-color 120ms ease;
}
.seitenleiste a .ico, .seitenleiste button.nav .ico { color: var(--akzent-tief); }
.seitenleiste a:hover, .seitenleiste button.nav:hover { background: rgb(0 0 0 / .05); text-decoration: none; }
@media (prefers-color-scheme: dark) {
  .seitenleiste a:hover, .seitenleiste button.nav:hover { background: rgb(255 255 255 / .07); }
}
.seitenleiste a[aria-current] { background: var(--akzent); color: var(--akzent-text); }
.seitenleiste a[aria-current] .ico { color: var(--akzent-text); }
.seitenleiste .zaehler {
  margin-left: auto; min-width: 1.35rem; padding: 0 .35rem; border-radius: 980px; text-align: center;
  font-size: .75rem; font-weight: 700; line-height: 1.35rem; background: var(--rand); color: var(--text);
}
.seitenleiste a[aria-current] .zaehler { background: rgb(255 255 255 / .25); color: inherit; }
.seitenleiste .unten { margin-top: auto; padding-top: .75rem; border-top: 1px solid var(--trenner); display: grid; gap: 2px; }
.ich { display: flex; align-items: center; gap: .6rem; padding: .35rem .6rem .5rem; font-size: .875rem; min-width: 0; }
.ich > div { min-width: 0; }
.ich .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar {
  width: 2rem; height: 2rem; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: linear-gradient(180deg, #7a7a7f, #5a5a5f); color: #fff; font-weight: 600; font-size: .75rem;
  text-transform: uppercase; letter-spacing: 0;
}
.avatar.gross { width: 3.5rem; height: 3.5rem; font-size: 1.25rem; }

main { width: 100%; margin: 0 auto; padding: 2.25rem 2.5rem 5rem; }
main.schmal { max-width: 44rem; }
main.breit { max-width: 68rem; }
main.ganz { max-width: none; }
main > * + * { margin-top: 1.5rem; }
main > .zurueck + * { margin-top: .35rem; }
main > .kopfzeile + * { margin-top: .35rem; }
.zurueck { display: inline-flex; align-items: center; gap: .15rem; font-size: .9375rem; font-weight: 500; margin-left: -.3rem; }
.zurueck .ico { width: 1.15rem; height: 1.15rem; }
.kopfzeile { display: flex; align-items: center; justify-content: space-between; gap: .6rem 1rem; flex-wrap: wrap; }
.blaettern { display: flex; align-items: center; justify-content: flex-end; gap: .5rem; flex-wrap: wrap; }
.blaettern .aus { opacity: .45; pointer-events: none; }
main > .blaettern { margin-top: 2rem; justify-content: center; }
.kopf { display: flex; align-items: flex-end; justify-content: space-between; gap: .75rem 1.25rem; flex-wrap: wrap; }
.kopf > div { min-width: 0; flex: 1 1 18rem; }
.kopf p { margin-top: .3rem; color: var(--leise); }
.kopf .knopfreihe { margin: 0; }
section > * + * { margin-top: .75rem; }
.reiter { display: none; }
.unternav.segment { display: none; }

/* Allein stehende Seiten (Anmelden, Fehler) */
body.allein main { max-width: 25rem; padding: 3.5rem 1.25rem 4rem; }
body.allein .marke-gross { display: grid; justify-items: center; gap: .9rem; text-align: center; margin-bottom: 1.75rem; }
body.allein .marke-gross .app-icon { width: 4rem; height: 4rem; border-radius: 15px; box-shadow: 0 6px 18px rgb(58 116 32 / .3); }
body.allein .marke-gross .app-icon .ico { width: 2.6rem; height: 2.6rem; }
body.allein .marke-gross p { color: var(--leise); }
body.allein .fuss { text-align: center; font-size: .875rem; color: var(--leise); }

/* --- Knöpfe ---------------------------------------------------------------------------------------------- */

button, a.knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  min-height: 2.75rem; padding: .65rem 1.25rem; border: 0; border-radius: 980px; cursor: pointer;
  font: inherit; font-size: 1rem; font-weight: 600; line-height: 1.2; letter-spacing: -.01em; text-decoration: none;
  background: var(--akzent); color: var(--akzent-text);
  transition: transform 160ms var(--kurve), background-color 150ms ease, opacity 150ms ease;
  touch-action: manipulation; user-select: none; -webkit-user-select: none;
}
button:hover, a.knopf:hover { background: var(--akzent-hover); color: var(--akzent-text); text-decoration: none; }
button:active, a.knopf:active { transform: scale(.97); }
button:disabled, button[aria-busy="true"] { opacity: .5; cursor: default; transform: none; }
button .ico, a.knopf .ico { width: 1.15rem; height: 1.15rem; }
button.zweit, a.knopf.zweit { background: var(--akzent-zart); color: var(--akzent-tief); }
button.zweit:hover, a.knopf.zweit:hover { background: color-mix(in srgb, var(--akzent) 20%, transparent); color: var(--akzent-tief); }
button.grau, a.knopf.grau { background: var(--flaeche-2); color: var(--text); }
button.grau:hover, a.knopf.grau:hover { background: color-mix(in srgb, var(--flaeche-2) 80%, var(--rand)); color: var(--text); }
button.gefahr { background: var(--rot-zart); color: var(--rot); }
button.gefahr:hover { background: color-mix(in srgb, var(--rot-voll) 22%, transparent); color: var(--rot); }
button.gefahr-voll { background: var(--rot-voll); color: #fff; }
button.gefahr-voll:hover { background: color-mix(in srgb, var(--rot-voll) 88%, #000); color: #fff; }
button.klein, a.knopf.klein { min-height: 2.25rem; padding: .4rem .9rem; font-size: .9375rem; }
button.breit, a.knopf.breit { width: 100%; }
button.link {
  background: none; color: var(--akzent-tief); padding: 0; min-height: 0; border-radius: 4px; font-weight: 500;
}
button.link:hover { background: none; text-decoration: underline; color: var(--akzent-tief); }
.knopfreihe { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.knopfreihe form { margin: 0; }
form.inline { display: inline; }

/* --- Gruppierte Listen (wie Einstellungen) --------------------------------------------------------------- */

.gruppe { background: var(--flaeche); border-radius: var(--r); box-shadow: var(--schatten); overflow: hidden; }
@media (prefers-color-scheme: light) { .gruppe { box-shadow: var(--schatten), 0 0 0 .5px rgb(0 0 0 / .05); } }
.gruppe > * + * { border-top: 1px solid var(--trenner); }
.gruppen-titel { font-size: .8125rem; font-weight: 600; color: var(--leise); margin: 0 1rem .45rem; letter-spacing: 0; }
h2.gruppen-titel { font-size: .8125rem; line-height: 1.4; }
.gruppen-titel + .gruppe, .gruppen-titel + .tabelle-rahmen { margin-top: 0; }
.gruppen-fuss { font-size: .8125rem; color: var(--leise); margin: .5rem 1rem 0; }
section > .gruppen-fuss { margin-top: .5rem; }
.zeile {
  display: flex; align-items: center; gap: .85rem; min-height: 3.5rem; padding: .75rem 1rem;
  color: inherit; text-decoration: none; transition: background-color 120ms ease;
}
a.zeile:hover { background: var(--flaeche-2); text-decoration: none; }
a.zeile:active { background: color-mix(in srgb, var(--flaeche-2) 60%, var(--rand)); }
.zeile .haupt { flex: 1; min-width: 0; }
.zeile .titel { display: block; font-weight: 600; overflow-wrap: anywhere; }
.zeile .unter { display: block; color: var(--leise); font-size: .875rem; margin-top: .1rem; overflow-wrap: anywhere; }
.zeile .rechts { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; justify-content: flex-end; text-align: right; }
.zeile .pfeil { color: var(--zart); width: 1.05rem; height: 1.05rem; }
.zeile.leer { color: var(--leise); justify-content: center; text-align: center; min-height: 4.5rem; }
.kachel {
  width: 2.25rem; height: 2.25rem; border-radius: 9px; flex: none; display: grid; place-items: center; color: #fff;
  background: linear-gradient(180deg, #86868b, #636368);
}
.kachel .ico { width: 1.25rem; height: 1.25rem; stroke-width: 2; }
.kachel.blau { background: linear-gradient(180deg, #2b8cf5, #0062cc); }
.kachel.gruen { background: linear-gradient(180deg, #4ea838, #2f7a1a); }
.kachel.orange { background: linear-gradient(180deg, #f59a1b, #d47500); }
.kachel.rot { background: linear-gradient(180deg, #f2554c, #cc2a20); }

/* Angaben als Zeilen: Name links, Wert rechts */
dl.angaben { margin: 0; }
.angaben > div { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: .8rem 1rem; min-height: 3rem; }
.angaben dt { color: var(--text); flex: none; }
.angaben dd { margin: 0; color: var(--leise); text-align: right; overflow-wrap: anywhere; min-width: 0; }

/* --- Zustände -------------------------------------------------------------------------------------------- */

.pille {
  display: inline-flex; align-items: center; gap: .35rem; white-space: nowrap;
  font-size: .8125rem; font-weight: 600; line-height: 1.2; padding: .3rem .65rem; border-radius: 980px;
  background: var(--flaeche-2); color: var(--leise);
}
.pille .ico { width: .95rem; height: .95rem; stroke-width: 2.25; vertical-align: 0; }
.pille.blau { background: var(--blau-zart); color: var(--blau); }
.pille.gruen { background: var(--gruen-zart); color: var(--gruen); }
.pille.orange { background: var(--orange-zart); color: var(--orange); }
.pille.rot { background: var(--rot-zart); color: var(--rot); }
.punkt { width: .5rem; height: .5rem; border-radius: 50%; background: currentColor; flex: none; }
.punkt.laeuft { animation: puls 1.6s ease-in-out infinite; }
@keyframes puls { 50% { opacity: .3; } }

.meldung {
  display: flex; gap: .7rem; align-items: flex-start; padding: .85rem 1rem; border-radius: var(--r-klein);
  font-size: .9375rem; background: var(--flaeche-2);
}
.meldung > .ico { margin-top: .1rem; }
.meldung > div, .meldung > p { min-width: 0; flex: 1; }
.meldung strong { display: block; }
.meldung.fehler { background: var(--rot-zart); }
.meldung.fehler > .ico { color: var(--rot); }
.meldung.ok { background: var(--gruen-zart); }
.meldung.ok > .ico { color: var(--gruen); }
.meldung.warnung { background: var(--orange-zart); }
.meldung.warnung > .ico { color: var(--orange); }
.meldung.info { background: var(--blau-zart); }
.meldung.info > .ico { color: var(--blau); }
.meldung ul { margin: .3rem 0 0; padding-left: 1.1rem; }
.hinweis { color: var(--leise); font-size: .875rem; }

/* Lebenslauf eines Auftrags: Hochgeladen → Verarbeitung → Prüfung → Bereit */
.schritte { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .5rem; list-style: none; margin: 0; padding: 0; counter-reset: s; }
.schritte li { display: grid; gap: .45rem; min-width: 0; overflow-wrap: anywhere; hyphens: auto; -webkit-hyphens: auto; font-size: .8125rem; color: var(--zart); font-weight: 500; }
.schritte li::before { content: ""; height: 4px; border-radius: 2px; background: var(--flaeche-2); }
.schritte li.erledigt { color: var(--leise); }
.schritte li.erledigt::before { background: var(--gruen-voll); }
.schritte li.jetzt { color: var(--text); font-weight: 650; }
.schritte li.jetzt::before { background: linear-gradient(90deg, var(--blau-voll) 0 50%, var(--flaeche-2) 50%); background-size: 200% 100%; animation: lauf 2.4s linear infinite; }
.schritte li.halt { color: var(--rot); font-weight: 650; }
.schritte li.halt::before { background: var(--rot-voll); }
@keyframes lauf { from { background-position: 100% 0; } to { background-position: 0 0; } }

.stand { background: var(--flaeche); border-radius: var(--r); box-shadow: var(--schatten); padding: 1.1rem 1.25rem; display: grid; gap: 1rem; }
@media (prefers-color-scheme: light) { .stand { box-shadow: var(--schatten), 0 0 0 .5px rgb(0 0 0 / .05); } }
.stand .gross { font-size: 1.375rem; font-weight: 700; letter-spacing: -.02em; }
.stand .oben { display: flex; justify-content: space-between; gap: .5rem 1rem; align-items: baseline; flex-wrap: wrap; }

.balken { position: relative; height: 6px; border-radius: 3px; background: var(--flaeche-2); overflow: hidden; display: flex; }
.balken > span { height: 100%; transition: width 600ms var(--kurve); }
.balken .fertig { background: var(--gruen-voll); }
.balken .laeuft { background: var(--blau-voll); }
.balken .zurueck { background: var(--rot-voll); }
.balken.schmal { height: 4px; width: 100%; max-width: 12rem; margin-top: .45rem; }

/* --- Formulare ------------------------------------------------------------------------------------------- */

.formular { background: var(--flaeche); border-radius: var(--r); box-shadow: var(--schatten); padding: 1.25rem; display: grid; gap: 1rem; }
@media (prefers-color-scheme: light) { .formular { box-shadow: var(--schatten), 0 0 0 .5px rgb(0 0 0 / .05); } }
.formular.gefahr { box-shadow: 0 0 0 1px color-mix(in srgb, var(--rot-voll) 45%, transparent); }
.feld { display: grid; gap: .4rem; min-width: 0; }
label, legend { font-weight: 600; font-size: .9375rem; }
.feld .hinweis { margin-top: -.1rem; }
textarea, select, input:not([type=checkbox]):not([type=radio]):not([type=file]) {
  font: inherit; font-size: 1rem; width: 100%; min-height: 2.875rem; padding: .65rem .85rem;
  border: 1px solid var(--rand); border-radius: var(--r-klein); background: var(--flaeche); color: var(--text);
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
textarea { resize: vertical; min-height: 5rem; line-height: 1.45; }
select { appearance: none; -webkit-appearance: none; padding-right: 2.25rem; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--leise) 50%), linear-gradient(135deg, var(--leise) 50%, transparent 50%);
  background-position: calc(100% - 1.1rem) 52%, calc(100% - .8rem) 52%; background-size: .3rem .3rem; background-repeat: no-repeat; }
textarea:hover, select:hover, input:not([type=checkbox]):not([type=radio]):not([type=file]):hover { border-color: var(--zart); }
textarea:focus-visible, select:focus-visible, input:not([type=checkbox]):not([type=radio]):not([type=file]):focus-visible {
  outline: none; border-color: var(--akzent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--akzent) 30%, transparent);
}
input.code { font-size: 1.5rem; letter-spacing: .3em; text-align: center; font-variant-numeric: tabular-nums; font-weight: 600; }
::placeholder { color: var(--zart); opacity: 1; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; display: grid; gap: .5rem; }
legend { padding: 0; margin-bottom: .5rem; }
input[type=checkbox], input[type=radio] { width: 1.2rem; height: 1.2rem; margin: 0; flex: none; cursor: pointer; }

/* Wahl-Zeilen (Kontrollkästchen und Schalter in Listen) */
.wahl { display: flex; align-items: center; gap: .8rem; min-height: 3rem; padding: .65rem 1rem; cursor: pointer; font-weight: 400; font-size: 1rem; }
.wahl > span { flex: 1; min-width: 0; }
.wahl small { display: block; color: var(--leise); font-size: .8125rem; }
.gruppe .wahl { border-radius: 0; }
/* Schalter wie am iPhone */
input.schalter {
  appearance: none; -webkit-appearance: none; position: relative; width: 3.1rem; height: 1.9rem; border-radius: 980px; flex: none;
  background: var(--rand); transition: background-color 200ms ease; cursor: pointer;
}
input.schalter::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: calc(1.9rem - 4px); height: calc(1.9rem - 4px); border-radius: 50%;
  background: #fff; box-shadow: 0 2px 4px rgb(0 0 0 / .2), 0 0 0 .5px rgb(0 0 0 / .04); transition: transform 220ms var(--kurve);
}
input.schalter:checked { background: var(--gruen-voll); }
input.schalter:checked::after { transform: translateX(1.2rem); }
input.schalter:focus-visible { outline: 3px solid color-mix(in srgb, var(--akzent) 60%, transparent); outline-offset: 2px; }

/* Segment-Schalter (Auswahl über Radio-Felder, ohne Skript) */
.segment { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 2px; padding: 3px; border-radius: 11px; background: var(--flaeche-2); border: 0; margin: 0; }
.segment label { position: relative; display: flex; align-items: center; justify-content: center; text-align: center; min-height: 2.35rem; padding: .35rem .75rem; border-radius: 8px; font-size: .9375rem; font-weight: 600; cursor: pointer; transition: background-color 160ms ease, box-shadow 160ms ease; }
.segment input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.segment label:has(input:checked) { background: var(--flaeche); box-shadow: 0 1px 3px rgb(0 0 0 / .14), 0 0 0 .5px rgb(0 0 0 / .04); }
@media (prefers-color-scheme: dark) { .segment label:has(input:checked) { background: #636366; } }
.segment label:has(input:focus-visible) { outline: 3px solid color-mix(in srgb, var(--akzent) 60%, transparent); outline-offset: 1px; }

/* Ausklappbare Zeile */
details.aufklapp { background: var(--flaeche-2); border-radius: var(--r-klein); }
details.aufklapp > summary {
  display: flex; align-items: center; gap: .6rem; min-height: 3rem; padding: .6rem 1rem; cursor: pointer; list-style: none; font-weight: 500;
}
details.aufklapp > summary::-webkit-details-marker { display: none; }
details.aufklapp > summary .rechts { margin-left: auto; color: var(--leise); font-size: .8125rem; display: flex; align-items: center; gap: .25rem; }
details.aufklapp > summary .ico.pfeil { width: 1rem; height: 1rem; transition: transform 200ms var(--kurve); }
details.aufklapp[open] > summary .ico.pfeil { transform: rotate(90deg); }
details.aufklapp > .innen { padding: .25rem 1rem 1rem; display: grid; gap: .85rem; }
details.aufklapp textarea, details.aufklapp input:not([type=checkbox]):not([type=radio]) { background: var(--flaeche); }

/* --- Hochladen ------------------------------------------------------------------------------------------- */

.neu { display: grid; grid-template-columns: minmax(0, 1fr) 22rem; gap: 1.25rem; align-items: stretch; }
.ablage {
  position: relative; display: grid; place-content: center; justify-items: center; gap: .35rem; text-align: center;
  min-height: 15rem; padding: 2rem 1.5rem; border-radius: 18px; cursor: pointer; font-weight: 400;
  border: 2px dashed color-mix(in srgb, var(--akzent) 40%, var(--trenner));
  background: color-mix(in srgb, var(--akzent) 4%, var(--flaeche));
  transition: border-color 160ms ease, background-color 160ms ease, transform 220ms var(--kurve);
}
.ablage:hover, .ablage.drueber { border-color: var(--akzent); background: color-mix(in srgb, var(--akzent) 9%, var(--flaeche)); }
.ablage.drueber { transform: scale(1.01); }
.ablage:has(input:focus-visible) { outline: 3px solid color-mix(in srgb, var(--akzent) 60%, transparent); outline-offset: 2px; }
.ablage input[type=file] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.ablage .gross { width: 3rem; height: 3rem; color: var(--akzent-tief); stroke-width: 1.5; margin-bottom: .35rem; }
.ablage .titel { font-size: 1.1875rem; font-weight: 650; letter-spacing: -.015em; }
.ablage .waehlen { color: var(--akzent-tief); font-weight: 600; }
.ablage .gewaehlt { display: none; margin: .6rem 0 0; padding: 0; list-style: none; max-width: 100%; font-size: .9375rem; }
.ablage.hat-dateien .gewaehlt { display: grid; gap: .2rem; }
.ablage .gewaehlt li { display: flex; gap: .4rem; align-items: center; justify-content: center; min-width: 0; }
.ablage .gewaehlt li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ablage .gewaehlt .ico { width: 1rem; height: 1rem; color: var(--akzent-tief); }
.optionen { display: flex; flex-direction: column; gap: .85rem; background: var(--flaeche); border-radius: var(--r); box-shadow: var(--schatten); padding: 1rem; }
@media (prefers-color-scheme: light) { .optionen { box-shadow: var(--schatten), 0 0 0 .5px rgb(0 0 0 / .05); } }
.optionen .modus-text { font-size: .8125rem; color: var(--leise); margin: -.2rem .25rem 0; }
.optionen .modus-text.pseudo { display: none; color: var(--orange); }
.optionen:has(input[value=pseudo]:checked) .modus-text.anonym { display: none; }
.optionen:has(input[value=pseudo]:checked) .modus-text.pseudo { display: block; }
.optionen .knoepfe { margin-top: auto; display: grid; gap: .5rem; }
.optionen .wahl { padding: .5rem 1rem; }
.optionen .wahl .ico { color: var(--orange); }
.hochladen-stand { display: none; gap: .4rem; font-size: .875rem; color: var(--leise); }
.hochladen-stand.an { display: grid; }
.hochladen-stand .balken > span { background: var(--akzent); }

/* --- Tabellen (Protokoll, Kennzahlen, Funde) ------------------------------------------------------------- */

.tabelle-rahmen { overflow-x: auto; background: var(--flaeche); border-radius: var(--r); box-shadow: var(--schatten); }
@media (prefers-color-scheme: light) { .tabelle-rahmen { box-shadow: var(--schatten), 0 0 0 .5px rgb(0 0 0 / .05); } }
table { border-collapse: collapse; width: 100%; font-size: .9375rem; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: .7rem 1rem; vertical-align: top; }
td { border-top: 1px solid var(--trenner); }
th { font-size: .8125rem; font-weight: 600; color: var(--leise); white-space: nowrap; }
td.zahl, th.zahl { text-align: right; white-space: nowrap; }
td.name { overflow-wrap: anywhere; min-width: 12rem; }
td.leise { font-size: .875rem; }
.kat { display: inline-block; font-size: .6875rem; font-weight: 700; letter-spacing: .03em; line-height: 1.5; color: var(--leise); background: var(--flaeche-2); border-radius: 5px; padding: .05rem .4rem; white-space: nowrap; }
.kat.art9 { color: var(--orange); background: var(--orange-zart); }

/* --- Kennzahlen ------------------------------------------------------------------------------------------ */

.kacheln { display: grid; grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr)); gap: .75rem; }
.kennzahl { background: var(--flaeche); border-radius: var(--r); box-shadow: var(--schatten); padding: .9rem 1.1rem; }
@media (prefers-color-scheme: light) { .kennzahl { box-shadow: var(--schatten), 0 0 0 .5px rgb(0 0 0 / .05); } }
.kennzahl .wert { font-size: 1.75rem; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kennzahl .name { font-size: .8125rem; color: var(--leise); }

/* --- Prüfen ---------------------------------------------------------------------------------------------- */

.hinweise { display: grid; grid-template-columns: repeat(auto-fill, minmax(19rem, 1fr)); gap: .6rem; }
.ansicht { display: flex; justify-content: space-between; align-items: center; gap: .75rem; flex-wrap: wrap; }
.ansicht .segment { min-width: min(100%, 24rem); }
.vergleich { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; align-items: start; margin-top: 1rem; }
.vergleich > section { min-width: 0; }
.vergleich h3 { font-size: .8125rem; font-weight: 600; color: var(--leise); margin: 0 .25rem .5rem; letter-spacing: 0; }
.vergleich > section > h3 + * { margin-top: 0; }
body:has(#ansicht-original:checked) .vergleich, body:has(#ansicht-ergebnis:checked) .vergleich { grid-template-columns: minmax(0, 1fr); }
body:has(#ansicht-original:checked) .vergleich .ergebnis, body:has(#ansicht-ergebnis:checked) .vergleich .original { display: none; }
.textansicht {
  margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; background: var(--flaeche); color: var(--text);
  border-radius: var(--r-klein); box-shadow: var(--schatten), 0 0 0 1px var(--trenner);
  padding: 1.5rem 1.75rem; font: 400 .9375rem/1.7 -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", sans-serif;
  max-height: 80vh; overflow: auto;
}
.textansicht mark {
  background: rgb(255 204 0 / .38); color: inherit; border-radius: 3px; padding: 0 .1em;
  box-shadow: inset 0 -2px 0 rgb(230 140 0 / .75);
}
@media (prefers-color-scheme: dark) { .textansicht mark { background: rgb(255 214 10 / .28); box-shadow: inset 0 -2px 0 rgb(255 159 10 / .8); } }
img.seite { display: block; width: 100%; height: auto; border-radius: var(--r-klein); background: #fff; box-shadow: var(--schatten), 0 0 0 1px var(--trenner); }
img.seite + img.seite { margin-top: .9rem; }
.leer-ansicht { display: grid; place-items: center; gap: .4rem; min-height: 14rem; padding: 2rem; text-align: center; color: var(--leise); background: var(--flaeche); border-radius: var(--r-klein); border: 1px dashed var(--rand); }
.leer-ansicht .ico { width: 2rem; height: 2rem; }
.entscheid { display: grid; gap: 1rem; }
.aktion {
  position: sticky; bottom: 1.25rem; z-index: 10; width: fit-content; max-width: 100%; margin: 1.5rem auto 0;
  display: flex; align-items: center; gap: .5rem; padding: .5rem .5rem .5rem 1.15rem; border-radius: 980px;
  background: var(--glas); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  box-shadow: var(--schatten-hoch), 0 0 0 .5px var(--trenner);
}
.aktion .frage { font-size: .9375rem; color: var(--leise); margin-right: .4rem; }
.aktion.erledigt { padding: .6rem 1.15rem; }
details#fehler { scroll-margin-top: calc(var(--band-hoehe) + 1rem); }
details#fehler > .innen fieldset .wahl { padding: .35rem 0; min-height: 2.5rem; }

/* --- Startpasswort, Zwei-Faktor -------------------------------------------------------------------------- */

.startpasswort { text-align: center; margin: 0; }
.startpasswort code, .geheim {
  display: inline-block; padding: .55rem .9rem; border-radius: var(--r-klein); background: var(--flaeche-2);
  font-size: 1.05rem; letter-spacing: .05em; word-break: break-all; user-select: all; -webkit-user-select: all;
}
.startpasswort code { font-size: 1.6rem; font-weight: 600; padding: .8rem 1.2rem; }
ol.anleitung { margin: 0; padding: 0; list-style: none; counter-reset: a; display: grid; gap: 1rem; }
ol.anleitung > li { counter-increment: a; display: grid; grid-template-columns: 1.75rem minmax(0, 1fr); gap: .75rem; align-items: start; }
ol.anleitung > li::before {
  content: counter(a); width: 1.75rem; height: 1.75rem; border-radius: 50%; display: grid; place-items: center;
  background: var(--akzent); color: var(--akzent-text); font-weight: 700; font-size: .875rem;
}
ol.anleitung > li > div { display: grid; gap: .6rem; justify-items: start; }
.qr { display: block; width: 13rem; height: 13rem; padding: 10px; background: #fff; border-radius: var(--r-klein); box-shadow: 0 0 0 1px var(--trenner); }

/* --- Schmale Bildschirme ----------------------------------------------------------------------------------- */

@media (max-width: 75rem) {
  .neu { grid-template-columns: minmax(0, 1fr) 20rem; }
}
@media (max-width: 64rem) {
  .rahmen { --leistenbreite: 13.5rem; }
  main { padding: 2rem 1.5rem 5rem; }
  .neu { grid-template-columns: 1fr; }
  .ablage { min-height: 11rem; }
}
@media (max-width: 47.99rem) {
  .rahmen { display: block; background: none; }
  .seitenleiste { display: none; }
  main { padding: 1.25rem 1rem calc(6rem + env(safe-area-inset-bottom)); }
  body.allein main { padding-top: 2.5rem; }
  h1 { font-size: 1.75rem; }
  .kopf > div { flex-basis: 100%; }
  .kopf .knopfreihe { width: 100%; }
  .reiter {
    display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; inset: auto 0 0 0; z-index: 30;
    padding: .35rem .25rem calc(.35rem + env(safe-area-inset-bottom));
    background: var(--glas); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-top: 1px solid var(--trenner);
  }
  .reiter a { display: grid; justify-items: center; align-content: center; gap: .1rem; min-height: 3rem; font-size: .6875rem; font-weight: 600; color: var(--zart); }
  .reiter a .ico { width: 1.6rem; height: 1.6rem; }
  .reiter a:hover { text-decoration: none; }
  .reiter a[aria-current] { color: var(--akzent-tief); }
  .reiter .zaehler { position: absolute; margin: -.1rem 0 0 1.4rem; min-width: 1.1rem; padding: 0 .3rem; border-radius: 980px; background: var(--rot-voll); color: #fff; font-size: .625rem; line-height: 1.1rem; text-align: center; }
  .unternav.segment { display: grid; }
  .funde-tabelle th:nth-child(4), .funde-tabelle td:nth-child(4) { display: none; }
  .ablage { min-height: 0; padding: 1.75rem 1rem; }
  .ablage .gross { width: 2.5rem; height: 2.5rem; }
  .vergleich { grid-template-columns: minmax(0, 1fr); }
  .ansicht .segment { width: 100%; }
  .hinweise { grid-template-columns: 1fr; }
  .aktion { bottom: calc(4.6rem + env(safe-area-inset-bottom)); width: 100%; padding-left: .5rem; }
  .aktion .frage { display: none; }
  .aktion > * { flex: 1; }
  .textansicht { padding: 1.1rem 1.15rem; max-height: none; }
  .zeile { align-items: flex-start; flex-wrap: wrap; }
  .zeile .kachel { margin-top: .1rem; }
  .zeile .rechts { width: 100%; justify-content: flex-start; padding-left: 3.1rem; }
  .zeile .pfeil { display: none; }
  .zeile.ohne-kachel .rechts { padding-left: 0; }
  .angaben > div { flex-direction: column; gap: .1rem; }
  .angaben dd { text-align: left; }
  table.liste thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  table.liste, table.liste tbody, table.liste tr, table.liste td { display: block; width: 100%; }
  table.liste tr { padding: .7rem 1rem; }
  table.liste tr + tr { border-top: 1px solid var(--trenner); }
  table.liste td { border: 0; padding: .1rem 0 .1rem 7.5rem; position: relative; min-height: 1.6rem; text-align: left; white-space: normal; }
  table.liste td[data-label]::before { content: attr(data-label); position: absolute; left: 0; top: .15rem; width: 7rem; color: var(--leise); font-size: .8125rem; font-weight: 600; }
  .schritte li { font-size: .75rem; }
  .startpasswort code { font-size: 1.3rem; }
}
@media (hover: none) {
  a.zeile:hover { background: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 1ms !important; animation: none !important; }
  button:active, a.knopf:active { transform: none; }
}
@media (prefers-reduced-transparency: reduce) {
  .reiter, .aktion { background: var(--flaeche); backdrop-filter: none; -webkit-backdrop-filter: none; }
}
@media print {
  .testbetrieb { position: static; }
  .seitenleiste, .reiter, .aktion { display: none; }
  .rahmen { display: block; }
}

/* Überschrift mittig (allein stehende Seiten) */
.mitte { text-align: center; display: grid; gap: .4rem; }
.mitte p { color: var(--leise); }
.segment a { display: flex; align-items: center; justify-content: center; text-align: center; min-height: 2.35rem; padding: .35rem .75rem; border-radius: 8px; font-size: .9375rem; font-weight: 600; color: var(--text); }
.segment a:hover { text-decoration: none; background: color-mix(in srgb, var(--flaeche) 50%, transparent); }
.segment a[aria-current] { background: var(--flaeche); box-shadow: 0 1px 3px rgb(0 0 0 / .14), 0 0 0 .5px rgb(0 0 0 / .04); }
@media (prefers-color-scheme: dark) { .segment a[aria-current] { background: #636366; } }

/* Balkenbreiten in 5-%-Schritten (keine Inline-Stile wegen CSP; app.js setzt Zwischenwerte direkt) */
.b0 { width: 0%; }
.b5 { width: 5%; }
.b10 { width: 10%; }
.b15 { width: 15%; }
.b20 { width: 20%; }
.b25 { width: 25%; }
.b30 { width: 30%; }
.b35 { width: 35%; }
.b40 { width: 40%; }
.b45 { width: 45%; }
.b50 { width: 50%; }
.b55 { width: 55%; }
.b60 { width: 60%; }
.b65 { width: 65%; }
.b70 { width: 70%; }
.b75 { width: 75%; }
.b80 { width: 80%; }
.b85 { width: 85%; }
.b90 { width: 90%; }
.b95 { width: 95%; }
.b100 { width: 100%; }

/* Ergebnis: Ersetzungen wie Schwärzungen */
.vergleich .ergebnis .textansicht mark { background: var(--text); color: var(--flaeche); box-shadow: none; padding: .05em .35em; font-size: .85em; font-weight: 600; letter-spacing: .02em; }
.entscheid > details { background: var(--flaeche); box-shadow: var(--schatten); }
@media (prefers-color-scheme: light) { .entscheid > details { box-shadow: var(--schatten), 0 0 0 .5px rgb(0 0 0 / .05); } }
.entscheid > details > summary .ico:first-child { color: var(--orange); }
ul.gruende { margin: .3rem 0 0; padding-left: 1.1rem; }
section > h3 { margin-top: 1.25rem; }
.nur-handy { display: none; }
@media (max-width: 47.99rem) { .nur-handy { display: block; } }

/* Dateiauswahl außerhalb der Ablagefläche (Rückübersetzen) */
input[type=file] { font: inherit; font-size: .9375rem; color: var(--leise); max-width: 100%; }
input[type=file]::file-selector-button {
  font: inherit; font-weight: 600; margin-right: .75rem; padding: .5rem 1rem; border: 0; border-radius: 980px;
  background: var(--akzent-zart); color: var(--akzent-tief); cursor: pointer;
}
input[type=file]::file-selector-button:hover { background: color-mix(in srgb, var(--akzent) 20%, transparent); }

/* --- Seitenleiste einklappen (nur Symbole). Zustand im Cookie anon_leiste, damit die Seite gleich richtig lädt -- */
.leisten-kopf { display: flex; align-items: center; gap: .25rem; padding-bottom: .75rem; }
.leisten-kopf .app-name { flex: 1; min-width: 0; padding-bottom: .25rem; }
.leisten-kopf .app-name .text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seitenleiste .leisten-knopf {
  flex: none; width: 2.25rem; height: 2.25rem; min-height: 0; padding: 0; border-radius: 8px;
  background: transparent; color: var(--leise); justify-content: center;
}
.seitenleiste .leisten-knopf:hover { background: rgb(0 0 0 / .06); color: var(--text); }
@media (prefers-color-scheme: dark) { .seitenleiste .leisten-knopf:hover { background: rgb(255 255 255 / .08); } }
.seitenleiste .leisten-knopf .ico { width: 1.25rem; height: 1.25rem; color: inherit; }

.rahmen.leiste-schmal { --leistenbreite: 4.5rem; }
.leiste-schmal .seitenleiste { padding: .75rem .625rem; overflow: visible; }
.leiste-schmal .seitenleiste .text {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}
.leiste-schmal .leisten-kopf { flex-direction: column; gap: .5rem; }
.leiste-schmal .leisten-kopf .app-name { padding: .25rem 0 0; justify-content: center; }
.leiste-schmal .seitenleiste a, .leiste-schmal .seitenleiste button.nav { position: relative; justify-content: center; padding: .5rem 0; }
.leiste-schmal .seitenleiste .zaehler {
  position: absolute; top: .1rem; right: .2rem; min-width: 1.1rem; padding: 0 .25rem; line-height: 1.1rem;
  font-size: .625rem; background: var(--rot-voll); color: #fff;
}
.leiste-schmal .seitenleiste a[aria-current] .zaehler { background: var(--rot-voll); color: #fff; }
.leiste-schmal .seitenleiste .abschnitt { height: 1px; margin: .6rem .4rem; padding: 0; background: var(--trenner); }
.leiste-schmal .ich { position: relative; justify-content: center; padding: .35rem 0 .5rem; }
/* Name als Hinweis beim Darüberfahren und bei Tastatur-Fokus */
.leiste-schmal .seitenleiste [data-titel]:hover::after,
.leiste-schmal .seitenleiste [data-titel]:focus-visible::after {
  content: attr(data-titel); position: absolute; left: calc(100% + .75rem); top: 50%; transform: translateY(-50%);
  z-index: 50; pointer-events: none; white-space: nowrap; padding: .35rem .65rem; border-radius: 7px;
  background: var(--text); color: var(--grund); font-size: .8125rem; font-weight: 600; letter-spacing: -.005em;
  box-shadow: var(--schatten-hoch);
}
@media (prefers-reduced-motion: reduce) { .rahmen { transition: none; } }
