/* 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;
  --fab-fg: #ffffff;
  --chip-bg: #e8f5e9;
  --outline-variant: #d7e2d6;
  --danger: #b3261e;
  /* Notification system v1 (notification_system_v1.md §1): one source per
     tone. Attention is the ONLY amber; critical (red) is for errors only. */
  --notice-neutral-bg: #eef3ee;
  --notice-neutral-fg: #4a574c;
  --notice-brand-bg: #dcf2e5;
  --notice-brand-fg: #1b5e20;
  --notice-attention-bg: #f7f0d9;
  --notice-attention-fg: #7a5d00;
  --notice-critical-bg: #fbe4e2;
  --notice-critical-fg: #b3261e;
  --toast-bg: #26302a;
  --toast-fg: #f1f5f1;
  --toast-action: #a8e6cf;
  --notice-brand-action: #1b5e20;
  --toast-border: transparent;
  --toast-shadow: 0 6px 20px rgb(0 0 0 / 18%);
  --badge-bg: #2a7a4b;
  --badge-fg: #ffffff;
}
: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;
    --fab-fg: #12351f;
    --chip-bg: #1e3a1e;
    --outline-variant: #2a3d2a;
    --danger: #f2b8b5;
    --notice-neutral-bg: #243724;
    --notice-neutral-fg: #b8cbb9;
    --notice-brand-bg: #21452e;
    --notice-brand-fg: #c8e6c9;
    --notice-attention-bg: #3a3519;
    --notice-attention-fg: #ffd54f;
    --notice-critical-bg: #45211f;
    --notice-critical-fg: #f2b8b5;
    --toast-bg: #2e432e;
    --toast-fg: #e8f5e9;
    --toast-action: #a8e6cf;
    --notice-brand-action: #a8e6cf;
    --toast-border: #3a523a;
    --toast-shadow: 0 6px 20px rgb(0 0 0 / 45%);
    --badge-bg: #a8e6cf;
    --badge-fg: #0f1a0f;
  }
}

: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;
  --fab-fg: #12351f;
  --chip-bg: #1e3a1e;
  --outline-variant: #2a3d2a;
  --danger: #f2b8b5;
  --notice-neutral-bg: #243724;
  --notice-neutral-fg: #b8cbb9;
  --notice-brand-bg: #21452e;
  --notice-brand-fg: #c8e6c9;
  --notice-attention-bg: #3a3519;
  --notice-attention-fg: #ffd54f;
  --notice-critical-bg: #45211f;
  --notice-critical-fg: #f2b8b5;
  --toast-bg: #2e432e;
  --toast-fg: #e8f5e9;
  --toast-action: #a8e6cf;
  --notice-brand-action: #a8e6cf;
  --toast-border: #3a523a;
  --toast-shadow: 0 6px 20px rgb(0 0 0 / 45%);
  --badge-bg: #a8e6cf;
  --badge-fg: #0f1a0f;
  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 actions: location + burger. The burger stays a settings shortcut on
   mobile and opens the contextual menu on desktop. Both retain 44px targets. */
.header-actions {
  position: relative;
  display: flex;
  align-items: center;
  gap: 2px;
  margin-right: -8px; /* optical: pull the icon row to the bar edge */
}
.icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  color: var(--text);
  border-radius: var(--radius-btn);
}
/* Shopping-list count on the burger (Count component); ring = app bar. */
.header-count-badge {
  position: absolute;
  top: 3px;
  right: 1px;
  --badge-ring: var(--bg);
}
.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);
}
.desktop-menu { display: none; }

