/* ==================================================================
   Verträglich – Stylesheet (Fassung 3, "frisch & farbig")

   Gestalterische Idee: Die Ampelstufe ist der Held. Sie bekommt ein
   grosses, farbiges Band, das man aus einem Meter Entfernung im
   Supermarktgang erkennt. Alles andere ordnet sich unter.

   Bewegung ist Teil der Aussage, nicht Deko: Die Ergebnis-Scheibe
   pulsiert, Befunde gleiten nacheinander herein, ein Treffer gibt
   haptisches Feedback. Wer am Handy Bewegung reduziert hat, bekommt
   die ruhige Variante -- das steuert prefers-reduced-motion.

   Farbe traegt nie allein: jede Stufe hat zusaetzlich ein Symbol.
   ================================================================== */

:root {
  --tinte:        #12161C;
  --tinte-leise:  #667180;
  --tinte-zart:   #97A1AD;
  --grund:        #F6F8FA;
  --karte:        #FFFFFF;
  --linie:        #E7EBF0;
  --linie-stark:  #D3DAE2;

  --gruen:        #16A46B;
  --gruen-tief:   #0D7A4E;
  --gruen-zart:   #E3F6EE;
  --gelb:         #F2A32C;
  --gelb-tief:    #9A6410;
  --gelb-zart:    #FDF1DC;
  --rot:          #E5484D;
  --rot-tief:     #A62229;
  --rot-zart:     #FCEBEC;
  --grau:         #7A828D;
  --grau-zart:    #EEF1F4;

  --akzent:       #12161C;

  --schrift: ui-sans-serif, system-ui, -apple-system, "Segoe UI",
             Roboto, "Helvetica Neue", Arial, sans-serif;

  --rund:    18px;
  --rund-s:  13px;
  --leiste:  70px;

  --schatten:      0 1px 3px rgba(18,22,28,0.06), 0 4px 16px rgba(18,22,28,0.05);
  --schatten-tief: 0 6px 24px rgba(18,22,28,0.12);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0;
  background: var(--grund);
  color: var(--tinte);
  font-family: var(--schrift);
  font-size: 16px; line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}
body { padding-bottom: calc(var(--leiste) + env(safe-area-inset-bottom) + 20px); }

