/* EcoTrace Consumer
 *
 * Aufbau dieser Datei:
 *   1. Farben und Maße (hell / dunkel)
 *   2. Grundelemente
 *   3. Gerüst: Kopf, untere Leiste, Schritte
 *   4. Bausteine des CO₂-Checks (Start, Eingabe, Angaben, Ergebnis)
 *   5. Übrige Ansichten (Verlauf, Einkauf, Konto, Hofladen …)
 *
 * Gestaltungsregeln, an die sich neue Bausteine halten sollten:
 *   - Farben nur über die Variablen unten, nie als Hex-Wert im Baustein —
 *     sonst stimmt eine der beiden Darstellungen nicht.
 *   - Eine Akzentfarbe (Grün). Bernstein und Rot nur für Hinweise und Warnungen.
 *   - Lesetext mindestens 16 px, Standard 18 px. Alles Antippbare mindestens 48 px hoch.
 *   - Keine Emojis, keine Farbverläufe, kein Leuchten. Icons kommen aus js/icons.js.
 */

/* ================================================================
   1. Farben und Maße
   ================================================================ */
:root {
  --bg:#F6F5F0;
  --surface:#FFFFFF;
  --surface-2:#EEF0EA;
  --text:#16201B;
  --muted:#48534D;
  --border:#D9D6CC;
  --accent:#1E5E43;
  --accent-strong:#16452F;
  --accent-soft:#E3EEE7;
  --on-accent:#FFFFFF;
  --amber:#8F5A00;
  --amber-soft:#FBF0D9;
  --red:#B3261E;
  --red-soft:#FBE9E7;
  --blue:#1F6FA8;
  --water-soft:#E4F0F8;
  --land:#6B4FA0;
  --land-soft:#EEE9F6;
  --bronze:#8A5320;

  /* Fünf Stufen der Einordnung. Die Stufe steht immer auch als Wort da —
     die Farbe ist nur eine zweite Hilfe. */
  --l1:#1E5E43; --l2:#5E9E73; --l3:#E3B43C; --l4:#D8782A; --l5:#9E3B1B;
  /* UX v2: Aufteilung "Woher kommt das CO₂?" in drei Grüntönen, Akzentfläche der Produkt-Icons */
  --split-ing:#16452F; --split-pack:#4F8A68; --split-trp:#9CC5AB;
  --icon-accent:#B9D4C1;

  /* Namen aus der alten Oberfläche, die ältere Bausteine noch verwenden */
  --card:var(--surface);
  --card-soft:var(--surface);
  --border-soft:var(--border);
  --social:var(--muted);
  --social-soft:var(--surface-2);
  --season-main:var(--accent);
  --season-greenhouse:var(--accent);
  --season-storage:var(--amber);
  --season-outside:var(--red);
  --region-de:var(--accent);
  --region-eu:var(--accent);

  --radius:16px;
  --radius-sm:12px;
  --tap:56px;
  --nav-h:76px;
  --font:'Atkinson Hyperlegible', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color-scheme: light;
}

/* Dunkel: wenn das Gerät dunkel eingestellt ist und nicht ausdrücklich "Hell"
   gewählt wurde — oder wenn ausdrücklich "Dunkel" gewählt wurde. Beide Blöcke
   müssen dieselben Werte tragen. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:#121815; --surface:#1B2420; --surface-2:#25302B;
    --text:#ECEFEA; --muted:#AEB8B1; --border:#3A4740;
    --accent:#7FD3A2; --accent-strong:#9BE0B7; --accent-soft:#21372B; --on-accent:#0E1512;
    --amber:#F0B955; --amber-soft:#3A2E14;
    --red:#F2958C; --red-soft:#3D211F;
    --blue:#7CC4F0; --water-soft:#1B2F3B;
    --land:#B9A4E6; --land-soft:#2A2440;
    --bronze:#D9A066;
    --l1:#7FD3A2; --l2:#4E9A6B; --l3:#E3B43C; --l4:#E08A3C; --l5:#D8604A;
    --split-ing:#B4EBCB; --split-pack:#5FB585; --split-trp:#3E8A60;
    --icon-accent:#2F6B4A;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg:#121815; --surface:#1B2420; --surface-2:#25302B;
  --text:#ECEFEA; --muted:#AEB8B1; --border:#3A4740;
  --accent:#7FD3A2; --accent-strong:#9BE0B7; --accent-soft:#21372B; --on-accent:#0E1512;
  --amber:#F0B955; --amber-soft:#3A2E14;
  --red:#F2958C; --red-soft:#3D211F;
  --blue:#7CC4F0; --water-soft:#1B2F3B;
  --land:#B9A4E6; --land-soft:#2A2440;
  --bronze:#D9A066;
  --l1:#7FD3A2; --l2:#4E9A6B; --l3:#E3B43C; --l4:#E08A3C; --l5:#D8604A;
  --split-ing:#B4EBCB; --split-pack:#5FB585; --split-trp:#3E8A60;
  --icon-accent:#2F6B4A;
  color-scheme: dark;
}

/* ================================================================
   2. Grundelemente
   ================================================================ */
* { box-sizing: border-box }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 18px;
  line-height: 1.45;
  padding: 0 20px;
  padding-bottom: calc(var(--nav-h) + 32px + env(safe-area-inset-bottom, 0px));
  min-height: 100vh;
  /* Nichts wird breiter als der Bildschirm: ein Wort, das nicht in die Zeile
     passt, bricht um, statt seitlich herauszuragen oder abgeschnitten zu werden. */
  overflow-wrap: break-word;
  /* Lange deutsche Wörter mit Bindestrich trennen (braucht lang="de") */
  hyphens: auto; -webkit-hyphens: auto;
}
img, svg, video, canvas, iframe, table, input, select, textarea, button { max-width: 100% }
/* Flex- und Grid-Kinder dürfen schmaler werden als ihr längstes Wort */
:where([class*="-row"], [class*="-head"], [class*="-main"], [class*="-info"], [class*="-text"]) > * { min-width: 0 }

.wrap { width: 100%; max-width: 560px; margin: 0 auto }

h1, h2, h3, p { margin: 0 }
strong { font-weight: 700 }
a { color: var(--accent); text-underline-offset: 3px }
[hidden] { display: none !important }

input, select, textarea, button { font-family: inherit; font-size: inherit; color: inherit }
button { cursor: pointer }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px }
h1:focus, h2:focus { outline: none }

.ic { flex-shrink: 0; display: block }
[data-icon] { display: inline-flex; flex-shrink: 0 }

label, legend, .legend-like {
  display: block; padding: 0; margin: 0 0 8px;
  font-size: 18px; font-weight: 700; color: var(--text);
}

input[type=text], input[type=number], input[type=email], input[type=password], select {
  width: 100%; min-height: var(--tap); padding: 12px 14px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font-size: 18px;
  outline: none;
}
input:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent) }
input::placeholder { color: var(--muted); opacity: .75 }

.muted  { color: var(--muted); font-size: 16px }
.divider { border: none; border-top: 1px solid var(--border); margin: 16px 0 }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px }
@media (max-width: 560px) { .grid2 { grid-template-columns: 1fr } }

/* Knöpfe */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: var(--tap); padding: 12px 20px;
  border: 2px solid var(--accent); border-radius: var(--radius);
  background: var(--accent); color: var(--on-accent);
  font-size: 18px; font-weight: 700; line-height: 1.2; text-align: center;
}
.btn:hover { background: var(--accent-strong); border-color: var(--accent-strong) }
.btn:disabled { opacity: .45; cursor: not-allowed }
.btn.secondary, .btn.ghost { background: var(--surface); color: var(--accent) }
.btn.secondary:hover, .btn.ghost:hover { background: var(--accent-soft) }
.btn.ghost { border-color: transparent; background: transparent }
.btn.danger { background: var(--red-soft); color: var(--red); border-color: var(--red) }
.btn-block { display: flex; width: 100% }
.btn-lg { min-height: 60px; font-size: 20px }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px }

.link-btn {
  background: none; border: none; padding: 0; margin: 0;
  color: var(--accent); font-weight: 700; text-decoration: underline; text-underline-offset: 3px;
}

/* Karten */
.card, .panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; margin-bottom: 16px;
}
.card-title { font-size: 20px; font-weight: 700; margin-bottom: 6px }
.step-header { display: flex; align-items: center; gap: 10px; margin-bottom: 14px }
.step-title { font-size: 20px; font-weight: 700; color: var(--text) }
.step-badge { display: none }

.chip {
  display: inline-flex; align-items: center; padding: 5px 12px; border-radius: 999px;
  background: var(--surface-2); color: var(--text); font-size: 15px; font-weight: 700;
}
.chip-good   { background: var(--accent-soft); color: var(--accent) }
.chip-warn   { background: var(--amber-soft);  color: var(--amber) }
.chip-danger { background: var(--red-soft);    color: var(--red) }
.badges-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px }
.badges-row:empty { display: none }

.notice {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 16px 18px; margin: 12px 0; border-radius: var(--radius);
  background: var(--surface-2); color: var(--text); font-size: 17px; line-height: 1.45;
}
.notice .ic { margin-top: 2px; flex-shrink: 0 }
.notice > div { flex: 1; min-width: 0 }
@media (max-width: 339px) {
  .notice { flex-direction: column; gap: 8px }
  .notice .btn { padding-left: 12px; padding-right: 12px }
  .notice .btn .ic { display: none }
}
.notice-warn { background: var(--amber-soft) }
.notice-warn .ic { color: var(--amber) }
.notice .btn .ic { color: inherit }
.notice-good { background: var(--accent-soft) }

/* Bio oder konventionell? (organic.js) — direkt unter dem Urteil */
.organic-box {
  margin: 12px 0; padding: 16px 18px; border-radius: var(--radius);
  background: var(--surface-2); color: var(--text); font-size: 17px; line-height: 1.45;
  border: 1px solid var(--border);
}
.organic-box.is-organic { background: var(--accent-soft); border-color: transparent }
.organic-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; font-size: 19px }
.organic-head .ic { color: var(--accent); flex-shrink: 0 }
.organic-head > span { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; min-width: 0 }
.organic-why { font-size: 16px; color: var(--muted); overflow-wrap: anywhere }
.organic-text { margin: 0 0 8px; overflow-wrap: break-word }
.organic-list { margin: 0 0 8px; padding-left: 22px }
.organic-list li { margin-bottom: 4px }
.organic-src { margin: 0; font-size: 15px; color: var(--muted) }
.fatal-banner { background: var(--red-soft); color: var(--red); padding: 14px 16px; margin: 0 -20px; font-weight: 700; text-align: center }