/* 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 8px;
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  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 {
  color: var(--primary-strong);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.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:where(:not(.ui-notice)) {
  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-nudge { color: var(--primary-strong); }
/* Warn/error statuses are .ui-notice bars (attention / critical). */
.location-status.ui-notice { margin: 12px 0 0; }
.location-screen-dynamic .location-status.ui-notice { margin-top: 8px; }
.location-screen-dynamic:empty { display: none; }
.location-screen-dynamic .location-status:where(:not(.ui-notice)) {
  margin-top: 8px;
  padding: 0 2px;
  border-radius: 0;
  background: transparent;
  line-height: 1.4;
}
.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(--text-muted); }
.location-candidate.is-checked,
.location-candidate.is-selected { border-color: var(--primary); }
.location-candidate.is-suggested {
  border-color: var(--notice-attention-fg);
  border-style: dashed;
  background: var(--notice-attention-bg);
}
.location-candidate-name { min-width: 0; }
.location-candidate-suffix { color: var(--notice-attention-fg) !important; font-weight: 700; }
.location-candidate-distance { font-variant-numeric: tabular-nums; text-align: right; }
.location-candidate-address { grid-column: 1 / -1; }
.location-candidate-accept { width: 100%; min-height: 44px; margin-top: 12px; }
.location-candidate-more {
  width: 100%;
  min-height: 44px;
  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-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-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.location-unsaved-marker {
  display: block;
  overflow: hidden;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  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: minmax(0, 1fr);
  gap: 8px;
  align-items: stretch;
}
.location-retailer-row {
  min-width: 0;
  border: 1px solid var(--outline-variant);
  border-radius: 14px;
  background: var(--surface);
  overflow: clip;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.location-retailer-row.is-expanded { border-color: var(--primary); }
.location-retailer-row-shell {
  position: relative;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto 52px;
  align-items: center;
  min-height: 64px;
}
.location-retailer-toggle {
  z-index: 0;
  grid-column: 1 / -1;
  grid-row: 1;
  width: 100%;
  min-height: 64px;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto 52px;
  align-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}
.location-retailer-toggle:disabled { cursor: wait; }
.location-retailer-logo {
  grid-column: 1;
  justify-self: center;
  max-width: 54px;
  max-height: 28px;
  object-fit: contain;
}
.location-retailer-logo-fallback {
  grid-column: 1;
  justify-self: center;
  max-width: 58px;
  overflow: hidden;
  font-size: 0.68rem;
  font-weight: 800;
  text-align: center;
  text-overflow: ellipsis;
}
.location-retailer-check {
  grid-column: 4;
  justify-self: center;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 2px solid var(--outline-variant);
  border-radius: 50%;
  color: #fff;
  font-size: 0.8rem;
  font-weight: 900;
}
.location-retailer-check.is-checked { border-color: var(--primary); background: var(--primary); }
.location-retailer-binding {
  z-index: 1;
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px;
  align-items: center;
  gap: 0 4px;
  min-height: 44px;
  padding: 4px 2px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
}
.location-retailer-binding:is(button) { width: 100%; border-radius: var(--radius-field); cursor: pointer; }
.location-retailer-binding:not(button) { pointer-events: none; }
.location-retailer-binding:is(button):disabled { cursor: wait; }
.location-binding-primary,
.location-binding-secondary {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.location-binding-primary { grid-column: 1; font-size: 0.9rem; font-weight: 700; }
.location-binding-secondary { grid-column: 1; color: var(--text-muted); font-size: 0.75rem; }
.location-retailer-binding.is-bound .location-binding-primary { color: var(--primary-strong); }
.location-retailer-binding.is-action .location-binding-primary { color: var(--notice-attention-fg); }
.location-retailer-binding.is-error .location-binding-primary,
.location-retailer-binding.is-error .location-binding-secondary { color: var(--danger); }
.location-binding-primary.is-shimmering::before,
.location-candidate-loading::before {
  content: '';
  display: block;
  width: min(100%, 132px);
  height: 12px;
  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-row-hint {
  display: block;
  margin: 0 10px 8px 64px;
  padding: 5px 8px;
  border-radius: var(--radius-field);
  background: var(--surface-high);
  color: var(--text-muted);
  font-size: 0.75rem;
  line-height: 1.35;
}
.location-row-hint.is-warn {
  border-radius: 12px;
  background: var(--notice-attention-bg);
  color: var(--notice-attention-fg);
}
.location-row-interest {
  min-height: 44px;
  margin: 0 10px 8px 64px;
  padding: 6px 8px;
  border: 0;
  border-radius: var(--radius-field);
  background: var(--surface-high);
  color: var(--primary-strong);
  font-size: 0.75rem;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}
.location-candidate-disclosure {
  padding: 12px;
  border-top: 1px solid var(--outline-variant);
  background: color-mix(in srgb, var(--surface-high) 48%, var(--surface));
}
.location-disclosure-title { margin: 0; font-size: 0.9rem; }
.location-candidate-state { margin: 10px 0 0; color: var(--text-muted); font-size: 0.85rem; }
.location-candidate-state.is-error { color: var(--danger); }
.location-candidate-loading { display: block; min-height: 28px; padding-top: 8px; }
.location-retailer-retry {
  z-index: 1;
  grid-column: 3;
  grid-row: 1;
  min-height: 44px;
  padding: 4px 8px;
  border: 0;
  border-radius: var(--radius-field);
  background: transparent;
  color: var(--danger);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
}
.location-retailer-row.is-inactive .location-retailer-logo,
.location-retailer-row.is-inactive .location-retailer-logo-fallback,
.location-retailer-row.is-inactive .location-retailer-binding { opacity: 0.5; }
.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-binding-chevron {
  grid-column: 2;
  grid-row: 1 / span 2;
  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-detail-radius { 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-retailer-binding:is(button):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-binding-primary.is-shimmering::before,
  .location-candidate-loading::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; }
}

/* 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);
}
/* — 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;
}

/* — Notification system v1 (docs/refactor/v5_1_1/reviews/notification_system_v1.md §2).
   Five components, built once from the --notice-* / --toast-* / --badge-*
   tokens and reused everywhere: dot, count, label, notice, toast. Text sizes
   are fixed: 10 (count), 11 (label), 12.5 (notice), 13 (toast). — */
.ui-dot {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--badge-bg);
  /* Ring = the surface the dot sits on; a host sets --badge-ring. */
  box-shadow: 0 0 0 2px var(--badge-ring, var(--bg));
  pointer-events: none;
}
.ui-count {
  display: inline-block;
  box-sizing: border-box;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 9px;
  background: var(--badge-bg);
  color: var(--badge-fg);
  box-shadow: 0 0 0 2px var(--badge-ring, var(--bg));
  font-size: 10px;
  font-weight: 700;
  line-height: 17px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}
.ui-label {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 4px;
  box-sizing: border-box;
  max-width: 100%;
  height: 20px;
  padding: 0 8px;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--notice-neutral-bg);
  color: var(--notice-neutral-fg);
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
  vertical-align: middle;
}
.ui-label svg {
  flex: 0 0 auto;
  width: 11px;
  height: 11px;
}
.ui-label--brand { background: var(--notice-brand-bg); color: var(--notice-brand-fg); }
.ui-label--attention { background: var(--notice-attention-bg); color: var(--notice-attention-fg); }
.ui-label--critical { background: var(--notice-critical-bg); color: var(--notice-critical-fg); }
.ui-label--quiet { padding: 0 2px; background: transparent; color: var(--text-muted); }
button.ui-label {
  font-family: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
button.ui-label:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}
.ui-notice {
  display: flex;
  align-items: center;
  gap: 8px;
  box-sizing: border-box;
  width: 100%;
  min-height: 38px;
  padding: 7px 8px 7px 11px;
  border-radius: 12px;
  background: var(--notice-neutral-bg);
  color: var(--notice-neutral-fg);
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.35;
}
.ui-notice--brand { background: var(--notice-brand-bg); color: var(--notice-brand-fg); }
.ui-notice--attention { background: var(--notice-attention-bg); color: var(--notice-attention-fg); }
.ui-notice--critical { background: var(--notice-critical-bg); color: var(--notice-critical-fg); }
.ui-notice-icon {
  display: inline-flex;
  flex: 0 0 auto;
}
.ui-notice-icon svg,
.ui-notice-icon .spinner {
  width: 15px;
  height: 15px;
}
.ui-notice-icon .spinner {
  border-width: 2px;
  border-color: color-mix(in srgb, currentColor 30%, transparent);
  border-top-color: currentColor;
}
.ui-notice-text {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ui-notice-text b { font-weight: 650; }
.ui-notice--multiline { align-items: flex-start; }
.ui-notice--multiline .ui-notice-text { white-space: normal; overflow: visible; }
.ui-notice--multiline .ui-notice-icon { margin-top: 1px; }
.ui-notice-title { display: block; font-weight: 650; }
.ui-notice-body { display: block; margin: 2px 0 0; color: var(--text); }
.ui-notice-action,
.ui-toast-action {
  flex: 0 0 auto;
  min-height: 28px;
  padding: 4px 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  font: inherit;
  font-size: 12.5px;
  font-weight: 650;
  white-space: nowrap;
  cursor: pointer;
}
.ui-notice-action { color: inherit; }
.ui-notice--neutral .ui-notice-action { color: var(--primary); }
.ui-notice--brand .ui-notice-action { color: var(--notice-brand-action); }
.ui-notice-action:hover { background: color-mix(in srgb, currentColor 10%, transparent); }
.ui-notice-action:focus-visible,
.ui-notice-dismiss:focus-visible,
.ui-toast-action:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 1px;
}
.ui-notice-dismiss {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  opacity: 0.7;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}
.ui-notice-dismiss:hover { opacity: 1; }
/* Quiet caption under a notice or above a list ("Prospekt: …"). */
.ui-caption {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.8125rem;
  line-height: 1.4;
}
/* One toast at a time, bottom centre (notice.js owns the queue). The region
   is a persistent polite live region; only its child changes. */
.ui-toast-region {
  position: fixed;
  z-index: 40;
  left: 50%;
  bottom: max(20px, env(safe-area-inset-bottom));
  width: min(calc(100% - 32px), 420px);
  transform: translateX(-50%);
  pointer-events: none;
}
.ui-toast {
  display: flex;
  align-items: center;
  gap: 10px;
  box-sizing: border-box;
  width: 100%;
  min-height: 40px;
  padding: 0 6px 0 14px;
  border: 1px solid var(--toast-border);
  border-radius: 12px;
  background: var(--toast-bg);
  color: var(--toast-fg);
  box-shadow: var(--toast-shadow);
  font-size: 13px;
  font-weight: 500;
  pointer-events: auto;
}
.ui-toast-message {
  flex: 1 1 auto;
  min-width: 0;
  padding: 10px 0;
  line-height: 1.3;
}
.ui-toast-action { color: var(--toast-action); font-size: 13px; }
/* App-level notice slot (notice.js mountAppNotice): top of the current view. */
.app-notice-region {
  margin: 0 0 12px;
}
.ui-toast-action:hover { background: rgb(255 255 255 / 8%); }
.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 {
  position: sticky;
  top: 0;
  z-index: 7;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 2px;
  background: var(--bg);
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
  transition: transform 180ms cubic-bezier(0.22, 0.61, 0.36, 1);
}
.tabs--scroll-hidden {
  transform: translateY(-100%);
  pointer-events: none;
}
.market-tabs-overlay-visible .chips-scroller {
  top: var(--market-tabs-sticky-height, 0px);
}
.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;
  /* Reserves the flyer range line (logo 24px + gap 2px + one .tab-range line
     + padding + underline): the range arrives with /v1/prospects, which the
     feed no longer waits for, and must not push painted cards down. */
  min-height: calc(24px + 2px + 0.625rem + 12px + 3px);
  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,
  .chips-scroller {
    transition: none;
  }
  .tabs--editing .tab--market {
    animation: none;
  }
}
/* 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;
}
.tab-panel {
  flex: 0 0 100%;
  width: 100%;
  min-width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* — Search — */
.search-field {
  display: flex;
  gap: 8px;
}
.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;
}
.search-close,
.search-fab { display: none; }