.ic { width: 1em; height: 1em; display: inline-block; vertical-align: -0.125em; fill: none;
      stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.ic--voll { fill: currentColor; stroke: none; }

.kopf {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(env(safe-area-inset-top) + 16px) 20px 14px;
}
.kopf__marke { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 1.1rem; letter-spacing: -0.02em; }
.kopf__marke .ic { color: var(--gruen); font-size: 1.4rem; }
.kopf__profil {
  font-size: 0.8rem; font-weight: 500; color: var(--tinte-leise);
  background: var(--karte); border: 1px solid var(--linie);
  padding: 6px 12px; border-radius: 999px; max-width: 55%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.ansicht { display: none; padding: 4px 16px 16px; }
.ansicht--aktiv { display: block; animation: einblenden 0.35s ease both; }
@keyframes einblenden { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.sucher {
  position: relative; aspect-ratio: 3 / 4; max-height: 52vh; margin: 0 auto;
  background: #0C0F13; border-radius: var(--rund); overflow: hidden; box-shadow: var(--schatten);
}
.sucher video { width: 100%; height: 100%; object-fit: cover; display: block; }
.sucher__rahmen {
  position: absolute; inset: 38% 14%; border-radius: 12px;
  box-shadow: 0 0 0 100vmax rgba(12,15,19,0.55); pointer-events: none;
}
.sucher__ecke { position: absolute; inset: 38% 14%; pointer-events: none; }
.sucher__rahmen::before, .sucher__rahmen::after,
.sucher__ecke::before, .sucher__ecke::after {
  content: ""; position: absolute; width: 26px; height: 26px; border: 3px solid #fff;
}
.sucher__rahmen::before { top: -3px; left: -3px; border-right: 0; border-bottom: 0; border-radius: 8px 0 0 0; }
.sucher__rahmen::after  { top: -3px; right: -3px; border-left: 0; border-bottom: 0; border-radius: 0 8px 0 0; }
.sucher__ecke::before   { bottom: -3px; left: -3px; border-right: 0; border-top: 0; border-radius: 0 0 0 8px; }
.sucher__ecke::after    { bottom: -3px; right: -3px; border-left: 0; border-top: 0; border-radius: 0 0 8px 0; }
.sucher__linie {
  position: absolute; left: 16%; right: 16%; height: 2px; top: 50%;
  background: linear-gradient(90deg, transparent, var(--gruen), transparent);
  border-radius: 2px; animation: scanwandern 2.4s ease-in-out infinite; pointer-events: none;
}
@keyframes scanwandern {
  0%, 100% { transform: translateY(-42px); opacity: 0.4; }
  50%      { transform: translateY(42px);  opacity: 1; }
}
.sucher__hinweis {
  position: absolute; left: 12px; right: 12px; bottom: 12px; margin: 0;
  padding: 10px 14px; background: rgba(12,15,19,0.7);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  color: #fff; font-size: 0.82rem; font-weight: 500; text-align: center; border-radius: 12px;
}

.scanleiste { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.knopf {
  flex: 1 1 auto; min-height: 54px; display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; padding: 0 20px; border: 0; border-radius: 15px; background: var(--karte); color: var(--tinte);
  font: inherit; font-weight: 500; cursor: pointer; box-shadow: var(--schatten);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.knopf .ic { font-size: 1.25rem; }
.knopf--haupt { flex: 1 1 100%; background: var(--akzent); color: #fff; box-shadow: 0 4px 14px rgba(18,22,28,0.22); }
.knopf--rand { flex: 0 1 auto; }
.knopf:active { transform: scale(0.97); }
.knopf:focus-visible { outline: 3px solid var(--gruen); outline-offset: 3px; }

.urteil {
  margin-top: 18px; background: var(--karte); border-radius: var(--rund); overflow: hidden;
  box-shadow: var(--schatten-tief); animation: kartemrein 0.5s cubic-bezier(0.16,1,0.3,1) both;
}
@keyframes kartemrein {
  from { opacity: 0; transform: translateY(20px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.urteil__band {
  display: flex; align-items: center; gap: 16px; padding: 26px 22px;
  background: var(--grau); color: #fff; transition: background 0.3s ease;
}
.urteil__scheibe {
  flex: 0 0 auto; width: 62px; height: 62px; border-radius: 50%; background: #fff;
  display: grid; place-items: center;
  animation: scheibepop 0.5s cubic-bezier(0.34,1.56,0.64,1) both; animation-delay: 0.1s;
}
.urteil__scheibe .ic { font-size: 2rem; color: var(--grau); }
@keyframes scheibepop {
  0% { transform: scale(0.7); opacity: 0; } 60% { transform: scale(1.08); } 100% { transform: scale(1); opacity: 1; }
}
.urteil__wort { margin: 0; font-size: 1.4rem; font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; }
.urteil__unterzeile { margin: 4px 0 0; font-size: 0.85rem; opacity: 0.9; }
.urteil--gruen .urteil__band { background: var(--gruen); }
.urteil--gruen .urteil__scheibe .ic { color: var(--gruen-tief); }
.urteil--gelb  .urteil__band { background: var(--gelb); }
.urteil--gelb  .urteil__scheibe .ic { color: var(--gelb-tief); }
.urteil--rot   .urteil__band { background: var(--rot); }
.urteil--rot   .urteil__scheibe .ic { color: var(--rot-tief); }
.urteil--gruen .urteil__scheibe {
  animation: scheibepop 0.5s cubic-bezier(0.34,1.56,0.64,1) both, pulsring 2.2s ease-out 0.6s infinite;
}
@keyframes pulsring {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,255,255,0.5); } 50% { box-shadow: 0 0 0 12px rgba(255,255,255,0); }
}
.urteil__kopf { padding: 18px 22px 4px; }
.urteil__kopf h2 { margin: 0; font-size: 1.05rem; font-weight: 600; }
.urteil__kopf p  { margin: 3px 0 0; font-size: 0.85rem; color: var(--tinte-leise); }
.ean { font-variant-numeric: tabular-nums; letter-spacing: 0.03em; }

.befunde { margin: 0; padding: 14px 16px 4px; }
.befunde__zeile {
  display: flex; align-items: center; gap: 12px; padding: 13px 15px; border-radius: var(--rund-s);
  margin-bottom: 8px; background: var(--grau-zart);
  animation: befundrein 0.45s cubic-bezier(0.16,1,0.3,1) both;
}
.befunde__zeile:nth-child(1) { animation-delay: 0.08s; }
.befunde__zeile:nth-child(2) { animation-delay: 0.15s; }
.befunde__zeile:nth-child(3) { animation-delay: 0.22s; }
.befunde__zeile:nth-child(4) { animation-delay: 0.29s; }
.befunde__zeile:nth-child(n+5) { animation-delay: 0.34s; }
@keyframes befundrein { from { opacity: 0; transform: translateX(-12px); } to { opacity: 1; transform: translateX(0); } }
.befunde__punkt {
  flex: 0 0 auto; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background: var(--grau); color: #fff;
}
.befunde__punkt .ic { font-size: 1rem; }
.befunde__text { min-width: 0; }
.befunde__name { margin: 0; font-size: 0.92rem; font-weight: 500; }
.befunde__grund { margin: 1px 0 0; font-size: 0.8rem; opacity: 0.85; }
.befunde__zeile--gruen { background: var(--gruen-zart); color: var(--gruen-tief); }
.befunde__zeile--gruen .befunde__punkt { background: var(--gruen); }
.befunde__zeile--gelb  { background: var(--gelb-zart); color: var(--gelb-tief); }
.befunde__zeile--gelb  .befunde__punkt { background: var(--gelb); }
.befunde__zeile--rot   { background: var(--rot-zart); color: var(--rot-tief); }
.befunde__zeile--rot   .befunde__punkt { background: var(--rot); }
.befunde__zeile--unbekannt { background: var(--grau-zart); color: var(--tinte-leise); }
.urteil__quelle { margin: 0; padding: 10px 22px 0; font-size: 0.76rem; color: var(--tinte-zart); }
.urteil__aktionen { padding: 16px; }

.filter-ampel { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 8px 0 16px; }
.ampelknopf {
  padding: 12px 4px; border: 2px solid transparent; border-radius: 15px; background: var(--karte);
  font: inherit; font-size: 0.72rem; font-weight: 500; color: var(--tinte-leise); cursor: pointer;
  display: grid; gap: 3px; justify-items: center; box-shadow: var(--schatten); transition: transform 0.12s ease;
}
.ampelknopf:active { transform: scale(0.96); }
.ampelknopf__zahl { font-size: 1.35rem; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--tinte); }
.ampelknopf--aktiv { border-color: var(--akzent); background: var(--grau-zart); }
.ampelknopf--gruen .ampelknopf__zahl { color: var(--gruen); }
.ampelknopf--gelb .ampelknopf__zahl { color: var(--gelb-tief); }
.ampelknopf--rot .ampelknopf__zahl { color: var(--rot); }
.ampelknopf--gruen.ampelknopf--aktiv { border-color: var(--gruen); background: var(--gruen-zart); }
.ampelknopf--gelb.ampelknopf--aktiv  { border-color: var(--gelb); background: var(--gelb-zart); }
.ampelknopf--rot.ampelknopf--aktiv   { border-color: var(--rot); background: var(--rot-zart); }

.kategorien { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 10px; margin-bottom: 6px; scrollbar-width: none; }
.kategorien::-webkit-scrollbar { display: none; }
.kat {
  flex: 0 0 auto; padding: 9px 16px; border: 0; border-radius: 999px; background: var(--karte);
  font: inherit; font-size: 0.83rem; font-weight: 500; color: var(--tinte-leise); white-space: nowrap;
  cursor: pointer; box-shadow: var(--schatten); transition: transform 0.12s ease;
}
.kat:active { transform: scale(0.96); }
.kat--aktiv { background: var(--akzent); color: #fff; }

.verlauf-werkzeug { display: flex; justify-content: flex-end; margin-bottom: 8px; }
.verlauf-leeren {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border: 0; border-radius: 999px;
  background: var(--rot-zart); font: inherit; font-size: 0.8rem; font-weight: 500; color: var(--rot-tief); cursor: pointer;
}
.verlauf-leeren .ic { font-size: 1rem; }
.verlauf-leeren:active { transform: scale(0.96); }

.liste { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.eintrag {
  display: flex; align-items: center; gap: 13px; padding: 13px 14px; background: var(--karte);
  border-radius: var(--rund-s); box-shadow: var(--schatten);
  animation: befundrein 0.4s cubic-bezier(0.16,1,0.3,1) both;
}
.eintrag__zeichen {
  flex: 0 0 auto; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px;
  background: var(--grau-zart); color: var(--grau); border: 0; cursor: pointer; padding: 0;
}
.eintrag__zeichen .ic { font-size: 1.2rem; }
.eintrag__zeichen--gruen { background: var(--gruen-zart); color: var(--gruen); }
.eintrag__zeichen--gelb  { background: var(--gelb-zart);  color: var(--gelb-tief); }
.eintrag__zeichen--rot   { background: var(--rot-zart);   color: var(--rot); }
.eintrag__zeichen--unbekannt { background: var(--grau-zart); color: var(--grau); }
.eintrag__text { flex: 1; min-width: 0; text-align: left; border: 0; background: none; font: inherit; cursor: pointer; padding: 0; }
.eintrag__name { margin: 0; font-weight: 500; font-size: 0.95rem; color: var(--tinte); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.eintrag__neben { margin: 2px 0 0; font-size: 0.78rem; color: var(--tinte-leise); }
.eintrag__loeschen {
  flex: 0 0 auto; width: 38px; height: 38px; border: 0; background: none; color: var(--tinte-zart);
  cursor: pointer; border-radius: 50%; display: grid; place-items: center;
}
.eintrag__loeschen .ic { font-size: 1.15rem; }
.eintrag__loeschen:active { background: var(--rot-zart); color: var(--rot); }

.leer { padding: 48px 20px; text-align: center; color: var(--tinte-leise); font-size: 0.9rem; }
.leer .ic { font-size: 2.4rem; color: var(--tinte-zart); display: block; margin: 0 auto 12px; }

.einleitung { margin: 8px 0 20px; font-size: 0.92rem; color: var(--tinte-leise); }
.gruppe { margin-bottom: 22px; }
.gruppe__titel {
  margin: 0 0 10px; font-size: 0.75rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--tinte-zart); padding-left: 4px;
}
.gruppe__karte { background: var(--karte); border-radius: var(--rund); box-shadow: var(--schatten); overflow: hidden; }
.wahl { display: flex; align-items: center; gap: 13px; padding: 14px 16px; cursor: pointer; border-bottom: 1px solid var(--linie); }
.wahl:last-child { border-bottom: 0; }
.wahl input { position: absolute; opacity: 0; pointer-events: none; }
.wahl__schalter {
  flex: 0 0 auto; width: 48px; height: 28px; border-radius: 999px; background: var(--linie-stark);
  position: relative; transition: background 0.2s ease;
}
.wahl__schalter::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.2); transition: transform 0.2s cubic-bezier(0.34,1.56,0.64,1);
}
.wahl input:checked ~ .wahl__schalter { background: var(--gruen); }
.wahl input:checked ~ .wahl__schalter::after { transform: translateX(20px); }
.wahl__text { flex: 1; min-width: 0; }
.wahl__name { font-weight: 500; font-size: 0.95rem; }
.wahl__info { display: block; font-size: 0.78rem; color: var(--tinte-leise); margin-top: 1px; }
.wahl__grad {
  flex: 0 0 auto; padding: 8px 10px; border: 1px solid var(--linie); border-radius: 10px;
  font: inherit; font-size: 0.8rem; font-weight: 500; background: var(--grund); color: var(--tinte);
}
.wahl__grad:disabled { opacity: 0.4; }
.warnung {
  margin-top: 16px; padding: 15px 16px; border-radius: var(--rund-s); background: var(--gelb-zart);
  color: var(--gelb-tief); font-size: 0.84rem; display: flex; gap: 10px;
}
.warnung .ic { flex: 0 0 auto; font-size: 1.2rem; margin-top: 1px; }
.version { margin-top: 20px; text-align: center; font-size: 0.72rem; color: var(--tinte-zart); }

.konto {
  margin-top: 22px;
  padding: 20px 18px;
  background: var(--karte);
  border-radius: var(--rund);
  box-shadow: var(--schatten);
}
.konto__zeile {
  margin: 0 0 14px;
  font-size: 0.85rem;
  color: var(--tinte-leise);
  text-align: center;
}
.konto__abmelden {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  min-height: 50px;
  padding: 0 20px;
  border: 0;
  border-radius: 14px;
  background: var(--rot-zart);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--rot-tief);
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease;
}
.konto__abmelden .ic { font-size: 1.25rem; }
.konto__abmelden:active { transform: scale(0.98); background: #F7D8DA; }
.konto__abmelden:focus-visible { outline: 3px solid var(--rot); outline-offset: 3px; }

.tableiste {
  position: fixed; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(3, 1fr);
  height: calc(var(--leiste) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: rgba(255,255,255,0.92); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--linie); z-index: 20;
}
.tab {
  display: grid; place-items: center; gap: 3px; border: 0; background: none; font: inherit;
  font-size: 0.68rem; font-weight: 500; color: var(--tinte-zart); cursor: pointer; transition: color 0.15s ease;
}
.tab .ic { font-size: 1.5rem; transition: transform 0.15s ease; }
.tab--aktiv { color: var(--gruen); }
.tab--aktiv .ic { transform: translateY(-2px); }
.fussnote { margin: 0; padding: 14px 16px 6px; text-align: center; font-size: 0.7rem; color: var(--tinte-zart); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important;
  }
}