.bar-track { height: 10px; border-radius: 5px; background: var(--surface-2); overflow: hidden }
.bar-fill  { height: 100%; border-radius: 5px; background: var(--accent) }

/* ================================================================
   3. Gerüst
   ================================================================ */
.app-header { display: flex; align-items: center; gap: 10px; height: 60px; padding-top: 8px }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--accent); color: var(--on-accent);
  align-items: center; justify-content: center;
}
.brand-logo { width: 36px; height: 36px; flex: none; display: block }
.brand-name { font-size: 22px; font-weight: 700; letter-spacing: -.3px }
/* Konto oben rechts (UX v2): ersetzt den Tab "Einstellungen" */
.account-btn {
  margin-left: auto; width: 48px; height: 48px; border-radius: 24px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface); color: var(--accent); border: 1px solid var(--border);
}
.account-btn.active { background: var(--accent-soft); border-color: var(--accent) }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.tab-view        { display: none }
.tab-view.active { display: block }

.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
  height: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--surface); border-top: 1px solid var(--border);
}
.tab-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  min-width: 0; padding: 6px 2px; border: none; background: none;
  color: var(--muted); font-size: 14px; font-weight: 400; line-height: 1.1;
}
.tab-btn.active { color: var(--accent); font-weight: 700 }
/* Fünf Spalten: auf schmalen Handys kleinere Schrift, lange Wörter trennen an &shy; */
@media (max-width: 359px) { .tab-btn { font-size: 12px; letter-spacing: -.01em } }
/* Scannen in der Mitte: runder Knopf, ragt über die Leiste hinaus */
.tab-scan { justify-content: flex-end; padding-bottom: 8px; color: var(--accent); font-weight: 700 }
.tab-scan-circle {
  width: 64px; height: 64px; border-radius: 32px; margin-top: -30px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent); color: var(--on-accent);
  border: 4px solid var(--bg); box-sizing: content-box;
}
@media (max-width: 359px) { .tab-scan-circle { width: 54px; height: 54px; border-radius: 27px; border-width: 3px; margin-top: -24px } }
@media (max-width: 319px) { .tab-scan-circle { width: 48px; height: 48px; border-radius: 24px; border-width: 3px; margin-top: -22px } }
.nav-icon-wrap { position: relative; display: inline-flex }
.nav-badge, .tab-new {
  position: absolute; top: -6px; left: 16px;
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px;
  background: var(--accent); color: var(--on-accent);
  font-size: 13px; font-weight: 700; line-height: 20px; text-align: center;
}
.tab-new { display: none }
.tab-new.show { display: block }
/* Fünf Spalten auf schmalen Handys: „neu“ darf nicht aus seiner Spalte ragen */
@media (max-width: 359px) { .tab-new { left: auto; right: -12px; min-width: 0; padding: 0 4px; font-size: 11px } }
.tab-trim-note { display: none }

/* Schritte: immer genau einer sichtbar (js/flow.js) */
.step { display: none }
.step.is-active { display: block }

.step-bar { display: flex; align-items: center; justify-content: space-between; min-height: 48px; margin: 0 -10px }
.back-btn {
  display: inline-flex; align-items: center; gap: 4px;
  min-height: 48px; padding: 0 10px; border: none; background: none;
  color: var(--accent); font-size: 18px; font-weight: 700;
}
.step-count { padding: 0 10px; color: var(--muted); font-size: 16px }
.step-progress { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-top: 4px }
.step-progress span { height: 6px; border-radius: 3px; background: var(--border) }
.step-progress span.on { background: var(--accent) }

.screen-title { margin: 22px 0 8px; font-size: 30px; line-height: 1.15; font-weight: 700; letter-spacing: -.3px }
.screen-lead  { color: var(--muted); font-size: 18px; margin-bottom: 20px }
.screen-foot  { margin: 16px 0 0; color: var(--muted); font-size: 16px; text-align: center }

/* ================================================================
   4. Bausteine des CO₂-Checks
   ================================================================ */

/* Start: vier Wege */
.method-list { display: flex; flex-direction: column; gap: 12px; margin-top: 22px }
.method {
  display: flex; align-items: center; gap: 16px; width: 100%; min-height: 80px;
  padding: 14px 16px 14px 18px; text-align: left;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius);
}
.method:hover { border-color: var(--accent) }
.method-icon {
  width: 50px; height: 50px; border-radius: 12px;
  background: var(--accent-soft); color: var(--accent);
  align-items: center; justify-content: center;
}
.method-text  { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0 }
.method-title { font-size: 19px; font-weight: 700; line-height: 1.2 }
.method-sub   { font-size: 16px; color: var(--muted); line-height: 1.3 }
.method-arrow { color: var(--muted) }
.method-primary { min-height: 88px; background: var(--accent); border-color: var(--accent); color: var(--on-accent) }
.method-primary:hover { background: var(--accent-strong) }
.method-primary .method-icon { background: transparent; color: var(--on-accent); border: 2px solid var(--on-accent) }
.method-primary .method-sub, .method-primary .method-arrow { color: var(--on-accent) }
.method-primary .method-title { font-size: 20px }

/* Start (UX v2): großer Scan-Bereich, darunter "Kein Barcode?" */
.scan-hero {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: 260px; margin-top: 12px; padding: 24px 16px;
  border: none; border-radius: var(--radius);
  background: var(--accent); color: var(--on-accent); text-align: center;
}
.scan-hero:hover { background: var(--accent-strong) }
.scan-hero-frame {
  display: inline-flex; align-items: center; justify-content: center;
  width: 120px; height: 120px; margin-bottom: 8px;
  border: 3px solid var(--on-accent); border-radius: 22px;
}
.scan-hero-title { font-size: 24px; font-weight: 700; line-height: 1.2 }
.scan-hero-sub   { font-size: 17px; line-height: 1.3 }
.method-panel { margin-top: 16px }
@media (max-width: 359px) { .method-panel { padding: 16px 12px } .method-list-compact .method { padding: 10px; gap: 10px } }
.method-list-compact { gap: 8px; margin-top: 10px }
.method-list-compact .method { min-height: 64px; padding: 10px 12px; gap: 12px }
.method-list-compact .method-icon { width: 42px; height: 42px }
.method-list-compact .method-title { font-size: 17px }
.method-list-compact .method-sub { font-size: 15px }

/* Das passiert gerade (UX v2) */
.working-kicker { display: flex; align-items: center; gap: 8px; margin: 22px 0 0; color: var(--accent); font-weight: 700 }
.working-list { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px }
.working-list li {
  display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.working-list li > span:last-child { display: flex; flex-direction: column; gap: 2px; min-width: 0 }
.working-sub { color: var(--muted); font-size: 16px }
.working-dot {
  flex: none; width: 24px; height: 24px; margin-top: 1px; border-radius: 12px;
  border: 3px solid var(--border); box-sizing: border-box;
}
.working-list li.is-done .working-dot {
  border-color: var(--accent); background: var(--accent);
  box-shadow: inset 0 0 0 3px var(--surface);
}
@media (prefers-reduced-motion: no-preference) {
  .working-list li:not(.is-done) .working-dot { animation: working-pulse 1.2s ease-in-out infinite }
  @keyframes working-pulse { 50% { border-color: var(--accent) } }
}
.working-foot { margin-top: 16px; color: var(--muted) }

/* Eingabe */
.field { margin-bottom: 18px }
.field:last-child { margin-bottom: 0 }
.field-hint  { color: var(--muted); font-size: 16px; margin: -4px 0 8px }
.field-error { color: var(--red); font-size: 16px; font-weight: 700; margin-top: 8px }
.field-row   { display: flex; gap: 10px; align-items: stretch }
.field-row input { flex: 1; min-width: 0 }
.field-row .btn { flex-shrink: 0 }
.field-unit .unit { display: flex; align-items: center; color: var(--muted); font-size: 16px; white-space: nowrap }
.or-line { margin: 4px 0 18px; color: var(--muted); font-size: 16px; text-align: center }
.optional { font-weight: 400; color: var(--muted) }
.panel-kicker { color: var(--muted); font-size: 16px; margin-bottom: 14px }
.status-line { min-height: 24px; margin-top: 12px; color: var(--text); font-size: 17px }
.status-line:empty { display: none }

.upload-grid { display: grid; grid-template-columns: 1fr; gap: 12px; margin-bottom: 16px }
.upload {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  position: relative; margin: 0; padding: 20px 16px; text-align: center;
  background: var(--surface); color: var(--text);
  border: 2px dashed var(--border); border-radius: var(--radius);
  font-weight: 400;
}
.upload input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none }
.upload-choice { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; width: 100%; margin-top: 10px }
.upload-choice .btn { flex: 1 1 180px }
.upload:focus-within { border-color: var(--accent); border-style: solid }
.upload-icon { color: var(--accent) }
.upload-text { font-size: 18px; font-weight: 700 }
.upload-hint { font-size: 16px; color: var(--muted) }
#previewFront, #previewOptFront {
  display: none; max-width: 100%; max-height: 220px; margin-top: 10px;
  border-radius: var(--radius-sm); border: 1px solid var(--border);
}
.progress { height: 6px; border-radius: 3px; overflow: hidden; background: var(--border); margin-top: 14px }
.progress > span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .25s }

