:root {
  --grund: #eef4f8;
  --flaeche: #ffffff;
  --flaeche-2: #e3ecf2;
  --text: #13202b;
  --text-2: #5b6b78;
  --linie: #d5e0e8;
  --akzent: #1f6fb2;
  --akzent-text: #ffffff;
  --bald: #c46a00;
  --bald-grund: #fff1df;
  --ueber: #c23a2c;
  --ueber-grund: #fde6e3;
  --schatten: 0 1px 2px rgb(19 32 43 / 0.06), 0 4px 16px rgb(19 32 43 / 0.06);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --grund: #0f1720;
    --flaeche: #18232e;
    --flaeche-2: #22303d;
    --text: #e6eef4;
    --text-2: #93a4b2;
    --linie: #2a3a48;
    --akzent: #5aa9e6;
    --akzent-text: #08131c;
    --bald: #f0a24a;
    --bald-grund: #3a2a14;
    --ueber: #f07a6c;
    --ueber-grund: #3d1d1a;
    --schatten: none;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--grund);
  color: var(--text);
  font: 16px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  padding-bottom: calc(96px + env(safe-area-inset-bottom));
  -webkit-tap-highlight-color: transparent;
}

button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }

.kopf {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: calc(16px + env(safe-area-inset-top)) 16px 8px;
  max-width: 640px;
  margin: 0 auto;
}
.kopf h1 { margin: 0; font-size: 28px; letter-spacing: -0.01em; }
.anzahl { color: var(--text-2); font-size: 15px; }

main, .gesperrt { max-width: 640px; margin: 0 auto; padding: 0 16px; }

.suche {
  width: 100%;
  margin: 8px 0 4px;
  padding: 11px 14px;
  border: 1px solid var(--linie);
  border-radius: 12px;
  background: var(--flaeche);
  font-size: 17px;
}
.suche:focus { outline: 2px solid var(--akzent); outline-offset: -1px; }

.warnung {
  margin: 8px 0;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--bald-grund);
}
.warnung h2 { margin: 0 0 6px; font-size: 15px; color: var(--bald); }
.warnung ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.warnung button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  border-radius: 999px;
  padding: 6px 12px;
  background: var(--flaeche);
  font-size: 15px;
}
.warnung small { color: var(--text-2); }
.punkt { width: 8px; height: 8px; border-radius: 50%; background: var(--bald); flex: none; }
.punkt.ueber { background: var(--ueber); }

.fach { margin-top: 18px; }
.fach h2 {
  display: flex;
  justify-content: space-between;
  margin: 0 4px 6px;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-2);
}
.fach ul {
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--flaeche);
  border-radius: 14px;
  box-shadow: var(--schatten);
  overflow: hidden;
}
.leer {
  margin: 0;
  padding: 14px;
  border: 1px dashed var(--linie);
  border-radius: 14px;
  color: var(--text-2);
  font-size: 15px;
}

