/* app.css — tokens + primitives for the public Plantydealz web app.
   Palette derived from the Mobile-App theme (app_theme.dart). Contrast of
   every text/muted/primary pair verified ≥4.5:1 incl. the primary button
   (dark uses --btn-fg white on green, mirroring Mobile-PR #463: 5.13:1).

   Theme mechanics: base :root = light tokens for no-JS. A prefers-color-scheme
   dark block applies only while no data-theme is set (no-JS / pre-paint). Once
   theme.js runs it ALWAYS sets [data-theme], and the explicit [data-theme]
   blocks are authoritative. */

:root {
  --radius-card: 16px;
  --radius-btn: 12px;
  --radius-pill: 999px;
  --radius-field: 10px;
  --gap: 16px;

  color-scheme: light dark;
}

:root,
:root[data-theme='light'] {
  --bg: #f8f9fa;
  --surface: #ffffff;
  --surface-border: #e8f5e9;
  --surface-high: #eef3ee;
  --text: #2d3436;
  --text-muted: #5b695d;
  --primary: #2a7a4b;
  --primary-strong: #1b5e20;
  --primary-container: #a8e6cf;
  --on-primary-container: #1b5e20;
  --btn-fg: #1b5e20;
  --chip-bg: #e8f5e9;
  --outline-variant: #d7e2d6;
  --danger: #b3261e;
  /* Amber trust hint. Text keeps var(--text); the accent tints only icons. */
  --warn-accent: #8d6e00;
  --warn-bg: #efebdb;
  --warn-border: #cbbc8a;
}
:root[data-theme='light'] {
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #0f1a0f;
    --surface: #1a2a1a;
    --surface-border: #2a3d2a;
    --surface-high: #223522;
    --text: #e8f5e9;
    --text-muted: #9db4a0;
    --primary: #a8e6cf;
    --primary-strong: #c8e6c9;
    --primary-container: #2e7d32;
    --on-primary-container: #c8e6c9;
    /* Wie Mobile-PR #463: weisser Button-Text — c8e6c9 auf 2e7d32 waere 3.81:1. */
    --btn-fg: #ffffff;
    --chip-bg: #1e3a1e;
    --outline-variant: #2a3d2a;
    --danger: #f2b8b5;
    --warn-accent: #ffd54f;
    --warn-bg: #3a4221;
    --warn-border: #837932;
  }
}

:root[data-theme='dark'] {
  --bg: #0f1a0f;
  --surface: #1a2a1a;
  --surface-border: #2a3d2a;
  --surface-high: #223522;
  --text: #e8f5e9;
  --text-muted: #9db4a0;
  --primary: #a8e6cf;
  --primary-strong: #c8e6c9;
  --primary-container: #2e7d32;
  --on-primary-container: #c8e6c9;
  --btn-fg: #ffffff;
  --chip-bg: #1e3a1e;
  --outline-variant: #2a3d2a;
  --danger: #f2b8b5;
  --warn-accent: #ffd54f;
  --warn-bg: #3a4221;
  --warn-border: #837932;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

/* The UA's `[hidden] { display: none }` loses to any author display rule
   (e.g. `.chips-row { display: flex }`), so `el.hidden = true` silently
   stopped hiding flex/grid elements — they stayed as empty boxes and even
   produced phantom flex gaps. Make the attribute authoritative. */
[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
    Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* — Layout — */
.app {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}
.bar {
  width: 100%;
  max-width: 720px;
  margin-inline: auto;
  padding-inline: 16px;
}
.app-header {
  background: var(--bg);
  border-bottom: 1px solid var(--surface-border);
}
.app-header .bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 56px;
}
.brand {
  color: var(--text);
  font-size: 1.125rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-decoration: none;
}
/* Header burger → settings route. ≥44px tap target. */
/* Header action icons: market-awning (→ market selection) + burger (→ settings),
   parity with the Mobile AppBar. Both use .icon-btn. */
.header-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-right: -8px; /* optical: pull the icon row to the bar edge */
}
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  color: var(--text);
  border-radius: var(--radius-btn);
}
.icon-btn:hover {
  background: var(--surface-high);
}
.icon-btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
.icon-btn[aria-current='page'] {
  color: var(--primary-strong);
}

/* Standort redesign 3C. All selectors are dormant while the store flag is
   off; the legacy market button and selector retain their original classes. */