@media (max-width: 959px) {
  .search-field {
    position: fixed;
    z-index: 35;
    right: 16px;
    bottom: max(16px, env(safe-area-inset-bottom));
    left: 16px;
    display: none;
    width: auto;
    padding: 8px;
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-btn);
    background: var(--surface);
    box-shadow: 0 8px 28px rgb(0 0 0 / 24%);
  }
  .search-field.is-open { display: flex; }
  .search-close {
    display: grid;
    place-items: center;
    flex: 0 0 44px;
    min-height: 44px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--text);
    cursor: pointer;
  }
  .search-fab {
    position: fixed;
    z-index: 30;
    right: max(18px, env(safe-area-inset-right));
    bottom: max(18px, env(safe-area-inset-bottom));
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: color-mix(in srgb, var(--primary-strong) 85%, transparent);
    color: var(--fab-fg);
    box-shadow: 0 4px 16px rgb(0 0 0 / 24%);
    cursor: pointer;
  }
  .search-fab.is-hidden { display: none; }
  /* The composer belongs to its panel; hide it while two panels slide. The
     magnifier is shell-owned (outside .tab-track) and never hides here. */
  .tab-panel:not(:only-child) .search-field { display: none; }
  .search-fab svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
  }
}

/* — Category chips (horizontal scroll) —
   Sticky category jump bar: sits at the viewport top while the direction-aware
   retailer tabs are hidden, and directly below them while they are visible.
   The opaque page-coloured background masks cards scrolling underneath;
   z-index keeps it above the feed (below the filter <dialog>, top layer). */