.pick-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px }
.pick-list:empty { display: none }
.pick-row {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 68px;
  padding: 10px 14px; text-align: left;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.pick-row:hover { border-color: var(--accent) }
.pick-img { width: 48px; height: 48px; flex-shrink: 0; object-fit: contain; border-radius: 8px; background: #fff }
.pick-img-empty { background: var(--surface-2) }
.pick-text { display: flex; flex-direction: column; min-width: 0 }
.pick-name { font-size: 17px; font-weight: 700 }
.pick-meta { font-size: 15px; color: var(--muted) }

/* Auswahlkacheln: Verpackung, Einweg/Mehrweg, Herkunft, Obst & Gemüse, Darstellung */
.choice { margin: 28px 0 0; padding: 0; border: 0; min-width: 0 }
.choice legend, .legend-like { font-size: 20px; margin-bottom: 12px }
.choice-grid, .produce-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px }
.choice-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 14px }
.produce-grid { grid-template-columns: repeat(3, minmax(0, 1fr)) }
@media (max-width: 359px) { .produce-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) } }
.pack-card {
  display: flex; align-items: center; gap: 10px; min-height: 64px;
  padding: 8px 12px; text-align: left;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: 14px;
  font-size: 18px; line-height: 1.2;
}
.pack-card:hover { border-color: var(--accent) }
.pack-card > [data-icon]:first-child { color: var(--muted) }
.pack-label { flex: 1; min-width: 0; overflow-wrap: break-word; hyphens: auto }
.pack-label small { display: block; margin-top: 2px; font-size: 15px; font-weight: 400; color: var(--muted) }
.pick-check { display: none; color: var(--accent) }
.pack-card.selected {
  background: var(--accent-soft); font-weight: 700;
  border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent);
}
.pack-card.selected > [data-icon]:first-child { color: var(--accent) }
.pack-card.selected .pick-check { display: inline-flex }
.produce-grid .pack-card, .choice-grid-3 .pack-card { justify-content: center; text-align: center; padding: 8px 6px }

.geo-hint-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; font-size: 16px }
.geo-hint-label { flex: 1; min-width: 0 }
.geo-hint-btn {
  min-height: 44px; padding: 8px 14px; border-radius: 22px;
  border: 1px solid var(--accent); background: var(--surface); color: var(--accent);
  font-size: 16px; font-weight: 700;
}
.geo-hint-btn:disabled { opacity: .55; cursor: default }
.geo-hint-confirmed { color: var(--accent) }
.geo-hint-denied, .geo-hint-note { color: var(--muted) }
.geo-hint-note { font-size: 15px; margin-bottom: 10px }

.ing-pills { display: flex; flex-wrap: wrap; gap: 8px }
.ing-pill {
  position: relative; padding: 5px 12px; border-radius: 999px; cursor: help;
  background: var(--accent-soft); color: var(--accent); font-size: 15px; font-weight: 700;
}
.ing-pill.proxy { background: var(--amber-soft); color: var(--amber) }

#btnCalc { margin-top: 32px }
.opt-skip {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; margin: 8px 0 0; color: var(--muted); font-size: 16px; font-weight: 400; cursor: pointer;
}
.opt-skip input { width: 22px; height: 22px; margin: 0; accent-color: var(--accent) }

/* Ergebnis */
/* Kopf (UX v2): Icon-Kachel, Name, Menge · Verpackung, Abzeichen */
.res-head { display: flex; align-items: center; gap: 12px; margin-top: 8px }
.res-icon {
  flex: none; width: 52px; height: 60px; border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent);
}
.product-icon .pi-accent { fill: var(--icon-accent) }
.res-head-text { flex: 1; min-width: 0 }
.res-head .res-title { margin: 0 }
.res-meta { margin: 2px 0 0; color: var(--muted); font-size: 16px }
.res-badge {
  flex: none; align-self: flex-start; display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 10px; border-radius: 14px; font-size: 15px; font-weight: 700;
  background: var(--accent-soft); color: var(--accent);
}
@media (max-width: 359px) { .res-head { flex-wrap: wrap } .res-badge { align-self: auto } }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px;
  border: none; background: none; color: var(--accent); border-radius: 24px;
}
.icon-btn[hidden] { display: none }
#resultCard .step-bar { margin-right: 0 }

/* Aufteilung als ein Balken (UX v2) */
.split-bar { margin-top: 16px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius) }
.split-bar .res-h { margin: 0 0 10px; font-size: 18px }
.split-track { display: flex; gap: 2px; height: 18px; border-radius: 9px; overflow: hidden }
.split-seg { display: block; height: 100% }
.split-ing  { background: var(--split-ing) }
.split-pack { background: var(--split-pack) }
.split-trp  { background: var(--split-trp) }
.split-legend { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 16px }
.split-legend li { display: inline-flex; align-items: center; gap: 6px }
.split-dot { flex: none; width: 12px; height: 12px; border-radius: 6px }

/* Bessere Alternative (UX v2) */
.alt-card {
  display: flex; align-items: center; gap: 10px; width: 100%; margin-top: 12px;
  padding: 12px 10px 12px 16px; text-align: left;
  background: var(--surface); color: var(--text);
  border: 2px solid var(--accent); border-radius: var(--radius);
}
.alt-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px }
.alt-kicker { font-size: 14px; font-weight: 700; color: var(--accent) }
.alt-name { font-size: 18px; font-weight: 700; line-height: 1.2 }
.alt-sub { font-size: 15px; color: var(--muted) }
.alt-badge {
  flex: none; display: flex; flex-direction: column; align-items: center;
  padding: 6px 10px; border-radius: 12px; background: var(--accent); color: var(--on-accent);
}
.alt-pct { font-size: 20px; font-weight: 700; line-height: 1.1; white-space: nowrap }
.alt-unit { font-size: 13px; font-weight: 700 }
.alt-card > [data-icon], .alt-card > svg { flex: none; color: var(--accent) }

/* Ansicht „Alternativen“ (UX v2) */
.alt-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px }
.alt-item {
  display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
}
.alt-item-icon {
  flex: none; width: 44px; height: 48px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent);
}
.alt-item-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px }
.alt-item-from { font-size: 15px; color: var(--muted) }
.alt-item-name { font-size: 17px; line-height: 1.25 }
.alt-item-sub { font-size: 14px; color: var(--muted) }

/* Einkauf (UX v2) */
.shop-ask-title { margin: 0 0 8px; font-size: 24px; line-height: 1.2 }
.shop-ask-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 18px }
.shop-ask-notes { margin: 16px 0 0; padding-left: 20px; color: var(--muted); font-size: 16px; display: flex; flex-direction: column; gap: 6px }
.cart-status-text { display: inline-flex; align-items: center; gap: 6px; min-width: 0 }
.cart-status-check { flex: none; color: var(--accent); font-weight: 700 }
.cart-status .link-btn { min-height: 44px; padding: 0 4px; font-weight: 700; white-space: nowrap }
.cart-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: -4px 0 14px; flex-wrap: wrap }
.cart-head-sub { margin: 0; color: var(--muted) }
.cart-list { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-direction: column; gap: 8px }
.cart-row {
  display: flex; align-items: center; gap: 10px; padding: 8px 6px 8px 10px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.cart-row-icon {
  flex: none; width: 40px; height: 44px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent);
}
.cart-row-name { flex: 1; min-width: 0; font-weight: 700; line-height: 1.25 }
.cart-row-kg { flex: none; white-space: nowrap; color: var(--muted) }
.cart-row-remove {
  flex: none; width: 44px; height: 44px; border: none; background: none;
  color: var(--muted); font-size: 24px; line-height: 1; border-radius: 22px;
}
.mode-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px }
.mode-chip {
  min-height: 44px; padding: 0 14px; border-radius: 22px;
  background: var(--surface); color: var(--text); border: 1px solid var(--border); font-size: 16px;
}
.mode-chip[aria-checked="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 700 }
.cart-km { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 14px 0 0; font-size: 16px; font-weight: 400 }
.cart-km input.cart-km-input { width: 88px; flex: none; min-height: 44px; padding: 0 10px; font-size: 18px; text-align: center }
.cart-sum { margin-top: 14px }
.cart-sum-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0 12px; padding: 4px 0 }
.cart-sum-row span:last-child { white-space: nowrap }
.cart-sum-total { margin-top: 6px; padding-top: 10px; border-top: 1px solid var(--border); font-size: 20px; font-weight: 700 }
.cart-bike { margin: 10px 0 0 }

/* Vergleich (UX v2, Skizze „Vergleich“) */
.cmp-detail { margin-bottom: 14px }
.cmp-best-card {
  display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border-radius: var(--radius);
  background: var(--accent-soft); color: var(--text);
}
.cmp-best-kicker { font-size: 14px; font-weight: 700; color: var(--accent) }
.cmp-best-name { font-size: 20px; line-height: 1.2 }
.cmp-best-pct { font-size: 17px; font-weight: 700; color: var(--accent) }
.cmp-bars { margin-top: 14px; display: flex; flex-direction: column; gap: 12px }
.cmp-bar-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-bottom: 6px }
.cmp-bar-name { font-weight: 700; flex: 1 1 auto; min-width: 0 }
.cmp-bar-val { white-space: nowrap; color: var(--muted) }
.cmp-chip { padding: 1px 8px; border-radius: 10px; font-size: 14px; font-weight: 700; background: var(--surface-2) }
.cmp-chip.level-1, .cmp-chip.level-2 { background: var(--accent-soft); color: var(--accent) }
.cmp-chip.level-3 { background: var(--amber-soft); color: var(--amber) }
.cmp-chip.level-4, .cmp-chip.level-5 { background: var(--red-soft); color: var(--red) }
.cmp-bar-track { display: flex; height: 16px; border-radius: 8px; overflow: hidden; background: var(--surface-2) }
.cmp-bar-base { display: block; height: 100%; background: var(--accent) }
.cmp-bar-gap  { display: block; height: 100%; background: var(--l4) }
.cmp-gap-legend { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 16px }
.cmp-gap-dot { flex: none; width: 12px; height: 12px; border-radius: 6px; background: var(--l4) }
.cmp-reasons-h { margin: 18px 0 8px; font-size: 18px }
.cmp-reasons { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px }
.cmp-reason { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; align-items: center }
.cmp-reason-name { font-weight: 700 }
.cmp-reason-val { grid-row: 1; grid-column: 2; white-space: nowrap; color: var(--muted) }
.cmp-reason-track { grid-row: 2; grid-column: 1 / -1; height: 10px; border-radius: 5px; background: var(--surface-2); overflow: hidden }
.cmp-reason-track > span { display: block; height: 100%; background: var(--accent) }
.cmp-same { margin: 0 0 8px; font-size: 18px; font-weight: 700 }
.sc-subtitle { margin-top: 6px }

