:root {
  --bg: #f3f4f6; --karte: #fff; --text: #111827; --leise: #6b7280; --rand: #e5e7eb;
  --akzent: #f59e0b; --akzent-text: #111827; --ok: #059669; --fehler: #dc2626; --warn: #b45309;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0b0f17; --karte: #151b26; --text: #e5e7eb; --leise: #9ca3af; --rand: #273142; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  padding-bottom: env(safe-area-inset-bottom);
}
.kopf {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: calc(.6rem + env(safe-area-inset-top)) 1rem .6rem; background: #111827; color: #fff;
}
.kopf a { color: #fff; text-decoration: none; }
.marke { font-weight: 700; letter-spacing: .02em; }
.marke::before { content: "●"; color: var(--akzent); margin-right: .4rem; }
.kopf nav { display: flex; gap: .25rem; align-items: center; }
.kopf nav a, .kopf nav button { padding: .4rem .7rem; border-radius: .5rem; color: #d1d5db; font-size: .95rem; }
.kopf nav a.aktiv { background: #374151; color: #fff; }
body.ohne-login .kopf nav { visibility: hidden; }
.banner { background: #fef3c7; color: #78350f; padding: .7rem 1rem; font-weight: 600; text-align: center; }
main { max-width: 960px; margin: 0 auto; padding: 1rem; }
.karte { background: var(--karte); border: 1px solid var(--rand); border-radius: 1rem; padding: 1.1rem; margin-bottom: 1rem; }
.schmal { max-width: 380px; margin: 3rem auto; }
h1 { font-size: 1.35rem; margin: 0 0 .8rem; }
h2 { font-size: 1.1rem; margin: 0; }
label { display: block; font-weight: 600; font-size: .9rem; }
input[type=password], input:not([type]), input[type=search] {
  display: block; width: 100%; margin-top: .3rem; padding: .75rem .85rem; font-size: 1.1rem;
  border: 1px solid var(--rand); border-radius: .6rem; background: var(--bg); color: var(--text);
}
input:focus { outline: 2px solid var(--akzent); border-color: transparent; }
#kennzeichen { text-transform: uppercase; font-family: ui-monospace, Menlo, monospace; letter-spacing: .05em; }
.felder { display: grid; gap: .8rem; grid-template-columns: 1fr 1fr; }
@media (max-width: 520px) { .felder { grid-template-columns: 1fr; } }
.vorschau { min-height: 1.4em; margin: .7rem 0 .4rem; color: var(--leise); }
.vorschau.ok { color: var(--ok); font-weight: 600; }
.vorschau.fehler, .fehler { color: var(--fehler); }
.hinweis { color: var(--leise); font-size: .875rem; margin: .4rem 0; }
.hinweis.ok { color: var(--ok); } .hinweis.warnung { color: var(--warn); } .hinweis.fehler { color: var(--fehler); }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .8rem; }
.chip { border: 1px solid var(--rand); background: var(--bg); color: var(--text); border-radius: 999px; padding: .35rem .75rem; font-size: .85rem; cursor: pointer; }
.knoepfe { display: flex; flex-wrap: wrap; gap: .6rem; }
.knoepfe.klein .knopf { padding: .5rem .8rem; font-size: .9rem; }
.knopf, button.primaer {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem; cursor: pointer;
  padding: .9rem 1.2rem; border-radius: .7rem; border: 1px solid var(--rand); background: var(--bg);
  color: var(--text); font: inherit; font-weight: 600; text-decoration: none; user-select: none;
}
#v-upload .knoepfe .knopf { flex: 1 1 10rem; font-size: 1.1rem; padding: 1.1rem; }
.primaer { background: var(--akzent) !important; border-color: var(--akzent) !important; color: var(--akzent-text) !important; }
button.primaer { width: 100%; margin-top: 1rem; font-size: 1.05rem; }
.gefahr { color: var(--fehler); }
.knopf[aria-disabled=true] { opacity: .4; pointer-events: none; }
.link { background: none; border: 0; color: var(--leise); font: inherit; cursor: pointer; text-decoration: none; }
.zeile { display: flex; justify-content: space-between; align-items: center; gap: .8rem; flex-wrap: wrap; margin-bottom: .8rem; }
.zeile h1 { margin: 0; }
.fortschritt { height: 6px; background: var(--rand); border-radius: 3px; overflow: hidden; margin: .35rem 0; }
.fortschritt.gross { height: 10px; border-radius: 5px; }
.fortschritt > div { height: 100%; width: 0; background: var(--akzent); transition: width .2s; }
.liste { list-style: none; margin: 0; padding: 0; }
.eintrag { display: flex; gap: .75rem; align-items: center; padding: .55rem 0; border-top: 1px solid var(--rand); }
.eintrag img { width: 56px; height: 56px; object-fit: cover; border-radius: .4rem; background: var(--rand); flex: none; }
.eintrag .info { flex: 1; min-width: 0; }
.eintrag .name { font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.eintrag.fertig .fortschritt > div { background: var(--ok); }
.eintrag.fehlerhaft { cursor: pointer; } .eintrag.fehlerhaft .fortschritt > div { background: var(--fehler); }
.vorgaenge li { border-top: 1px solid var(--rand); }
.vorgaenge a { display: flex; flex-direction: column; padding: .75rem .25rem; color: var(--text); text-decoration: none; }
.vorgaenge li.neu strong::after { content: "neu"; margin-left: .5rem; font-size: .7rem; background: var(--akzent); color: #111827; padding: .1rem .4rem; border-radius: .3rem; vertical-align: middle; }
#suche { margin: .2rem 0 .8rem; }
.raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .6rem; margin-top: 1rem; }
.raster figure { margin: 0; cursor: pointer; border-radius: .5rem; overflow: hidden; background: var(--bg); border: 1px solid var(--rand); }
.raster img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.raster figcaption { font-size: .75rem; padding: .3rem .4rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.raster figure.abgeholt { opacity: .45; }
.lightbox { position: fixed; inset: 0; z-index: 10; background: rgba(0,0,0,.92); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 1rem; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 6rem); object-fit: contain; }
.lightbox-leiste { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; justify-content: center; margin-top: .8rem; color: #fff; }
.lightbox-leiste .knopf { padding: .5rem .8rem; background: #1f2937; color: #fff; border-color: #374151; }
[hidden] { display: none !important; }
.fuss { text-align: center; color: var(--leise); font-size: .8rem; padding: 1rem 1rem calc(1rem + env(safe-area-inset-bottom)); }