.chips-scroller {
  position: sticky;
  top: 0;
  z-index: 5;
  padding-block: 8px;
  background: var(--bg);
  border-bottom: 1px solid var(--surface-border);
  transition: top 180ms cubic-bezier(0.22, 0.61, 0.36, 1);
}
/* Nach der Basisregel, sonst gewinnt deren gleich spezifische transition
   (Review PR 1202 Runde 2): Reduced Motion muss den Sticky-Sofort-Sprung
   liefern. */
@media (prefers-reduced-motion: reduce) {
  .chips-scroller {
    transition: none;
  }
}
.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);
}
/* Inline counts in chips and section headers are neutral Labels (.ui-label). */
.chip-count {
  margin-left: 2px;
}
/* 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);
}

/* — 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 {
  min-width: 20px;
  justify-content: center;
}
/* 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;
}

/* — Bestaetigungs-Dialog (App-AlertDialog-Parity, #1463) —
   Mittig statt Bottom-Sheet, weil die App fuer destruktive Rueckfragen einen
   AlertDialog zeigt und keinen Sheet. */
.confirm-dialog {
  width: calc(100% - 32px);
  max-width: 380px;
  margin: auto;
  padding: 0;
  border: 0;
  background: transparent;
}
.confirm-dialog::backdrop {
  background: rgba(15, 26, 15, 0.55);
}
.confirm-dialog-panel {
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-card);
}
.confirm-dialog-title {
  margin: 0 0 8px;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text);
}
.confirm-dialog-body {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9375rem;
}
.confirm-dialog-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
}
.confirm-dialog-cancel {
  min-height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: var(--radius-btn);
  background: none;
  color: var(--primary-strong);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.confirm-dialog-cancel:hover { background: var(--surface-high); }
.confirm-dialog-cancel:focus-visible,
.confirm-dialog-confirm:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* — 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;
}
/* Progressive drain: the counts slot shows a spinner plus text (same margin
   and caption line as `.feed-count`, so the switch to the counts does not
   shift the list) plus an end marker. */