.location-chip {
  min-height: 44px;
  max-width: min(44vw, 240px);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 12px;
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 700;
  text-decoration: none;
}
.location-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.location-chip:hover { background: var(--surface-high); }
.location-chip:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
.location-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  background: rgb(0 0 0 / 42%);
}
.location-panel-open { overflow: hidden; }
.location-panel {
  width: 100%;
  max-height: min(88dvh, 760px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 18px 16px max(20px, env(safe-area-inset-bottom));
  border-radius: 22px 22px 0 0;
  background: var(--surface);
  box-shadow: 0 -12px 42px rgb(0 0 0 / 22%);
}
.location-panel::before {
  content: '';
  display: block;
  width: 40px;
  height: 4px;
  margin: -6px auto 14px;
  border-radius: 2px;
  background: var(--outline-variant);
}
.location-panel-head {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center;
  min-height: 44px;
  margin-bottom: 10px;
}
.location-panel-head > .location-panel-title:first-child {
  grid-column: 1 / 3;
  padding-left: 4px;
}
.location-panel-title {
  grid-column: 2;
  margin: 0;
  font-size: 1.2rem;
}
.location-icon-button {
  width: 44px;
  height: 44px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: var(--radius-btn);
  background: transparent;
  color: var(--text);
}
.location-panel-head > .location-icon-button:last-child { grid-column: 3; }
.location-lead {
  margin: 0 0 14px;
  color: var(--text-muted);
  font-size: 0.9rem;
}
.primary-btn,
.secondary-btn {
  min-height: 44px;
  padding: 0 18px;
  border-radius: var(--radius-btn);
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, filter 0.15s ease;
}
.primary-btn {
  border: 1px solid transparent;
  background: var(--primary-container);
  color: var(--btn-fg);
}
.primary-btn:hover:not(:disabled) { filter: brightness(0.97); }
.secondary-btn {
  border: 1px solid var(--primary);
  background: transparent;
  color: var(--primary-strong);
}
.secondary-btn:hover:not(:disabled) { background: var(--chip-bg); }
.primary-btn:disabled,
.secondary-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.location-search-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}
.location-input-wrap { min-width: 0; }
.location-input[type='text'] {
  width: 100%;
  min-height: 48px;
  padding: 0 13px;
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-field);
  background: var(--surface);
  color: var(--text);
  font: inherit;
}
.location-submit { min-height: 48px; }
.location-geo-button {
  width: 100%;
  min-height: 48px;
  margin-top: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.location-status {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: var(--radius-field);
  background: var(--surface-high);
  color: var(--text-muted);
  font-size: 0.875rem;
}
.location-status.is-error,
.location-status.is-warn { color: var(--danger); }
.location-status.is-nudge { color: var(--primary-strong); }
.location-screen-dynamic:empty { display: none; }
.location-screen-dynamic .location-status {
  margin-top: 8px;
  padding: 0 2px;
  border-radius: 0;
  background: transparent;
  line-height: 1.4;
}
.location-screen-dynamic .location-status.is-warn { color: var(--warn-accent); }
.location-place-candidates,
.location-candidate-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}
.location-place-candidate,
.location-candidate {
  min-height: 52px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 12px;
  align-items: center;
  padding: 9px 12px;
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-btn);
  background: var(--surface);
  color: var(--text);
  text-align: left;
}
.location-candidate span,
.location-place-candidate span { color: var(--text-muted); font-size: 0.8rem; }
.location-candidate small { grid-column: 1 / -1; color: var(--primary-strong); }
.location-candidate.is-selected { border-color: var(--primary); }
.location-candidate-more {
  width: 100%;
  min-height: 40px;
  margin-top: 8px;
  padding: 6px 12px;
  border: 0;
  border-radius: var(--radius-btn);
  background: transparent;
  color: var(--primary-strong);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
}
.location-retailer-deselect { width: 100%; min-height: 44px; margin-top: 12px; }
.location-summary-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.location-summary-button {
  min-width: 0;
  min-height: 44px;
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  padding: 7px 12px;
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.location-summary-button span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.location-radius-pill {
  position: relative;
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 20px;
  align-items: center;
  min-width: 92px;
  min-height: 44px;
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}
.location-radius-pill select {
  grid-column: 1 / -1;
  grid-row: 1;
  width: 100%;
  min-height: 42px;
  padding: 0 34px 0 13px;
  border: 0;
  border-radius: inherit;
  appearance: none;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
}
.location-radius-pill select:disabled { cursor: wait; }
.location-radius-chevron {
  grid-column: 2;
  grid-row: 1;
  display: grid;
  place-items: center;
  pointer-events: none;
}
.location-radius-chevron svg { width: 16px; height: 16px; }
.location-retailer-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-items: stretch;
}
.location-retailer-tile {
  position: relative;
  min-width: 0;
  height: 122px;
  display: grid;
  grid-template-rows: minmax(0, 1fr) 36px;
  border: 1px solid var(--outline-variant);
  border-radius: 14px;
  background: var(--surface);
  overflow: hidden;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.location-retailer-tile.is-selected {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary-container) 42%, var(--surface));
  box-shadow: inset 0 0 0 1px var(--primary);
}
.location-retailer-tile.is-degraded,
.location-retailer-tile.is-error { border-color: var(--danger); }
.location-retailer-toggle {
  width: 100%;
  min-height: 0;
  display: grid;
  place-items: center;
  padding: 12px 9px 8px;
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}
.location-retailer-toggle:disabled { cursor: wait; }
.location-retailer-logo { max-width: 84px; max-height: 36px; object-fit: contain; }
.location-retailer-logo-fallback { font-weight: 800; }
.location-tile-footer {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  align-items: center;
  gap: 2px;
  padding: 1px 2px 1px 10px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
}
.location-tile-footer.is-interactive {
  width: 100%;
  cursor: pointer;
  transition: background 0.15s ease;
}
.location-tile-footer.is-interactive:disabled {
  cursor: wait;
}
.location-retailer-substat {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-muted);
  font-size: 0.75rem;
  line-height: 1;
  text-align: left;
  white-space: nowrap;
}
.location-retailer-substat.is-shimmering::before {
  content: '';
  display: block;
  width: min(100%, 92px);
  height: 9px;
  border-radius: var(--radius-pill);
  background: linear-gradient(
    100deg,
    var(--surface-high) 20%,
    color-mix(in srgb, var(--primary-container) 55%, var(--surface)) 45%,
    var(--surface-high) 70%
  );
  background-size: 220% 100%;
  animation: location-footer-shimmer 1.25s ease-in-out infinite;
}
@keyframes location-footer-shimmer {
  from { background-position: 100% 0; }
  to { background-position: -100% 0; }
}
.location-tile-nudge,
.location-tile-neighbor-hint {
  position: absolute;
  z-index: 1;
  left: 6px;
  right: 6px;
  display: block;
  overflow: hidden;
  padding: 3px 6px;
  border-radius: var(--radius-pill);
  color: var(--primary-strong);
  background: var(--surface-high);
  font-size: 0.66rem;
  line-height: 1.2;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.location-tile-nudge { top: 5px; }
.location-tile-neighbor-hint { top: 26px; }
.location-neighbor-interest-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}
.location-neighbor-interest {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 9px 12px;
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-btn);
  background: var(--surface);
}
.location-neighbor-interest-copy {
  display: grid;
  gap: 2px;
}
.location-neighbor-interest-copy small { color: var(--text-muted); }
.location-neighbor-interest-button { min-height: 40px; }
.location-tile-chevron {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--primary-strong);
  display: grid;
  place-items: center;
  padding: 0;
  cursor: pointer;
}
.location-tile-chevron-placeholder {
  width: 34px;
  height: 34px;
}
.location-detail-radius,
.location-detail-retry { width: 100%; margin-top: 12px; }
.location-commit { width: 100%; min-height: 48px; margin-top: 12px; }
.location-route-card { padding-top: 12px; }

