/* Buchungsmaschine Lager 4 – MDC-Blau (#0C2340 / #003DA5 / #0085CA / #99D6EA). Handy zuerst, große Flächen für Handschuhe. */
:root {
  --nacht: #0C2340; --blau: #003DA5; --hell: #0085CA; --eis: #99D6EA; --grund: #F3F6FA; --weiss: #fff;
  --text: #0C2340; --leise: #5A6B82; --rand: #D5DDE8; --gruen: #1B8A4B; --gelb: #B86E00; --rot: #B3261E; --grau: #8A97A8;
  --duration-fast: 150ms;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--grund); color: var(--text);
  font: 17px/1.35 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-text-size-adjust: 100%; }
body { overscroll-behavior-y: contain; }
button, input { font: inherit; color: inherit; }
button { -webkit-tap-highlight-color: transparent; touch-action: manipulation; cursor: pointer; }
h1 { margin: 0 0 .2rem; font-size: 1.6rem; }
h2 { margin: 1rem 0 .4rem; font-size: 1.05rem; }
.verborgen { display: none !important; }
.leise { color: var(--leise); font-size: .92rem; }
.mitte-text { text-align: center; }
#app { max-width: 640px; margin: 0 auto; min-height: 100%; padding-bottom: env(safe-area-inset-bottom); }
.ansicht { padding: 0 .6rem 1rem; }
.karte { background: var(--weiss); border: 1px solid var(--rand); border-radius: 16px; padding: 1rem; margin-top: .7rem; }
.karte.mitte { margin-top: 8vh; }