.feed-count-loading {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
}
.feed-count-loading .spinner,
.feed-loading-more-end .spinner {
  width: 14px;
  height: 14px;
}
.feed-loading-more-end {
  display: flex;
  justify-content: center;
  padding: 16px 0 4px;
}
.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-store-picker-required {
  display: grid;
  gap: 12px;
}
.feed-store-picker-card {
  border-color: color-mix(in srgb, var(--notice-attention-fg) 40%, var(--outline-variant));
  background: color-mix(in srgb, var(--notice-attention-bg) 60%, var(--surface));
}
.feed-store-picker-title {
  margin: 0;
  font-size: 1.125rem;
}
.feed-store-picker-copy {
  margin: 6px 0 14px;
}
.feed-store-picker-cta {
  min-height: 44px;
}
.feed-store-picker-adjust,
.feed-store-picker-card .feed-remove-market {
  width: 100%;
  min-height: 44px;
  margin-top: 10px;
}
.feed-store-picker-card .location-candidate-disclosure {
  margin-top: 14px;
  padding: 14px 0 0;
  border-top-color: color-mix(in srgb, var(--notice-attention-fg) 30%, var(--outline-variant));
  background: transparent;
}
.feed-store-picker-examples {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.feed-store-picker-example {
  min-height: 112px;
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-card);
  background: var(--surface-high);
  color: var(--text-muted);
  opacity: 0.58;
}
.feed-store-picker-example-image {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-field);
  background: color-mix(in srgb, var(--outline-variant) 70%, var(--surface));
}
.feed-store-picker-example-copy {
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.35;
}
@media (max-width: 520px) {
  .feed-store-picker-examples { grid-template-columns: minmax(0, 1fr); }
}
/* Feed notices (notification system v1): one notice above the list, or a
   notice block (notice + quiet captions) as the empty state of the feed. */
.feed-notice-block {
  display: grid;
  gap: 8px;
}
.feed-notice-block .ui-caption,
.feed-notice-block .feed-origin {
  margin: 0;
  padding: 0 4px;
}
.feed-notice-block-action {
  justify-self: start;
  margin-top: 4px;
}
.feed-origin {
  margin: 0 0 12px;
  color: var(--text-muted);
  font-size: 0.8125rem;
}
.feed-origin p {
  margin: 0 0 4px;
}
.feed-origin p:last-child {
  margin-bottom: 0;
}
.feed-reset {
  margin-top: 4px;
}
.feed-error-inline {
  margin-bottom: 12px;
}

.feed-count {
  margin: 0 0 10px;
}

/* — 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;
  padding-right: 64px;
  border: 0;
  background: transparent;
  box-shadow: none;
}
.offer-card-shell .offer-body { padding-right: 0; }
: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-picture {
  flex: 0 0 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.offer-picture-caption {
  font-size: 0.625rem;
  line-height: 1.2;
  color: var(--text-muted);
  overflow-wrap: anywhere;
}
.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;
}
/* #2222: one meta line "store · validity · amount and unit price"; it wraps,
   never cuts. */
.offer-meta {
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.35;
  color: var(--text-muted);
}

/* Vegan presentation hint. #2297 (owner 2026-11-01): on the card an amber
   "!" on the picture tile opens the warning; the card keeps its height. The
   44 px button is a sibling of the card link; its 20 px badge sits 4 px past
   the tile's bottom-right corner (52 px tile at 12 px padding; a caption
   wrapper centres it in 64 px, +6 px). The detail page renders the
   explanation as a multi-line attention notice box (.ui-notice). */
