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

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

.storage-note {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  color: var(--text-muted);
  font-size: 0.875rem;
}
.storage-note .icon {
  display: inline-flex;
  color: var(--primary-strong);
}

/* Onboarding uses the same market selector as /markt, but without card chrome.
   Centered: the home route view is 1160px wide on desktop and a left-hugging
   560px column would look accidental there. */
.onboarding {
  width: 100%;
  max-width: 560px;
  margin-inline: auto;
}
.onboarding .section-title {
  margin: 0 0 0.375rem;
  font-size: 1.5rem;
  line-height: 1.2;
}
.onboarding > .text-muted {
  margin: 0 0 24px;
}
.onboarding .market-select-form {
  gap: 24px;
}
.onboarding .market-plz-field input {
  width: 10ch;
  max-width: 100%;
}
.onboarding .market-radius-field select {
  width: max-content;
  max-width: 100%;
}
.onboarding .market-logo-grid {
  gap: 8px;
}
.onboarding .market-logo-btn {
  min-height: 72px;
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-btn);
  background: transparent;
  box-shadow: none;
}
.onboarding .market-logo-btn.is-selected {
  /* inset shadow doubles the 1px border to a 2px ring WITHOUT changing the
     border-box size, so selecting a market never shifts the grid by 1px. */
  border-color: var(--primary);
  box-shadow: inset 0 0 0 1px var(--primary);
  background: var(--chip-bg);
}
.onboarding .market-logo-btn:not(.is-selected) .market-logo {
  filter: grayscale(1);
  opacity: 0.72;
}
.onboarding .market-logo-btn.is-selected .market-logo {
  filter: none;
  opacity: 1;
}
.onboarding .storage-note,
.onboarding .disclaimer {
  max-width: 520px;
  color: var(--text-muted);
  font-size: 0.75rem;
  line-height: 1.45;
}
.onboarding .storage-note {
  align-items: flex-start;
  margin-bottom: -18px;
}
.onboarding .storage-note .icon {
  margin-top: 1px;
  color: var(--text-muted);
}
.onboarding .btn.block {
  width: 100%;
  max-width: 320px;
}

@media (min-width: 560px) {
  .onboarding .market-select-form {
    display: grid;
    grid-template-columns: auto auto;
    justify-content: start;
    align-items: start;
    column-gap: 18px;
    row-gap: 24px;
  }
  .onboarding .market-select-form > * {
    grid-column: 1 / -1;
  }
  .onboarding .market-select-form > .market-plz-field,
  .onboarding .market-select-form > .market-radius-field {
    grid-column: auto;
  }
}

/* — 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) — */
.tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}
.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
   any state; the pressed background indicates the active tab (same treatment as
   the verified market-select logo buttons). */
.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);
}

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

/* — Flyer period line — */
.flyer-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  font-size: 0.875rem;
  color: var(--text-muted);
}
.flyer-link {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}
.flyer-link:hover {
  text-decoration: underline;
}

/* — 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) — */
.chips-scroller {
  position: relative;
}
.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;
}
.chips-row .chip[aria-pressed='true'] {
  background: var(--chip-bg);
  border-color: var(--outline-variant);
  color: var(--text);
  box-shadow: inset 0 -2.5px 0 var(--primary);
}
.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;
}
.chips-row .chip[aria-pressed='true'] .chip-count {
  background: var(--primary-container);
  color: var(--on-primary-container);
}

/* — 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-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 14px;
  color: var(--text-muted);
}
.feed-pager-pages {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
}
.feed-pager-btn {
  min-width: 32px;
  height: 32px;
  padding: 0 9px;
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--text);
  font-size: 0.8125rem;
  font-weight: 700;
  cursor: pointer;
}
.feed-pager-btn[aria-current='page'] {
  background: var(--chip-bg);
  color: var(--on-primary-container);
  border-color: transparent;
}
.feed-pager-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.feed-pager-arrow {
  font-size: 1rem;
}
.feed-pager-ellipsis {
  min-width: 24px;
  text-align: center;
  font-size: 0.8125rem;
}
.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;
}

/* — Offer card v2 — */
.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);
}

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

/* Trust hint (card, compact). */
.trust-hint {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  max-width: 100%;
  min-width: 0;
  flex: 0 1 auto;
  color: var(--text);
}
.trust-hint-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  border: 1px solid var(--warn-border);
  border-radius: 50%;
  background: var(--warn-bg);
  color: var(--warn-accent);
}
.trust-hint-icon svg {
  width: 13px;
  height: 13px;
}
.trust-hint-text {
  min-width: 0;
  overflow-wrap: anywhere;
  white-space: normal;
  text-align: right;
  font-size: 0.6875rem;
  font-weight: 800;
  line-height: 1.2;
}

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

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

