:root {
    --gruen: #2f5d3a;
    --gruen-dunkel: #234a2c;
    --gruen-hell: #e7efe4;
    --erde: #8a5a3b;
    --text: #1d2420;
    --leise: #65706a;
    --linie: #d9ded8;
    --flaeche: #ffffff;
    --grund: #f5f4ef;
    --rot: #b3261e;
    --rot-hell: #fbe9e7;
    --gelb-hell: #fff6dc;
    --radius: 12px;
}

* { box-sizing: border-box; }

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

body {
    margin: 0;
    background: var(--grund);
    color: var(--text);
    font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    padding-bottom: calc(76px + env(safe-area-inset-bottom));
}

h1 { font-size: 1.5rem; margin: .4rem 0 1rem; }
h2 { font-size: 1.1rem; margin: 1.6rem 0 .6rem; }
a { color: var(--gruen); }
code.passwort { font-size: 1.2rem; background: #fff; padding: 2px 8px; border-radius: 6px; user-select: all; }

.kopf {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 16px; background: var(--flaeche); border-bottom: 1px solid var(--linie);
    position: sticky; top: 0; z-index: 5;
}
.marke { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--text); font-weight: 600; min-width: 0; }
.marke span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.link-knopf { background: none; border: 0; color: var(--leise); font: inherit; cursor: pointer; padding: 6px; }

.inhalt { max-width: 760px; margin: 0 auto; padding: 16px; }

.navi {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 5;
    display: flex; background: var(--flaeche); border-top: 1px solid var(--linie);
    padding-bottom: env(safe-area-inset-bottom);
}
.navi a {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
    padding: 8px 4px 10px; font-size: .75rem; color: var(--leise); text-decoration: none;
}
.navi a.aktiv { color: var(--gruen); font-weight: 600; }
.navi svg, .grosskachel svg, .fotofeld svg {
    width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round;
}

.meldung { padding: 12px 14px; border-radius: var(--radius); margin: 0 0 14px; }
.meldung.ok { background: var(--gruen-hell); }
.meldung.fehler { background: var(--rot-hell); color: var(--rot); }
.meldung.hinweis { background: var(--gelb-hell); }
.ki-hinweis { background: var(--flaeche); border-left: 4px solid var(--erde); padding: 10px 12px; border-radius: 6px; font-size: .95rem; }

.leise { color: var(--leise); }
.klein { font-size: .85rem; }
.rot { color: var(--rot); }

.karte, details.karte {
    background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius);
    padding: 14px 16px; margin: 0 0 14px;
}
.karte h2 { margin-top: 0; }
details summary { cursor: pointer; padding: 4px 0; }