.offer-card-shell > .vegan-hint {
  position: absolute;
  top: 24px;
  left: 24px;
  width: 44px;
  height: 44px;
}
.offer-card-shell > .vegan-hint--caption {
  left: 30px;
}
.vegan-hint-icon {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.vegan-hint-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: var(--notice-attention-fg);
  color: var(--notice-attention-bg);
  font-size: 0.75rem;
  font-weight: 800;
  line-height: 1;
}
.vegan-hint-icon:focus-visible {
  outline: none;
}
.vegan-hint-icon:focus-visible > .vegan-hint-dot {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
.vegan-hint-pop {
  position: fixed;
  z-index: 30;
  inset: auto;
  width: max-content;
  max-width: min(280px, calc(100vw - 16px));
  margin: 0;
  padding: 8px 10px;
  border: 1px solid var(--outline-variant);
  border-radius: 12px;
  background: var(--notice-attention-bg);
  color: var(--text);
  font-size: 0.75rem;
  line-height: 1.4;
  box-shadow: 0 4px 16px rgba(20, 32, 20, 0.18);
}
.vegan-hint-pop > strong {
  display: block;
  color: var(--notice-attention-fg);
}
.vegan-hint-text {
  margin: 0;
  padding: 7px 9px;
  border-radius: 12px;
  background: var(--notice-attention-bg);
  color: var(--text);
  font-size: 0.75rem;
  line-height: 1.4;
}
.vegan-hint--detail .vegan-hint-text {
  margin-top: 2px;
  padding: 0;
  background: transparent;
  font-size: 0.875rem;
  line-height: 1.45;
}

.shopping-list-card-add {
  position: absolute;
  z-index: 2;
  top: 8px;
  right: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--outline-variant);
  border-radius: 50%;
  background: var(--surface-high);
  color: var(--primary-strong);
  cursor: pointer;
}
.shopping-list-card-add.is-added {
  border-color: var(--primary);
  background: var(--primary-container);
}
.shopping-list-card-add:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
/* Per-offer validity text in the card meta line (Variante-C texts unchanged,
   #2222: toned text, no pill): neutral, expired = quiet,
   active-ends-today = attention. */
.offer-window-badge[data-tone='neutral'] {
  color: var(--notice-neutral-fg);
  font-weight: 600;
}
.offer-window-badge[data-tone='attention'] {
  color: var(--notice-attention-fg);
  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 {
  margin-right: 2px;
  vertical-align: 2px;
}
/* #2222: on the card the program is small bold text right before the price;
   brand green, attention amber when the price needs the card. */
.price-label--inline {
  margin-right: 0;
  vertical-align: baseline;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--notice-brand-fg);
}
.price-label--inline.price-label--required {
  color: var(--notice-attention-fg);
}
.price-regular {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
}
.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;
}
.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 --notice-attention-bg).
   ====================================================================== */

/* — Card → detail navigation (whole card is the link) — */
.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;
}

@media (hover: hover) {
  .offer-card-shell:hover {
    border-color: var(--primary);
  }
  .offer-card--link:hover {
    border-color: var(--primary);
  }
  .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,
.detail-product-caption {
  margin: 6px 0 0;
  font-size: 0.75rem;
  color: var(--text-muted);
  overflow-wrap: anywhere;
}

.detail-product-source {
  display: inline-block;
  margin-top: 6px;
  font-size: 0.875rem;
}
.produce-source-entry {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--outline-variant);
  scroll-margin-top: 96px;
}
.produce-source-entry:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 4px;
}
.produce-source-preview {
  flex: 0 0 96px;
  width: 96px;
  height: 96px;
  object-fit: contain;
  border-radius: 8px;
  background: var(--surface-high);
}
.produce-source-body {
  min-width: 0;
  overflow-wrap: anywhere;
}
.produce-source-type {
  margin: 0 0 8px;
  font-size: 1rem;
}