.artikel { display: flex; align-items: center; }
.artikel + .artikel { border-top: 1px solid var(--linie); }
.artikel-haupt {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 6px 10px 10px;
  border: 0;
  background: none;
  text-align: left;
}
.symbol {
  width: 56px;
  height: 56px;
  flex: none;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--flaeche-2);
  font-size: 32px;
  line-height: 1;
}
.artikel-text { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.artikel-text strong { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.artikel-text small { color: var(--text-2); font-size: 14px; }

.marke {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.marke.bald { background: var(--bald-grund); color: var(--bald); }
.marke.ueber { background: var(--ueber-grund); color: var(--ueber); }

.minus {
  flex: none;
  width: 52px;
  height: 44px;
  margin-right: 10px;
  border: 0;
  border-radius: 12px;
  background: var(--flaeche-2);
  font-weight: 600;
}
.minus:active { background: var(--linie); }

.hinweis { color: var(--text-2); text-align: center; margin: 24px 0; }
.hinweis.klein { text-align: left; margin: 2px 0 0; font-size: 14px; }

.fab {
  position: fixed;
  right: max(20px, calc(50% - 300px));
  bottom: calc(20px + env(safe-area-inset-bottom));
  width: 60px;
  height: 60px;
  border: 0;
  border-radius: 50%;
  background: var(--akzent);
  color: var(--akzent-text);
  font-size: 32px;
  line-height: 1;
  box-shadow: 0 6px 20px rgb(31 111 178 / 0.35);
}

.gesperrt { text-align: center; padding-top: 48px; }
.gesperrt p { color: var(--text-2); }

/* Blatt */

.blatt {
  width: 100%;
  max-width: 560px;
  max-height: 92dvh;
  margin: auto auto 0;
  padding: 0 16px calc(20px + env(safe-area-inset-bottom));
  border: 0;
  border-radius: 18px 18px 0 0;
  background: var(--flaeche);
  color: var(--text);
  overflow-y: auto;
}
.blatt::backdrop { background: rgb(0 0 0 / 0.4); }
@media (min-width: 600px) {
  .blatt { margin: auto; border-radius: 18px; }
}

.blatt-kopf {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 -16px 8px;
  padding: 12px 8px;
  background: var(--flaeche);
  border-bottom: 1px solid var(--linie);
}
.blatt-kopf h2 { margin: 0; font-size: 17px; }

.text-knopf {
  min-height: 44px;
  padding: 0 10px;
  border: 0;
  background: none;
  color: var(--akzent);
}
.text-knopf.stark { font-weight: 600; }
.text-knopf.klein { min-height: 32px; font-size: 15px; padding: 0; }
.text-knopf:disabled { opacity: 0.4; }

.name-zeile { display: flex; align-items: flex-end; gap: 12px; }
.name-zeile .feld { flex: 1; }
.emoji-gross {
  width: 64px;
  height: 64px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--flaeche-2);
  font-size: 40px;
  line-height: 1;
}
.emojis {
  display: flex;
  gap: 4px;
  margin: 4px -16px 0;
  padding: 2px 16px 6px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}
.emojis button {
  flex: none;
  width: 46px;
  height: 46px;
  border: 1.5px solid transparent;
  border-radius: 10px;
  background: var(--grund);
  font-size: 26px;
  line-height: 1;
  scroll-snap-align: start;
}
.emojis .aktiv { border-color: var(--akzent); background: var(--flaeche-2); }

.foto-feld {
  position: relative;
  display: grid;
  place-items: center;
  height: 90px;
  margin-top: 4px;
  border: 1.5px dashed var(--linie);
  border-radius: 14px;
  background: var(--flaeche-2);
  color: var(--akzent);
  font-weight: 600;
  overflow: hidden;
  cursor: pointer;
}
.foto-feld.mit-foto { height: 220px; border-style: solid; }
.foto-feld img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.foto-feld.mit-foto span {
  position: absolute;
  right: 10px;
  bottom: 10px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgb(0 0 0 / 0.55);
  color: #fff;
  font-size: 14px;
}

.feld { display: flex; flex-direction: column; gap: 4px; margin: 14px 0 0; padding: 0; border: 0; min-width: 0; }
.feld > span, .feld legend { font-size: 14px; color: var(--text-2); padding: 0; }
.feld input, .feld select {
  width: 100%;
  min-height: 44px;
  padding: 9px 12px;
  border: 1px solid var(--linie);
  border-radius: 10px;
  background: var(--grund);
  font-size: 17px;
}
.feld input:focus, .feld select:focus { outline: 2px solid var(--akzent); outline-offset: -1px; }

.schalter { display: flex; align-items: center; gap: 10px; min-height: 44px; margin-top: 6px; font-size: 15px; }
.schalter input { width: 22px; height: 22px; margin: 0; accent-color: var(--akzent); }
.feld input:disabled { opacity: 0.45; }

.zeile2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.faecher { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-top: 4px; }
.faecher button {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 0;
  border: 1px solid var(--linie);
  border-radius: 10px;
  background: var(--grund);
}
.faecher strong { font-size: 19px; }
.faecher small { font-size: 10px; color: var(--text-2); }
.faecher .aktiv { background: var(--akzent); border-color: var(--akzent); color: var(--akzent-text); }
.faecher .aktiv small { color: inherit; }

.stepper {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  min-height: 44px;
  border: 1px solid var(--linie);
  border-radius: 10px;
  background: var(--grund);
  overflow: hidden;
}
.stepper button { height: 44px; border: 0; background: none; font-size: 22px; color: var(--akzent); }
.stepper output { text-align: center; font-size: 17px; font-weight: 600; }

.meldung { margin: 14px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--ueber-grund); color: var(--ueber); }

.loeschen {
  width: 100%;
  min-height: 44px;
  margin-top: 24px;
  border: 0;
  border-radius: 12px;
  background: var(--ueber-grund);
  color: var(--ueber);
  font-weight: 600;
}

/* Toast */

.toast {
  position: fixed;
  left: 16px;
  right: 92px;
  bottom: calc(26px + env(safe-area-inset-bottom));
  max-width: 460px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 10px 10px 14px;
  border-radius: 12px;
  background: var(--text);
  color: var(--grund);
  font-size: 15px;
}
@media (min-width: 680px) { .toast { left: calc(50% - 304px); } }
.toast[hidden] { display: none; }
.toast button { border: 0; background: none; color: var(--akzent); font-weight: 600; white-space: nowrap; min-height: 32px; }
@media (prefers-color-scheme: dark) { .toast button { color: #1f6fb2; } }

[hidden] { display: none !important; }
