/* ERP – eine Spalte, fürs iPhone gebaut. Tippflächen mindestens 44 Punkt, Eingabefelder mit 17 Pixel Schrift,
   damit das iPhone beim Antippen nicht hineinzoomt. Keine fremden Schriften, keine Bilder außer dem Symbol. */

:root {
  --grund: #f4f5f7;
  --flaeche: #ffffff;
  --schrift: #1b2430;
  --leise: #5b6675;
  --linie: #d9dde3;
  --marke: #1d3557;
  --marke-schrift: #ffffff;
  --rot: #b3261e;
  --rot-grund: #fdecea;
  --gruen: #1e6b3a;
  --gruen-grund: #e8f4ec;
  --grau-grund: #eceff3;
  --leiste-hoehe: 58px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --grund: #12161c;
    --flaeche: #1b2129;
    --schrift: #e8ebef;
    --leise: #9aa5b3;
    --linie: #323b47;
    --marke: #8fb3e8;
    --marke-schrift: #0e1621;
    --rot: #ff8a80;
    --rot-grund: #3a1d1b;
    --gruen: #86d6a2;
    --gruen-grund: #17301f;
    --grau-grund: #232b35;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--grund);
  color: var(--schrift);
  font: 17px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow-wrap: anywhere;
}

body.mit-leiste { padding-bottom: calc(var(--leiste-hoehe) + env(safe-area-inset-bottom, 0px)); }

.testmarke {
  margin: 0;
  padding: calc(4px + env(safe-area-inset-top, 0px)) 12px 4px;
  background: #b3261e;
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-align: center;
  text-transform: uppercase;
  position: sticky;
  top: 0;
  z-index: 3;
}