/* 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;
}

/* — 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;
}
.detail-shopping-list {
  width: 100%;
  min-height: 48px;
  font-weight: 800;
}
.detail-snapshot-notice { margin: 0 0 12px; color: var(--text-muted); }
.detail-flyer,
.detail-share {
  background: transparent;
  border-color: var(--outline-variant);
  color: var(--text);
}
.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;
}

/* Einkaufszettel --------------------------------------------------------- */
.settings-shopping-list-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: inherit;
  text-decoration: none;
}
.settings-shopping-list-link:hover { border-color: var(--primary); }
.settings-shopping-list-title { font-weight: 800; }
.settings-shopping-list-count { color: var(--primary-strong); font-size: 0.875rem; font-weight: 700; }
.shopping-list { gap: 12px; padding-bottom: 76px; }
.shopping-list-input-row { display: flex; gap: 8px; align-items: stretch; }
.shopping-list-input {
  min-width: 0;
  flex: 1 1 auto;
  min-height: 48px;
  padding: 0 12px;
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-btn);
  background: var(--surface);
  color: var(--text);
  font: inherit;
}
.shopping-list-input:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.shopping-list-inline-hint { margin: 6px 4px 0; color: var(--notice-attention-fg); font-size: 0.8125rem; }
.shopping-list-inline-hint.is-error { color: var(--notice-critical-fg); }
.shopping-list-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
}
.shopping-list-remove-checked {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 6px 13px;
  border: 1px solid var(--primary);
  border-radius: var(--radius-pill);
  background: var(--primary-container);
  color: var(--on-primary-container);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 800;
  cursor: pointer;
}
.shopping-list-remove-checked:hover { background: var(--surface-high); color: var(--text); }
.shopping-list-remove-checked:focus-visible,
.shopping-list-clear:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.shopping-list-remove-checked-icon { font-size: 1rem; line-height: 1; }
/* #1463: eigener Button-Reset statt `.link-btn`. Die Unterstreichung von
   `.link-btn` liess die destruktive Aktion wie einen Textlink aussehen; die
   App zeigt hier einen gedaempften Textbutton ohne Unterstreichung. */
.shopping-list-clear {
  min-height: 32px;
  padding: 4px 9px;
  border: 0;
  border-radius: var(--radius-btn);
  background: none;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.shopping-list-clear:hover { color: var(--text); background: var(--surface-high); }
.shopping-list-empty { padding: 54px 20px; text-align: center; }
.shopping-list-empty h2 { margin: 12px 0 6px; }
.shopping-list-empty p { margin: 0; }
.shopping-list-empty-icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin-inline: auto;
  border-radius: 50%;
  background: var(--primary-container);
  color: var(--on-primary-container);
  font-size: 1.6rem;
}
.shopping-list-group { margin-top: 6px; }
/* Trennung zwischen Maerkten lebt vom Abstand, nicht von Linien neben dem
   Logo (Owner-Feedback 21.08.); Haarlinien gibt es nur ZWISCHEN Zeilen. */
.shopping-list-group + .shopping-list-group { margin-top: 26px; }
.shopping-list-group-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 32px;
  margin: 0;
  color: var(--text);
  font-size: 0.875rem;
}
.shopping-list-group-title img { width: 96px; height: 36px; object-fit: contain; }
.shopping-list-group-glyph {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--surface-high);
  color: var(--primary-strong);
  font-size: 1.1rem;
}
.shopping-list-group-fallback { font-weight: 800; }
.shopping-list-group-items { display: grid; }
.shopping-list-group-items .shopping-list-row + .shopping-list-row { border-top: 1px solid var(--outline-variant); }
.shopping-list-row {
  position: relative;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto 40px 40px;
  gap: 10px;
  align-items: center;
  min-height: 62px;
  padding: 10px 4px;
  transition: transform 150ms ease;
  touch-action: pan-y;
}
.shopping-list-row.is-swiping {
  background: linear-gradient(90deg, var(--surface) 0%, var(--surface) 75%, var(--notice-attention-bg) 100%);
  transition: none;
}
.shopping-list-image {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  overflow: hidden;
  border-radius: 10px;
  background: var(--surface-high);
  color: var(--text-muted);
}
.shopping-list-image img { display: block; width: 100%; height: 100%; object-fit: contain; }
/* Real product photos are cut-outs on white/transparent ground: drop the chip
   box for them, keep it only while the placeholder glyph is showing. Same
   :has() baseline as the toast dodge rules below. */