/* Mehr erfahren (UX v2) */
.more-card {
  display: flex; align-items: center; gap: 10px; width: 100%; margin-top: 12px; min-height: 64px;
  padding: 12px 14px 12px 16px; text-align: left;
  background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius);
}
.more-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px }
.more-title { font-size: 18px; font-weight: 700 }
.more-chips { display: flex; flex-wrap: wrap; gap: 4px 6px }
.more-chips span { padding: 2px 8px; border-radius: 10px; background: var(--surface-2); color: var(--muted); font-size: 14px }
.more-card > svg { flex: none; color: var(--accent) }
#detailPanel { margin-top: 12px }
.print-btn { margin-top: 12px }

/* Aktionsleiste unten im Ergebnis (UX v2), über der Navigationsleiste */
.result-actions {
  position: fixed; z-index: 40; left: 0; right: 0;
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
  display: flex; flex-direction: column; gap: 8px; padding: 8px 16px 10px;
  max-width: 560px; margin: 0 auto;
  background: var(--surface); border-top: 1px solid var(--border);
}
.result-actions-row { display: flex; gap: 10px }
.result-actions-row .btn { min-width: 0; padding-left: 8px; padding-right: 8px; justify-content: center; text-align: center }
#btnNextScan { flex: 1.5 }
#btnCompare  { flex: 1; border-width: 2px }
.cart-status { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 15px; color: var(--muted) }
.cart-status[hidden] { display: none }
#resultCard.is-active { padding-bottom: 150px }
@media (max-width: 359px) { .result-actions-row .btn { font-size: 17px } }

.res-kicker { margin-top: 12px; color: var(--muted); font-size: 16px }
.res-title  { font-size: 24px; line-height: 1.2; font-weight: 700; overflow-wrap: anywhere }
.res-h      { margin: 32px 0 14px; font-size: 22px; font-weight: 700 }
.res-hint   { margin: -8px 0 14px; color: var(--muted); font-size: 16px }

.verdict {
  margin-top: 18px; padding: 22px 20px 20px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 20px;
}
.verdict.is-sim { border-color: var(--amber); border-width: 2px }
.verdict-kicker { color: var(--muted); font-size: 17px }
.verdict-num { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; margin-top: 4px }
.verdict-value { font-size: 48px; line-height: 1; font-weight: 700; letter-spacing: -1px }
.verdict-unit  { font-size: 22px; font-weight: 700 }
.verdict-chip {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 14px;
  padding: 8px 14px; border-radius: 999px; font-size: 18px; font-weight: 700;
  background: var(--surface-2); color: var(--text);
}
.verdict-chip.level-1, .verdict-chip.level-2 { background: var(--accent-soft); color: var(--accent) }
.verdict-chip.level-3 { background: var(--amber-soft); color: var(--amber) }
.verdict-chip.level-4, .verdict-chip.level-5 { background: var(--red-soft); color: var(--red) }
.verdict-text { margin-top: 14px; font-size: 18px }
/* UX v2: Überschrift statt Plakette, Farbe nach Stufe (Wort steht immer dabei) */
.verdict-head { margin: 0; font-size: 24px; line-height: 1.2; font-weight: 700 }
.verdict-head.level-1, .verdict-head.level-2 { color: var(--accent) }
.verdict-head.level-3 { color: var(--amber) }
.verdict-head.level-4, .verdict-head.level-5 { color: var(--red) }
.verdict .verdict-kicker { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); font-size: 15px }
/* UX v2: kompakt wie in der Skizze, damit Balken und Alternative ohne Scrollen sichtbar werden */
.verdict { padding: 16px 16px 14px }
.verdict .scale { margin-top: 12px }
.verdict .verdict-text { margin-top: 10px; font-size: 17px }
.verdict .verdict-value { font-size: 40px }
.verdict .verdict-unit { font-size: 20px }
.verdict .verdict-equiv { margin: 2px 0 0; font-size: 16px }
.verdict .verdict-foot { margin-top: 6px; font-size: 15px; line-height: 1.35 }
.verdict-foot { margin-top: 12px; color: var(--muted); font-size: 16px }
.q-high { color: var(--accent) } .q-mid { color: var(--text) } .q-low { color: var(--red) }

.scale { margin-top: 20px }
.scale-marks, .scale-bars { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px }
.scale-marks { height: 28px }
.scale-marks span { display: flex; flex-direction: column; align-items: center; font-size: 14px }
.scale-marks b { font-weight: 700; line-height: 18px }
.scale-marks i { width: 0; height: 0; border: 6px solid transparent; border-top: 8px solid var(--text); border-bottom: 0 }
.scale-bars { align-items: center; height: 24px }
.scale-seg { height: 12px; border-radius: 6px }
.scale-seg.level-1 { background: var(--l1) } .scale-seg.level-2 { background: var(--l2) }
.scale-seg.level-3 { background: var(--l3) } .scale-seg.level-4 { background: var(--l4) }
.scale-seg.level-5 { background: var(--l5) }
.scale-seg.is-active { height: 20px; box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--text) }
.scale-bars.is-4 { grid-template-columns: repeat(4, minmax(0, 1fr)) }
.nova-scale { margin: 6px 0 14px }
.scale-ends { display: flex; justify-content: space-between; margin-top: 6px; color: var(--muted); font-size: 15px }

.split { display: flex; flex-direction: column; gap: 18px }
.split-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-weight: 700; margin-bottom: 8px }
.split-sub  { margin-top: 6px; color: var(--muted); font-size: 15px }
/* Prozentzahl nie umbrechen ("15" / "%"), auch neben einem langen Namen wie "Verarbeitung im Werk" */
.split-pct  { white-space: nowrap; flex-shrink: 0 }

.tips { display: flex; flex-direction: column; gap: 10px }
.tip {
  display: flex; gap: 14px; padding: 16px 18px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
}
.tip-icon {
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 40px; height: 40px; border-radius: 10px; background: var(--accent-soft); color: var(--accent);
}
.tip-title { font-weight: 700 }
.tip-text  { color: var(--muted); font-size: 16px; margin-top: 2px }

/* "Mehr erfahren": Abschnitte zum Aufklappen. Module hängen eigene Abschnitte an
   (.detail-section mit .detail-heading); `order` legt die Reihenfolge fest,
   js/multiimpact.js (initDetailAccordion) macht die Überschrift zum Knopf. */
.detail-panel {
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
}
.detail-section { order: 5; border-top: 1px solid var(--border); padding: 0 18px }
.water-detail-block { order: 1; border-top: none }
.pack-detail-block { order: 2 } .comp-detail-block { order: 3 }
.season-detail-block { order: 4 } .labels-detail-block { order: 5 }
.labour-detail-block { order: 6 } .health-detail-block { order: 7 }
.quality-detail-block { order: 8 } .method-detail-block { order: 9 }
.detail-heading {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 68px; margin: 0 -18px; padding: 12px 18px; cursor: pointer;
  font-size: 18px; font-weight: 700; color: var(--text);
}
.dh-text  { display: flex; flex-direction: column; gap: 2px; min-width: 0; text-align: left }
.dh-title { font-size: 18px; font-weight: 700 }
.dh-sub   { font-size: 15px; font-weight: 400; color: var(--muted) }
.detail-heading .ic, .sim-header-btn .ic { transition: transform .15s }
.detail-section.is-open > .detail-heading .ic { transform: rotate(180deg) }
.detail-section > :not(.detail-heading) { display: none }
.detail-section.is-open > :not(.detail-heading) { display: revert }
.detail-section.is-open { padding-bottom: 18px }
.detail-text   { font-size: 17px; margin-bottom: 10px }
.detail-source { font-size: 15px; color: var(--muted); margin-bottom: 10px }
/* Herkunftskarte (origin-map.js) */
.origin-map { display: block; width: 100%; height: auto; margin: 4px 0 12px; background: var(--water-soft); border-radius: var(--radius-sm) }
.origin-map .om-land { fill: var(--surface); stroke: var(--muted) }
.origin-map .om-line { fill: none; stroke: var(--amber); opacity: .8 }
.origin-map .om-dot { fill: var(--amber); stroke: var(--surface) }
.origin-map .om-de { fill: var(--accent); stroke: var(--surface) }
.detail-list   { margin: 0 0 12px; padding-left: 22px; font-size: 17px }
.detail-list li { margin-bottom: 6px }
.conf-note { font-size: 15px; color: var(--muted) }

.stat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px }
@media (max-width: 339px) { .stat-grid { grid-template-columns: 1fr } }
.detail-section.is-open > .stat-grid { display: grid }
.stat { padding: 14px; border-radius: var(--radius-sm); background: var(--bg) }
.stat-label { font-size: 15px; color: var(--muted) }
.stat-value { margin-top: 2px; font-size: 22px; font-weight: 700; line-height: 1.2; overflow-wrap: anywhere }
.stat-sub   { margin-top: 4px; font-size: 15px; color: var(--muted) }

.label-item { margin-bottom: 16px }
.label-item-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 6px }
.label-item-icon { color: var(--accent); display: inline-flex }
.label-item-name { font-size: 18px; font-weight: 700 }
.kind-chip { padding: 3px 10px; border-radius: 999px; font-size: 14px; font-weight: 700; background: var(--surface-2); color: var(--text) }
.kind-law, .kind-audited, .kind-assoc { background: var(--accent-soft); color: var(--accent) }
.kind-claim { background: var(--amber-soft); color: var(--amber) }

.labour-row { margin-bottom: 14px }
.labour-row-head { display: flex; justify-content: space-between; gap: 12px; font-weight: 700; margin-bottom: 8px }
.labour-row .detail-source { margin-top: 6px }

.action-stack { display: flex; flex-direction: column; gap: 12px; margin-top: 28px }

/* Bio-Schätzung: sieht aus wie ein weiterer Abschnitt von "Mehr erfahren" */
#simWrap { margin-top: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden }
.sim-header-btn {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%;
  min-height: 68px; padding: 12px 18px; border: none; background: none; color: var(--text); text-align: left;
}
.sim-header-btn[aria-expanded="true"] .ic { transform: rotate(180deg) }
.sim-chevron { color: var(--text) }
.sim-pin, .tile-sim { color: var(--amber) }

/* ================================================================
   5. Übrige Ansichten
   ================================================================ */


/* Cards */

/* Geo hint (after OCR origin detection) */

/* Upload */