label { display: block; margin: 0 0 12px; font-size: .9rem; color: #4b554f; }
input[type=text], input[type=email], input[type=password], input[type=number], select, textarea {
    display: block; width: 100%; margin-top: 4px; padding: 11px 12px;
    font: inherit; color: var(--text); background: #fff;
    border: 1px solid var(--linie); border-radius: 10px; min-height: 46px;
}
input:focus, select:focus { outline: 2px solid var(--gruen); outline-offset: 1px; }
label.haken { display: flex; align-items: center; gap: 8px; color: var(--text); }
label.haken input { width: 20px; height: 20px; accent-color: var(--gruen); }

.knopf {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    background: var(--gruen); color: #fff; border: 0; border-radius: 10px;
    padding: 13px 18px; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; min-height: 48px;
}
.knopf:hover { background: var(--gruen-dunkel); }
.knopf.voll { width: 100%; margin-top: 8px; }
.knopf.klein { padding: 8px 12px; min-height: 38px; font-size: .9rem; }
.knopf.hell { background: var(--gruen-hell); color: var(--gruen-dunkel); }
.knopf.gefahr { background: var(--rot-hell); color: var(--rot); }

.titelzeile { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.titelzeile h1 { margin-bottom: .6rem; }

.grosskachel {
    display: flex; align-items: center; gap: 14px; text-decoration: none;
    background: var(--gruen); color: #fff; border-radius: var(--radius); padding: 18px; margin-bottom: 12px;
}
.grosskachel svg { width: 38px; height: 38px; flex: none; }
.grosskachel strong { display: block; font-size: 1.1rem; }
.grosskachel small { opacity: .85; }
.grosskachel.hell { background: var(--flaeche); color: var(--text); border: 1px solid var(--linie); }
.grosskachel.hell svg { color: var(--gruen); }

.liste { display: flex; flex-direction: column; gap: 8px; }
.zeile {
    display: flex; align-items: center; gap: 12px; padding: 10px; text-decoration: none; color: var(--text);
    background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius);
}
.zeile img, .zeile .platzhalter { width: 56px; height: 56px; border-radius: 8px; object-fit: cover; flex: none; background: var(--gruen-hell); }
.zeile-text { flex: 1; min-width: 0; }
.zeile-text strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.zeile-text small { color: var(--leise); }
.preis { font-weight: 700; white-space: nowrap; }
.etikett { font-size: .8rem; padding: 3px 8px; border-radius: 99px; background: var(--gelb-hell); white-space: nowrap; }
.etikett.gruen { background: var(--gruen-hell); }
.etikett.rot { background: var(--rot-hell); color: var(--rot); }

.fotofeld {
    position: relative; display: flex; align-items: center; justify-content: center;
    min-height: 240px; border: 2px dashed var(--linie); border-radius: var(--radius);
    background: var(--flaeche); color: var(--gruen); text-align: center; overflow: hidden; cursor: pointer;
}
.fotofeld.klein-hoch { min-height: 170px; }
.fotofeld input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.fotofeld span { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 16px; }
.fotofeld svg { width: 44px; height: 44px; }
.fotofeld small { color: var(--leise); }
.fotofeld img { width: 100%; max-height: 420px; object-fit: contain; }

.schalenfoto { width: 100%; max-height: 380px; object-fit: contain; background: #000; border-radius: var(--radius); margin-bottom: 12px; }

.position { background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); padding: 10px; margin-bottom: 8px; }
.position-haupt { display: flex; flex-direction: column; gap: 8px; }
.position-haupt select { margin: 0; width: 100%; font-size: .95rem; padding-right: 28px; }
.menge { display: flex; align-items: center; justify-content: flex-end; }
.menge-text { margin-right: auto; color: var(--leise); font-size: .9rem; }
.menge input { width: 52px; text-align: center; margin: 0; padding: 8px 2px; -moz-appearance: textfield; }
.menge input::-webkit-inner-spin-button { -webkit-appearance: none; }
.menge button {
    width: 40px; height: 46px; border: 1px solid var(--linie); background: var(--gruen-hell); color: var(--gruen-dunkel);
    font-size: 1.3rem; cursor: pointer;
}
.menge .minus { border-radius: 10px 0 0 10px; border-right: 0; }
.menge .plus { border-radius: 0 10px 10px 0; border-left: 0; }
.ki-zeile { display: block; margin-top: 8px; font-size: .88rem; line-height: 1.35; color: #4b554f; }
.ki-zeile.sicherheit-niedrig { color: var(--rot); }
.ki-zeile.sicherheit-mittel { color: var(--erde); }

.preisbox { background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); padding: 14px 16px; margin: 18px 0 8px; }
.aufschluesselung { display: grid; grid-template-columns: 1fr auto; row-gap: 4px; margin: 0 0 10px; font-size: .92rem; }
.aufschluesselung dt { padding-right: 12px; }
.aufschluesselung dt { color: var(--leise); }
.aufschluesselung dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.aufschluesselung .linie { border-top: 1px solid var(--linie); padding-top: 4px; font-weight: 600; color: var(--text); }
.vorschlag { display: flex; justify-content: space-between; align-items: baseline; background: var(--gruen-hell); border-radius: 10px; padding: 12px 14px; }
.vorschlag strong { font-size: 1.7rem; color: var(--gruen-dunkel); }
.preisbox.laedt .vorschlag strong { opacity: .4; }
.final { margin: 12px 0 0; }

.weiteres { margin-top: 22px; }
.weiteres form { margin-top: 10px; }

.reiter { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin: -4px 0 14px; background: var(--flaeche); border: 1px solid var(--linie); border-radius: 99px; padding: 3px; }
.reiter a { padding: 8px 2px; border-radius: 99px; text-decoration: none; color: var(--text); text-align: center; font-size: .88rem; }
.reiter a.aktiv { background: var(--gruen); color: #fff; }

.raster3, .raster4 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
textarea { resize: vertical; line-height: 1.35; }
@media (min-width: 560px) {
    .raster3 { grid-template-columns: repeat(3, 1fr); }
    .raster4 { grid-template-columns: repeat(4, 1fr); }
}

.mit-einheit { display: flex; align-items: center; gap: 6px; color: var(--leise); }
.mit-einheit input { min-width: 0; }
.mit-einheit input { margin-top: 4px; }
input.schmal { max-width: 110px; }

.inaktiv { opacity: .55; }

.rpos, .bestandzeile { background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); padding: 12px; margin: 0 0 10px; }
.rpos label, .bestandzeile label, .neuform label { margin-bottom: 8px; }
.rpos .haken { margin-bottom: 10px; font-weight: 600; }
.drei, .zwei { display: grid; gap: 0 8px; }
.drei { grid-template-columns: 1fr 1fr 1.3fr; }
.zwei { grid-template-columns: 1fr 1fr; }
.bestandzeile .zeile-knopf, .schalenform .zeile-knopf { display: flex; justify-content: space-between; align-items: center; }
.bestandzeile .zeile-knopf .haken { margin: 0; }
.neuform { margin-top: 12px; }
.neuform h3 { font-size: 1rem; margin: 14px 0 8px; }

.schalenform .zeile-knopf .haken { margin: 0; }

.mitarbeiter { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--linie); flex-wrap: wrap; }
.mitarbeiter small { display: block; color: var(--leise); }
.knopfgruppe { display: flex; gap: 6px; }

.seiten { display: flex; justify-content: space-between; padding: 14px 0; color: var(--leise); }

.anmeldung { max-width: 380px; margin: 8vh auto 0; text-align: center; }
.anmeldung form { text-align: left; margin-top: 18px; }

.warten { position: fixed; inset: 0; background: rgba(29, 36, 32, .55); z-index: 20; display: flex; align-items: center; justify-content: center; padding: 16px; }
.warten[hidden] { display: none; }
.warten-box { background: #fff; border-radius: 16px; padding: 26px 22px; max-width: 320px; text-align: center; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.warten-box span { color: var(--leise); font-size: .9rem; }
.kreisel { width: 44px; height: 44px; border: 4px solid var(--gruen-hell); border-top-color: var(--gruen); border-radius: 50%; animation: drehen 1s linear infinite; }
@keyframes drehen { to { transform: rotate(360deg); } }