@media (hover: hover) {
  .location-summary-button:hover,
  .location-radius-pill:hover {
    border-color: var(--primary);
    background: color-mix(in srgb, var(--primary-container) 24%, var(--surface));
  }
  .location-retailer-toggle:hover:not(:disabled),
  .location-tile-footer.is-interactive:hover:not(:disabled),
  .location-candidate:hover:not(:disabled),
  .location-candidate-more:hover {
    background: color-mix(in srgb, var(--primary-container) 24%, var(--surface));
  }
}

@media (prefers-reduced-motion: reduce) {
  .location-retailer-substat.is-shimmering::before {
    animation: none;
    background: var(--surface-high);
  }
}

@media (min-width: 720px) {
  .location-overlay {
    align-items: flex-start;
    justify-content: flex-end;
    padding: 64px 24px 24px;
    background: transparent;
  }
  .location-panel {
    width: min(430px, calc(100vw - 48px));
    max-height: calc(100dvh - 88px);
    padding: 18px;
    border: 1px solid var(--outline-variant);
    border-radius: 18px;
    box-shadow: 0 18px 54px rgb(0 0 0 / 24%);
    pointer-events: auto;
  }
  .location-panel::before { display: none; }
  .location-retailer-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Segmented control (theme switch): three flush segments, active = filled. */
.segmented {
  display: flex;
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-btn);
  overflow: hidden;
}
.segment {
  flex: 1 1 0;
  min-height: 40px;
  padding: 0 12px;
  border: 0;
  border-left: 1px solid var(--outline-variant);
  background: var(--surface);
  color: var(--text);
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
}
.segment:first-child {
  border-left: 0;
}
.segment:hover {
  background: var(--surface-high);
}
.segment:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}
.segment[aria-pressed='true'] {
  background: var(--primary-container);
  /* --btn-fg (white in dark) not --on-primary-container: 5.13:1 vs 3.81:1 on
     the dark container — mirrors the .tab pressed rule. */
  color: var(--btn-fg);
}
/* Schalter (role="switch"): Zustand via aria-checked; genutzt vom
   Alkohol-Opt-out in den Einstellungen. */
.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.switch-label {
  font-size: 0.9375rem;
  font-weight: 600;
}
.switch {
  position: relative;
  flex: none;
  width: 46px;
  height: 26px;
  padding: 0;
  border: 1px solid var(--outline-variant);
  border-radius: 13px;
  background: var(--surface-high);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  transition: transform 0.15s ease;
}
.switch:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
.switch[aria-checked='true'] {
  background: var(--primary);
  border-color: var(--primary);
}
.switch[aria-checked='true']::after {
  transform: translateX(20px);
}

.segmented-caption {
  margin: 8px 0 0;
  font-size: 0.8125rem;
}
.view {
  flex: 1;
  width: 100%;
  max-width: 720px;
  margin-inline: auto;
  padding: 16px;
}
@media (min-width: 720px) {
  .view {
    padding-block: 24px;
  }
}

/* .control — labelled select row, reused by the settings route (formerly the
   footer theme/language controls). */
.control {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.control label {
  color: var(--text-muted);
  font-size: 0.8125rem;
  font-weight: 600;
}

/* — Stacks & typography — */
.stack {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}
.section-title {
  margin: 0 0 0.5rem;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.prose p {
  margin: 0 0 0.75rem;
  line-height: 1.6;
}
.prose p:last-child {
  margin-bottom: 0;
}
.text-muted {
  color: var(--text-muted);
}
.disclaimer {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.8125rem;
  line-height: 1.5;
}

/* — Primitives (reused by W-2) — */
.card {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-card);
  padding: 1rem 1.125rem;
  box-shadow: 0 1px 2px rgba(20, 32, 20, 0.04);
}
:root[data-theme='dark'] .card,
:root:not([data-theme]) .card {
  box-shadow: none;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: var(--chip-bg);
  color: var(--on-primary-container);
  font-size: 0.6875rem;
  font-weight: 600;
}
.chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  background: var(--chip-bg);
  color: var(--on-primary-container);
  font-size: 0.8125rem;
  font-weight: 600;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: var(--radius-btn);
  background: var(--primary-container);
  color: var(--btn-fg);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}
.btn.block {
  width: 100%;
}
.btn:hover:not(:disabled) {
  filter: brightness(0.97);
}
.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.link-btn {
  padding: 0;
  border: 0;
  background: none;
  color: var(--primary);
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}

/* — Forms — */
.field {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  margin: 0;
  padding: 0;
  border: 0;
}
.field > label:not(.check),
.field > legend {
  padding: 0;
  color: var(--text);
  font-weight: 600;
}
input[type='text'],
select {
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-field);
  background: var(--surface);
  font-size: 1rem;
}
input[type='text'][aria-invalid='true'] {
  border-color: var(--danger);
}
.field-error {
  margin: 0;
  color: var(--danger);
  font-size: 0.875rem;
}
.check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  cursor: pointer;
}
.check input {
  width: 20px;
  height: 20px;
  accent-color: var(--primary);
}

/* Center the canonical location onboarding on the wide home route. */
.onboarding {
  width: 100%;
  max-width: 520px;
  margin-inline: auto;
}
.location-onboarding {
  padding: clamp(20px, 5vw, 32px);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: 0 8px 30px rgb(20 32 20 / 8%);
}
:root[data-theme='dark'] .location-onboarding {
  box-shadow: 0 8px 30px rgb(0 0 0 / 18%);
}
@media (max-width: 520px) {
  .location-onboarding { padding: 20px 16px; }
  .location-search-form { grid-template-columns: 1fr; }
  .location-submit { width: 100%; }
}

/* — placeholder — */
.placeholder p {
  margin: 0;
}