#previewOptFront {
  max-width: 100%; border-radius: 10px; margin-top: 10px; display: none;
  border: 1px solid var(--border-soft)
}

/* Buttons */

/* Form */

textarea, button {
  font-family: inherit;
}

/* Origin selector */

/* Ingredient pills */

/* Health/ingredient detail block (Gesundheit & Inhaltsstoffe) */
.health-nova-row { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.health-nova-badge { color: var(--text); font-weight: 700; font-size: 16px; padding: 4px 10px; border-radius: 999px; flex-shrink: 0; }
.health-nova-label { font-size: 16px; font-weight: 600; color: var(--text); }
.health-diet-row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.health-section { margin-top: 10px; }
.health-section-title { font-size: 15px; color: var(--muted); margin-bottom: 4px; text-transform: uppercase; letter-spacing: .02em; }
.health-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.health-pill {
  background: var(--border-soft); border: 1px solid var(--border);
  border-radius: 999px; padding: 3px 10px; font-size: 16px; color: var(--text);
}
.health-pill--positive { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.health-pill--warn { background: var(--amber-soft); border-color: var(--amber); color: var(--amber); }
.health-pill--danger { background: var(--red-soft); border-color: var(--red); color: var(--red); }
.health-personal-warning {
  background: var(--red-soft); border: 1px solid var(--red);
  color: var(--red); font-weight: 700; font-size: 16px;
  border-radius: 8px; padding: 8px 10px; margin-bottom: 10px;
}

/* Produktvergleich (Phase C) */
.entry-compare-check { display: none; align-items: center; flex-shrink: 0; }
#historyEntryList.compare-mode .entry-compare-check { display: flex; }
#historyEntryList.compare-mode .entry-actions { opacity: .5; pointer-events: none; }
.entry-compare-cb { width: 18px; height: 18px; accent-color: var(--accent); cursor: pointer; }
#btnCompareToggle.active { border-color: var(--accent); color: var(--accent); }

.compare-table { display: grid; grid-template-columns: 90px repeat(var(--cols), 1fr); gap: 1px; background: var(--border); border-radius: 8px; overflow: hidden; }
.compare-row { display: contents; }
.compare-row-label, .compare-row-val {
  background: var(--card); padding: 8px 6px; font-size: 16px; color: var(--text);
  display: flex; align-items: center;
}
.compare-row-label { color: var(--muted); font-weight: 600; overflow-wrap: anywhere; }
.compare-row-val { justify-content: center; text-align: center; word-break: break-word; flex-direction: column; gap: 2px; }
/* Urteil und Gründe über der Tabelle (compare.js) */
.cmp-summary { margin: 0 0 14px }
.cmp-verdict { margin: 0 0 10px; font-size: 17px; line-height: 1.45; overflow-wrap: break-word }
.cmp-note { margin: 12px 0 0; font-size: 16px; color: var(--muted); line-height: 1.45; overflow-wrap: break-word }
.cmp-sub { display: block; font-size: 14px; color: var(--muted); line-height: 1.3 }
.cmp-best, .cmp-bio { color: var(--accent) }
/* Zahlen nie mitten im Wert umbrechen ("1,60 k / g"); Namen dürfen silbengetrennt umbrechen */
.cmp-num { white-space: nowrap }
.compare-row-val strong, .compare-row-val { hyphens: auto; -webkit-hyphens: auto }
/* Schmal (Handy): Beschriftung über der Zeile, die Werte bekommen die ganze Breite.
   Drei Produkte nebeneinander mit Beschriftungsspalte zerhackten Wörter ("Weidemi-lch"). */
@media (max-width: 480px) {
  .compare-table { grid-template-columns: repeat(var(--cols), 1fr) }
  .compare-row-label { grid-column: 1 / -1; padding: 8px 8px 2px; background: var(--surface-2); font-size: 15px }
  .compare-row-label:empty { display: none }
  .compare-row-val { padding: 6px 4px 8px; font-size: 15px }
  .cmp-sub { font-size: 13px }
}

/* Ingredient pill tooltip */
.ing-tooltip {
  position: absolute; z-index: 2000; pointer-events: none;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 14px; min-width: 170px; max-width: min(280px, calc(100vw - 16px));
  box-shadow: 0 6px 24px rgba(0, 0, 0, .18);
  
  opacity: 0; transition: opacity .15s;
  font-size: 16px; color: var(--text); line-height: 1.6;
}
.ing-tooltip .tip-match { margin-bottom: 6px; font-size: 15px }
.ing-tooltip .tip-direct { color: var(--accent) }
.ing-tooltip .tip-proxy { color: var(--amber) }
.ing-tooltip .tip-row { display: flex; justify-content: space-between; gap: 10px }
.ing-tooltip .tip-row span { color: var(--muted) }
.ing-tooltip .tip-key { margin-top: 6px; font-size: 15px; line-height: 1.4; color: var(--muted); overflow-wrap: anywhere }

/* Progress */

/* Result */

/* Benchmark */

/* Recommendations */

/* Alternative product cards */

/* Category-level product alternatives */

/* Hofladen CTA in recommendations */

/* Misc */

/* Print */

/* ================================================================
   Multi-Impact Dashboard — Phase 1.2
   ================================================================ */

/* 4-tile grid: side-by-side on desktop, 2×2 on mobile */

/* Individual tile */

/* Detail toggle button */

/* Detail panel */

/* ================================================================
   Phase 1.3 — Seasonality & Regionality Badges
   ================================================================ */

.season-badge, .region-badge {
  display: inline-flex; align-items: center;
  padding: 2px 9px; border-radius: 999px;
  font-size: 15px; font-weight: 600;
  border: 1px solid currentColor;
  max-width: 100%; line-height: 1.6;
}

.badge-saisonal { color: var(--season-main);       background: var(--accent-soft); }
.badge-greenhouse { color: var(--season-greenhouse);  background: var(--accent-soft); }
.badge-lager { color: var(--season-storage);     background: var(--amber-soft); }
.badge-ausserhalb { color: var(--season-outside);     background: var(--red-soft); }
.badge-region-de { color: var(--region-de);          background: var(--accent-soft); }
.badge-region-eu { color: var(--region-eu);          background: var(--accent-soft); }
/* Übersee-Herkunft / Importware ohne heimische Saison */
.badge-region-import { color: var(--season-storage);  background: var(--amber-soft); }

.season-dot {
  position: absolute; top: -3px; right: -3px;
  width: 8px; height: 8px; border-radius: 50%;
  border: 1.5px solid var(--bg); pointer-events: none;
}
.season-dot.dot-main { background: var(--season-main); }
.season-dot.dot-greenhouse { background: var(--season-greenhouse); }
.season-dot.dot-lager { background: var(--season-storage); }
.season-dot.dot-ausserhalb { background: var(--season-outside); }

/* ================================================================
   Phase 1.4 — Personal History
   ================================================================ */

/* Tab navigation */

/* Tab views */

/* Opt-out checkbox */

/* Privacy banner */
.privacy-banner {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  padding: 14px 16px;
  font-size: 16px;
  color: var(--text);
  margin-bottom: 16px;
  line-height: 1.6;
}
.privacy-banner-text { flex: 1; }
.privacy-banner-text strong { display: block; margin-bottom: 4px; font-size: 17px; }
.privacy-banner-dismiss {
  flex-shrink: 0;
  background: var(--accent);
  color: var(--on-accent);
  border: none;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  align-self: center;
}

/* Near-limit warning banner */
.near-limit-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--amber-soft);
  border-left: 3px solid var(--season-storage);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 16px;
  color: var(--text);
  margin-bottom: 12px;
}
.near-limit-text { flex: 1; line-height: 1.5; }
.near-limit-dismiss {
  background: none;
  border: none;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
  padding: 0 2px;
  flex-shrink: 0;
}

/* History entry list */
.history-entry-list { list-style: none; padding: 0; margin: 0; max-height: 420px; overflow-y: auto; }
.history-entry-item {
  display: flex;
  flex-direction: column;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 16px;
}
.history-entry-item:last-child { border-bottom: none; }
.history-entry-info { flex: 1; min-width: 0; }
.history-entry-name { font-weight: 600; color: var(--text); }
.history-entry-meta { font-size: 15px; color: var(--muted); margin-top: 2px; }
.entry-farm-chip { display: inline-block; font-size: 15px; font-weight: 500; color: var(--accent); background: var(--accent-soft); border-radius: 10px; padding: 1px 7px; margin-left: 5px; vertical-align: middle; }
.history-entry-co2 { font-weight: 700; color: var(--accent); font-size: 17px; white-space: nowrap; }

/* Per-entry qty control + delete */
.entry-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; margin-top: 6px; }
.qty-control { display: flex; align-items: center; gap: 2px; background: var(--surface-2); border-radius: 6px; padding: 2px 4px; }
.qty-btn { background: none; border: none; cursor: pointer; color: var(--text); font-size: 18px; line-height: 1; padding: 1px 5px; border-radius: 4px; }
.qty-btn:hover { background: var(--border); }
.qty-value { font-size: 16px; font-weight: 700; min-width: 18px; text-align: center; color: var(--text); }
.qty-hint { font-size: 15px; color: var(--muted); margin-left: 3px; font-weight: 400; }
.entry-delete-btn { background: none; border: none; cursor: pointer; color: var(--muted); font-size: 18px; line-height: 1; padding: 2px 6px; border-radius: 4px; opacity: 0.55; transition: opacity 0.15s, color 0.15s; margin-left: auto; }
.entry-delete-btn:hover { color: var(--red); opacity: 1; }

/* SVG chart */
.history-svg { width: 100%; height: auto; overflow: visible; display: block; margin-bottom: 4px; }
.chart-axis-line { stroke: var(--border-soft); stroke-width: 1.5; }
.chart-grid-line { stroke: var(--border); stroke-width: 0.5; stroke-dasharray: 3 4; }
.chart-budget-line { stroke: var(--amber); stroke-width: 1.5; stroke-dasharray: 5 4; opacity: 0.7; }
.chart-budget-label { fill: var(--amber); font-size: 15px; font-family: var(--font); opacity: 0.85; }
.chart-x-label { fill: var(--muted); font-size: 15px; font-family: var(--font); }
.chart-y-label { fill: var(--muted); font-size: 15px; font-family: var(--font); }
.chart-empty-dash { fill: var(--border-soft); font-size: 17px; font-family: var(--font); }

