/* Lagerliste. Mobil zuerst, hell und dunkel nach Systemeinstellung,
   Systemschrift, nichts wird von außen geladen. */
:root {
  --grund: #f5f5f3;
  --flaeche: #ffffff;
  --text: #17191c;
  --leise: #565b62;
  --linie: #c9ccd1;
  --akzent: #0b5c4a;
  --akzent-text: #ffffff;
  --akzent-hell: #e3f1ec;
  --warn: #8a4500;
  --warn-grund: #fff1df;
  --gefahr: #a3202a;
  --fokus: #1a56c4;
  --radius: 10px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --grund: #111315;
    --flaeche: #1b1e21;
    --text: #eceef0;
    --leise: #a9afb6;
    --linie: #3c4249;
    --akzent: #63c9a8;
    --akzent-text: #0b1a15;
    --akzent-hell: #18322a;
    --warn: #ffbd6b;
    --warn-grund: #33240f;
    --gefahr: #ff8a8f;
    --fokus: #8ab4ff;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--grund);
  color: var(--text);
  font: 17px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5rem; }
h1 { font-size: 1.25rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.05rem; margin-top: 1.25rem; }
a { color: var(--akzent); }
:focus-visible { outline: 3px solid var(--fokus); outline-offset: 2px; }
.unsichtbar { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sprung { position: absolute; left: -999px; top: 0; background: var(--flaeche); padding: .5rem 1rem; z-index: 20; }
.sprung:focus { left: .5rem; top: .5rem; }

.kopf { position: sticky; top: 0; z-index: 5; background: var(--flaeche); border-bottom: 1px solid var(--linie); }
.kopf-innen { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0 1rem; padding: .75rem 1rem .25rem; max-width: 60rem; margin: 0 auto; }
/* Darf umbrechen statt abgeschnitten zu werden: wer angemeldet ist, muss lesbar sein. */
.ich { margin: 0; color: var(--leise); font-size: .9rem; min-width: 0; overflow-wrap: anywhere; }
.reiter { display: flex; max-width: 60rem; margin: 0 auto; }
.reiter-knopf {
  flex: 1; min-height: 48px; border: 0; background: none; color: var(--leise); font: inherit; font-weight: 600;
  border-bottom: 3px solid transparent; cursor: pointer;
}
.reiter-knopf[aria-current="page"] { color: var(--text); border-bottom-color: var(--akzent); }
.zahl { display: inline-block; min-width: 1.5em; padding: 0 .4em; border-radius: 1em; background: var(--warn-grund); color: var(--warn); font-size: .85rem; border: 1px solid currentColor; }

main { max-width: 60rem; margin: 0 auto; padding: 1rem 1rem 6rem; }
main:focus { outline: none; }

.suche input { width: 100%; }
.filter { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: end; margin: .75rem 0; }
.feld { display: flex; flex-direction: column; gap: .25rem; margin: 0 0 .75rem; }
.feld.klein { margin: 0; flex: 1 1 9rem; }
label, legend { font-weight: 600; font-size: .95rem; }
.frei { font-weight: 400; color: var(--leise); }
input, select, textarea {
  font: inherit; color: var(--text); background: var(--flaeche);
  border: 1px solid var(--leise); border-radius: 8px; padding: .65rem .75rem; min-height: 48px; width: 100%;
}
textarea { min-height: 6rem; resize: vertical; }
input[type="checkbox"], input[type="radio"] { width: 1.4rem; height: 1.4rem; min-height: 0; accent-color: var(--akzent); margin: 0; }
input[type="file"] { padding: .5rem; }
.haken { display: inline-flex; align-items: center; gap: .5rem; min-height: 48px; font-weight: 600; cursor: pointer; }
.treffer { color: var(--leise); margin: .25rem 0 .5rem; font-size: .95rem; }

.liste { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; }
.eintrag {
  width: 100%; display: grid; grid-template-columns: 1fr auto; gap: .15rem 1rem; align-items: center;
  text-align: left; font: inherit; color: inherit; background: var(--flaeche);
  border: 1px solid var(--linie); border-radius: var(--radius); padding: .75rem 1rem; min-height: 64px; cursor: pointer;
}
.eintrag:hover { border-color: var(--leise); }
.eintrag-name { font-weight: 600; overflow-wrap: anywhere; }
.eintrag-meta { grid-column: 1; color: var(--leise); font-size: .9rem; }
.eintrag-bestand { grid-row: 1 / span 2; grid-column: 2; text-align: right; font-weight: 700; font-size: 1.1rem; font-variant-numeric: tabular-nums; }
.eintrag-bestand small { display: block; font-weight: 400; font-size: .8rem; color: var(--leise); }
.markierung { display: inline-block; margin-top: .25rem; padding: .05rem .5rem; border-radius: 6px; background: var(--warn-grund); color: var(--warn); border: 1px solid currentColor; font-size: .8rem; font-weight: 600; }
.leer, .hinweis { color: var(--leise); }
.warnung { color: var(--warn); background: var(--warn-grund); padding: .5rem .75rem; border-radius: 8px; }

.knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 48px; padding: .6rem 1.1rem; border-radius: var(--radius); border: 2px solid var(--akzent);
  background: var(--akzent); color: var(--akzent-text); font: inherit; font-weight: 700; cursor: pointer; text-decoration: none;
}
.knopf.zweit { background: transparent; color: var(--akzent); }
.knopf.gefahr { background: transparent; color: var(--gefahr); border-color: var(--gefahr); }
.knopf.gross { min-height: 60px; font-size: 1.15rem; }
.knopf.breit { width: 100%; }
.knopf.rund { width: 56px; min-width: 56px; height: 56px; padding: 0; font-size: 1.6rem; }
.knopf[disabled] { opacity: .6; cursor: progress; }
.knopfreihe { display: flex; flex-wrap: wrap; gap: .5rem; margin: .75rem 0; }
.knopfreihe.senkrecht { flex-direction: column; align-items: stretch; max-width: 26rem; }