/* — noscript — */
.noscript {
  max-width: 720px;
  margin: 16px auto;
  padding: 0 16px;
}
.noscript p {
  margin: 0.25rem 0;
}

/* ======================================================================
   W-2 Wochenliste — tabs, flyer line, search, chips, feed, offer card v2.
   ====================================================================== */

/* — Retailer tabs (horizontal scroll) — */
.market-tabs-editbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 36px;
  padding: 5px 8px 5px 12px;
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-btn);
  background: var(--surface);
}
.market-tabs-editbar-title {
  font-size: 0.875rem;
  font-weight: 700;
}
.market-tabs-editbar-done {
  min-height: 28px;
  padding: 2px 8px;
  border: 0;
  border-radius: var(--radius-field);
  background: transparent;
  color: var(--primary-strong);
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
}
.market-tabs-editbar-done:hover {
  background: var(--surface-high);
}
.tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 2px;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}
.market-tab-wrap {
  position: relative;
  flex: 0 0 auto;
  display: flex;
}
.tab {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--text);
  font-size: 0.9375rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}
.tab[aria-pressed='true'] {
  background: var(--primary-container);
  border-color: transparent;
  /* --btn-fg (white in dark) not --on-primary-container: the latter is 3.81:1
     on the dark container, the former 5.13:1 — mirrors Mobile-PR #463. */
  color: var(--btn-fg);
}
/* Retailer LOGO tab (parity with the Mobile TabBar). Logo stays full-colour on
   every state; the pressed background indicates the active tab. */
.tab--logo {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 44px;
  padding: 6px 12px; /* reserves the underline gap in every state */
  border: 0;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  background: transparent;
}
/* Box-less: the active tab is marked ONLY by the underline — override the pill
   background/colour from .tab[aria-pressed='true'] (comes earlier, equal
   specificity, so this later rule wins). */
.tab--logo[aria-pressed='true'] {
  background: transparent;
  border-bottom-color: var(--primary);
  color: inherit;
}
/* Uniform logo box (App parity): every logo normalised to one box (REWE's) via
   object-fit:contain — smaller logos get padding, none dominates. */
.tab-logo {
  display: block;
  width: 68px;
  height: 24px;
  object-fit: contain;
}
.tab-logo-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 68px;
  height: 24px;
  color: var(--text);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
}
/* Flyer date range under each tab logo (parity with the Mobile TabBar). */
.tab-range {
  font-size: 0.625rem;
  line-height: 1;
  color: var(--text-muted);
  white-space: nowrap;
}
/* "Alle" tab: a text label sized like a logo box so its range line aligns. */
.tab-all-label {
  display: flex;
  align-items: center;
  height: 24px;
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text);
}
.market-tab-remove {
  position: absolute;
  z-index: 1;
  top: -3px;
  right: -3px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 2px solid var(--surface);
  border-radius: var(--radius-pill);
  background: var(--danger);
  color: var(--surface);
  font-size: 1.125rem;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}
.market-tab-remove:hover {
  filter: brightness(1.08);
}
.tabs--editing .tab--market {
  transform-origin: 50% 80%;
  animation: market-tab-wiggle 180ms ease-in-out infinite alternate;
}
.tabs--editing .market-tab-wrap:nth-child(even) .tab--market {
  animation-direction: alternate-reverse;
}
@keyframes market-tab-wiggle {
  from {
    transform: rotate(-0.7deg);
  }
  to {
    transform: rotate(0.7deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .tabs--editing .tab--market {
    animation: none;
  }
}
.market-snackbar {
  position: fixed;
  z-index: 40;
  left: 50%;
  bottom: max(20px, env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  width: min(calc(100% - 32px), 420px);
  min-height: 48px;
  padding: 10px 12px 10px 16px;
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-btn);
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 8px 28px rgb(0 0 0 / 24%);
  transform: translateX(-50%);
}
.market-snackbar-message {
  min-width: 0;
  font-size: 0.9375rem;
}
.market-snackbar-undo {
  flex: 0 0 auto;
  min-height: 32px;
  padding: 4px 8px;
  border: 0;
  border-radius: var(--radius-field);
  background: transparent;
  color: var(--primary-strong);
  font-size: 0.875rem;
  font-weight: 800;
  cursor: pointer;
}
.market-snackbar-undo:hover {
  background: var(--surface-high);
}

/* Sliding tab viewport: clips the horizontally-moving panels but keeps its
   natural height (overflow-x: hidden leaves the block in normal flow, so the
   page still scrolls vertically). The track lays the active panel — and, during
   a swipe, its neighbour — side by side; JS translates it. */
.tab-area {
  position: relative;
  /* Clip the swipe track horizontally. `hidden` is only the fallback for old
     engines: it would turn .tab-area into a scroll container, and any future
     position:sticky descendant would silently stick to it instead of the
     viewport. `clip` clips without creating a scrollport (we never scroll
     .tab-area programmatically; the swipe is transform-based). */
  overflow-x: hidden;
  overflow-x: clip;
  /* Vertical panning stays native/immediate; JS owns the horizontal axis (so a
     mostly-vertical drag never gets hijacked into a tab swipe). */
  touch-action: pan-y;
}
.tab-track {
  display: flex;
  align-items: flex-start;
  will-change: transform;
}
.tab-panel {
  flex: 0 0 100%;
  width: 100%;
  min-width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* — Search — */
.search-field {
  display: flex;
}
.search-input {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-field);
  background: var(--surface);
  color: var(--text);
  font-size: 1rem;
}

/* — Category chips (horizontal scroll) —
   Sticky category jump bar: sticks to the viewport top once the retailer tabs +
   search scroll away (the app header is not sticky), so the bar always sits at
   the top under the tabs. `top: 0` + an opaque page-coloured background mask the
   cards scrolling underneath; z-index keeps it above the feed (below the filter
   <dialog>, which is in the top layer). */
.chips-scroller {
  position: sticky;
  top: 0;
  z-index: 5;
  padding-block: 8px;
  background: var(--bg);
  border-bottom: 1px solid var(--surface-border);
}
.chips-scroller::before,
.chips-scroller::after {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 1;
  width: 56px;
  opacity: 0;
  pointer-events: none;
  content: '';
}
.chips-scroller::before {
  left: 0;
  background: linear-gradient(to left, transparent, var(--bg));
}
.chips-scroller::after {
  right: 0;
  background: linear-gradient(to right, transparent, var(--bg));
}
.chips-scroller.has-prev::before,
.chips-scroller.has-next::after {
  opacity: 1;
}
.chips-row {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.chips-row::-webkit-scrollbar {
  display: none;
}
.chips-nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--radius-btn);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transform: translateY(-50%);
}
.chips-nav--prev {
  left: 0;
}
.chips-nav--next {
  right: 0;
}
@media (hover: hover) {
  .chips-nav:hover {
    border-color: var(--outline-variant);
    color: var(--text);
  }
}
/* Funnel button in its own box → category filter sheet (parity with the App). */
.chip-filter {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  min-height: 36px;
  padding: 6px 10px;
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-btn);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}
.chip-filter:hover {
  background: var(--surface-high);
}
.chip-filter.is-active {
  background: var(--chip-bg);
  border-color: var(--primary);
  color: var(--primary-strong);
}
/* Category chip: tinted icon + label + count badge; active = highlighted bg +
   green underline (inset). Rounded rect, not a full pill (App parity). */