/* Current month status */
.current-month-status { padding: 12px 0 0; }
.current-month-empty { color: var(--muted); font-size: 16px; margin: 0; padding: 4px 0; }
.current-month-row { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.current-month-value { font-size: 26px; font-weight: 800; line-height: 1; }
.current-month-label { font-size: 16px; color: var(--muted); }
.current-month-pct { font-weight: 700; }
.current-month-bar-track { height: 8px; background: var(--border); border-radius: 4px; overflow: hidden; }
.current-month-bar { height: 100%; border-radius: 4px; transition: width 0.35s ease; }

/* Month-over-month trend badge */
.month-trend-badge { display: flex; align-items: center; gap: 6px; margin-top: 10px; padding: 8px 10px; border-radius: 8px; font-size: 16px; font-weight: 600; }
.month-trend-badge.down { background: var(--accent-soft); color: var(--accent); }
.month-trend-badge.up { background: var(--red-soft); color: var(--red); }
.month-trend-badge.flat { background: var(--border-soft); color: var(--muted); }
.month-trend-icon { flex-shrink: 0; }

/* Inline text-button (e.g. "Übernehmen" hints) */

/* Top-3 drivers */
.top-drivers-block { margin-bottom: 0; }
.top-driver-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.top-driver-row:last-child { border-bottom: none; }
.top-driver-rank { font-size: 16px; color: var(--muted); width: 18px; flex-shrink: 0; }
.top-driver-info { flex: 1; min-width: 0; }
.top-driver-name { font-size: 16px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.top-driver-bar-row { display: flex; align-items: center; gap: 6px; }
.top-driver-bar-track { flex: 1; height: 5px; background: var(--border); border-radius: 3px; overflow: hidden; }
.top-driver-bar { height: 100%; background: var(--accent); border-radius: 3px; }
.top-driver-pct { font-size: 15px; color: var(--muted); white-space: nowrap; width: 36px; text-align: right; }
.top-driver-co2 { font-size: 16px; font-weight: 700; color: var(--text); white-space: nowrap; flex-shrink: 0; min-width: 52px; text-align: right; }

/* Entry list inline expand */
.history-entry-item { cursor: pointer; }
.history-entry-item:hover .history-entry-name { color: var(--accent); }
.history-entry-main { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.history-entry-detail { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.impact-mini-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; }
.mini-label { font-size: 15px; color: var(--muted); margin-right: 4px; }
.mini-val { font-size: 16px; font-weight: 600; color: var(--text); }

/* ================================================================
   SIMULATOR (Phase 1.5)
   ================================================================ */

/* Amber hint bar — rendered at top of #results when simulation is active */
.sim-hint-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--amber-soft);
  border-left: 3px solid var(--amber);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 10px;
}

/* [Sim] pin on tile footer */

/* Tile value when simulation is active */

/* Simulator header button (disclosure) */

/* Schnellauswahl loser Ware — Disclosure-Header, gleiches Muster wie .sim-header-btn oben */

/* One-shot pulse animation on first reveal per session */
@keyframes simPulse {
  0%   { box-shadow: 0 0 0 0   rgba(251,191,36,.45); }
  50%  { box-shadow: 0 0 0 8px rgba(251,191,36,.12); }
  100% { box-shadow: 0 0 0 0   rgba(251,191,36,0);   }
}

/* Collapsible sim panel */
.sim-panel {
  border: 1px solid var(--amber-soft);
  border-top: none;
  border-radius: 0 0 10px 10px;
  background: var(--card);
  margin-top: -4px;
}
.sim-panel-inner { padding: 14px 16px; }

/* Toggle row: label + iOS toggle + × close button */
.sim-toggle-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.sim-toggle-info { flex: 1; min-width: 0; }
.sim-toggle-label { font-size: 16px; font-weight: 600; color: var(--text); }
.sim-toggle-hint { font-size: 15px; color: var(--muted); margin-top: 2px; min-height: 14px; }

/* iOS-style toggle — visual: 48×28 px, hit area: 44 px tall (WCAG 2.5.5) */
.sim-toggle-btn {
  position: relative;
  width: 48px;
  min-height: 44px;
  background: none;
  border: none;
  padding: 8px 0;
  cursor: pointer;
  flex-shrink: 0;
  outline-offset: 3px;
}
.sim-toggle-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.sim-toggle-track {
  position: relative;
  width: 48px;
  height: 28px;
  border-radius: 14px;
  background: var(--border);
  transition: background 0.2s;
  pointer-events: none;
}
.sim-toggle-btn[aria-checked="true"] .sim-toggle-track { background: var(--accent); }
.sim-toggle-knob {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.25);
  transition: transform 0.2s;
  pointer-events: none;
}
.sim-toggle-btn[aria-checked="true"] .sim-toggle-knob { transform: translateX(20px); }

/* Close button (×) */
.sim-close-btn {
  background: none;
  border: none;
  font-size: 22px;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  padding: 4px;
  min-width: 32px;
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.sim-close-btn:hover { color: var(--text); }

/* Delta rows (qualifying ingredients + impact changes) */
.sim-qualifying-list { margin-bottom: 10px; }
.sim-qual-item {
  font-size: 16px;
  color: var(--muted);
  padding: 3px 0;
  display: flex;
  gap: 6px;
}
.sim-qual-name { font-weight: 600; color: var(--text); }

.sim-delta-section { border-top: 1px solid var(--border); padding-top: 10px; margin-top: 4px; }
.sim-delta-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 5px 0;
  font-size: 16px;
  border-bottom: 1px solid var(--border);
}
.sim-delta-row:last-child { border-bottom: none; }
.sim-delta-label { width: 72px; flex-shrink: 0; color: var(--muted); font-weight: 600; }
.sim-delta-orig { color: var(--muted); }
.sim-delta-arrow { color: var(--muted); font-size: 15px; }
.sim-delta-new { font-weight: 700; color: var(--text); }
.sim-delta-change { font-size: 15px; margin-left: auto; }
.sim-delta-pos { color: var(--red); }
.sim-delta-neg { color: var(--accent); }

/* Method note */
.sim-method-note {
  margin-top: 10px;
  font-size: 15px;
  color: var(--muted);
  font-style: italic;
  line-height: 1.5;
  border-top: 1px solid var(--border);
  padding-top: 8px;
}

/* ================================================================
   Phase 2.3.B — FarmerHub Consumer Tool Integration
   ================================================================ */

/* Card: visually separated from EAN-scan card with green accent border */

/* Trust badges — Consumer-Tool-eigene Klassen (keine Wiederverwendung Farmer-Hub-CSS) */
.trust-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 700;
  border: 1px solid currentColor;
  max-width: 100%;
  line-height: 1.6;
}
.trust-badge--bronze { color: var(--bronze); background: var(--surface-2); }
.trust-badge--silver { color: var(--muted); background: var(--surface-2); }
.trust-badge--gold { color: var(--amber); background: var(--amber-soft); }

/* "· Selbstangabe" suffix — phase 2.5 will flip trust_is_self_reported → tag disappears */
.trust-self-reported {
  font-size: 15px;
  font-weight: 500;
  opacity: 0.72;
}

/* Trust + farm block rendered inside #resultCard above the impact tiles */
.farmerhub-trust-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 5px;
}
.farmerhub-farm-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}
.farmerhub-address {
  font-size: 16px;
  color: var(--muted);
  margin-bottom: 5px;
}
.farmerhub-product-name {
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

/* "Weitere Produkte von diesem Hof" — clickable chip list, re-resolves in place */
.farmerhub-siblings-title {
  font-size: 16px;
  color: var(--muted);
  margin: 10px 0 6px;
}
.farmerhub-sibling-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-soft);
  color: var(--text);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 16px;
  cursor: pointer;
  margin: 0 6px 6px 0;
  transition: background .15s;
}
.farmerhub-sibling-chip:hover { background: var(--accent-soft); }
.farmerhub-sibling-chip:disabled { opacity: .5; cursor: default; }

/* Yellow warning box for 410 inactive product */
.farmerhub-inactive-notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--amber-soft);
  border-left: 3px solid var(--amber);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 16px;
  color: var(--text);
  line-height: 1.5;
  margin-top: 10px;
}

/* Inline status / error messages in the farmerhub card */
.farmerhub-error { color: var(--red);   font-size: 16px; }
.farmerhub-info { color: var(--muted); font-size: 16px; }

/* Mobile-first: all farmerhub elements must work at 375 px */
@media (max-width: 375px) {
  .farmerhub-trust-row { gap: 6px; }
  .farmerhub-farm-name { font-size: 17px; }
}

/* ================================================================
   Nearby Farm Shops — browser-geolocation CTA (Phase 4)
   ================================================================ */

.nfs-card {
  background: var(--surface);
  border: 1px solid var(--accent-soft);
  border-radius: 12px;
  padding: 14px;
  margin-top: 14px;
}
.nfs-alt-label { font-size: 17px; }
.nfs-search-btn { margin-top: 2px; }

.nfs-listing-card {
  border-top: 1px solid var(--border-soft);
  padding: 10px 0;
}
.nfs-listing-card:first-of-type { border-top: none; padding-top: 6px; }
.nfs-listing-co2 {
  font-size: 16px;
  font-weight: 700;
  color: var(--accent);
  margin: 2px 0;
}
.nfs-attribution {
  font-size: 15px;
  color: var(--muted);
  margin-top: 8px;
}

/* ================================================================
   Shopping Cart (Warenkorb) — Phase 1.6
   ================================================================ */

/* Cart "In Warenkorb" button — amber accent */

/* Cart item count badge in panel header */
.cart-count-badge {
  background: var(--amber); color: var(--on-accent);
  border-radius: 999px; font-size: 15px; font-weight: 800;
  min-width: 22px; height: 22px; padding: 0 6px;
  display: flex; align-items: center; justify-content: center;
  margin-left: auto;
}