/* — Long-form trust hint (amber, calm) — */
.detail-trust {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px;
  border: 1px solid var(--warn-border);
  border-radius: var(--radius-card);
  background: var(--warn-bg);
}
.detail-trust-head {
  display: flex;
  align-items: center;
  gap: 8px;
}
.detail-trust-icon {
  display: inline-flex;
  flex: 0 0 auto;
  color: var(--warn-accent);
}
.detail-trust-title {
  color: var(--text);
  font-size: 0.9375rem;
  font-weight: 800;
}
.detail-trust-body {
  margin: 0;
  color: var(--text);
  font-size: 0.875rem;
  line-height: 1.5;
}

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

/* ======================================================================
   Marktauswahl — retailer logo grid, radius row, candidate list, prospect-
   source hints, "Dein Markt" confirmed line. Theme-aware via tokens.
   Text pairs reuse verified pairings (var(--text) / var(--text-muted) /
   var(--primary) on --surface, all ≥4.5:1 in both modes). The warning hint
   keeps var(--text) for the text and only tints the ICON with --warn-accent
   (same contrast-safe split as .trust-hint), because --warn-accent as text on
   --surface-high / --chip-bg dips below 4.5:1.
   ====================================================================== */

/* — Retailer logo buttons (grid, multi-select, greyscale when unselected) — */
.market-retailers-hint {
  margin: 0 0 4px;
  font-size: 0.875rem;
}
.market-logo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}
/* Boxed retailer cards — App-Wizard-Parität (_RetailerSelectionCard): a bordered
   surface tile per market, NOT the box-less feed-tab underline. Selected = a
   primary border + a subtle primary tint. box-sizing:border-box keeps the tile
   size stable when the border thickens on selection (no layout shift). The feed
   tabs (.tab--logo) stay box-less on purpose. */
.market-logo-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 78px;
  padding: 10px;
  border: 1px solid var(--outline-variant);
  border-radius: 14px;
  background: var(--surface-high);
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease;
}
.market-logo-btn.is-selected {
  border: 2px solid var(--primary);
  background: color-mix(in srgb, var(--primary) 12%, var(--surface));
}
.market-logo-btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
/* Uniform logo box (App parity): a single fixed box for every retailer, sized
   to REWE's aspect; smaller logos get padding via object-fit:contain so none
   dominates. Full colour, no greyscale/box. */
.market-logo {
  width: 108px;
  height: 44px;
  object-fit: contain;
}
.market-logo-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 108px;
  height: 44px;
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.1;
  text-align: center;
  white-space: normal;
}

/* — Per-retailer detail area — */
.market-details {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.market-details:empty {
  display: none;
}

/* — Candidate section (one per selected LOCAL retailer) — */
.market-store-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.market-store-head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 8px;
}
.market-store-retailer {
  font-size: 0.8125rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--text);
}
.market-store-title {
  font-size: 0.8125rem;
  color: var(--text-muted);
}
.market-store-body {
  display: flex;
  flex-direction: column;
}
.market-store-empty {
  margin: 0;
  font-size: 0.875rem;
}

/* — Candidate list rows (radio semantics) — */
.market-store-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.market-store {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-field);
  background: var(--surface);
  text-align: left;
  cursor: pointer;
}
.market-store:hover {
  background: var(--surface-high);
}
.market-store.is-selected {
  border-color: var(--primary);
  /* keep the fill on --surface so the warning hint text stays ≥4.5:1 */
  box-shadow: inset 0 0 0 1px var(--primary);
}
.market-store:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
.market-store-info {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.market-store-name {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text);
}
.market-store-addr {
  font-size: 0.8125rem;
  color: var(--text-muted);
}
.market-store-check {
  flex: 0 0 auto;
  align-self: center;
  display: inline-flex;
  color: var(--primary);
}

/* — Prospect-source hint (near-me = calm muted; unavailable = amber icon) — */
.market-hint {
  display: flex;
  align-items: flex-start;
  gap: 4px;
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.3;
}
.market-hint-icon {
  flex: 0 0 auto;
  display: inline-flex;
  margin-top: 1px;
  color: var(--text-muted);
}
.market-hint--warn {
  color: var(--text);
}
.market-hint--warn .market-hint-icon {
  color: var(--warn-accent);
}

/* — "Dein Markt" confirmed line (compact, with a change control) — */
.market-chosen {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--primary);
  border-radius: var(--radius-field);
  background: var(--surface);
}
.market-chosen-info {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.market-chosen-label {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text);
}
.market-chosen-addr {
  font-size: 0.8125rem;
  color: var(--text-muted);
}
.market-chosen .link-btn {
  flex: 0 0 auto;
}

/* — National retailer note (toggle-only, no store list) — */
.market-national {
  padding: 6px 2px;
}
.market-national-text {
  font-size: 0.875rem;
  color: var(--text-muted);
}

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