.chips-row .chip {
  flex: 0 0 auto;
  gap: 6px;
  min-height: 36px;
  border-radius: var(--radius-btn);
  background: var(--surface);
  border-color: var(--outline-variant);
  color: var(--text);
  white-space: nowrap;
  cursor: pointer;
}
.chip-icon {
  display: inline-flex;
  flex: 0 0 auto;
  color: var(--cat-l);
}
:root[data-theme='dark'] .chip-icon,
:root:not([data-theme]) .chip-icon {
  color: var(--cat-d);
}
.chip-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  padding: 1px 6px;
  border-radius: var(--radius-pill);
  background: var(--surface-high);
  color: var(--text-muted);
  font-size: 0.6875rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
/* Jump-nav chips mark the currently-visible section with aria-current (they
   navigate, they do not toggle a filter), so mirror the active treatment. */
.chips-row .chip[aria-current='true'] {
  background: var(--chip-bg);
  border-color: var(--outline-variant);
  color: var(--text);
  box-shadow: inset 0 -2.5px 0 var(--primary);
}
.chips-row .chip[aria-current='true'] .chip-count {
  background: var(--primary-container);
  color: var(--on-primary-container);
}

/* — Category section headers (grouped feed, App parity) — */
.feed-section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0 6px;
  /* On a chip jump the header is scrolled just under the sticky bar; this keeps
     it clear of the bar for any native scroll-into-view path too. */
  scroll-margin-top: 64px;
}
.feed-section-header:first-child {
  margin-top: 4px;
}
.feed-section-title {
  flex: 1 1 auto;
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--text);
}
.feed-section-count {
  flex: 0 0 auto;
  min-width: 20px;
  padding: 1px 8px;
  border-radius: var(--radius-pill);
  background: var(--surface-high);
  color: var(--text-muted);
  font-size: 0.6875rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
/* Tinted category glyph on its pastel tile (same colour roles as the chip icon
   + categories.js background). Light theme uses the *-l vars; JS always stamps
   data-theme, so the dark override is authoritative whenever JS has run. */
.feed-section-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: var(--cat-bg-l);
  color: var(--cat-l);
}
:root[data-theme='dark'] .feed-section-icon,
:root:not([data-theme]) .feed-section-icon {
  background: var(--cat-bg-d);
  color: var(--cat-d);
}

/* — Category filter sheet (bottom <dialog>) — */
.filter-sheet {
  width: 100%;
  max-width: 560px;
  margin: auto auto 0; /* dock to the bottom */
  padding: 0;
  border: 0;
  background: transparent;
}
.filter-sheet::backdrop {
  background: rgba(15, 26, 15, 0.55);
}
.filter-sheet-panel {
  display: flex;
  flex-direction: column;
  max-height: 80dvh;
  padding: 16px 16px 20px;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-bottom: 0;
  border-radius: var(--radius-card) var(--radius-card) 0 0;
}
.filter-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.filter-sheet-title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text);
}
.filter-sheet-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin-right: -8px;
  border: 0;
  background: transparent;
  color: var(--text);
  border-radius: var(--radius-btn);
  cursor: pointer;
}
.filter-sheet-close:hover {
  background: var(--surface-high);
}
.filter-sheet-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
}
.filter-option {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 44px;
  padding: 8px 10px;
  border: 0;
  border-radius: var(--radius-field);
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.filter-option:hover {
  background: var(--surface-high);
}
.filter-option[aria-checked='true'] {
  background: var(--chip-bg);
}
.filter-option-icon {
  display: inline-flex;
  flex: 0 0 auto;
  color: var(--cat-l);
}
:root[data-theme='dark'] .filter-option-icon,
:root:not([data-theme]) .filter-option-icon {
  color: var(--cat-d);
}
.filter-option-label {
  flex: 1 1 auto;
  font-size: 0.9375rem;
  font-weight: 600;
}
.filter-option-check {
  flex: 0 0 auto;
  width: 20px;
  text-align: center;
  color: var(--primary-strong);
  font-weight: 800;
}
.filter-sheet-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
}
.filter-sheet-footer .btn {
  flex: 0 0 auto;
}