.kopf { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  margin: 0 -.6rem; padding: calc(.5rem + env(safe-area-inset-top)) .7rem .5rem; background: var(--nacht); color: #fff; }
.kopf .leise { color: var(--eis); }
.kopf-rechts { display: flex; align-items: center; gap: .4rem; }
.titel { font-weight: 700; font-size: 1.05rem; text-align: center; flex: 1; }
.klein { min-height: 40px; padding: 0 .7rem; border-radius: 10px; border: 1px solid rgba(255,255,255,.45); background: transparent; color: #fff; font-size: .9rem; }
.chip { display: inline-block; padding: .15rem .55rem; border-radius: 999px; font-size: .82rem; font-weight: 600; background: rgba(255,255,255,.16); color: #fff; white-space: nowrap; }
.chip.warn { background: #FFD24D; color: #3b2a00; }
.chip.gut { background: #BFE8CF; color: #0b4a26; }

.feld { display: block; margin-top: .9rem; font-weight: 600; }
.feld input { display: block; width: 100%; margin-top: .3rem; padding: .8rem; border: 2px solid var(--rand); border-radius: 12px; font-size: 1.15rem; background: #fff; }
.feld input:focus { outline: none; border-color: var(--hell); }
.pin-anzeige { min-height: 3rem; margin-top: .3rem; padding: .6rem; border: 2px solid var(--rand); border-radius: 12px; font-size: 1.6rem; letter-spacing: .5rem; text-align: center; background: #fff; }
.tasten { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin-top: .7rem; }
.tasten button { min-height: 64px; border-radius: 14px; border: 1px solid var(--rand); background: #fff; font-size: 1.6rem; font-weight: 700; }
.tasten button:active { background: var(--eis); }
.tasten button.ok { background: var(--blau); color: #fff; border-color: var(--blau); }
.tasten button.ok:disabled { opacity: .45; }
.tasten button.neben { font-size: 1.05rem; font-weight: 600; color: var(--leise); }
.meldung { min-height: 1.2rem; margin: .5rem 0 0; color: var(--rot); font-weight: 600; text-align: center; }
.meldung.ruhig { color: var(--leise); font-weight: 500; }

.gross { display: block; width: 100%; min-height: 68px; padding: .6rem 1rem; border-radius: 16px; border: 0; font-size: 1.25rem; font-weight: 700; }
.blau { background: var(--blau); color: #fff; }
.raster { display: grid; gap: .5rem; }
.gaenge { grid-template-columns: repeat(4, 1fr); }
.ebenen { grid-template-columns: repeat(3, 1fr); }
.raster button { min-height: 72px; border-radius: 14px; border: 2px solid var(--rand); background: #fff; font-size: 1.5rem; font-weight: 800; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.raster button small { font-size: .75rem; font-weight: 600; color: var(--leise); }
.raster button.gewaehlt { border-color: var(--blau); background: #E6EEFB; }
.raster button.fertig { border-color: var(--gruen); background: #E7F5EC; }
.raster button.teil { border-color: var(--hell); }

/* Leiste der 64 Plätze */
.leiste { display: flex; gap: 4px; overflow-x: auto; padding: .5rem .1rem; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
.leiste button { flex: 0 0 auto; width: 44px; height: 44px; border-radius: 10px; border: 2px solid var(--rand); background: #fff; font-weight: 700; font-size: .95rem; scroll-snap-align: center; }
.leiste button.jetzt { border-color: var(--nacht); box-shadow: 0 0 0 3px var(--eis); transform: scale(1.08); }
.leiste button.leer { background: #E3E8EF; color: var(--leise); }
.leiste button.wartet { background: #DCEBFA; border-color: var(--hell); }
.leiste button.erkannt { background: #CFEBD9; border-color: var(--gruen); }
.leiste button.gebucht { background: var(--gruen); border-color: var(--gruen); color: #fff; }
.leiste button.klaer { background: #FFE3B8; border-color: var(--gelb); }

/* Kamera */
.kamera { position: relative; overflow: hidden; border-radius: 14px; background: #000; aspect-ratio: 4 / 3; max-height: 44vh; margin: 0 auto; }
.kamera video { width: 100%; height: 100%; object-fit: cover; display: block; }
.kamera.schmal { max-height: 16vh; aspect-ratio: auto; height: 16vh; }
.linie { position: absolute; left: 6%; right: 6%; top: 50%; height: 2px; background: #ff3b30; box-shadow: 0 0 8px #ff3b30; }
.k-hinweis { position: absolute; left: 0; right: 0; top: 0; padding: .35rem .6rem; background: rgba(12,35,64,.72); color: #fff; font-weight: 700; font-size: 1rem; text-align: center; }
.k-hinweis:empty { display: none; }

/* Arbeitsfeld unter der Kamera */
.feldkarte { background: var(--weiss); border: 1px solid var(--rand); border-radius: 16px; padding: .8rem; margin-top: .5rem; }
.platz { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; }
.platz b { font-size: 2.2rem; line-height: 1; letter-spacing: .02em; }
.platz span { color: var(--leise); font-weight: 600; }
.drei { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: .5rem; margin-top: .7rem; }
.drei button, .zwei button, .eins button { min-height: 84px; border-radius: 16px; border: 0; font-size: 1.15rem; font-weight: 800; color: #fff; line-height: 1.15; }
.zwei { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin-top: .6rem; }
.eins { display: grid; grid-template-columns: 1fr; gap: .5rem; margin-top: .6rem; }
.t-leer { background: var(--grau); }
.t-label { background: var(--blau); }
.t-ohne { background: var(--nacht); }
.t-ausloeser { background: var(--hell); font-size: 1.4rem !important; min-height: 96px !important; }
.t-neben { background: #fff !important; color: var(--text) !important; border: 2px solid var(--rand) !important; font-weight: 600 !important; min-height: 56px !important; font-size: 1rem !important; }
.t-ok { background: var(--gruen); }
.drei button:active, .zwei button:active, .eins button:active { filter: brightness(.9); }
.schritt { font-weight: 800; font-size: 1.15rem; margin: .1rem 0 .2rem; }
.daumen { display: flex; gap: .4rem; margin-top: .5rem; flex-wrap: wrap; }
.daumen figure { margin: 0; position: relative; }
.daumen img { width: 74px; height: 74px; object-fit: cover; border-radius: 10px; border: 2px solid var(--rand); display: block; }
.daumen figcaption { font-size: .7rem; text-align: center; color: var(--leise); font-weight: 600; }
.menge-anzeige { margin-top: .4rem; padding: .4rem .7rem; border: 2px solid var(--hell); border-radius: 12px; font-size: 2.2rem; font-weight: 800; text-align: right; min-height: 3.6rem; background: #fff; }
.menge-anzeige small { float: left; font-size: .9rem; font-weight: 600; color: var(--leise); line-height: 2.8rem; }
.liste { margin: .5rem 0 0; padding: 0; list-style: none; }
.liste li { padding: .45rem .1rem; border-top: 1px solid var(--rand); font-size: .95rem; }
.liste li b { display: block; }
.marke { display: inline-block; padding: .05rem .45rem; border-radius: 999px; font-size: .78rem; font-weight: 700; margin-right: .3rem; }
.marke.gut { background: #CFEBD9; color: #0b4a26; } .marke.warn { background: #FFE3B8; color: #5a3600; } .marke.neu { background: #DCEBFA; color: #0b3a6b; } .marke.aus { background: #E3E8EF; color: #44505f; }

.toast { position: fixed; left: 50%; bottom: calc(1rem + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 20; max-width: 92vw;
  padding: .7rem 1.1rem; border-radius: 999px; background: var(--nacht); color: #fff; font-weight: 700; box-shadow: 0 6px 20px rgba(0,0,0,.3); text-align: center; }
.toast.fehler { background: var(--rot); }
@media (min-width: 700px) { .kamera { max-height: 50vh; } }