.kopf, main, .fuss {
  width: 100%;
  max-width: 34rem;
  margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

.kopf { padding-top: 10px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }

/* ---------- Kundenansicht: Schalter im Kopf und Marke darunter ---------- */
.kundenschalter { margin: 0; }
.knopf-klein {
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid var(--linie);
  border-radius: 22px;
  background: var(--flaeche);
  color: var(--leise);
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
.knopf-klein-an { background: var(--marke); border-color: var(--marke); color: var(--marke-schrift); }
.kundenmarke {
  width: 100%;
  max-width: 34rem;
  margin: 6px auto 0;
  padding: 8px max(16px, env(safe-area-inset-right, 0px)) 8px max(16px, env(safe-area-inset-left, 0px));
  background: var(--gruen-grund);
  color: var(--gruen);
  border-top: 1px solid var(--gruen);
  border-bottom: 1px solid var(--gruen);
  font-size: 15px;
  font-weight: 600;
}

.wortmarke {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  min-width: 44px;
  color: var(--marke);
  font-weight: 800;
  font-size: 20px;
  letter-spacing: 0.08em;
  text-decoration: none;
}

main { flex: 1; padding-bottom: 8px; }

h1 { font-size: 26px; line-height: 1.2; margin: 6px 0 16px; }
h2 { font-size: 19px; line-height: 1.25; margin: 24px 0 8px; }
p { margin: 0 0 12px; }
a { color: var(--marke); }

.leise, small { color: var(--leise); font-size: 15px; }
.nur-vorlesen, .unsichtbar {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.fuss { color: var(--leise); font-size: 13px; text-align: center; padding-top: 16px; padding-bottom: 16px; }

/* ---------- Meldungen ---------- */
.meldungen { margin: 0 0 16px; }
.meldung { margin: 0 0 8px; padding: 12px 14px; border-radius: 10px; border: 1px solid transparent; }
.meldung-fehler { background: var(--rot-grund); color: var(--rot); border-color: var(--rot); }
.meldung-ok { background: var(--gruen-grund); color: var(--gruen); border-color: var(--gruen); }

/* ---------- Formulare ---------- */
.formular { display: flex; flex-direction: column; gap: 6px; margin: 0 0 16px; }
.formular label { font-weight: 600; margin-top: 10px; }

input, select, button, .knopf { font: inherit; }

input[type="text"], input[type="password"], input[type="search"], input[type="number"], input[type="email"], input[type="tel"], input[type="date"], select, textarea {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--linie);
  border-radius: 10px;
  background: var(--flaeche);
  color: var(--schrift);
  -webkit-appearance: none;
  appearance: none;
}

select {
  background-image: linear-gradient(45deg, transparent 50%, var(--leise) 50%), linear-gradient(135deg, var(--leise) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 40px;
}

textarea { font: inherit; line-height: 1.4; resize: vertical; }
input[type="date"] { min-width: 0; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible { outline: 3px solid var(--marke); outline-offset: 2px; }
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--rot); border-width: 2px; }
.feldfehler { margin: 0; padding: 8px 12px; border-radius: 8px; background: var(--rot-grund); color: var(--rot); font-size: 15px; font-weight: 600; }
.feldhinweis { margin: 0; }
.feldhinweis a, .karte-ausblick a, .leise a { display: inline-block; min-height: 44px; line-height: 44px; }
summary { display: list-item; min-height: 44px; padding: 10px 0; box-sizing: border-box; cursor: pointer; }   /* Tippfläche 44 Punkt, das Dreieck bleibt */
.feld-gross { min-height: 60px; font-size: 24px; font-variant-numeric: tabular-nums; }
.formular h2 { margin-bottom: 0; }
.haken, .suche label.haken, .formular label.haken { display: flex; align-items: center; gap: 10px; min-height: 44px; margin: 6px 0 0; font-weight: 400; }
.haken input { width: 24px; height: 24px; margin: 0; flex: none; accent-color: var(--marke); }
.knopfreihe { display: flex; flex-direction: column; gap: 0; margin: 0 0 18px; }
input:disabled { background: var(--grau-grund); color: var(--leise); }

.code-feld { font-size: 24px; letter-spacing: 0.3em; text-align: center; font-variant-numeric: tabular-nums; }

.knopf {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  margin-top: 12px;
  padding: 10px 16px;
  border: 1px solid var(--marke);
  border-radius: 10px;
  background: var(--marke);
  color: var(--marke-schrift);
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
.knopf-zweit { background: transparent; color: var(--marke); }
.knopf:active { opacity: 0.8; }

/* ---------- Karten und Listen ---------- */
.karte { background: var(--flaeche); border: 1px solid var(--linie); border-radius: 14px; padding: 14px 16px; margin: 0 0 14px; }
.karte h2 { margin-top: 0; }
.karte p:last-child { margin-bottom: 0; }
.karte-ausblick { border-style: dashed; }

/* ---------- Artikelkarte ---------- */
.artikelkarte h2 { font-size: 21px; }
.artikelkarte h2 { margin-bottom: 0; }
.artikelkarte h2 a { display: flex; align-items: center; min-height: 44px; color: var(--schrift); text-decoration: none; }
.artikelkarte h2 a::after { content: "›"; margin-left: 8px; color: var(--leise); }
.preis { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin: 6px 0 8px; }
.preis strong { font-size: 30px; line-height: 1.15; font-variant-numeric: tabular-nums; }
.preis span { color: var(--leise); }
.intern { font-size: 14px; }
.inaktiv { opacity: 0.6; border-style: dotted; }
.langtext { white-space: pre-line; }
.logo-vorschau { max-width: 240px; max-height: 120px; width: auto; height: auto; background: #ffffff; padding: 6px; border: 1px solid var(--linie); border-radius: 8px; }
input[type="file"] { width: 100%; min-height: 48px; padding: 10px 0; }
.statusverlauf { list-style: none; margin: 0 0 12px; padding: 0; }
.statusverlauf li { padding: 6px 0; border-top: 1px solid var(--linie); }
.statusverlauf li:first-child { border-top: 0; }
.pruefliste { margin: 0 0 12px; padding-left: 22px; }
.pruefliste li { margin-bottom: 6px; }
.ergebnis { border-color: var(--gruen); }

.suche { margin: 0 0 18px; }
.suche label { display: block; font-weight: 600; margin-bottom: 6px; }
.suche .leise { margin-top: 6px; }

.zurueck { margin: 0; }
.zurueck a { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; }

.liste { list-style: none; margin: 0 0 20px; padding: 0; background: var(--flaeche); border: 1px solid var(--linie); border-radius: 14px; overflow: hidden; }
.liste li + li { border-top: 1px solid var(--linie); }
.liste a { display: flex; flex-direction: column; justify-content: center; min-height: 60px; padding: 10px 16px; color: var(--schrift); text-decoration: none; }
.liste a span { font-weight: 600; }
.liste a:active { background: var(--grau-grund); }

.zustand, .eintraege { list-style: none; margin: 0 0 20px; padding: 0; }
.zustand li, .kasten { padding: 12px 14px; margin: 0 0 8px; border-radius: 10px; border-left: 5px solid var(--linie); background: var(--flaeche); }
.zustand-gut { border-left-color: var(--gruen) !important; }
.zustand-ruhig { border-left-color: var(--leise) !important; }
.zustand-alarm { border-left-color: var(--rot) !important; background: var(--rot-grund) !important; }

.eintraege li { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; margin: 0 0 8px; border: 1px solid var(--linie); border-radius: 10px; background: var(--flaeche); }
.eintraege li.ungesehen { border-color: var(--rot); }

.schritte { padding-left: 22px; margin: 0 0 16px; }
.schritte li { margin-bottom: 14px; }
.qr { display: block; width: 222px; max-width: 100%; height: auto; border-radius: 8px; background: #ffffff; }
.schluessel { font: 600 18px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 0.06em; padding: 10px 12px; background: var(--grau-grund); border-radius: 10px; -webkit-user-select: all; user-select: all; }

/* ---------- Intro-Video beim ersten Öffnen am Tag ----------
   Ohne JavaScript bleibt die Überblendung unsichtbar (display none); erst static/intro.js setzt die Klasse intro-an.
   Dunkler Grund, das quadratische Video mittig so groß, wie die kürzere Seite des Fensters erlaubt. */
.intro { display: none; }
.intro-an {
  display: flex;
  position: fixed;
  inset: 0;
  z-index: 20;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #0b0d10;
  color: #ffffff;
  touch-action: none;
  overscroll-behavior: contain;
  cursor: pointer;
}
.intro-video {
  display: block;
  width: min(100vw, 100vh);
  width: min(100vw, 100dvh);
  max-width: 100%;
  max-height: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  background: #0b0d10;
}
.intro-weiter {
  position: absolute;
  top: calc(12px + env(safe-area-inset-top, 0px));
  right: calc(16px + env(safe-area-inset-right, 0px));
  min-height: 44px;
  min-width: 44px;
  padding: 10px 18px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 22px;
  background: rgba(0, 0, 0, 0.55);
  color: #ffffff;
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
.intro-weiter:focus-visible { outline: 3px solid #ffffff; outline-offset: 2px; }
.intro-hinweis {
  position: absolute;
  left: 0; right: 0;
  bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  margin: 0;
  text-align: center;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
}

/* ---------- Punkt an „Mehr“ ---------- */
.punkt { display: inline-block; width: 10px; height: 10px; margin-left: 5px; border-radius: 50%; vertical-align: middle; }
.punkt-alarm { background: #d93025; }
.punkt-ruhig { background: var(--leise); opacity: 0.6; }

/* ---------- feste untere Leiste ---------- */
.leiste {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 0 max(4px, env(safe-area-inset-right, 0px)) env(safe-area-inset-bottom, 0px) max(4px, env(safe-area-inset-left, 0px));
  background: var(--flaeche);
  border-top: 1px solid var(--linie);
}
.leiste a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: var(--leiste-hoehe);
  min-width: 44px;
  color: var(--leise);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}
.leiste a.aktiv { color: var(--marke); }
.leiste svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.leiste svg .dick { stroke-width: 3.2; }
.leiste span { display: inline-flex; align-items: center; }

@media (min-width: 40rem) {
  .leiste { left: 50%; right: auto; width: 34rem; transform: translateX(-50%); border: 1px solid var(--linie); border-bottom: 0; border-radius: 14px 14px 0 0; }
}

/* ---------- Angebot: kleine Knöpfe nebeneinander (hinauf, hinunter, entfernen) ---------- */
.knopfzeile { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 0; }
.formular-knopf { margin: 0; }
.knopfzeile .knopf-klein { min-width: 44px; }