/* — Feed & states — */
.feed-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.feed-status {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 4px;
  color: var(--text-muted);
  font-size: 0.9375rem;
}
.spinner {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  border: 2px solid var(--outline-variant);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: pd-spin 0.7s linear infinite;
}
@keyframes pd-spin {
  to {
    transform: rotate(360deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .spinner {
    animation-duration: 2s;
  }
}
.feed-empty p {
  margin: 0 0 0.75rem;
}
.feed-empty p:last-child {
  margin-bottom: 0;
}
.feed-reset {
  margin-top: 4px;
}
.feed-error {
  border-color: var(--danger);
  background: color-mix(in srgb, var(--danger) 7%, var(--surface));
}
.feed-error > p {
  margin: 0 0 0.75rem;
  color: var(--text);
}
.feed-error-inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid var(--danger);
  border-radius: var(--radius-field);
  background: color-mix(in srgb, var(--danger) 7%, var(--surface));
  color: var(--text);
  font-size: 0.875rem;
}

/* API-delivered possible-vegan offers live outside the confirmed category
   flow. The heading remains visible while the card list starts collapsed. */
.possible-vegan {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--outline-variant);
}
.possible-vegan-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--warn-border);
  border-radius: var(--radius-card);
  background: var(--warn-bg);
  color: var(--text);
  text-align: left;
  font: inherit;
  cursor: pointer;
}
.possible-vegan-toggle:focus-visible {
  outline: 2px solid var(--warn-accent);
  outline-offset: 2px;
}
.possible-vegan-copy {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}
.possible-vegan-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.possible-vegan-title {
  font-size: 1rem;
  font-weight: 750;
}
.possible-vegan-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  min-height: 22px;
  padding: 0 6px;
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--warn-accent);
  font-size: 0.75rem;
  font-weight: 800;
}
.possible-vegan-description {
  color: var(--text-muted);
  font-size: 0.8125rem;
  line-height: 1.35;
}
.possible-vegan-chevron {
  display: inline-flex;
  flex: 0 0 auto;
  color: var(--warn-accent);
  transform: rotate(0deg);
  transition: transform 160ms ease;
}
.possible-vegan-toggle[aria-expanded='true'] .possible-vegan-chevron {
  transform: rotate(180deg);
}
.possible-vegan-content {
  margin-top: 12px;
}
@media (prefers-reduced-motion: reduce) {
  .possible-vegan-chevron {
    transition: none;
  }
}

/* — Offer card v2 — */
.offer-card-shell {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-card);
  box-shadow: 0 1px 2px rgba(20, 32, 20, 0.04);
}
.offer-card-shell > .offer-card {
  flex: 1 1 auto;
  border: 0;
  background: transparent;
  box-shadow: none;
}
.offer-card-shell .offer-body {
  padding-right: 22px;
}
:root[data-theme='dark'] .offer-card-shell,
:root:not([data-theme]) .offer-card-shell {
  box-shadow: none;
}
.offer-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-card);
  box-shadow: 0 1px 2px rgba(20, 32, 20, 0.04);
}
a.offer-card {
  color: inherit;
  text-decoration: none;
}
:root[data-theme='dark'] .offer-card,
:root:not([data-theme]) .offer-card {
  box-shadow: none;
}
.offer-cat-tile {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  /* Both theme variants set inline per card; CSS picks by [data-theme]. */
  background: var(--tile-bg-l);
  color: var(--tile-fg-l);
}
:root[data-theme='dark'] .offer-cat-tile {
  background: var(--tile-bg-d);
  color: var(--tile-fg-d);
}
/* Normalise every non-photo glyph (produce icon or category illustration) to a
   uniform size in the 52×52 slot, regardless of each SVG's own width/height. */
.offer-cat-tile svg {
  width: 26px;
  height: 26px;
}
/* Product photo filling the 52×52 slot (feed product_image_url, mode=on); JS
   falls back to the category tile on a broken/absent image. */