/* Cart items list */
.cart-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 0; border-bottom: 1px solid var(--border-soft);
}
.cart-item:last-child { border-bottom: none; }
.cart-item-icon { font-size: 20px; flex-shrink: 0; }
.cart-item-main { flex: 1; min-width: 0; }
.cart-item-name {
  font-weight: 600; font-size: 16px;
}
.cart-item-co2 { font-size: 16px; color: var(--muted); margin-top: 2px; }
.cart-item-mult { color: var(--text); }
.cart-item-controls { display: flex; align-items: center; gap: 5px; flex-shrink: 0; }
.cart-qty-btn {
  background: var(--card); border: 1px solid var(--border-soft);
  color: var(--text); border-radius: 6px; width: 26px; height: 26px;
  font-size: 18px; font-weight: 700; cursor: pointer; line-height: 1;
  display: flex; align-items: center; justify-content: center; padding: 0;
  transition: .12s all;
}
.cart-qty-btn:hover { border-color: var(--accent); color: var(--accent); }
.cart-qty { font-size: 16px; font-weight: 700; min-width: 18px; text-align: center; }
.cart-remove-btn {
  background: transparent; border: 1px solid var(--border-soft);
  color: var(--muted); border-radius: 6px; width: 26px; height: 26px;
  font-size: 15px; cursor: pointer; line-height: 1;
  display: flex; align-items: center; justify-content: center; padding: 0;
  transition: .12s all; margin-left: 2px;
}
.cart-remove-btn:hover { border-color: var(--red); color: var(--red); }
.cart-empty { color: var(--muted); font-size: 16px; text-align: center; padding: 16px 0; }

/* Last-mile transport section */
.cart-lastmile {
  margin: 14px 0; padding: 12px 14px;
  background: var(--card); border-radius: 10px; border: 1px solid var(--border-soft);
}
.cart-lastmile-title { font-weight: 700; font-size: 16px; margin-bottom: 10px; }
.transport-modes { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.transport-mode-btn {
  background: var(--card); border: 1px solid var(--border-soft);
  color: var(--muted); border-radius: 8px; padding: 5px 10px;
  font-size: 16px; cursor: pointer; transition: .12s all; max-width: 100%;
}
.transport-mode-btn:hover { border-color: var(--amber); color: var(--text); }
.transport-mode-btn.active {
  background: var(--amber-soft); border-color: var(--amber);
  color: var(--amber); font-weight: 600;
}
.cart-km-row {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.cart-km-input {
  width: 72px; padding: 5px 8px; font-size: 16px; text-align: center;
  border: 1px solid var(--border-soft); border-radius: 8px;
  background: var(--card); color: var(--text); outline: none;
}
.cart-km-input:focus { border-color: var(--amber); box-shadow: 0 0 0 1px var(--amber-soft); }
.cart-km-label { font-size: 16px; color: var(--muted); }
.cart-lastmile-co2 { font-size: 16px; color: var(--amber); font-weight: 600; margin-left: auto; }
.cart-lastmile-zero { font-size: 16px; color: var(--accent); font-weight: 600; margin-left: auto; }

/* Cart total block */
.cart-total-block { padding-top: 10px; border-top: 1px solid var(--border-soft); }
.cart-total-row {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 16px; padding: 4px 0; color: var(--muted);
}
.cart-total-label { color: var(--muted); }
.cart-total-sum {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 17px; font-weight: 700; padding: 10px 0 0;
  border-top: 1px solid var(--border-soft); margin-top: 6px;
}
.cart-total-co2 { font-size: 26px; font-weight: 800; color: var(--text); }
.cart-total-unit { font-size: 16px; color: var(--muted); }

@media (max-width: 480px) {
  .transport-modes { gap: 4px; }
  .transport-mode-btn { font-size: 15px; padding: 4px 8px; }
  .cart-total-co2 { font-size: 22px; }
}

/* Cart save button + confirmation */
.cart-save-btn {
  background: var(--accent); color: var(--on-accent); font-weight: 700;
  border: none; border-radius: 10px; cursor: pointer;
  transition: opacity .15s;
}
.cart-save-btn:hover { opacity: .85; }
.cart-save-confirm {
  flex: 2; display: flex; align-items: center; justify-content: center;
  background: var(--accent-soft); border: 1px solid var(--accent);
  border-radius: 10px; font-size: 16px; font-weight: 700;
  color: var(--accent); padding: 0 12px;
}

/* Cart entries in history list */
.history-cart-entry { border-left: 3px solid var(--amber); }
.cart-hist-breakdown {
  padding: 8px 0 4px;
  border-top: 1px solid var(--border-soft);
  margin-top: 4px;
}
.cart-hist-item {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 0; font-size: 16px;
}
.cart-hist-icon { font-size: 17px; flex-shrink: 0; }
.cart-hist-name { flex: 1; min-width: 0; color: var(--muted); }
.cart-hist-co2 { font-size: 16px; font-weight: 600; color: var(--text); white-space: nowrap; }
.cart-hist-transport .cart-hist-name { color: var(--amber); }
.cart-hist-transport .cart-hist-co2 { color: var(--amber); }
.cart-hist-total-row {
  display: flex; justify-content: space-between;
  padding: 6px 0 0; margin-top: 4px;
  border-top: 1px solid var(--border-soft);
  font-size: 16px; font-weight: 700; color: var(--text);
}
.cart-hist-total-co2 { color: var(--amber); }

/* ================================================================
   UX Redesign — Input Tabs, Pack Grid, Cart FAB + Overlay
   ================================================================ */

/* Visual packaging material selector */

/* Brief pulse when a product is added to an already-open cart, so the
   FAB badge count-up doesn't happen silently while the overlay stays closed. */

@keyframes cartFabBump {
  0%   { transform: scale(1); }
  35%  { transform: scale(1.25); }
  100% { transform: scale(1); }
}

/* Cart overlay / bottom drawer */
.cart-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: flex-end;
}
.cart-overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(2px);
}
.cart-overlay-sheet {
  position: relative;
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  background: var(--card-soft);
  border: 1px solid var(--border-soft);
  border-bottom: none;
  border-radius: 20px 20px 0 0;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  animation: slideUp .25s ease-out;
}
@keyframes slideUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}
.cart-overlay-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--border-soft);
  flex-shrink: 0;
}
.cart-overlay-title { font-size: 18px; font-weight: 700; color: var(--text); flex: 1; }
.cart-overlay-close {
  background: var(--card);
  border: 1px solid var(--border-soft);
  color: var(--muted);
  border-radius: 999px;
  width: 30px;
  height: 30px;
  font-size: 17px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: .15s;
  font-family: inherit;
}
.cart-overlay-close:hover { color: var(--text); border-color: var(--text); }
.cart-overlay-body {
  overflow-y: auto;
  padding: 16px 20px 32px;
  flex: 1;
}

/* Card container — colored left stripe by risk */

/* Header — brand name prominent */

/* Tabs */

/* Risk banner — full-width colored panel */

/* Summary */

/* Sections */

/* Source line */

/* Loading skeleton */

@keyframes sustain-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ILO indicator grid */

/* Brand-input form (fallback — only shows if auto-detection failed) */

/* ================================================================
   Mobile Optimizations — Smartphone-First
   ================================================================ */

/* iOS: prevent page zoom on input focus (inputs < 16px trigger auto-zoom in Safari) */
@media (max-width: 768px) {
  
  
  .cart-km-input { font-size: 18px; }
}

/* Result number: scale down on mobile */

/* Phase bar row: shrink label/value columns on narrow screens */

/* Button rows: stack buttons full-width on mobile for easier tapping */

/* ILO indicator grid: 2-column on mobile (3 col is too cramped) */

/* Sustainability tabs: tighter font on small screens */

/* History list: remove fixed max-height — let it scroll naturally on mobile */
@media (max-width: 480px) {
  .history-entry-list { max-height: none; }
}

/* Privacy/near-limit banners: stack icon + text vertically on small screens */
@media (max-width: 390px) {
  .privacy-banner { flex-direction: column; gap: 10px; }
  .near-limit-banner { flex-wrap: wrap; }
}

/* ================================================================
   PWA: update banner + offline pill
   ================================================================ */
.pwa-update-banner {
  position: fixed;
  left: 50%;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card-soft);
  border: 1px solid var(--accent);
  color: var(--text);
  padding: 10px 12px 10px 16px;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 600;
  
  animation: pwa-banner-in .25s ease-out;
}
.pwa-update-banner button {
  background: var(--accent);
  color: var(--on-accent);
  border: none;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}
