/* Lager-UI: große Ziele, hoher Kontrast, eine Spalte (Memor 10/11 ≈ 360 px breit).
   Theming über Tokens: hell als Default, dunkel via prefers-color-scheme ODER [data-theme=dark]. */
:root {
  color-scheme: light dark;
  --bg: #f1f3f5;
  --surface: #ffffff;
  --hover: #e9ecef;
  --text: #212529;
  --muted: #495057;
  --rand: #ced4da;
  --header-bg: #1f2530;
  --header-text: #f4f5f7;
  --orange: #f94b0c;
  --gruen: #2b8a3e;
  --rot: #c92a2a;
  --gelb: #b66a00;
  --blau-hell: #3b5bdb;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1216; --surface: #171a1f; --hover: #222831;
    --text: #e6e8ec; --muted: #9099a4; --rand: #2a2f37;
    --header-bg: #0c0e12; --header-text: #f1f3f5;
    --orange: #ff5a1f; --gruen: #5bc46a; --rot: #ff6b6b; --gelb: #e0a030; --blau-hell: #7aa2ff;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1216; --surface: #171a1f; --hover: #222831;
  --text: #e6e8ec; --muted: #9099a4; --rand: #2a2f37;
  --header-bg: #0c0e12; --header-text: #f1f3f5;
  --orange: #ff5a1f; --gruen: #5bc46a; --rot: #ff6b6b; --gelb: #e0a030; --blau-hell: #7aa2ff;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 18px;
  background: var(--bg);
  color: var(--text);
}
header.app {
  background: var(--header-bg);
  color: var(--header-text);
  padding: 0.6rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 2px solid var(--orange);
}
header.app a { color: #fff; text-decoration: none; font-weight: 600; }
header.app .nutzer { font-size: 0.8rem; opacity: 0.85; }
header.app .kopf-rechts { display: flex; align-items: center; gap: 0.6rem; }
.thementaste { background: transparent; border: 1px solid rgba(255,255,255,0.30); color: #fff; cursor: pointer;
  border-radius: 8px; padding: 0.3rem 0.5rem; font-size: 1rem; line-height: 1; }
main { padding: 1rem; max-width: 640px; margin: 0 auto; }
h1 { font-size: 1.3rem; margin: 0 0 0.75rem; }
h2 { font-size: 1.1rem; margin: 1rem 0 0.5rem; }
.karte {
  background: var(--surface);
  border: 1px solid var(--rand);
  border-radius: 10px;
  padding: 0.9rem;
  margin-bottom: 0.75rem;
}
/* Menü-Buttons (Home) und Listeneinträge */
a.kachel, button.kachel {
  display: block;
  width: 100%;
  background: var(--surface);
  border: 2px solid var(--orange);
  border-radius: 12px;
  color: var(--orange);
  font-size: 1.2rem;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  padding: 1.1rem;
  margin-bottom: 0.75rem;
  cursor: pointer;
}
a.kachel small { display: block; font-weight: 400; font-size: 0.85rem; color: var(--muted); }
ul.liste { list-style: none; margin: 0; padding: 0; }
ul.liste li { margin-bottom: 0.5rem; }
ul.liste a {
  display: block;
  background: var(--surface);
  border: 1px solid var(--rand);
  border-radius: 10px;
  padding: 0.8rem;
  text-decoration: none;
  color: inherit;
}
ul.liste .titel { font-weight: 700; }
ul.liste .meta { font-size: 0.85rem; color: var(--muted); }
/* Gesperrter (fremd geclaimter) Auftrag: wie eine Listenkachel, aber inaktiv/gedimmt. */
ul.liste .liste-gesperrt {
  display: block; background: var(--surface); border: 1px solid var(--rand);
  border-radius: 10px; padding: 0.8rem; color: var(--muted); opacity: 0.8;
}
/* Formulare */
label { display: block; font-size: 0.85rem; color: var(--muted); margin: 0.6rem 0 0.2rem; }
input, textarea, select {
  width: 100%;
  font-size: 1.15rem;
  padding: 0.7rem;
  border: 2px solid var(--rand);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
}
input:focus, textarea:focus { outline: 3px solid var(--orange); border-color: var(--orange); }
input.scan { border-color: var(--orange); font-weight: 600; }
button.primaer, button.sekundaer {
  width: 100%;
  font-size: 1.2rem;
  font-weight: 700;
  padding: 0.9rem;
  margin-top: 0.9rem;
  border-radius: 12px;
  border: none;
  cursor: pointer;
}
button.primaer { background: var(--gruen); color: #fff; }
button.sekundaer { background: var(--surface); color: var(--muted); border: 2px solid var(--rand); }
/* Meldungen */
.flash { border-radius: 10px; padding: 0.8rem; margin-bottom: 0.75rem; font-weight: 600;
  color: var(--c, var(--text)); background: color-mix(in srgb, var(--c, var(--muted)) 16%, var(--surface)); border: 1px solid color-mix(in srgb, var(--c, var(--muted)) 45%, var(--surface)); }
.flash.ok { --c: var(--gruen); }
.flash.fehler { --c: var(--rot); }
/* Positions-/Bestandstabellen */
table.zeilen { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: 10px; overflow: hidden; }
table.zeilen th, table.zeilen td { padding: 0.6rem 0.5rem; text-align: left; border-bottom: 1px solid var(--rand); }
table.zeilen th { font-size: 0.75rem; text-transform: uppercase; color: var(--muted); }
/* Zeilen-Zustand: grün = exakt, orange = unter, blau = über; rejected immer rot. */
table.zeilen tr.zustand-voll td { color: var(--gruen); }
table.zeilen tr.zustand-unter td { color: var(--gelb); }
table.zeilen tr.zustand-ueber td { color: var(--blau-hell); }
table.zeilen .rejected { color: var(--rot); font-weight: 700; }
table.zeilen td.menge { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.klickbar { cursor: pointer; }
tr.klickbar:active { background: var(--hover); }
.badge { display: inline-block; font-size: 0.7rem; font-weight: 700; padding: 0.15rem 0.5rem; border-radius: 999px;
  color: var(--c, var(--muted)); background: color-mix(in srgb, var(--c, var(--muted)) 18%, var(--surface)); }
.badge.open { --c: var(--blau-hell); }
.badge.partial { --c: var(--gelb); }
.badge.complete { --c: var(--gruen); }
.badge.closed { --c: var(--muted); }
/* Auftrags-Status */
.badge.new, .badge.allocated { --c: var(--blau-hell); }
.badge.picking { --c: var(--gelb); }
.badge.picked, .badge.packed { --c: var(--gruen); }
.badge.shipped, .badge.cancelled { --c: var(--muted); }
.badge.short { --c: var(--rot); }
.produktkopf { font-size: 1.15rem; font-weight: 700; }
.produktkopf small { display: block; font-size: 0.8rem; color: var(--muted); font-weight: 400; }

/* Einlagern: Bild + Text (Box-Inhaltsliste + Positions-Kopf). Bild ist per Lightbox klickbar (.bild-galerie). */
.pa-pos-kopf { display: flex; gap: 0.6rem; align-items: center; margin-bottom: 0.2rem; }
.pa-zeile { display: flex; gap: 0.55rem; align-items: center; }
.pa-zeile-text { display: flex; flex-direction: column; min-width: 0; }
.pa-zeile-text small { display: block; font-size: 0.78rem; color: var(--muted); }
.pa-bild { flex-shrink: 0; width: 46px; height: 46px; border: 1px solid var(--rand); border-radius: 8px; overflow: hidden; background: rgba(127, 127, 127, 0.12); display: block; }
.pa-bild img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pa-pos-kopf .pa-bild { width: 60px; height: 60px; }

/* ===================== Geführter Pick-Schritt (ein Artikel auf einmal) ===================== */
.pick-fortschritt { margin-bottom: 0.7rem; }
.pick-bar { height: 7px; background: var(--rand); border-radius: 5px; overflow: hidden; margin-bottom: 0.35rem; }
.pick-bar-fill { height: 100%; background: var(--orange); border-radius: 5px; transition: width 0.2s; }
.pick-step .pick-bild {
  width: 100%; min-height: 120px; max-height: 30vh; display: flex; align-items: center; justify-content: center;
  background: rgba(127, 127, 127, 0.12); border-radius: 12px; overflow: hidden; margin-bottom: 0.5rem;
}
.pick-step .pick-bild img { max-width: 100%; max-height: 30vh; object-fit: contain; display: block; }
.pick-bild-leer { color: var(--muted); font-size: 0.85rem; padding: 1.5rem; }
.pick-anweisung { font-size: 1.05rem; margin: 0.4rem 0 0.8rem; }
.pick-anweisung strong { color: var(--orange); }

/* Geführter Pick-Schritt blendet den App-Header aus → mehr Platz, kein Scrollen. */
body.chrome-hidden header.app { display: none; }

/* Anweisungs-Checkliste (① Lagerplatz → ② Produkt scannen) — kein Eingabefeld, nur validieren. */
.pick-anweisung-liste { list-style: none; padding: 0; margin: 0.4rem 0 0.7rem; display: flex; flex-direction: column; gap: 0.4rem; }
.pick-anweisung-liste li { display: flex; align-items: center; gap: 0.5rem; padding: 0.55rem 0.7rem; border: 2px solid var(--rand); border-radius: 10px; font-size: 1.05rem; }
.pick-anweisung-liste li.aktiv { border-color: var(--orange); background: rgba(249, 75, 12, 0.08); font-weight: 600; }
.pick-anweisung-liste li.ok { border-color: var(--gruen); color: var(--gruen); }
.pick-anweisung-liste strong { color: var(--orange); }
.pick-anweisung-liste li.ok strong { color: var(--gruen); }
.anw-haken { width: 24px; height: 24px; flex: none; border-radius: 50%; border: 2px solid var(--rand); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; }
.pick-anweisung-liste li.aktiv .anw-haken { border-color: var(--orange); }
.pick-anweisung-liste li.ok .anw-haken { border-color: var(--gruen); background: var(--gruen); color: #fff; }
.pick-anweisung-liste li.ok .anw-haken::after { content: "✓"; }
.anw-count { margin-left: auto; font-variant-numeric: tabular-nums; font-weight: 700; color: var(--orange); }
.pick-anweisung-liste li.ok .anw-count { color: var(--gruen); }
.pick-fehler { background: var(--rot); color: #fff; border-radius: 9px; padding: 0.55rem 0.7rem; font-weight: 600; margin-bottom: 0.5rem; }

/* Sicherheits-Abfrage bei „Weiter (ohne Scan)". */
.pick-confirm { border: none; border-radius: 14px; padding: 1.1rem; background: var(--surface); color: var(--text); max-width: 90vw; width: 22rem; box-shadow: 0 12px 48px rgba(0,0,0,0.35); }
.pick-confirm::backdrop { background: rgba(0,0,0,0.5); }
.pick-confirm p { margin: 0 0 1rem; font-size: 1.05rem; }
.pick-confirm .pick-confirm-aktionen { display: flex; gap: 0.6rem; }
.pick-confirm button { flex: 1; }
/* Pack: Gewicht + Waage-Knopf in einer Zeile. */
.pk-weight-zeile { display: flex; gap: 0.5rem; align-items: stretch; }
.pk-weight-zeile input { flex: 1; }
.pk-weight-zeile #pk-weigh { width: auto; white-space: nowrap; padding-left: 0.9rem; padding-right: 0.9rem; }
.pk-weigh-status { display: block; margin-top: 0.3rem; }

/* Pack-Check (read-only Soll-Inhalt nach Tote-Scan): kleine Bilder, Klick → groß (lightbox.js). */
.pack-check-bild { width: 60px; }
.pack-check-bild img { width: 52px; height: 52px; object-fit: cover; border-radius: 8px; border: 1px solid var(--rand); display: block; }
.pack-check-leer { color: var(--muted); }
.fertig-links { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.fertig-links .kachel { flex: 1; text-align: center; min-width: 8rem; }
.pick-rest { margin: 0.7rem 0; }
.pick-rest summary { cursor: pointer; color: var(--muted); font-size: 0.85rem; padding: 0.3rem 0; }
table.zeilen tr.aktiv td { color: var(--orange); font-weight: 700; }
table.zeilen tr.klickbar { cursor: pointer; }

/* HTMX-Ladeindikator */
.htmx-request { opacity: 0.6; }

/* ===================== Scan-Feld-Erweiterung (Kamera / Suche / Tippen) =====================
   JS (scanfield.js) hängt an jedes .scan-Feld eine Tastenreihe; auf dem Memor ungenutzt,
   auf dem Handy der Weg ohne Hardware-Wedge. */
.scanfeld { position: relative; }
/* Strich-Icons rechts IM Eingabefeld (vertikal zentriert; bei Textarea oben angedockt). */
.scanfeld-icons {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  display: flex; align-items: center; gap: 2px;
}
.scanfeld.mehrzeilig .scanfeld-icons { top: 8px; transform: none; }
.scanfeld-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; padding: 0;
  background: transparent; border: none; color: var(--muted); cursor: pointer;
  border-radius: 8px; -webkit-tap-highlight-color: transparent;
}
.scanfeld-icon svg { width: 22px; height: 22px; display: block; }
.scanfeld-icon:active { background: var(--hover); }
.scanfeld-icon.kamera { color: var(--orange); }       /* Kamera = primäre Aktion, Grexon-Orange */
.scanfeld-icon.tippen.aktiv { color: var(--gruen); }

/* --- Suche-Overlay (zentrierte Karte auf abgedunkeltem Grund). Das Kamera-Overlay (.scan-cam-*)
   liegt in camera.css, da es auch der Desk lädt; die Close-Taste .scan-cam-x kommt von dort. --- */
.scan-such { position: fixed; inset: 0; z-index: 9999; display: flex; align-items: flex-start; justify-content: center; background: rgba(0,0,0,0.5); padding: 1rem; }
.scan-such[hidden] { display: none; }
.scan-such-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.7rem 1rem; font-weight: 700; border-bottom: 1px solid var(--rand);
}
.scan-such-karte {
  background: var(--surface); color: var(--text);
  width: 100%; max-width: 520px; margin-top: 6vh;
  border: 1px solid var(--rand); border-radius: 14px; overflow: hidden;
  display: flex; flex-direction: column; max-height: 84vh;
}
.scan-such-feld { margin: 0.8rem; width: auto; }
.scan-such-treffer { overflow-y: auto; padding: 0 0.8rem 0.8rem; }
.scan-such-treffer-btn {
  display: flex; flex-direction: column; gap: 0.15rem; width: 100%; text-align: left;
  background: var(--surface); border: 1px solid var(--rand); border-radius: 10px;
  padding: 0.7rem 0.8rem; margin-bottom: 0.5rem; cursor: pointer; color: inherit;
}
.scan-such-treffer-btn:active { background: var(--hover); }
/* Tastatur-Auswahl (↑/↓): deutlicher als :hover, Grexon-Orange-Akzent. */
.scan-such-treffer-btn.active { background: var(--hover); border-color: var(--orange); box-shadow: inset 3px 0 0 var(--orange); }
.scan-such-treffer-btn .haupt { font-weight: 700; font-size: 1.05rem; }
.scan-such-treffer-btn .sub { font-size: 0.8rem; color: var(--muted); }
.scan-such-leer { color: var(--muted); padding: 0.8rem; text-align: center; }

/* ===================== Annahme-Maske: Gruppen (grün/rot) + Mengen-Stepper ===================== */
.annahme-gruppe {
  border: 1px solid var(--rand); border-left: 5px solid var(--c, var(--rand)); border-radius: 10px;
  padding: 0.55rem 0.8rem 0.85rem; margin: 0.7rem 0;
  background: color-mix(in srgb, var(--c, var(--muted)) 7%, var(--surface));
}
.annahme-gut { --c: var(--gruen); }
.annahme-schlecht { --c: var(--rot); }
.gruppe-titel { font-weight: 800; color: var(--c); margin-bottom: 0.1rem; }
.menge-stepper { display: flex; align-items: stretch; gap: 0.5rem; }
.menge-stepper input { flex: 1; text-align: center; font-weight: 700; }
.stepper {
  flex: 0 0 3.2rem; font-size: 1.6rem; font-weight: 700; line-height: 1;
  border: 2px solid var(--rand); border-radius: 10px; background: var(--surface); color: var(--text);
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.stepper:active { background: var(--hover); }

/* Bestätigungs-Dialog (Annahme abschließen u. a.) — ersetzt natives confirm() */
dialog.dialog {
  border: none; border-radius: 14px; padding: 1.1rem; width: 22rem; max-width: 90vw;
  background: var(--surface); color: var(--text); box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}
dialog.dialog::backdrop { background: rgba(0, 0, 0, 0.45); }
dialog.dialog p { margin: 0 0 1rem; font-size: 1.05rem; font-weight: 600; }
.dialog-tasten { display: flex; gap: 0.6rem; }
.dialog-tasten button {
  flex: 1; font-size: 1.05rem; font-weight: 700; padding: 0.7rem; border-radius: 10px; border: none; cursor: pointer;
}
.dialog-tasten .primaer { background: var(--gruen); color: #fff; }
.dialog-tasten .sekundaer { background: var(--surface); color: var(--muted); border: 2px solid var(--rand); }

/* ===================== Off-Canvas-Navigation (Drawer, ☰) ===================== */
header.app .kopf-links { display: flex; align-items: center; gap: 0.5rem; }
header.app a.marke { color: #fff; text-decoration: none; font-weight: 600; display: inline-flex; align-items: center; }
.menue-taste {
  background: transparent; border: 1px solid rgba(255, 255, 255, 0.30); color: #fff; cursor: pointer;
  border-radius: 8px; padding: 0.2rem 0.55rem; font-size: 1.3rem; line-height: 1;
  -webkit-tap-highlight-color: transparent;
}
/* Während einer laufenden Operation: das große ☰-Menü ausblenden (kein versehentliches
   Wegnavigieren). Das Logo bleibt bewusst ein funktionierender Heim-Link — alle Buchungen
   sind persist-as-you-go, ein Verlassen verliert nichts, und ohne Logo wäre der Werker
   ganz ohne Ausweg gefangen (z. B. im Versand-Schritt ohne Abbrechen-Taste). */
body.op-active .menue-taste { display: none; }

.drawer-backdrop {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.45);
  opacity: 0; pointer-events: none; transition: opacity 0.2s ease; z-index: 1000;
}
body.drawer-auf .drawer-backdrop { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; left: 0; bottom: 0; width: 300px; max-width: 85vw;
  background: var(--surface); color: var(--text); z-index: 1001;
  border-right: 2px solid var(--orange); box-shadow: 2px 0 18px rgba(0, 0, 0, 0.28);
  /* visibility:hidden nimmt den geschlossenen Drawer aus der Tab-Reihenfolge (sonst
     fokussierbare Links hinter aria-hidden) — verzögert via transition, damit die
     Slide-out-Animation noch läuft; beim Öffnen schaltet sie sofort auf sichtbar. */
  visibility: hidden;
  transform: translateX(-100%); transition: transform 0.22s ease, visibility 0.22s ease;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
}
body.drawer-auf .drawer { transform: translateX(0); visibility: visible; }
.drawer-kopf {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.7rem 1rem; border-bottom: 1px solid var(--rand);
  background: var(--header-bg); color: var(--header-text);
}
.drawer-titel { font-weight: 700; }
.drawer-zu {
  background: transparent; border: none; color: var(--header-text); font-size: 1.3rem; line-height: 1;
  cursor: pointer; padding: 0.1rem 0.4rem; -webkit-tap-highlight-color: transparent;
}
.drawer-baum { list-style: none; margin: 0; padding: 0.3rem 0 1rem; }
.drawer-baum > li { margin: 0; }
.drawer-top, .drawer-sub, .drawer-baum summary {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.85rem 1rem; text-decoration: none; color: var(--text);
}
.drawer-top { font-weight: 600; cursor: pointer; }
.drawer-baum summary {
  font-weight: 600; cursor: pointer; list-style: none; justify-content: space-between;
  -webkit-tap-highlight-color: transparent;
}
.drawer-baum summary::-webkit-details-marker { display: none; }
.drawer-baum a:active, a.drawer-top:active, .drawer-baum summary:active { background: var(--hover); }
.drawer-sub { padding-left: 2.3rem; font-size: 0.95rem; }
.drawer-baum .pfeil { font-size: 0.7rem; color: var(--muted); transition: transform 0.15s ease; }
.drawer-baum details[open] > summary .pfeil { transform: rotate(90deg); }
/* Line-Icons (icons-Tag): in Flex nicht stauchen; Drawer-Größe; pfeil rechts halten */
.ic { flex: none; vertical-align: -0.14em; }
.drawer-baum .ic { width: 20px; height: 20px; }
.drawer-baum summary { justify-content: flex-start; }
.drawer-baum summary .pfeil { margin-left: auto; }
.thementaste { display: inline-flex; align-items: center; }
.thementaste .ic { display: block; width: 17px; height: 17px; }
.thementaste .ic-sun { display: none; }
:root[data-theme="dark"] .thementaste .ic-moon { display: none; }
:root[data-theme="dark"] .thementaste .ic-sun { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .thementaste .ic-moon { display: none; }
  :root:not([data-theme="light"]) .thementaste .ic-sun { display: block; }
}
.drawer-baum .aktiv { color: var(--orange); font-weight: 700; box-shadow: inset 4px 0 0 var(--orange); }
.drawer-baum .soon { color: var(--muted); cursor: default; opacity: 0.75; }
.soon-badge {
  margin-left: auto; font-size: 0.62rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em;
  background: color-mix(in srgb, var(--muted) 22%, var(--surface)); color: var(--muted);
  border-radius: 999px; padding: 0.12rem 0.5rem;
}

/* ===================== Dashboard (Statistik-Kacheln) ===================== */
.dash { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.7rem; margin-bottom: 1rem; }
.dash-kachel {
  display: flex; flex-direction: column; gap: 0.15rem;
  background: var(--surface); border: 1px solid var(--rand); border-left: 5px solid var(--c, var(--orange));
  border-radius: 12px; padding: 0.9rem; text-decoration: none; color: inherit;
}
a.dash-kachel:active { background: var(--hover); }       /* Press-Feedback nur für klickbare Kacheln */
.dash-kachel.info { cursor: default; }                   /* Info-Kachel (z. B. Retouren): nur Zahl, kein Link */
.dash-zahl { font-size: 2rem; font-weight: 800; line-height: 1.1; color: var(--c, var(--orange)); font-variant-numeric: tabular-nums; }
.dash-titel { font-weight: 700; font-size: 0.95rem; }
.dash-sub { font-size: 0.78rem; color: var(--muted); }
.dash-kachel.k-recv { --c: var(--blau-hell); }
.dash-kachel.k-put { --c: var(--gelb); }
.dash-kachel.k-pick { --c: var(--orange); }
.dash-kachel.k-pack { --c: var(--gruen); }
.dash-kachel.k-ret { --c: var(--rot); }
/* Arbeitsplatz-Wahl-Gate: Buttons untereinander (Tap-Fallback zum Scan) */
.ws-wahl { display: flex; flex-direction: column; gap: 0.6rem; margin-top: 0.4rem; }
.ws-wahl form { margin: 0; }
.ws-wahl .kachel { width: 100%; }

/* ===================== Foto / Anhang (Kamera-Beleg an Anlieferung) ===================== */
.hinweis { color: var(--muted); font-size: 0.9rem; margin: 0.3rem 0 0.7rem; }
.attach-suche input { width: 100%; box-sizing: border-box; padding: 0.7rem 0.8rem; font-size: 1rem;
  border: 2px solid var(--orange); border-radius: 10px; background: var(--surface); color: var(--text); margin-bottom: 0.6rem; }
.attach-po-liste { display: flex; flex-direction: column; gap: 0.5rem; }
a.kachel.attach-po { text-align: left; padding: 0.8rem 1rem; font-size: 1rem; }
.attach-po strong { display: block; font-size: 1.05rem; }
.attach-po small { color: var(--muted); font-weight: 400; }
.attach-kopf { display: flex; flex-direction: column; gap: 0.1rem; }
.attach-kopf small { color: var(--muted); }
/* Positionswahl: „Ganze Anlieferung"-Kachel + Tabelle (Thumbnail | SKU | Anhang-Zähler). */
a.kachel.attach-ganze { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; margin-bottom: 0.6rem; }
.attach-ganze strong { display: flex; align-items: center; gap: 0.45rem; }
.attach-tabelle td { vertical-align: middle; }
.attach-tabelle .attach-name { color: var(--muted); font-weight: 400; }
.attach-zahl-zelle { text-align: right; width: 3.6rem; }
.attach-zahl { display: inline-flex; align-items: center; gap: 0.25rem; padding: 0.15rem 0.5rem;
  border: 1px solid var(--rand); border-radius: 999px; color: var(--muted); font-size: 0.85rem; font-weight: 700; }
/* Foto-Seite: Kopf der gewählten Position. */
.attach-pos { display: flex; align-items: center; gap: 0.7rem; margin: 0.5rem 0 0.7rem; }
.attach-pos-bild { display: block; flex: 0 0 auto; }
.attach-pos-bild img { width: 52px; height: 52px; object-fit: cover; border-radius: 8px; border: 1px solid var(--rand); display: block; }
.attach-pos-text { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; }
.attach-pos-text small { color: var(--muted); }
.attach-shoot { margin-bottom: 0.5rem; }
.attach-datei-btn { display: block; width: 100%; margin-bottom: 0.8rem; }
a.sekundaer.attach-fertig { display: block; text-align: center; margin-top: 0.8rem; text-decoration: none; }
.attach-strip { margin: 0.4rem 0; }
.attach-galerie { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.attach-item { position: relative; }
.attach-thumb { display: block; width: 84px; height: 84px; border: 1px solid var(--rand); border-radius: 10px;
  overflow: hidden; background: rgba(127, 127, 127, 0.12); }
.attach-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.attach-datei-chip { display: flex; align-items: center; justify-content: center; width: 84px; height: 84px;
  border: 1px solid var(--rand); border-radius: 10px; background: rgba(127, 127, 127, 0.12); color: var(--muted); }
.attach-line-badge { position: absolute; bottom: 2px; left: 2px; padding: 0.05rem 0.35rem; border-radius: 6px;
  background: rgba(0, 0, 0, 0.6); color: #fff; font-size: 10px; font-weight: 700; max-width: 78px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attach-del { position: absolute; top: -7px; right: -7px; margin: 0; }
.attach-x { width: 24px; height: 24px; padding: 0; border-radius: 50%; border: 1px solid var(--rand);
  background: var(--surface); color: var(--muted); font-size: 13px; line-height: 1; cursor: pointer; box-shadow: 0 1px 4px rgba(0,0,0,0.3); }