.offer-cat-tile--photo {
  background: var(--surface-high);
  overflow: hidden;
}
.offer-photo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}
.offer-body {
  flex: 1 1 auto;
  min-width: 0; /* lets the title ellipsis work inside the flex row */
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.offer-title {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.25;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.offer-store {
  margin: 0;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Amber vegan presentation hint. The icon is the only accent; explanatory
   text keeps the normal foreground contrast in both themes. */
.vegan-hint {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.vegan-hint-badge {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--warn-border);
  border-radius: var(--radius-pill);
  background: var(--warn-bg);
  color: var(--warn-accent);
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.vegan-hint-badge:focus-visible {
  outline: 2px solid var(--warn-accent);
  outline-offset: 2px;
}
.vegan-hint-text {
  margin: 0;
  padding: 7px 9px;
  border: 1px solid var(--warn-border);
  border-radius: var(--radius-field);
  background: var(--warn-bg);
  color: var(--text);
  font-size: 0.75rem;
  line-height: 1.4;
}
.vegan-hint--detail {
  align-items: flex-start;
}
.vegan-hint--detail .vegan-hint-text {
  flex: 1 1 auto;
  font-size: 0.9375rem;
}
.offer-card-shell > .vegan-hint {
  display: block;
  padding: 0;
}
.offer-card-shell > .vegan-hint.is-expanded {
  padding: 0 12px 12px 76px;
}
.offer-card-shell > .vegan-hint > .vegan-hint-badge {
  position: absolute;
  top: 10px;
  right: 38px;
  z-index: 1;
}
.offer-card-shell > .vegan-hint > .vegan-hint-text {
  width: 100%;
}

/* Short per-offer validity window; intentionally flat (no card-pill comeback).
   Partial-window states carry their state via colour: default green = active,
   amber = upcoming, grey = expired. Long promotions stay neutral. */
.offer-window-badge {
  align-self: flex-start;
  color: var(--primary);
  font-size: 0.6875rem;
  font-weight: 700;
  line-height: 1.25;
}
.offer-window-badge--upcoming {
  color: var(--warn-accent);
}
.offer-window-badge--expired {
  color: var(--text-muted);
}
.offer-window-badge--long-promo {
  color: var(--text-muted);
  font-weight: 600;
}

/* Expired partial-week offers stay listed until the prospect week ends, but
   greyed out so they never read as a current deal. The shell variant resets
   the inner card so the opacity is applied exactly once. */
.offer-card--expired {
  opacity: 0.55;
}
.offer-card-shell--expired {
  opacity: 0.55;
}
.offer-card-shell--expired > .offer-card--expired {
  opacity: 1;
}

/* Price row and price zone. */
.price-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 8px;
  min-width: 0;
}
.price-zone {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 0;
}
.price-zone--stacked {
  gap: 2px;
}
.price-line {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--primary-strong);
  font-variant-numeric: tabular-nums;
}
.price-label {
  color: var(--primary-strong);
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: none;
}
.price-line--secondary {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
}
/* Assistive-only text (screen readers); visually removed without display:none
   so the accessible name stays in the a11y tree. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.price-old {
  color: var(--text-muted);
  font-size: 0.9em;
  font-weight: 400;
  text-decoration: line-through;
}
.price-unavailable {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
}
.offer-unit-price {
  margin: 2px 0 0;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

/* ======================================================================
   W-3 Offer detail + W-4 feedback flow.
   New text pairs verified ≥4.5:1 in BOTH modes (see PR notes):
   --primary-strong on --bg (feedback confirm) 7.47:1 / 13.3:1; every other
   pair reuses a W-1/W-2-verified pairing (--text / --text-muted / --danger on
   --surface/--bg, category label on its pastel tile, var(--text) on --warn-bg).
   ====================================================================== */

/* — Card → detail navigation (chevron + link affordance) — */
.offer-card--link {
  cursor: pointer;
}
.offer-card--link:hover {
  background: var(--surface-high);
}
.offer-card--link:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
.offer-chevron {
  align-self: center;
  flex: 0 0 auto;
  display: inline-flex;
  color: var(--text-muted);
}

@media (hover: hover) {
  .offer-card-shell:hover {
    border-color: var(--primary);
  }
  .offer-card--link:hover {
    border-color: var(--primary);
  }
  .offer-card--link:hover .offer-chevron {
    color: var(--primary-strong);
  }
  .chip[aria-pressed='false']:hover,
  /* unpressed only — .tabs .tab:hover (0,3,0) would out-specify the pressed
     background from .tab[aria-pressed='true'] (0,2,0) and wash out the
     active tab while hovered. */
  .tabs .tab[aria-pressed='false']:hover {
    background: var(--surface-high);
  }
}

/* — Detail page shell — */
.detail-back {
  display: inline-flex;
  align-items: center;
  margin-bottom: 12px;
  color: var(--primary);
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
}
.detail-back:hover {
  text-decoration: underline;
}
.detail {
  display: flex;
  flex-direction: column;
}

/* — Page image tile (≈60vh) + fullscreen affordance — */
.detail-image {
  position: relative;
  display: block;
  width: 100%;
  height: 60dvh;
  min-height: 240px;
  max-height: 560px;
  border-radius: var(--radius-card);
  overflow: hidden;
  background: #000;
}
.detail-image--photo {
  padding: 0;
  border: 0;
  cursor: zoom-in;
}
.detail-image-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.detail-image-fs {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
}
.detail-image--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--tile-bg-l);
  color: var(--tile-fg-l);
}
:root[data-theme='dark'] .detail-image--placeholder {
  background: var(--tile-bg-d);
  color: var(--tile-fg-d);
}
.detail-image-leaf {
  display: inline-flex;
}
.detail-image-leaf svg {
  width: 72px;
  height: 72px;
}

/* Product photo block in the detail (SEPARATE from the prospect-page hero
   above). Shown when the feed carries product_image_url; OFF images add a
   small CC-BY-SA credit line. */
.detail-product {
  margin: 4px 0;
}
.detail-product-img {
  display: block;
  width: 100%;
  max-width: 160px;
  height: auto;
  border-radius: 12px;
  background: var(--surface-high);
}
.detail-product-credit {
  margin: 6px 0 0;
  font-size: 0.75rem;
  color: var(--text-muted);
  overflow-wrap: anywhere;
}

/* web_structured hero: the product packshot is the primary anchor (these offers
   have no prospect page), so present it centered and larger than the small
   in-body thumbnail above. Only applies when the block sits directly in .detail
   (the hero slot), never to the in-body prospect-layout thumbnail. */
.detail > .detail-product {
  margin: 0 0 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.detail > .detail-product .detail-product-img {
  max-width: min(320px, 70%);
}

/* — Detail body — */
.detail-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 16px;
}
.detail-cat-chip {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: var(--tile-bg-l);
  color: var(--tile-fg-l);
  font-size: 0.8125rem;
  font-weight: 600;
}
:root[data-theme='dark'] .detail-cat-chip {
  background: var(--tile-bg-d);
  color: var(--tile-fg-d);
}
.detail-cat-icon {
  display: inline-flex;
}
.detail-cat-icon svg {
  width: 16px;
  height: 16px;
}
.detail-title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--text);
}

/* — Large price zone (reuses renderPrice output; scales the typography) — */
.detail-price {
  margin-top: 4px;
}
.detail-price .price-line {
  font-size: 1.75rem;
}
.detail-price .price-line--secondary {
  font-size: 1rem;
}
.detail-price .price-unavailable {
  font-size: 1.125rem;
}
.detail-price .price-label {
  font-size: 0.8125rem;
}

/* — Meta list (icon + text rows) — */
.meta-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}
.meta-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.meta-icon {
  flex: 0 0 auto;
  display: inline-flex;
  margin-top: 1px;
  color: var(--text-muted);
}
.meta-text {
  color: var(--text-muted);
  font-size: 0.9375rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

/* — Detail actions: evidence anchor + share — */
.detail-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}
.detail-flyer {
  gap: 8px;
  text-decoration: none;
}
.detail-flyer-icon,
.detail-action-icon {
  display: inline-flex;
}
.detail-share {
  gap: 8px;
}
.share-action {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.share-manual-input {
  width: 100%;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-btn);
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

/* — Feedback section — */
.detail-feedback {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--surface-border);
}
.feedback-status {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.feedback-status-head {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.feedback-status-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-field);
  background: var(--surface);
}
.feedback-status-type {
  color: var(--text);
  font-size: 0.875rem;
}
.feedback-status-value {
  color: var(--text);
  font-size: 0.8125rem;
  font-weight: 700;
  white-space: nowrap;
}
.feedback-confirm {
  margin: 0;
  color: var(--primary-strong);
  font-size: 0.875rem;
  font-weight: 600;
}
.feedback-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.feedback-form-title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
}
.feedback-submit {
  align-self: flex-start;
  min-width: 120px;
}
.feedback-helper {
  margin: 0;
  font-size: 0.8125rem;
}