@keyframes pwa-banner-in {
  from { opacity: 0; transform: translate(-50%, 12px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

/* ================================================================
   Auth: login/register overlay form + profile tab
   ================================================================ */
.auth-error {
  background: var(--red-soft);
  border: 1px solid var(--red);
  color: var(--red);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 16px;
  margin-bottom: 12px;
}
.auth-switch {
  text-align: center;
  font-size: 16px;
  color: var(--muted);
  margin-top: 14px;
}
.auth-switch a { color: var(--accent); text-decoration: none; font-weight: 600; margin-left: 4px; }

.pwa-offline-pill {
  display: none;
  align-items: center;
  gap: 8px;
  position: fixed;
  left: 50%;
  top: calc(10px + env(safe-area-inset-top, 0px));
  transform: translateX(-50%);
  z-index: 999;
  max-width: calc(100% - 32px);
  background: rgba(2,6,23,.92);
  border: 1px solid var(--border-soft);
  color: var(--muted);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 16px;
  text-align: center;
  box-shadow: 0 6px 20px rgba(0,0,0,.4);
}


/* Anpassungen der übernommenen Bausteine an das neue Gerüst */
.cart-overlay { z-index: 100 }
.cart-overlay-sheet { background: var(--surface); color: var(--text) }
.cart-overlay-close { min-width: 44px; min-height: 44px }
.history-entry-list { max-height: none }
.history-entry-co2, .cart-total-co2, .current-month-value { color: var(--text) }
.health-nova-badge { color: #fff }
.sim-toggle-knob { background: #fff }
.trust-badge--silver { color: var(--muted) }
.trust-badge--gold { color: var(--amber) }
.farmerhub-farm-name { font-size: 20px }
.farmerhub-product-name { font-size: 18px }
.farmerhub-siblings-title { font-size: 16px }
.farmerhub-sibling-chip { min-height: 44px; font-size: 16px; background: var(--surface); border-color: var(--border) }
.farmerhub-inactive-notice { border-left: none; border-radius: var(--radius); font-size: 17px }
.farmerhub-inactive-notice .ic { color: var(--amber); flex-shrink: 0 }
.nfs-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; margin-top: 12px }
.nfs-alt-label { font-size: 18px; margin-bottom: 6px }
.nfs-search-btn { margin-top: 12px; width: 100% }
.sim-panel { border: none; border-top: 1px solid var(--border); border-radius: 0; margin-top: 0; background: none }
.privacy-banner, .near-limit-banner, .sim-hint-bar { border-left: none; border-radius: var(--radius); color: var(--text) }
.health-section-title { text-transform: none; letter-spacing: 0; font-size: 16px; font-weight: 700; color: var(--text); margin-bottom: 6px }
.health-pill { font-size: 15px; padding: 5px 12px; background: var(--surface-2); border-color: transparent }
.health-nova-label { font-size: 17px }
.ampel { display: inline-block; padding: 5px 12px; border-radius: 999px; font-weight: 700; background: var(--surface-2); color: var(--text) }
.ampel.green  { background: var(--accent-soft); color: var(--accent) }
.ampel.yellow { background: var(--amber-soft);  color: var(--amber) }
.ampel.red    { background: var(--red-soft);    color: var(--red) }
.cart-save-btn, .transport-mode-btn, .privacy-banner-dismiss { min-height: 48px }
.qty-control { background: var(--surface-2) }
.history-entry-main { flex-wrap: wrap }
.history-entry-info { flex: 1 1 100% }
.history-entry-name { font-size: 18px }
.entry-actions { width: 100%; margin-top: 8px; flex-wrap: wrap; row-gap: 6px; min-width: 0 }
.entry-delete-btn { min-width: 44px; min-height: 44px; font-size: 24px; opacity: .8; display: inline-flex; align-items: center; justify-content: center }
.top-driver-pct { width: auto; min-width: 44px }
.entry-edit-btn { min-height: 44px; padding: 0 14px; border: 1px solid var(--border); border-radius: 22px; background: var(--surface); color: var(--accent); font-size: 16px; font-weight: 700 }
.qty-btn, .cart-qty-btn, .cart-remove-btn, .entry-delete-btn { min-width: 44px; min-height: 44px }

/* Druck */
#printReport { display: none; font-family: Arial, Helvetica, sans-serif; color: #000; font-size: 11pt }
@media print {
  body { background: #fff !important; color: #000 !important; padding: 0 !important }
  .wrap, .bottom-nav, .cart-overlay { display: none !important }
  #printReport { display: block !important }
  @page { size: A4 portrait; margin: 18mm }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important }
}

/* Codes und Nummern (FSC-C014047, DE-ÖKO-001) nie mitten im Code umbrechen */
.nowrap { white-space: nowrap }

/* ================================================================
   Geführte Fotos (js/guided-capture.js) — Kamera mit Rahmen
   Feste Farben: liegt über dem Kamerabild, egal ob hell oder dunkel.
   ================================================================ */
.gc-open, .gc-open body { overflow: hidden }
.gc-overlay {
  position: fixed; inset: 0; z-index: 1000; background: #000; color: #fff;
  display: flex; flex-direction: column; justify-content: space-between;
}
.gc-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover }
.gc-top, .gc-bottom { position: relative; z-index: 2; padding: 16px; padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)) }
.gc-top { padding-top: max(16px, env(safe-area-inset-top)); background: linear-gradient(rgba(0,0,0,.82), rgba(0,0,0,.55) 75%, transparent) }
.gc-bottom { padding-bottom: max(16px, env(safe-area-inset-bottom)); background: linear-gradient(transparent, rgba(0,0,0,.6) 25%, rgba(0,0,0,.85)) }
.gc-count { font-size: 16px; opacity: .9 }
.gc-title { margin: 4px 0 6px; font-size: 26px; line-height: 1.2; color: #fff; overflow-wrap: anywhere }
.gc-hint { margin: 0; font-size: 18px; line-height: 1.45; overflow-wrap: anywhere }
.gc-frame {
  --gc-w: .85; --gc-aspect: 1.5;
  position: absolute; z-index: 1; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: calc(var(--gc-w) * 100vw); max-width: 640px;
  aspect-ratio: var(--gc-aspect); max-height: 46vh;
  border: 4px solid #2bd46a; border-radius: 14px;
  box-shadow: 0 0 0 100vmax rgba(0,0,0,.45);   /* abdunkeln außerhalb des Rahmens */
  transition: width .2s, aspect-ratio .2s;
}
.gc-flash { position: absolute; inset: 0; border-radius: 10px; background: #fff; opacity: 0; pointer-events: none }
.gc-flashing .gc-flash { animation: gc-flash .35s ease-out }
@keyframes gc-flash { from { opacity: .7 } to { opacity: 0 } }
@media (prefers-reduced-motion: reduce) { .gc-flashing .gc-flash { animation: none } .gc-frame { transition: none } }
.gc-thumbs { display: flex; gap: 8px; min-height: 0; margin-bottom: 10px; flex-wrap: wrap }
.gc-thumbs img { height: 48px; max-width: 30%; object-fit: cover; border-radius: 6px; border: 2px solid #2bd46a }
.gc-shoot { min-height: 60px; font-size: 20px }
.gc-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px }
.gc-row .btn { flex: 1 1 140px }
.btn.ghost.gc-light { color: #fff; border-color: rgba(255,255,255,.55) }
.btn.ghost.gc-light:hover { background: rgba(255,255,255,.12) }
.guided-start { margin-bottom: 16px }
.guided-start .btn { min-height: 60px; font-size: 19px }
.guided-or { margin: 4px 0 12px; font-weight: 700 }
.guided-thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 12px }
.guided-thumbs img { height: 64px; max-width: 45%; object-fit: cover; border-radius: 8px; border: 1px solid var(--border, #ccc) }

/* Verpackungsteile + Wiegen (js/weigh.js) */
.pack-parts { margin: 12px 0; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface) }
.pack-parts-title { margin: 0 0 6px; font-weight: 700 }
.pack-parts-list { margin: 0; padding-left: 20px; line-height: 1.5; overflow-wrap: anywhere }
.pack-parts-note { margin: 6px 0 0; font-size: 16px; line-height: 1.45 }
#btnWeigh { margin: 4px 0 12px }
.weigh-tip { margin: 0 0 6px; line-height: 1.5 }
.weigh-barcode { margin: 0 0 12px; font-size: 15px }
.weigh-row { border: 1px solid var(--border); border-radius: 12px; padding: 12px; margin-bottom: 12px }
.weigh-row label { display: block; margin-top: 8px; font-weight: 700 }
.weigh-row input[type=text], .weigh-row input[type=number], .weigh-row select { display: block; width: 100%; margin-top: 4px; font-weight: 400 }
.weigh-row-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap }
.weigh-row-no { font-weight: 700 }
.weigh-pair { display: grid; grid-template-columns: 1fr; gap: 0 12px }
@media (min-width: 380px) { .weigh-pair { grid-template-columns: 3fr 2fr } }
.weigh-check { display: flex !important; gap: 10px; align-items: flex-start; font-weight: 400 !important; line-height: 1.4 }
.weigh-check input { margin-top: 3px; width: 22px; height: 22px; flex: none }

/* Unter 360 px: Verpackungskacheln untereinander. Zweispaltig blieben für „Karton oder Papier“
   neben Symbol und Haken nur ~70 px, und die Wörter zerrissen mitten im Wort (18.11.2026). */
@media (max-width: 359px) {
  #packGrid { grid-template-columns: 1fr }
}

/* Schon gewusst? — Vergleiche während der Foto-Auswertung (js/funfacts.js) */
.funfact {
  margin-top: 16px; padding: 16px 18px; border-radius: var(--radius);
  background: var(--accent-soft); color: var(--text); overflow-wrap: anywhere;
}
.funfact[hidden] { display: none }
.funfact-label { display: block; font-weight: 700; color: var(--accent-strong); margin-bottom: 6px }
.funfact-text { margin: 0; font-size: 18px; line-height: 1.5 }
.funfact-source { margin: 8px 0 0; font-size: 15px; color: var(--muted); line-height: 1.4 }
@media (prefers-reduced-motion: no-preference) {
  .funfact:not([hidden]) { animation: funfact-in .35s ease-out }
  @keyframes funfact-in { from { opacity: 0; transform: translateY(4px) } to { opacity: 1; transform: none } }
}

/* Kurze Einführung beim ersten Start (js/guide.js) */
.guide-sheet { text-align: left }
.guide-progress { margin: 0 0 12px; color: var(--muted); font-size: 16px }
.guide-icon {
  width: 72px; height: 72px; border-radius: 20px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent-strong); margin-bottom: 16px;
}
.guide-title { margin: 0 0 10px; font-size: 26px; line-height: 1.25; outline: none }
.guide-text { margin: 0; font-size: 19px; line-height: 1.55; overflow-wrap: anywhere }
.guide-note { margin: 14px 0 0; font-size: 16px; line-height: 1.5 }
.guide-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 22px }

/* Alltagsvergleich unter der großen Zahl (multiimpact.js) */
.verdict-equiv { margin: 4px 0 10px; font-size: 18px; color: var(--muted); line-height: 1.4; overflow-wrap: anywhere }

/* Barcode-Scanner (scanner.js): nutzt die Kamera-Ansicht der geführten Fotos (.gc-*) */
.sc-frame { overflow: hidden }
.sc-line { position: absolute; left: 6%; right: 6%; top: 50%; height: 3px; border-radius: 2px; background: #ff4d4d;
  box-shadow: 0 0 10px rgba(255, 77, 77, .8); animation: sc-sweep 1.6s ease-in-out infinite alternate }
@keyframes sc-sweep { from { top: 18% } to { top: 82% } }
@media (prefers-reduced-motion: reduce) { .sc-line { animation: none } }
.sc-status { margin: 0 0 8px; font-size: 18px; line-height: 1.45; color: #fff; overflow-wrap: anywhere }
.sc-status:empty { display: none }
.sc-cancel { margin-top: 8px }

/* Vergleich mit ähnlichen Produkten (peers.js, 27.11.2026) */
.peer-block { margin-top: 6px }
.peer-alt-h { margin-top: 16px; font-weight: 700 }
.peer-alts { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px }
.peer-alts li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; overflow-wrap: anywhere }
.peer-alt-val { color: var(--muted); white-space: nowrap }
