/* Lager: Kisten im Keller. Farben aus app.css (--paper, --panel, --line ...). */
.lg { display: grid; gap: 18px; }
.lg-kopf h2 { margin: 0; font-size: 22px; letter-spacing: -.02em; }
.lg-kopf p { margin: 6px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.lg-suche { width: 100%; max-width: 520px; margin-top: 14px; font-size: 16px; min-height: 46px; padding: 10px 14px; border-radius: 10px; }
.lg-kopf--kiste { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; }
.lg-aktionen { display: flex; flex-wrap: wrap; gap: 8px; }
.lg-zurueck { justify-self: start; appearance: none; border: 0; background: none; color: var(--blue); font-size: 15px; padding: 4px 0; cursor: pointer; }

/* Regal mit Kisten */
.lg-regal { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 14px; }
.lg-kiste { position: relative; appearance: none; cursor: pointer; text-align: center; display: grid; gap: 4px; justify-items: center; padding: 14px 10px 14px; border: 1px solid var(--line); border-radius: 14px; background: linear-gradient(180deg, var(--panel2), var(--panel)); color: var(--paper); transition: border-color .15s, transform .15s; }
.lg-kiste:hover, .lg-kiste:focus-visible { border-color: var(--paper); outline: none; transform: translateY(-2px); }
.lg-kiste--neu { border-style: dashed; background: transparent; color: var(--muted); }
.lg-svg { width: 100%; max-width: 190px; height: auto; display: block; }
.lg-wanne { fill: rgba(190, 205, 215, .10); stroke: rgba(242, 239, 231, .78); stroke-width: 1.6; stroke-linejoin: round; }
.lg-deckel { fill: rgba(127, 145, 168, .34); stroke: rgba(242, 239, 231, .86); stroke-width: 1.6; stroke-linejoin: round; }
.lg-deckel-kante { fill: none; stroke: rgba(242, 239, 231, .34); stroke-width: 1.1; }
.lg-griff { fill: rgba(127, 145, 168, .62); stroke: rgba(242, 239, 231, .86); stroke-width: 1.3; stroke-linejoin: round; }
.lg-rippe { fill: none; stroke: rgba(242, 239, 231, .16); stroke-width: 1; }
.lg-glanz { fill: none; stroke: rgba(255, 255, 255, .30); stroke-width: 1.6; stroke-linecap: round; }
.lg-schatten { fill: rgba(0, 0, 0, .55); }
.lg-schild { fill: #f2efe7; stroke: rgba(0, 0, 0, .35); stroke-width: .8; }
.lg-schild-text { font: 800 19px/1 "Helvetica Neue", Helvetica, Arial, sans-serif; fill: #0a0a0a; }
.lg-stoff { fill: none; stroke-width: 5.4; stroke-linecap: round; opacity: .85; }
.lg-stoff--0 { stroke: #9d978a; } .lg-stoff--1 { stroke: #5d6672; } .lg-stoff--2 { stroke: #7a5a52; } .lg-stoff--3 { stroke: #3d4038; }
.lg-kiste--neu .lg-wanne, .lg-kiste--neu .lg-deckel, .lg-kiste--neu .lg-griff { stroke-dasharray: 4 4; fill: transparent; stroke: var(--faint); }
.lg-kiste--neu .lg-schild, .lg-kiste--neu .lg-glanz, .lg-kiste--neu .lg-schatten { display: none; }
.lg-kiste__schild { font-size: 15px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; margin-top: 2px; }
.lg-aufkleber rect { fill: #f2efe7; stroke: rgba(0, 0, 0, .45); stroke-width: .35; }
.lg-aufkleber.is-wohnung { opacity: .45; }
.lg-kiste__zahl { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.lg-chip { display: inline-block; font-size: 10px; letter-spacing: .05em; text-transform: uppercase; padding: 3px 7px; border-radius: 20px; border: 1px solid var(--line2); color: var(--muted); }
.lg-chip--offen { border-color: rgba(184, 154, 101, .6); color: #d8bd8a; }
.lg-chip--ok { border-color: rgba(127, 158, 130, .6); color: #a9c8ab; }
.lg-chip--weg { border-color: rgba(189, 107, 99, .65); color: #e2a19a; }
.lg-chip--vor { border-color: rgba(127, 145, 168, .7); color: #aebdd0; }
.lg-chip--wohnung { border-color: rgba(184, 154, 101, .9); background: rgba(184, 154, 101, .16); color: #e6cb97; font-weight: 700; }
.lg-chip--ort { border-color: var(--paper); color: var(--paper); font-weight: 700; }
.lg-frei { appearance: none; cursor: pointer; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; width: 100%; margin-top: 16px; padding: 14px 16px; border: 1px dashed var(--line2); border-radius: 12px; background: transparent; color: var(--paper); font-size: 14px; text-align: left; }
.lg-frei span { color: var(--muted); }
.lg-frei:hover { border-color: var(--paper); }

/* In der Kiste */
.lg-dazu { display: flex; flex-wrap: wrap; gap: 8px; }
.lg-dazu .control { flex: 1 1 240px; font-size: 16px; min-height: 44px; border-radius: 10px; }
.lg-notiz { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.5; }
.lg-raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(138px, 1fr)); gap: 12px; }
.lg-teil { appearance: none; cursor: pointer; text-align: left; display: grid; gap: 4px; align-content: start; padding: 8px 8px 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); color: var(--paper); }
.lg-teil:hover, .lg-teil:focus-visible { border-color: var(--paper); outline: none; }
.lg-teil__bild { display: grid; place-items: center; aspect-ratio: 3 / 4; border-radius: 8px; background: #000; overflow: hidden; }
.lg-teil__bild img { width: 100%; height: 100%; object-fit: contain; }
.lg-teil__bild i { font-style: normal; font-size: 11px; color: var(--faint); }
.lg-teil__nr { font-size: 20px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.lg-teil__titel { font-size: 12px; line-height: 1.35; color: var(--muted); overflow-wrap: anywhere; }
.lg-teil .lg-chip { justify-self: start; }
.lg-teil.is-verkauft .lg-teil__bild { opacity: .45; }

/* Fenster: mittig; am iPhone ein Blatt von unten mit großem Schließen-Knopf (liegt über Tab-Leiste und Statusleiste). */
html.lg-gesperrt, html.lg-gesperrt body { overflow: hidden; }
.lg-dialog { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 20px; background: rgba(0, 0, 0, .74); overscroll-behavior: contain; }
.lg-dialog__box { position: relative; width: min(440px, 100%); max-height: calc(100dvh - 40px); overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; display: grid; gap: 10px; align-content: start; padding: 20px; border: 1px solid var(--line2); border-radius: 16px; background: var(--panel2); }
.lg-dialog__griff { display: none; }
.lg-dialog__bild { display: grid; place-items: center; height: min(38dvh, 320px); border-radius: 10px; background: #000; overflow: hidden; }
.lg-dialog__bild img { max-width: 100%; max-height: 100%; object-fit: contain; }
.lg-dialog h3 { margin: 0; font-size: 18px; line-height: 1.3; }
.lg-dialog__ort { margin: 0; font-size: 14px; color: var(--muted); line-height: 1.5; }
.lg-dialog__ort strong { color: var(--paper); }
.lg-dialog__label { font-size: 10px; letter-spacing: .09em; text-transform: uppercase; color: var(--faint); margin-top: 4px; }
.lg-dialog__zeile { display: flex; gap: 8px; }
.lg-dialog__zeile .control, .lg-dialog__feld { flex: 1; font-size: 16px; min-height: 48px; border-radius: 10px; padding: 10px 12px; }
.lg-dialog .btn { min-height: 48px; font-size: 14px; border-radius: 10px; }
.lg-dialog__knoepfe { display: grid; gap: 8px; }
.lg-dialog__knoepfe .btn { text-align: center; text-decoration: none; min-height: 48px; display: grid; place-items: center; }
.lg-dialog__zu { margin-top: 4px; color: var(--muted); }
.lg-dialog__link { color: var(--muted); font-size: 13px; text-underline-offset: 3px; justify-self: start; padding: 6px 0; }
.lg-meldung { position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 210; max-width: calc(100vw - 32px); padding: 11px 16px; border-radius: 10px; background: var(--paper); color: #070707; font-size: 13px; font-weight: 600; text-align: center; }

/* Verkauft-Bereich, Mehrfachauswahl */
.lg-archiv--aufgabe { border-style: solid; border-color: rgba(184, 154, 101, .7); margin: 0 0 16px; }
.lg-archiv--aufgabe h3 { color: #e6cb97; }
.lg-archiv--vor { border-color: rgba(127, 145, 168, .55); }
.lg-archiv--vor h3 { color: #aebdd0; }
.lg-aktionen--oben { margin-top: 12px; }
.lg-aktionen .btn { min-height: 40px; border-radius: 9px; }
.lg-archiv { display: grid; gap: 12px; margin-top: 10px; padding: 14px; border: 1px dashed rgba(189, 107, 99, .5); border-radius: 14px; }
.lg-archiv__kopf { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.lg-archiv h3 { margin: 0; font-size: 15px; color: #e2a19a; }
.lg-archiv p { margin: 3px 0 0; font-size: 12px; color: var(--muted); }
.lg-teil__bild { position: relative; }
.lg-teil__haken { position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; border: 1.5px solid var(--paper); background: rgba(0, 0, 0, .6); color: transparent; font-size: 15px; }
.lg-teil.is-gewaehlt { border-color: var(--paper); background: var(--panel3); }
.lg-teil.is-gewaehlt .lg-teil__haken { background: var(--paper); color: #070707; }
.lg-leiste { position: sticky; bottom: calc(74px + env(safe-area-inset-bottom)); z-index: 40; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid var(--line2); border-radius: 14px; background: rgba(18, 18, 18, .97); box-shadow: 0 10px 40px rgba(0, 0, 0, .6); }
.lg-leiste strong { font-size: 13px; margin-right: auto; }
.lg-leiste .control { font-size: 16px; min-height: 44px; border-radius: 9px; }
.lg-leiste .btn { min-height: 44px; border-radius: 9px; }
.lg-leiste .btn:disabled { opacity: .4; }

@media (max-width: 640px) {
  .lg-kopf h2 { font-size: 20px; }
  .lg-suche { max-width: none; min-height: 48px; }
  .lg-regal { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .lg-raster { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .lg-kopf--kiste { align-items: flex-start; }
  .lg-aktionen { width: 100%; }
  .lg-aktionen .btn { flex: 1 1 auto; }
  .lg-dazu .btn { flex: 1 1 100%; min-height: 46px; }
  .lg-zurueck { font-size: 17px; padding: 8px 0; }
  .lg-dialog { padding: 0; place-items: end stretch; }
  .lg-dialog__box { width: 100%; max-height: calc(100dvh - env(safe-area-inset-top) - 28px); border: 0; border-top: 1px solid var(--line2); border-radius: 20px 20px 0 0; padding: 10px 16px calc(18px + env(safe-area-inset-bottom)); }
  .lg-dialog__griff { display: block; width: 40px; height: 4px; border-radius: 4px; background: var(--line2); justify-self: center; margin-bottom: 4px; }
  .lg-dialog__bild { height: min(32dvh, 280px); }
  .lg-dialog__zu { position: sticky; bottom: 0; background: var(--panel3); color: var(--paper); border-color: var(--line2); }
  .lg-leiste .control { flex: 1 1 100%; }
  .lg-leiste .btn { flex: 1 1 0; }
}
@media (prefers-reduced-motion: reduce) { .lg-kiste { transition: none; } }

/* Druck / PDF: nur der Lagerkatalog, je Kiste eine Seite, Shop-Stil (schwarz, Helvetica, Versalien). */
#lgDruck { display: none; }
@media print {
  @page { size: A4; margin: 0; }
  html, body { background: #fff !important; overflow: visible !important; height: auto !important; }
  body > *:not(#lgDruck) { display: none !important; }
  #lgDruck { display: block; color: #0a0a0a; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .lgd-seite { box-sizing: border-box; min-height: 296mm; padding: 0 12mm 10mm; display: flex; flex-direction: column; break-after: page; page-break-after: always; }
  .lgd-seite:last-child { break-after: auto; page-break-after: auto; }
  .lgd-kopf { display: flex; justify-content: space-between; align-items: flex-end; margin: 0 -12mm; padding: 9mm 12mm 6mm; background: #0a0a0a; color: #f2efe7; }
  .lgd-marke { margin: 0; font-size: 22pt; font-weight: 800; letter-spacing: .01em; line-height: 1; }
  .lgd-unter { margin: 2mm 0 0; font-size: 7pt; letter-spacing: .22em; text-transform: uppercase; opacity: .75; }
  .lgd-rechts p { margin: 0; font-size: 7pt; letter-spacing: .14em; text-transform: uppercase; text-align: right; line-height: 1.7; opacity: .8; }
  .lgd-titel { display: flex; align-items: baseline; justify-content: space-between; gap: 6mm; border-bottom: .6mm solid #0a0a0a; padding: 7mm 0 3mm; margin-bottom: 5mm; }
  .lgd-titel h1 { margin: 0; font-size: 34pt; font-weight: 800; letter-spacing: -.02em; text-transform: uppercase; line-height: 1; }
  .lgd-titel p { margin: 0; font-size: 8pt; letter-spacing: .12em; text-transform: uppercase; text-align: right; }
  .lgd-raster { display: grid; grid-template-columns: repeat(6, 1fr); gap: 3.2mm 3mm; align-content: start; }
  .lgd-teil { break-inside: avoid; page-break-inside: avoid; display: grid; gap: .8mm; align-content: start; }
  .lgd-bild { aspect-ratio: 3 / 4; background: #0a0a0a; display: grid; place-items: center; overflow: hidden; }
  .lgd-bild img { width: 100%; height: 100%; object-fit: contain; }
  .lgd-teil b { font-size: 11pt; font-weight: 800; letter-spacing: -.01em; line-height: 1.1; margin-top: .6mm; }
  .lgd-teil span { font-size: 6.2pt; line-height: 1.25; color: #333; overflow-wrap: anywhere; }
  .lgd-fuss { margin-top: auto; padding-top: 4mm; border-top: .2mm solid #0a0a0a; display: flex; justify-content: space-between; font-size: 6.5pt; letter-spacing: .16em; text-transform: uppercase; }
}