/* — Secondary button (sheet cancel) — */
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 20px;
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-btn);
  background: var(--surface);
  color: var(--text);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}
.btn-secondary:hover {
  background: var(--surface-high);
}

/* — Fullscreen image dialog (native <dialog>) — */
.image-dialog {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  max-width: 100vw;
  max-height: 100dvh;
  margin: 0;
  padding: 0;
  border: 0;
  background: #000;
  color: #fff;
}
.image-dialog::backdrop {
  background: rgba(0, 0, 0, 0.9);
}
.image-dialog-scroll {
  width: 100%;
  height: 100%;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  align-items: center;
  justify-content: center;
}
.image-dialog-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  /* Let iOS pinch-zoom the image; the scroll container pans the zoomed result. */
  touch-action: pinch-zoom;
}
.image-dialog-close {
  position: fixed;
  top: calc(12px + env(safe-area-inset-top, 0px));
  right: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  cursor: pointer;
}

/* — Feedback sheet (native <dialog>, bottom-anchored) — */
.sheet {
  width: 100%;
  max-width: 560px;
  max-height: 92dvh;
  margin: auto auto 0;
  padding: 0;
  border: 1px solid var(--surface-border);
  border-bottom: 0;
  border-radius: 20px 20px 0 0;
  background: var(--surface);
  color: var(--text);
  overflow: hidden;
}
.sheet::backdrop {
  background: rgba(0, 0, 0, 0.5);
}
.sheet-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: 92dvh;
  padding: 20px 18px calc(18px + env(safe-area-inset-bottom, 0px));
  overflow-y: auto;
}
.sheet-title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
}
.sheet-subtitle {
  margin: 0;
  font-size: 0.875rem;
}
.sheet-types {
  gap: 2px;
}
.radio-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  cursor: pointer;
}
.radio-row input {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  accent-color: var(--primary);
}
.radio-label {
  flex: 1 1 auto;
  font-size: 0.9375rem;
}
.radio-row--disabled {
  cursor: default;
}
.radio-row--disabled .radio-label {
  color: var(--text-muted);
}
.radio-note {
  flex: 0 0 auto;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-style: italic;
}
.sheet-textarea {
  width: 100%;
  min-height: 76px;
  padding: 10px 12px;
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-field);
  background: var(--surface);
  color: var(--text);
  font-size: 1rem;
  line-height: 1.4;
  resize: vertical;
}
.sheet-counter {
  align-self: flex-end;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
}
.sheet-error {
  margin: 0;
  color: var(--danger);
  font-size: 0.875rem;
}
.sheet-actions {
  display: flex;
  gap: 12px;
  margin-top: 4px;
}
.sheet-actions > * {
  flex: 1;
}

/* ======================================================================
   Einstellungen (W-2) — settings route reached via the header burger. Cards
   stacked via .stack; each has a heading + body. Theme-aware via tokens.
   ====================================================================== */
.settings-heading {
  margin: 0 0 10px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}
.settings-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.settings-region-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.settings-region-summary {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--text);
}
.settings-region-head .link-btn {
  flex: 0 0 auto;
}
.settings-info-links {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}
.settings-info-links a {
  font-size: 0.9375rem;
}

/* ======================================================================
   Vegane Labels (Vegan-Seite) — Namen der gängigen Zertifikate + ein
   reservierter [DESIGN — offen] Bild-Slot je Label (Abbildung folgt im
   Folge-PR, sobald die Bildquelle/Rechte geklärt sind).
   ====================================================================== */
.vegan-labels {
  margin-top: 20px;
}
.vegan-labels-intro {
  margin: 0 0 12px;
  font-size: 0.9375rem;
  color: var(--text);
}
/* One shown label: the official V-Label graphic + its name. */
.vegan-label {
  display: flex;
  align-items: center;
  gap: 12px;
}
.vegan-label-slot--img {
  flex: 0 0 auto;
  display: inline-flex;
}
.vegan-label-img {
  display: block;
  height: 88px;
  width: auto;
  object-fit: contain;
}
.vegan-label-name {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
}
/* The Vegan Society sunflower is named in text only (no image). */
.vegan-labels-note {
  margin: 12px 0 0;
  font-size: 0.875rem;
  color: var(--text-muted);
}

@media (min-width: 960px) {
  .app-header .bar {
    max-width: 1160px;
  }
  .view[data-route='/'],
  .view[data-route='/offer/:id'] {
    max-width: 1160px;
  }
  .feed-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
    align-items: stretch;
  }
  .feed-list > .offer-card,
  .feed-list > .offer-card-shell {
    height: 100%;
  }
  /* status/empty/error cards and the chips row live OUTSIDE .feed-list
     (listEl siblings, home.js renderFeed) — no full-width guards needed. */
  .detail {
    display: grid;
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    gap: 24px;
    align-items: start;
  }
  .detail > .detail-image {
    position: sticky;
    top: 24px;
    /* the mobile 60dvh/560px cap is sized for a stacked layout; in the
       two-column layout the image IS the left pane, so let it use the
       viewport height (minus header + breathing room). */
    height: calc(100dvh - 120px);
    max-height: calc(100dvh - 120px);
  }
  .detail > .detail-body {
    min-width: 0;
    padding-top: 0;
  }
  /* web_structured hero packshot occupies the left pane instead of the prospect
     image; keep it sticky and near the top so the pane never looks empty. */
  .detail > .detail-product {
    position: sticky;
    top: 24px;
    justify-content: flex-start;
  }
}
