:root {
  --ink: #0a0a0a;
  --paper: #ffffff;
  --grau: #f2f2f2;
  --linie: #e3e3e3;
  --leise: #6e6e6e;
  --ok: #00a85a;
  --warn: #d97706;
  --rot: #d0302f;
  --r: 14px;
  --kopf: "Anton", "Impact", "Arial Narrow", sans-serif;
  --text: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--text); font-size: 16px; }
body { padding-bottom: env(safe-area-inset-bottom); }
#app { max-width: 640px; margin: 0 auto; padding: 16px 16px 120px; }
h1, h2, h3 { font-family: var(--kopf); font-weight: 400; text-transform: uppercase; letter-spacing: .01em; line-height: 1; margin: 0; }
h1 { font-size: 40px; margin: 8px 0 20px; }
h2 { font-size: 24px; margin: 28px 0 12px; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
.leise { color: var(--leise); }
.klein { font-size: 13px; }

.kopfzeile { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; }
.zurueck { font-weight: 600; padding: 10px 0; }

/* Kacheln */
.kachel { display: block; width: 100%; text-align: left; border-radius: var(--r); padding: 22px 20px; margin-bottom: 12px; background: var(--grau); }
.kachel strong { display: block; font-family: var(--kopf); font-size: 28px; text-transform: uppercase; font-weight: 400; }
.kachel span { color: var(--leise); font-size: 14px; }
.kachel.schwarz { background: var(--ink); color: var(--paper); }
.kachel.schwarz span { color: #bdbdbd; }
.zahl { float: right; font-family: var(--kopf); font-size: 28px; }

/* Listen */
.liste { border-top: 1px solid var(--linie); }
.zeile { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--linie); }
.zeile .mitte { flex: 1; min-width: 0; }
.zeile .titel { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.zeile .unter { font-size: 13px; color: var(--leise); }
.zeile.aus .titel { color: var(--leise); text-decoration: line-through; }
.kunde-zeile { width: 100%; text-align: left; }

.haken { width: 30px; height: 30px; border-radius: 8px; border: 2px solid var(--ink); flex: none; display: grid; place-items: center; font-weight: 700; }
.haken.an { background: var(--ink); color: var(--paper); }
.haken.an::after { content: "✓"; }
.preis { width: 84px; flex: none; text-align: right; padding: 8px 10px; border: 1px solid var(--linie); border-radius: 10px; background: var(--paper); }
.plus { width: 40px; height: 40px; border-radius: 10px; background: var(--grau); font-size: 22px; flex: none; }

.marke { display: inline-block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 2px 7px; border-radius: 6px; background: var(--grau); margin-right: 6px; vertical-align: 1px; }
.marke.offen { background: #fff1db; color: #8a4b00; }
.marke.ok { background: #dcf5e8; color: #00653a; }

/* Chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 10px 14px; border-radius: 999px; border: 2px solid var(--ink); font-weight: 600; }
.chip.an { background: var(--ink); color: var(--paper); }

/* Formular */
.feld { display: block; width: 100%; padding: 14px 16px; border: 2px solid var(--ink); border-radius: var(--r); background: var(--paper); font-size: 18px; }
label.etikett { display: block; font-weight: 600; margin: 18px 0 8px; }
.knopf { display: block; width: 100%; padding: 18px; border-radius: var(--r); background: var(--ink); color: var(--paper); font-family: var(--kopf); text-transform: uppercase; font-size: 22px; letter-spacing: .02em; text-align: center; text-decoration: none; }
.knopf.hell { background: var(--grau); color: var(--ink); }
.knopf:disabled { opacity: .35; }

/* Leiste unten */
.leiste { position: fixed; left: 0; right: 0; bottom: 0; background: var(--paper); border-top: 1px solid var(--linie); padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); display: flex; gap: 10px; justify-content: center; z-index: 5; }
.leiste > * { flex: 1; max-width: 300px; padding: 16px 8px; font-size: 19px; }
.leiste .knopf.hell { flex: .6; }

details.vorschlaege { margin-top: 8px; }
details.vorschlaege summary { padding: 12px 0; font-weight: 600; color: var(--leise); cursor: pointer; }

/* Scanner */
.scanner { position: fixed; inset: 0; background: #000; color: #fff; z-index: 20; display: flex; flex-direction: column; }
.scanner-kopf { display: flex; align-items: center; justify-content: space-between; padding: calc(10px + env(safe-area-inset-top)) 16px 10px; gap: 10px; }
.scanner-kopf h3 { font-size: 22px; }
.scanner .chips { padding: 0 16px 10px; overflow-x: auto; flex-wrap: nowrap; }
.scanner .chip { border-color: #fff; color: #fff; white-space: nowrap; padding: 8px 12px; font-size: 14px; }
.scanner .chip.an { background: #fff; color: #000; }
#leser { flex: 1; position: relative; overflow: hidden; }
#leser video { width: 100% !important; height: 100% !important; object-fit: cover; }
.schliessen { color: #fff; font-weight: 700; padding: 10px 4px; }
.zaehler { font-family: var(--kopf); font-size: 22px; }
.hinweis { position: absolute; left: 0; right: 0; bottom: 18px; text-align: center; color: #fff; font-size: 14px; text-shadow: 0 1px 4px #000; pointer-events: none; }

.blatt { position: fixed; left: 0; right: 0; bottom: 0; background: var(--paper); color: var(--ink); border-radius: 20px 20px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); z-index: 30; max-height: 85vh; overflow-y: auto; box-shadow: 0 -8px 30px rgba(0,0,0,.4); }
.blatt h3 { font-size: 26px; margin-bottom: 4px; }
.preisraster { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 14px 0; }
.preisraster button { padding: 16px 4px; border-radius: 12px; background: var(--grau); font-weight: 700; font-size: 17px; }
.preisraster button.an { background: var(--ink); color: var(--paper); }
.reihe { display: flex; gap: 10px; }
.reihe > * { flex: 1; }

#toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(110px + env(safe-area-inset-bottom)); background: var(--ink); color: var(--paper); padding: 12px 18px; border-radius: 12px; z-index: 40; font-weight: 600; max-width: calc(100% - 32px); text-align: center; }
body.scannt #toast { bottom: auto; top: calc(110px + env(safe-area-inset-top)); }
#toast.ok { background: var(--ok); }
#toast.warn { background: var(--warn); }

/* Offene Artikel */
.karte { border: 1px solid var(--linie); border-radius: var(--r); padding: 14px; margin-bottom: 14px; }
.fotos { display: flex; gap: 8px; overflow-x: auto; margin-bottom: 10px; }
.fotos img { height: 160px; border-radius: 10px; }
.karte .feld { font-size: 16px; padding: 10px 12px; border-width: 1px; margin-bottom: 8px; }
.leer { padding: 40px 0; text-align: center; color: var(--leise); }