dialog {
  width: min(40rem, 100vw); max-width: 100vw; max-height: 100dvh; margin: auto; padding: 1rem 1rem 1.5rem;
  border: 0; border-radius: var(--radius); background: var(--flaeche); color: var(--text);
}
dialog::backdrop { background: rgba(0, 0, 0, .55); }
@media (max-width: 40rem) {
  dialog { width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; margin: 0; }
}
.dialog-kopf { display: flex; justify-content: space-between; align-items: start; gap: 1rem; }
.dialog-kopf h2 { overflow-wrap: anywhere; }
.schliessen { min-width: 48px; min-height: 48px; border: 1px solid var(--linie); border-radius: var(--radius); background: none; color: var(--text); font-size: 1.6rem; line-height: 1; cursor: pointer; }
.meta { color: var(--leise); margin: 0 0 .5rem; }
.bestand-gross { font-size: 1.6rem; font-weight: 700; margin: .25rem 0 1rem; font-variant-numeric: tabular-nums; }
.status { font-size: 1rem; vertical-align: middle; }

fieldset { border: 0; padding: 0; margin: 0 0 .75rem; min-width: 0; }
.umschalter { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.umschalter legend { grid-column: 1 / -1; margin-bottom: .25rem; }
.umschalt { position: relative; }
.umschalt input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; cursor: pointer; }
.umschalt span {
  display: flex; align-items: center; justify-content: center; min-height: 60px; border-radius: var(--radius);
  border: 2px solid var(--akzent); color: var(--akzent); font-weight: 700; font-size: 1.1rem;
}
.umschalt input:checked + span { background: var(--akzent); color: var(--akzent-text); }
.umschalt input:focus-visible + span { outline: 3px solid var(--fokus); outline-offset: 2px; }
.menge { display: grid; grid-template-columns: auto 1fr auto; gap: .5rem; align-items: center; }
.menge input { text-align: center; font-size: 1.4rem; font-weight: 700; min-height: 56px; }
.zwei { display: grid; gap: 0 1rem; }
@media (min-width: 34rem) { .zwei { grid-template-columns: 1fr 1fr; } }
.wahl { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.wahl legend { width: 100%; margin-bottom: .25rem; }
.wahl label { display: inline-flex; align-items: center; gap: .5rem; min-height: 48px; font-weight: 400; }

.fehler { color: var(--gefahr); margin: .25rem 0; min-height: 0; }
.fehler:empty { display: none; }
[aria-invalid="true"] { border-color: var(--gefahr); border-width: 2px; }
.nachfrage { margin-top: .75rem; padding: .75rem; border-radius: var(--radius); background: var(--warn-grund); color: var(--text); }

.block { margin-top: 1.25rem; padding-top: .5rem; border-top: 1px solid var(--linie); }
details summary { min-height: 48px; display: flex; align-items: center; cursor: pointer; font-weight: 600; color: var(--akzent); }
.angaben { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1rem; margin: 1rem 0; }
.angaben dt { color: var(--leise); }
.angaben dd { margin: 0; overflow-wrap: anywhere; white-space: pre-line; }
.verlauf { list-style: none; padding: 0; margin: 0; display: grid; gap: .35rem; }
.verlauf li { padding: .4rem 0; border-bottom: 1px solid var(--linie); font-size: .95rem; }
.verlauf .plus { color: var(--akzent); font-weight: 700; }
.verlauf .minus { font-weight: 700; }

.gruppe { background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); padding: .75rem 1rem; margin: .75rem 0; }
.gruppe h3 { margin: 0; display: inline; font-size: 1.05rem; }
.gruppe summary { min-height: 48px; display: flex; align-items: center; cursor: pointer; color: var(--text); }
.gruppe[open] summary { margin-bottom: .25rem; }
.gruppe summary::-webkit-details-marker { display: none; }
.gruppe summary::before { content: "\25B8"; margin-right: .5rem; color: var(--akzent); }
.gruppe[open] summary::before { content: "\25BE"; }
.gruppe ul { margin: .25rem 0 .5rem; padding-left: 1.2rem; }
.gruppe li { margin: .25rem 0; }
.tabelle { width: 100%; border-collapse: collapse; font-size: .95rem; margin: .5rem 0; display: block; overflow-x: auto; }
.tabelle th, .tabelle td { text-align: left; padding: .35rem .5rem; border-bottom: 1px solid var(--linie); }
.fuss { color: var(--leise); font-size: .9rem; margin-top: 2rem; }