.shopping-list-image:has(img:not([hidden])) { background: none; }
.shopping-list-image-fallback { display: grid; place-items: center; width: 100%; height: 100%; }
.shopping-list-image-fallback svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.is-checked .shopping-list-image { filter: grayscale(1); opacity: 0.45; }
.shopping-list-content { min-width: 0; color: inherit; text-decoration: none; }
a.shopping-list-content:hover .shopping-list-item-title { color: var(--primary-strong); text-decoration: underline; }
.shopping-list-item-title { margin: 0; font-size: 0.9375rem; line-height: 1.3; }
.is-checked .shopping-list-item-title { color: var(--text-muted); text-decoration: line-through; }
.shopping-list-meta {
  margin: 3px 0 0;
  overflow: hidden;
  color: var(--text-muted);
  font-size: 0.75rem;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.shopping-list-meta > span { display: inline-block; max-width: 100%; }
/* #1617 A2: card-only warning under the meta line (attention Label). */
.shopping-list-loyalty { margin-top: 4px; }
.shopping-list-controls { display: flex; align-items: center; gap: 1px; }
.shopping-list-step {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 36px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 1.2rem;
  cursor: pointer;
}
.shopping-list-check {
  width: 36px;
  height: 36px;
  border: 2px solid var(--outline-variant);
  border-radius: 50%;
  background: transparent;
  color: var(--primary-strong);
  cursor: pointer;
}
.shopping-list-check[aria-checked='true']::before { content: '✓'; font-size: 1.25rem; font-weight: 800; }
.shopping-list-check[aria-checked='true'] { border-color: var(--primary); background: var(--primary-container); }
.shopping-list-check:focus-visible,
.shopping-list-step:focus-visible,
.shopping-list-delete:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.shopping-list-delete {
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--surface);
  color: var(--danger);
  font-size: 1.2rem;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
}
.shopping-list-step:disabled { opacity: 0.4; cursor: default; }
.shopping-list-count { text-align: center; font-weight: 800; }
.shopping-list-row:hover .shopping-list-delete,
.shopping-list-row:focus-within .shopping-list-delete {
  opacity: 1;
  pointer-events: auto;
}
.shopping-list-composer {
  position: fixed;
  z-index: 35;
  right: 16px;
  bottom: max(16px, env(safe-area-inset-bottom));
  left: 16px;
  width: min(520px, calc(100% - 32px));
  margin-inline: auto;
  padding: 14px;
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: 0 8px 28px rgb(0 0 0 / 24%);
}
.shopping-list-composer-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.shopping-list-composer-head h2 { margin: 0 0 10px; font-size: 1rem; }
.shopping-list-composer-close {
  width: 40px;
  height: 40px;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.shopping-list-fab {
  position: fixed;
  z-index: 30;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 0;
  border-radius: 50%;
  background: var(--primary);
  color: var(--fab-fg);
  box-shadow: 0 5px 18px rgb(0 0 0 / 25%);
  font-size: 1.8rem;
  cursor: pointer;
}
/* Floating controls step above the (single) toast. This relies on :has(),
   matching the existing app-wide :has() dependency. Baseline: Chrome 105+,
   Safari 15.4+ and Firefox 121+; older engines keep usable controls without
   avoidance. */
body:has(.ui-toast) .search-field.is-open,
body:has(.ui-toast) .shopping-list-composer,
body:has(.ui-toast) .search-fab,
body:has(.ui-toast) .shopping-list-fab {
  bottom: max(76px, calc(env(safe-area-inset-bottom) + 76px));
}

@media (max-width: 480px) {
  .shopping-list-input-row .btn { padding-inline: 12px; }
  .shopping-list-row { grid-template-columns: 40px minmax(0, 1fr) auto 36px 36px; gap: 5px; }
  .shopping-list-content { grid-column: 2 / -1; }
  .shopping-list-controls { grid-column: 3; grid-row: 2; }
  .shopping-list-check { grid-column: 4; grid-row: 2; }
  .shopping-list-delete { grid-column: 5; grid-row: 2; }
  .shopping-list-meta {
    display: -webkit-box;
    white-space: normal;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }
  .shopping-list-step { width: 28px; }
}

/* — 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-row { align-items: center; }
.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;
  }
  .desktop-menu {
    position: absolute;
    z-index: 60;
    top: calc(100% + 4px);
    right: 0;
    display: flex;
    flex-direction: column;
    width: max-content;
    min-width: 250px;
    padding: 6px;
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-card);
    background: var(--surface);
    box-shadow: 0 10px 30px rgb(0 0 0 / 22%);
  }
  .desktop-menu-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    min-height: 42px;
    padding: 8px 10px;
    border-radius: var(--radius-btn);
    color: var(--text);
    text-decoration: none;
  }
  .desktop-menu-item:hover,
  .desktop-menu-item:focus-visible { background: var(--surface-high); }
  .desktop-menu-item:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
  .desktop-menu-item[aria-current='page'] {
    background: var(--primary-container);
    color: var(--on-primary-container);
    font-weight: 800;
  }
  .desktop-menu-item-label { font-size: 0.875rem; }
  .desktop-menu-item-meta {
    color: var(--primary-strong);
    font-size: 0.75rem;
    font-weight: 800;
    white-space: nowrap;
  }
  .desktop-menu-item[aria-current='page'] .desktop-menu-item-meta { color: inherit; }
  .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;
  }
}

/* Further directory stores are informational; no selection surface. */
.location-further-stores { padding: 12px; border-top: 1px solid var(--surface-border); }
.location-further-heading { font-size: 1rem; margin: 0 0 8px; }
.location-further-explanation { margin: 8px 0; }
.location-further-store { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 10px 0; }
.location-further-store small { color: var(--text-muted); }
.location-further-skip { margin-top: 8px; }