.meldung {
  position: fixed; left: 50%; bottom: 1rem; transform: translateX(-50%); z-index: 30; max-width: calc(100vw - 2rem);
  background: var(--text); color: var(--grund); padding: .75rem 1.1rem; border-radius: var(--radius); font-weight: 600;
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.meldung.sichtbar { opacity: 1; }
/* Im Dialog im Fluss unter dem Formular, damit sie den Knopf "buchen" nicht verdeckt. */
dialog .meldung { position: static; transform: none; max-width: none; margin-top: .75rem; }
dialog .meldung:not(.sichtbar) { display: none; }
@media (prefers-reduced-motion: reduce) { .meldung { transition: none; } }

.druck { position: fixed; inset: 0; z-index: 25; overflow: auto; background: #fff; color: #000; padding: 1rem; }
.druck .knopf { --akzent: #0b5c4a; --akzent-text: #fff; }
.druck-kopf { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .5rem; }
.druck-raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); gap: 1rem; margin-top: 1rem; }
.qr-karte { border: 1px dashed #777; padding: .5rem; text-align: center; break-inside: avoid; page-break-inside: avoid; }
.qr-karte svg { width: 100%; max-width: 9rem; height: auto; display: block; margin: 0 auto; }
.qr-karte strong { display: block; font-size: .95rem; overflow-wrap: anywhere; }
.qr-karte span { display: block; font-size: .8rem; color: #333; }
@media print {
  body > *:not(.druck) { display: none !important; }
  .druck { position: static; padding: 0; }
  .druck-kopf { display: none; }
  .druck-raster { grid-template-columns: repeat(4, 1fr); gap: 4mm; }
}
