/* === products (agent 3) === */
/* Product finder. Uses only theme variables from app.css (no hard-coded colors). */
.prd-page { gap: var(--space-4); }
.prd-sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.prd-header h1 { font-size: var(--fs-xl); font-weight: var(--fw-bold); line-height: 1.1; }
.prd-header .muted { font-size: var(--fs-sm); }

/* search */
.prd-search { display: flex; flex-direction: column; gap: var(--space-3); padding: var(--space-4); }
.prd-search-row { display: flex; gap: var(--space-2); align-items: center; }
.prd-q.input {
  flex: 1; min-width: 0; min-height: 48px; padding: 0 var(--space-5);
  border-radius: var(--radius-pill); border-color: transparent; background: var(--surface-2);
  box-shadow: 0 1px 0 var(--bg), 0 0 0 1px var(--muted) inset;
  font-size: var(--fs-md);
}
.prd-q.input:hover { box-shadow: 0 1px 0 var(--bg), 0 0 0 1px var(--text) inset; }
.prd-q.input:focus-visible { box-shadow: 0 0 0 2px var(--text) inset, var(--focus-ring); }
.prd-go.btn { min-height: 48px; border-radius: var(--radius-pill); padding: 0 var(--space-5); text-transform: uppercase; letter-spacing: 1.4px; font-weight: var(--fw-bold); }
.prd-chips, .prd-suggest { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.prd-suggest { justify-content: center; margin-top: var(--space-2); }
.prd-chip.chip { border-color: transparent; background: var(--surface-2); color: var(--text); font-weight: var(--fw-bold); }
.prd-chip.chip:hover { background: color-mix(in srgb, var(--text) 12%, var(--surface-2)); }

.prd-note-text { font-size: var(--fs-xs); line-height: 1.5; }
.prd-note-text .badge-sample { margin-right: var(--space-1); }
.prd-note-text a { color: var(--text); font-weight: var(--fw-bold); }

/* layout: filters bar above full-width results */
.prd-layout { display: flex; flex-direction: column; gap: var(--space-4); min-width: 0; }
.prd-main { display: flex; flex-direction: column; gap: var(--space-4); min-width: 0; }
.prd-filter-toggle { display: none; }
.prd-filters.card { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-3); padding: var(--space-3) var(--space-4); }
.prd-field { display: flex; flex-direction: column; gap: 4px; min-width: 130px; flex: 1 1 130px; border: 0; padding: 0; margin: 0; }
.prd-field > label, .prd-field > legend { font-size: var(--fs-xs); font-weight: var(--fw-bold); color: var(--muted); padding: 0; }
.prd-field .select, .prd-field .input { min-height: 38px; font-size: var(--fs-sm); border-radius: var(--radius-pill); border-color: transparent; background-color: var(--surface-2); box-shadow: 0 0 0 1px var(--line) inset; }
.prd-field .select { padding-left: var(--space-3); }
.prd-price { flex: 1.4 1 190px; }
.prd-price-row { display: flex; align-items: center; gap: var(--space-2); }
.prd-price-row .input { min-width: 0; }
.prd-clear.btn { min-height: 38px; border-radius: var(--radius-pill); text-transform: uppercase; letter-spacing: 1.4px; font-size: var(--fs-xs); font-weight: var(--fw-bold); }

.prd-count { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); font-size: var(--fs-sm); }
.prd-intent-tags { display: inline-flex; flex-wrap: wrap; gap: var(--space-1); }

/* results grid: 5 -> 3 -> 2 -> 1 columns, by available width */
.prd-results { container-type: inline-size; min-width: 0; }
.prd-grid { display: grid; gap: var(--space-4); grid-template-columns: 1fr; }
@container (min-width: 420px) { .prd-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@container (min-width: 660px) { .prd-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@container (min-width: 1040px) { .prd-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }

/* product card (album-card style) */
.prd-card {
  position: relative; display: flex; flex-direction: column; gap: var(--space-2); min-width: 0;
  background: var(--surface); border-radius: 8px; padding: var(--space-3);
  box-shadow: var(--shadow);
  transition: background var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.prd-card:hover { background: var(--surface-2); box-shadow: var(--shadow-lg); }
.prd-card.prd-top { box-shadow: 0 0 0 2px var(--good) inset, var(--shadow-lg); }
.prd-card.is-comparing { box-shadow: 0 0 0 2px var(--text) inset, var(--shadow); }
.prd-card.prd-top.is-comparing { box-shadow: 0 0 0 2px var(--good) inset, 0 0 0 4px var(--text) inset, var(--shadow-lg); }
.prd-card-top { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); min-height: 36px; }
.prd-cat { font-size: var(--fs-xs); font-weight: var(--fw-bold); color: var(--muted); text-transform: uppercase; letter-spacing: 1.4px; }
.prd-ribbon {
  display: inline-flex; align-items: center; padding: 3px var(--space-2); border-radius: var(--radius-pill);
  background: var(--good); color: var(--accent-ink); font-size: var(--fs-xs); font-weight: var(--fw-bold);
  text-transform: uppercase; letter-spacing: 1px; white-space: nowrap;
}
.prd-icons { display: flex; gap: var(--space-1); flex-shrink: 0; }
.prd-circle {
  width: 36px; height: 36px; border-radius: 50%; border: 0; padding: 0;
  display: inline-grid; place-items: center; cursor: pointer;
  background: var(--surface-2); color: var(--text); font-size: var(--fs-md); line-height: 1;
  box-shadow: 0 0 0 1px var(--line) inset;
  transition: transform var(--dur) var(--ease), background var(--dur) var(--ease);
}
.prd-circle:hover:not(:disabled) { transform: scale(1.06); background: color-mix(in srgb, var(--text) 14%, var(--surface-2)); }
.prd-circle:disabled { opacity: 0.4; cursor: not-allowed; }
.prd-circle:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.prd-circle.is-on { background: var(--text); color: var(--bg); box-shadow: none; }
.prd-star.is-on { background: var(--text); color: var(--bg); }

.prd-title { font-size: var(--fs-sm); font-weight: var(--fw-bold); line-height: 1.3; color: var(--text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.prd-model { font-size: var(--fs-xs); color: var(--muted); margin-top: -4px; }
.prd-rating { display: flex; align-items: center; gap: 6px; font-size: var(--fs-xs); color: var(--muted); font-weight: var(--fw-bold); }
.prd-stars { --r: 80%; position: relative; display: inline-block; width: 70px; height: 12px; font-size: 12px; line-height: 12px; letter-spacing: 2px; }
.prd-stars::before, .prd-stars::after { content: "★★★★★"; position: absolute; inset: 0; overflow: hidden; white-space: nowrap; }
.prd-stars::before { color: var(--line); }
.prd-stars::after { color: var(--text); width: var(--r); }
.prd-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.prd-tags .tag { font-size: 11px; padding: 1px 7px; border-radius: 4px; }

.prd-price-block { margin-top: auto; padding-top: var(--space-2); }
.prd-best-label { font-size: 11px; font-weight: var(--fw-bold); color: var(--muted); text-transform: uppercase; letter-spacing: 1.2px; }
.prd-best { font-size: var(--fs-xl); font-weight: var(--fw-bold); line-height: 1.15; font-variant-numeric: tabular-nums; color: var(--text); }
.prd-top .prd-best { color: var(--good); }
.prd-best-at { font-size: var(--fs-xs); color: var(--muted); }
.prd-best-at strong { color: var(--text); }
.prd-badges { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.prd-badges .tag { font-size: 11px; }

/* compact offer list */
.prd-offers { width: 100%; border-collapse: collapse; font-size: var(--fs-xs); margin-top: var(--space-1); }
.prd-offers th, .prd-offers td { padding: 6px 0; border-top: 1px solid var(--line); vertical-align: top; text-align: left; font-weight: var(--fw-regular); }
.prd-offers th { color: var(--text); padding-right: var(--space-2); }
.prd-offers th { font-weight: var(--fw-bold); }
.prd-offers td { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.prd-offer-note { display: block; font-size: 11px; color: var(--muted); font-weight: var(--fw-regular); }
.prd-was { display: block; font-size: 11px; color: var(--muted); }
.prd-win th, .prd-win td { color: var(--good); font-weight: var(--fw-bold); }
.prd-win .prd-offer-note { color: var(--good); font-weight: var(--fw-bold); }
/* out of stock: dimmed with the muted color, not opacity, so it still meets 4.5:1 */
.prd-oos th, .prd-oos td { color: var(--muted); }
.prd-oos td.prd-num { text-decoration: line-through; }
/* "Buy at X" link: neutral pill (green stays reserved for the winner and primary CTAs) */
.prd-offers td.prd-buy-cell { width: 1%; padding-left: var(--space-2); vertical-align: middle; }
.prd-buy { display: inline-flex; align-items: center; justify-content: center; min-height: 26px; padding: 0 10px;
  border-radius: var(--radius-pill); background: var(--surface-3); color: var(--text); font-size: 11px;
  font-weight: var(--fw-bold); letter-spacing: var(--btn-tracking); text-transform: uppercase; text-decoration: none; }
.prd-buy:hover { background: var(--surface-hover); }
.prd-buy:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.prd-oos .prd-buy { color: var(--muted); }
/* affiliate disclosure: always visible above the offers */
.prd-disclosure { margin: 0 0 var(--space-3); font-size: var(--fs-xs); color: var(--muted); line-height: var(--lh); }
.prd-disclosure a { color: var(--text); text-decoration: underline; }
.prd-disclosure-extra { margin-top: calc(-1 * var(--space-2)); }
.prd-attribution { margin: var(--space-3) 0 0; }
/* Retailer policies: price-less "Check price on X" rows, set apart from the ranked prices. */
.prd-checkprice .prd-checkprice-head th { padding-top: var(--space-2); border-top: 1px dashed var(--line); color: var(--muted); font-weight: var(--fw-regular); }
.prd-offers td.prd-checkprice-cell { text-align: right; }
.prd-checkprice-link { color: var(--text); text-decoration: underline; }

/* empty / loading */
.prd-empty { gap: var(--space-2); border-style: none; background: var(--surface); }
.prd-empty-title { font-size: var(--fs-lg); }
.prd-skel { min-height: 160px; background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%); background-size: 200% 100%; animation: prd-shimmer 1.2s linear infinite; border: 0; }
@keyframes prd-shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .prd-skel { animation: none; } .prd-circle, .prd-card { transition: none; } }

/* compare */
.prd-compare.card { padding: var(--space-4); box-shadow: var(--shadow-lg); border: 0; }
.prd-compare:focus { outline: none; }
.prd-compare-head { justify-content: space-between; margin-bottom: var(--space-3); }
.prd-compare-head h2, .prd-watch h2 { font-size: var(--fs-lg); font-weight: var(--fw-bold); }
.prd-compare-head .btn { border-radius: var(--radius-pill); text-transform: uppercase; letter-spacing: 1.4px; font-size: var(--fs-xs); font-weight: var(--fw-bold); }
.prd-compare-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 calc(-1 * var(--space-2)); }
.prd-compare-table { min-width: 520px; }
.prd-compare-table th, .prd-compare-table td { padding: var(--space-2); font-size: var(--fs-xs); vertical-align: top; }
.prd-compare-table thead th { text-transform: none; letter-spacing: 0; color: var(--text); font-size: var(--fs-xs); min-width: 140px; }
.prd-compare-table tbody th { color: var(--muted); white-space: nowrap; text-transform: none; letter-spacing: 0; font-weight: var(--fw-bold); position: sticky; left: 0; background: var(--surface); }
.prd-best-cell { color: var(--good); font-weight: var(--fw-bold); background: color-mix(in srgb, var(--good) 12%, transparent); }
.prd-sub { font-size: 11px; font-weight: var(--fw-regular); margin-top: 2px; }

/* watchlist */
.prd-watch.card { padding: var(--space-4); border: 0; }
.prd-watch h2 { margin-bottom: var(--space-2); }
.prd-watch-list { list-style: none; margin: 0; padding: 0; }
.prd-watch-item { display: grid; grid-template-columns: 1fr auto auto; gap: var(--space-3); align-items: center; padding: var(--space-2) 0; border-top: 1px solid var(--line); }
.prd-watch-item:first-child { border-top: 0; }
.prd-watch-info { min-width: 0; }
.prd-link { background: none; border: 0; padding: 0; color: var(--text); font: inherit; font-size: var(--fs-sm); font-weight: var(--fw-bold); text-align: left; cursor: pointer; }
.prd-link:hover { text-decoration: underline; }
.prd-link:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 2px; }
.prd-watch-price { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.prd-watch-now { font-weight: var(--fw-bold); font-variant-numeric: tabular-nums; }
.prd-x-btn.btn { min-height: 32px; border-radius: var(--radius-pill); text-transform: uppercase; letter-spacing: 1.4px; font-size: 11px; font-weight: var(--fw-bold); padding: 0 var(--space-3); }

/* compare tray */
.prd-tray {
  position: sticky; bottom: var(--space-3); z-index: 20;
  background: var(--surface-2); border-radius: 8px; padding: var(--space-2) var(--space-3);
  box-shadow: var(--shadow-lg);
}
.prd-tray[hidden] { display: none; }
.prd-tray-inner { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); flex-wrap: wrap; }
.prd-tray-items { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; min-width: 0; }
.prd-tray-chip.chip { cursor: default; color: var(--text); background: var(--surface); border-color: transparent; padding-right: 4px; font-size: var(--fs-xs); }
.prd-x { width: 24px; height: 24px; border-radius: 50%; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: var(--fs-md); line-height: 1; }
.prd-x:hover { color: var(--text); background: var(--surface-2); }
.prd-x:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.prd-tray-hint { font-size: var(--fs-xs); }
.prd-tray-btns { gap: var(--space-2); flex-wrap: nowrap; }
.prd-tray-btns .btn { min-height: 38px; border-radius: var(--radius-pill); text-transform: uppercase; letter-spacing: 1.4px; font-size: var(--fs-xs); font-weight: var(--fw-bold); }

/* mobile */
@media (max-width: 699px) {
  /* keep the compare tray above the shell's fixed bottom tab bar */
  .prd-tray { bottom: calc(var(--tabbar-h, 64px) + var(--space-2) + env(safe-area-inset-bottom, 0px)); }
}
@media (max-width: 720px) {
  .prd-filter-toggle.btn {
    display: inline-flex; align-self: flex-start; min-height: 36px; border-radius: var(--radius-pill);
    background: var(--surface-2); color: var(--text); border-color: transparent;
    text-transform: uppercase; letter-spacing: 1.4px; font-size: var(--fs-xs); font-weight: var(--fw-bold);
  }
  .prd-filterwrap { display: flex; flex-direction: column; gap: var(--space-2); }
  .prd-filters[data-open="false"] { display: none; }
  .prd-field { flex: 1 1 140px; }
  .prd-price { flex-basis: 100%; }
}
@media (max-width: 480px) {
  .prd-search { padding: var(--space-3); }
  .prd-q.input { padding: 0 var(--space-4); font-size: var(--fs-sm); }
  .prd-go.btn { padding: 0 var(--space-4); }
  .prd-header h1 { font-size: var(--fs-xl); }
  .prd-watch-item { grid-template-columns: auto 1fr auto; }
  .prd-watch-item .prd-x-btn { grid-column: 2 / -1; justify-self: start; }
  .prd-tray-btns { width: 100%; }
  .prd-tray-btns .btn { flex: 1; }
}
/* touch: 44px tap targets in the product finder */
@media (max-width: 699px), (pointer: coarse) {
  .prd-circle { width: var(--control-h); height: var(--control-h); }
  .prd-filter-toggle.btn, .prd-clear.btn, .prd-tray-btns .btn, .prd-x-btn.btn { min-height: var(--control-h); }
  .prd-field .select, .prd-field .input { min-height: var(--control-h); }
  .prd-x { width: var(--control-h); height: var(--control-h); margin: -8px -4px -8px 0; }
  .prd-buy { min-height: var(--control-h); min-width: var(--control-h); margin: 2px 0; }
  .prd-disclosure a { display: inline-flex; align-items: center; min-height: var(--control-h); }
  .prd-link { min-height: var(--control-h); }
}
/* product art / photos (art-frame from app.css) */
.prd-media { margin-bottom: var(--space-1); }
@container (max-width: 419px) { .prd-media { aspect-ratio: auto; height: 150px; } }
.prd-cmp-thumb { width: 96px; margin-bottom: var(--space-2); }
.prd-watch-item { grid-template-columns: auto minmax(0, 1fr) auto auto; }
.prd-watch-thumb { width: 44px; flex: none; }
.prd-dev-hint { white-space: nowrap; }
@media (max-width: 480px) {
  .prd-dev-hint { white-space: normal; }
  .prd-watch-item { grid-template-columns: auto minmax(0, 1fr) auto; }
}
/* price alerts: popover from the star, target inputs on watchlist rows, alert banner.
   Live alerts use the info blue; demo alerts (sample prices) are dashed and carry .badge-sample.
   Green stays reserved for winners and primary CTAs ("Set alert"). */
.prd-pop {
  display: flex; flex-direction: column; gap: var(--space-2);
  background: var(--surface-2); border-radius: 8px; padding: var(--space-3);
  box-shadow: rgba(0, 0, 0, 0.5) 0 8px 24px;
}
.prd-pop-h { font-size: var(--fs-xs); color: var(--muted); margin: 0; }
.prd-pop-h strong { color: var(--text); }
.prd-pop-btns { gap: var(--space-2); flex-wrap: wrap; }
.prd-pop-btns .btn, .prd-alert-buy.btn {
  min-height: 36px; border-radius: var(--radius-pill); text-transform: uppercase; letter-spacing: 1.4px;
  font-size: 11px; font-weight: var(--fw-bold); padding: 0 var(--space-3);
}
.prd-target { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; font-size: var(--fs-xs); color: var(--muted); font-weight: var(--fw-bold); }
.prd-target-field { display: inline-flex; align-items: center; gap: 4px; color: var(--text); }
.prd-target-input.input { width: 7.5em; min-height: 32px; padding: 0 var(--space-3); font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.prd-watch-head { justify-content: space-between; align-items: center; gap: var(--space-2); margin-bottom: var(--space-2); }
.prd-watch-head h2 { margin-bottom: 0; }
.prd-watch-alert { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-1) var(--space-3); margin-top: var(--space-1); }
.prd-anydrop { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-xs); color: var(--muted); cursor: pointer; }
.prd-anydrop input { width: 16px; height: 16px; accent-color: var(--text); }
.prd-alerts-badge {
  border: 0; cursor: pointer; border-radius: var(--radius-pill); padding: 4px var(--space-3); min-height: 28px;
  background: var(--info-soft); color: var(--info); font: inherit; font-size: var(--fs-xs); font-weight: var(--fw-bold);
}
.prd-alerts-badge:hover { background: color-mix(in srgb, var(--info) 24%, transparent); }
.prd-alerts-badge:focus-visible, .prd-alerts:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.prd-alerts { margin-bottom: var(--space-3); border-radius: 8px; }
.prd-alerts-h { font-size: var(--fs-sm); font-weight: var(--fw-bold); margin: 0 0 var(--space-2); }
.prd-alert-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.prd-alert {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap;
  background: var(--surface); border-radius: 8px; padding: var(--space-3); box-shadow: var(--shadow);
}
.prd-alert.is-live { box-shadow: 4px 0 0 var(--info) inset, var(--shadow); }
.prd-alert.is-demo { background: transparent; box-shadow: 0 0 0 1px var(--line) inset; outline: 1px dashed var(--warn); outline-offset: -1px; }
.prd-alert-body { min-width: 0; flex: 1 1 260px; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.prd-alert-kind { font-size: 11px; font-weight: var(--fw-bold); text-transform: uppercase; letter-spacing: 1.4px; color: var(--info); }
.prd-alert-text { margin: 0; font-size: var(--fs-sm); color: var(--muted); }
.prd-alert-text .prd-link { display: inline; }
.prd-alert-btns { gap: var(--space-2); flex-wrap: nowrap; align-items: center; }
.prd-alert-buy.btn { background: var(--surface-2); color: var(--text); border-color: transparent; text-decoration: none; display: inline-flex; align-items: center; }
.prd-alert-buy.btn:hover { background: var(--line); }
.prd-alerts .prd-disclosure { margin-top: var(--space-2); }
@media (max-width: 480px) {
  .prd-alert-btns { width: 100%; justify-content: space-between; }
}
@media (max-width: 699px), (pointer: coarse) {
  .prd-target-input.input, .prd-pop-btns .btn, .prd-alert-buy.btn, .prd-alerts-badge { min-height: var(--control-h); }
  .prd-anydrop { min-height: var(--control-h); }
  .prd-alert-text .prd-link { min-height: 0; }
}
/* === end products === */

/* === grocery (agent 2) === */
.gro-page { --gro-gap: var(--space-4); }
.gro-header { align-items: flex-start; }
.gro-h2 { font-size: var(--fs-lg); font-weight: var(--fw-bold); }
.gro-label { display: block; font-size: var(--fs-sm); font-weight: var(--fw-bold); margin-bottom: var(--space-2); }
.gro-link {
  background: none; border: 0; padding: 0; cursor: pointer;
  color: var(--text); font-size: var(--fs-xs); font-weight: var(--fw-bold);
  text-decoration: underline; text-underline-offset: 2px;
}
/* Text-style buttons keep a 24px-tall hit area (WCAG 2.5.8 target size). */
.gro-line-sub .gro-link { display: inline-flex; align-items: center; min-height: 24px; }
.gro-link:hover { color: var(--accent-hover); }
.gro-link:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: var(--radius-xs); }
.gro-from { color: var(--muted); }
/* phones: the "Settings › Advanced" link gets a 44px tap target */
@media (max-width: 720px) {
  .gro-dev-hint .gro-link { display: inline-flex; align-items: center; min-height: 44px; padding: 0 var(--space-2); margin: 0 calc(-1 * var(--space-2)); }
}

/* layout: stacked on mobile, list | compare on wide screens */
.gro-layout { display: grid; gap: var(--gro-gap); grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 960px) {
  .gro-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); }
  .gro-col-compare { position: sticky; top: var(--space-4); }
}

/* add form + autocomplete */
.gro-add-row { display: flex; gap: var(--space-2); align-items: stretch; }
.gro-combo { position: relative; flex: 1; min-width: 0; }
.gro-add-btn { flex: none; }
.gro-suggest {
  position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 6px);
  margin: 0; padding: var(--space-1); list-style: none;
  background: var(--surface-3); border-radius: var(--radius); box-shadow: var(--shadow-lg);
  max-height: 320px; overflow-y: auto;
}
.gro-opt {
  display: flex; flex-direction: column; gap: 2px; cursor: pointer;
  padding: var(--space-2) var(--space-3); border-radius: var(--radius-xs);
}
.gro-opt:hover, .gro-opt[aria-selected="true"] { background: var(--surface-hover); }
.gro-opt[aria-selected="true"] { box-shadow: var(--text) 2px 0 0 inset; }
.gro-opt-name { font-size: var(--fs-sm); font-weight: var(--fw-bold); color: var(--text); }
.gro-opt-meta { font-size: var(--fs-xs); color: var(--muted); }
.gro-opt-free .gro-opt-name { font-weight: var(--fw-regular); }

/* list */
.gro-list-head, .gro-list-foot, .gro-compare-head, .gro-ads-head {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap;
}
.gro-list-head { margin-bottom: var(--space-2); }
.gro-count { font-size: var(--fs-xs); }
.gro-list { list-style: none; margin: 0; padding: 0; }
.gro-line { padding: var(--space-2) 0; }
.gro-line + .gro-line { box-shadow: var(--line) 0 -1px 0; }
.gro-line-row { display: flex; align-items: center; gap: var(--space-3); min-height: var(--control-h); }
.gro-check {
  flex: none; width: 22px; height: 22px; margin: 0; cursor: pointer;
  appearance: none; -webkit-appearance: none; border-radius: var(--radius-circle);
  box-shadow: var(--line-input) 0 0 0 2px inset; display: grid; place-items: center;
  transition: background var(--dur) var(--ease);
}
.gro-check:checked { background: var(--text); box-shadow: none; }
.gro-check:checked::after {
  content: ""; width: 6px; height: 11px; margin-top: -2px;
  border: solid var(--bg); border-width: 0 2.5px 2.5px 0; transform: rotate(45deg);
}
.gro-check:focus-visible { outline: none; box-shadow: var(--line-input) 0 0 0 2px inset, var(--focus-ring); }
.gro-line-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.gro-line-name {
  font-size: var(--fs-sm); font-weight: var(--fw-bold); cursor: pointer;
  overflow-wrap: anywhere;
}
.gro-line-sub { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px var(--space-2); font-size: var(--fs-xs); }
.gro-line.is-checked .gro-line-name { color: var(--muted); text-decoration: line-through; }
.gro-qty { display: flex; align-items: center; gap: var(--space-1); flex: none; }
.gro-qty-val { min-width: 2ch; text-align: center; font-size: var(--fs-sm); font-weight: var(--fw-bold); font-variant-numeric: tabular-nums; }
.gro-icon-btn {
  flex: none; width: var(--control-sm); height: var(--control-sm); padding: 0; border: 0;
  display: inline-grid; place-items: center; cursor: pointer;
  border-radius: var(--radius-circle); background: var(--surface-2); color: var(--text);
  transition: background var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.gro-icon-btn:hover:not(:disabled) { background: var(--surface-hover); transform: scale(1.06); }
.gro-icon-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.gro-icon-btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.gro-del { background: transparent; color: var(--muted); }
.gro-del:hover:not(:disabled) { color: var(--bad); background: var(--bad-soft); }
.gro-picker { padding: var(--space-2) 0 var(--space-1) calc(22px + var(--space-3)); display: flex; flex-direction: column; gap: 6px; font-size: var(--fs-xs); }
.gro-picker-label { font-size: var(--fs-xs); font-weight: var(--fw-bold); color: var(--muted); }
.gro-list-foot { margin-top: var(--space-3); font-size: var(--fs-xs); }
.gro-clear { min-height: var(--control-sm); padding: 0 var(--space-3); font-size: var(--fs-xs); }

/* empty */
.gro-empty-title { font-size: var(--fs-md); color: var(--text); }
.gro-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-2); margin-top: var(--space-2); }

/* compare */
.gro-compare { display: flex; flex-direction: column; gap: var(--space-4); }
.gro-status { font-size: var(--fs-xs); }
.gro-sample-note { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); font-size: var(--fs-xs); }
.gro-compare-empty { font-size: var(--fs-sm); }
.gro-toggle {
  display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-1);
  padding: var(--space-1); border-radius: var(--radius-pill); background: var(--surface-2);
}
.gro-seg {
  min-height: var(--control-sm); border: 0; border-radius: var(--radius-pill); cursor: pointer;
  background: transparent; color: var(--muted);
  font-size: var(--fs-xs); font-weight: var(--fw-bold); text-transform: uppercase; letter-spacing: 1px;
}
.gro-seg[aria-pressed="true"] { background: var(--text); color: var(--bg); }
.gro-seg:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.gro-winner {
  display: flex; flex-direction: column; gap: var(--space-2);
  padding: var(--space-4); border-radius: var(--radius);
  background: linear-gradient(160deg, var(--hero-from), var(--hero-to)); box-shadow: var(--shadow-lg);
}
.gro-winner-main { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 2px var(--space-3); }
.gro-winner-label {
  grid-column: 1 / -1; font-size: var(--fs-xs); font-weight: var(--fw-bold);
  text-transform: uppercase; letter-spacing: var(--eyebrow-tracking); color: var(--muted);
}
.gro-winner-store { font-size: var(--fs-xl); font-weight: var(--fw-bold); line-height: var(--lh-tight); }
.gro-winner-total { font-size: var(--fs-xl); font-weight: var(--fw-bold); font-variant-numeric: tabular-nums; justify-self: end; }
.gro-winner-main > .gro-winner-total:nth-child(2) { justify-self: start; }
.gro-savings { color: var(--good); font-weight: var(--fw-bold); font-size: var(--fs-sm); }
.gro-warn-text { color: var(--warn); font-size: var(--fs-xs); }
.gro-budget-btn { align-self: flex-start; margin-top: var(--space-1); }

.gro-stores, .gro-split, .gro-blines { list-style: none; margin: 0; padding: 0; }
.gro-stores { display: flex; flex-direction: column; gap: var(--space-2); }
.gro-store { border-radius: var(--radius); background: var(--surface-2); overflow: hidden; }
.gro-store.is-winner { box-shadow: var(--good) 0 0 0 1px inset; }
.gro-store-head {
  width: 100%; display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-3); border: 0; background: transparent; color: inherit; text-align: left; cursor: pointer;
}
.gro-store-head:hover { background: var(--surface-hover); }
.gro-store-head:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--focus) inset; }
.gro-rank {
  flex: none; width: 28px; height: 28px; display: grid; place-items: center;
  border-radius: var(--radius-circle); background: var(--surface-3);
  font-size: var(--fs-xs); font-weight: var(--fw-bold);
}
.gro-store.is-winner .gro-rank { background: var(--accent); color: var(--accent-ink); }
.gro-store-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.gro-store-name { font-size: var(--fs-sm); font-weight: var(--fw-bold); display: inline-flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.gro-store-meta { font-size: var(--fs-xs); overflow-wrap: anywhere; }
.gro-missing { color: var(--warn); }
.gro-store-price { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.gro-store-total { font-size: var(--fs-md); font-weight: var(--fw-bold); font-variant-numeric: tabular-nums; }
.gro-store.is-winner .gro-store-total { color: var(--good); }
.gro-store-diff { font-size: var(--fs-xs); font-variant-numeric: tabular-nums; }
.gro-chev { flex: none; color: var(--muted); transition: transform var(--dur) var(--ease); }
.gro-store-head[aria-expanded="true"] .gro-chev { transform: rotate(180deg); }
.gro-store-body { padding: 0 var(--space-3) var(--space-3); display: flex; flex-direction: column; gap: var(--space-2); }
.gro-missing-note { font-size: var(--fs-xs); color: var(--warn); }
.gro-store-budget { align-self: flex-start; min-height: var(--control-sm); padding: 0 var(--space-3); font-size: var(--fs-xs); }

.gro-bline { display: flex; justify-content: space-between; gap: var(--space-3); padding: var(--space-2) 0; }
.gro-bline + .gro-bline { box-shadow: var(--line) 0 -1px 0; }
.gro-bline-main { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.gro-bline-name { font-size: var(--fs-sm); font-weight: var(--fw-bold); overflow-wrap: anywhere; }
.gro-bline-meta { font-size: var(--fs-xs); }
.gro-bline-store { color: var(--text); font-weight: var(--fw-bold); }
.gro-bline-tags { display: flex; flex-wrap: wrap; gap: var(--space-1); margin-top: 2px; }
.gro-bline-price { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; text-align: right; }
.gro-bline-total { font-size: var(--fs-sm); font-weight: var(--fw-bold); font-variant-numeric: tabular-nums; }
.gro-bline-each { font-size: var(--fs-xs); font-variant-numeric: tabular-nums; white-space: nowrap; }
.gro-was { font-size: var(--fs-micro); }

.gro-split { display: flex; flex-direction: column; gap: var(--space-2); }
.gro-split-store { border-radius: var(--radius); background: var(--surface-2); padding: var(--space-3); }
.gro-split-head { display: grid; grid-template-columns: 1fr auto; gap: 2px var(--space-3); align-items: baseline; margin-bottom: var(--space-1); }
.gro-split-head .gro-store-meta { grid-row: 2; }
.gro-split-sub { grid-row: 1 / span 2; grid-column: 2; align-self: center; font-weight: var(--fw-bold); font-variant-numeric: tabular-nums; }
.gro-error { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-2); color: var(--bad); font-size: var(--fs-sm); }

/* weekly ads */
.gro-ads { display: flex; flex-direction: column; gap: var(--space-4); }
.gro-ads [data-region="ads"] { display: flex; flex-direction: column; }
.gro-ads-week { font-size: var(--fs-xs); margin-top: 2px; }
.gro-ads-tools { display: flex; flex-direction: column; gap: var(--space-3); }
.gro-ads-search { max-width: 420px; }
.gro-ads-chips {
  display: flex; gap: var(--space-2); overflow-x: auto; padding: 2px 2px var(--space-1);
  scrollbar-width: thin; -webkit-overflow-scrolling: touch;
}
.gro-ads-chip { flex: none; }
.gro-chip-n { font-size: var(--fs-micro); opacity: 0.7; font-variant-numeric: tabular-nums; }
.gro-deals {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: var(--space-3); grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr));
}
.gro-deal {
  display: flex; flex-direction: column; gap: var(--space-1);
  padding: var(--space-3) var(--space-4) var(--space-4); border-radius: var(--radius);
  background: var(--surface-2); transition: background var(--dur) var(--ease);
}
.gro-deal:hover { background: var(--surface-3); box-shadow: var(--shadow); }
.gro-deal-store { font-size: var(--fs-micro); font-weight: var(--fw-bold); text-transform: uppercase; letter-spacing: var(--eyebrow-tracking); color: var(--muted); }
.gro-deal-title { font-size: var(--fs-sm); font-weight: var(--fw-bold); overflow-wrap: anywhere; }
.gro-deal-price { font-size: var(--fs-xl); font-weight: var(--fw-bold); line-height: var(--lh-tight); margin-top: var(--space-1); font-variant-numeric: tabular-nums; }
.gro-deal-price.is-deal { color: var(--good); }
.gro-deal-meta { font-size: var(--fs-xs); }
.gro-deal-tags { display: flex; flex-wrap: wrap; gap: var(--space-1); }
.gro-tag-coupon { background: var(--info-soft); color: var(--info); }
.gro-deal-action { margin-top: auto; padding-top: var(--space-2); }
.gro-deal-add { min-height: var(--control-sm); padding: 0 var(--space-4); font-size: var(--fs-xs); letter-spacing: 1px; }
.gro-deal-instore { font-size: var(--fs-xs); }
.gro-ads-none { font-size: var(--fs-sm); }
.gro-ads-more { align-self: center; margin-top: var(--space-3); }

@media (max-width: 480px) {
  .gro-add-btn { padding: 0 var(--space-4); }
  .gro-line-row { gap: var(--space-2); }
  .gro-winner-store, .gro-winner-total { font-size: var(--fs-lg); }
  .gro-store-head { gap: var(--space-2); padding: var(--space-3) var(--space-2); }
  .gro-deals { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2); }
  .gro-deal { padding: var(--space-3); }
  .gro-deal-price { font-size: var(--fs-lg); }
}
@media (prefers-reduced-motion: reduce) {
  .gro-icon-btn, .gro-chev, .gro-check, .gro-deal { transition: none; }
}
/* category thumbnails (art-thumb from app.css) */
.gro-opt { flex-direction: row; align-items: center; gap: var(--space-3); }
.gro-opt-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.gro-thumb { width: 36px; height: 36px; }
.gro-line-thumb { width: 40px; height: 40px; }
.gro-line.is-checked .gro-line-thumb { opacity: 0.5; }
.gro-deal-head { display: flex; align-items: center; gap: var(--space-3); min-width: 0; }
.gro-deal-head { margin-bottom: var(--space-1); }
.gro-deal-head .gro-thumb { width: 44px; height: 44px; background: var(--surface-3); }
.gro-deal-head .gro-deal-store { min-width: 0; overflow-wrap: anywhere; }
.gro-deal:hover .gro-deal-head .art-thumb .art-bg { fill: var(--surface-hover); }
@media (max-width: 480px) {
  .gro-line-thumb { width: 36px; height: 36px; }
  .gro-deal-head { gap: var(--space-2); }
  .gro-deal-head .gro-thumb { width: 36px; height: 36px; }
}
/* coupons (phase 9a) */
.gro-cpn { display: flex; flex-direction: column; gap: var(--space-4); }
.gro-cpn [data-region="coupons"] { display: flex; flex-direction: column; }
.gro-cpn-tools { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.gro-cpn-search { flex: 1 1 260px; max-width: 420px; }
.gro-cpn-cat { flex: 0 1 200px; width: auto; min-width: 160px; }
.gro-cpn-sep { flex: none; width: 1px; align-self: stretch; margin: var(--space-1) var(--space-1); background: var(--line-strong); }
.gro-cpn-clipchip svg { flex: none; }
@media (min-width: 721px) { .gro-cpn [data-region="cpn-chips"] { flex-wrap: wrap; overflow-x: visible; } }
.gro-cpn-value { font-size: var(--fs-xl); font-weight: var(--fw-bold); line-height: var(--lh-tight); margin-top: var(--space-1); font-variant-numeric: tabular-nums; }
.gro-cpn-card .tag { white-space: normal; text-align: left; }
.gro-bline-total .gro-was { margin-right: var(--space-1); }
.gro-tag-match { background: var(--info); color: var(--accent-ink); }
.gro-clip { gap: 6px; }
.gro-clip.is-on { background: var(--text); color: var(--bg); box-shadow: none; }
.gro-clip.is-on:hover { background: var(--muted); }
/* "Include coupons" switch in Compare stores */
.gro-cpn-switch-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-3); }
.gro-switch { display: inline-flex; align-items: center; gap: var(--space-2); cursor: pointer; font-size: var(--fs-sm); font-weight: var(--fw-bold); }
.gro-switch-input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.gro-switch-track {
  position: relative; flex: none; width: 40px; height: 22px; border-radius: var(--radius-pill);
  background: var(--track); box-shadow: var(--line-input) 0 0 0 1px inset; transition: background var(--dur) var(--ease);
}
.gro-switch-thumb {
  position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: var(--radius-circle);
  background: var(--muted); transition: transform var(--dur) var(--ease), background var(--dur) var(--ease);
}
.gro-switch-input:checked + .gro-switch-track { background: var(--text); box-shadow: none; }
.gro-switch-input:checked + .gro-switch-track .gro-switch-thumb { transform: translateX(18px); background: var(--bg); }
.gro-switch-input:focus-visible + .gro-switch-track { box-shadow: var(--focus-ring); }
.gro-switch-note { font-size: var(--fs-xs); flex-basis: 100%; }
.gro-cpn-all { display: inline-flex; align-items: center; gap: var(--space-2); font-size: var(--fs-xs); color: var(--muted); cursor: pointer; flex-basis: 100%; }
.gro-cpn-all input { accent-color: var(--text); width: 16px; height: 16px; margin: 0; }
.gro-cpn-shelf { font-size: var(--fs-xs); color: var(--info); overflow-wrap: anywhere; }
.gro-cpn-winner { font-size: var(--fs-xs); color: var(--info); font-weight: var(--fw-bold); }
@media (max-width: 480px) {
  .gro-cpn-cat { flex: 1 1 100%; max-width: none; }
  .gro-cpn-search { max-width: none; }
  .gro-cpn-value { font-size: var(--fs-lg); }
  .gro-cpn-card .gro-thumb { display: none; }
  .gro-cpn-card .gro-deal-head { margin-bottom: 0; }
  .gro-cpn-card .gro-deal-store { letter-spacing: 1px; }
}
@media (prefers-reduced-motion: reduce) { .gro-switch-track, .gro-switch-thumb { transition: none; } }
/* store-brand swaps, trip settings + drive verdict */
.gro-compare-head .gro-status { margin-right: auto; }
.gro-trip { position: relative; }
.gro-trip-btn { gap: 6px; padding: 0 var(--space-3); color: var(--text); }
.gro-trip-btn svg { flex: none; }
.gro-trip-pop {
  position: absolute; z-index: 25; right: 0; top: calc(100% + 6px); width: 280px;
  display: flex; flex-direction: column; gap: var(--space-3);
  padding: var(--space-4); border-radius: var(--radius);
  background: var(--surface-3); box-shadow: var(--shadow-lg);
}
.gro-trip-pop[hidden] { display: none; }
.gro-trip-title { font-size: var(--fs-sm); font-weight: var(--fw-bold); }
.gro-trip-field { display: flex; flex-direction: column; gap: var(--space-1); }
.gro-trip-flabel { font-size: var(--fs-xs); font-weight: var(--fw-bold); color: var(--muted); }
.gro-trip-inputwrap { display: flex; align-items: center; gap: var(--space-2); }
.gro-trip-input { flex: 1; min-width: 0; min-height: var(--control-h); }
.gro-trip-unit { flex: none; width: 52px; font-size: var(--fs-xs); }
.gro-trip-note { font-size: var(--fs-xs); }
.gro-trip-actions { display: flex; justify-content: flex-end; gap: var(--space-2); }
.gro-trip-verdict { font-size: var(--fs-sm); font-weight: var(--fw-bold); overflow-wrap: anywhere; }
.gro-trip-verdict.is-worth { color: var(--text); }
.gro-trip-verdict.is-not { color: var(--warn); }
.gro-trip-verdict .muted { font-weight: var(--fw-regular); font-size: var(--fs-xs); }
.gro-dist { white-space: nowrap; }

.gro-swaps {
  display: flex; flex-direction: column; gap: var(--space-2);
  padding: var(--space-3) var(--space-4); border-radius: var(--radius); background: var(--surface-2);
}
.gro-swaps.is-done { flex-direction: row; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.gro-swaps-done { font-size: var(--fs-sm); color: var(--muted); }
.gro-swaps-head { display: flex; flex-direction: column; gap: 2px; }
.gro-swaps-title { font-size: var(--fs-md); font-weight: var(--fw-bold); }
.gro-swaps-sub { font-size: var(--fs-xs); }
.gro-swap-list { list-style: none; margin: 0; padding: 0; }
.gro-swap { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: var(--space-1) var(--space-3); padding: var(--space-2) 0; }
.gro-swap + .gro-swap { box-shadow: var(--line) 0 -1px 0; }
.gro-swap-main { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.gro-swap-from { font-size: var(--fs-sm); font-weight: var(--fw-bold); overflow-wrap: anywhere; }
.gro-swap-to { font-size: var(--fs-xs); color: var(--muted); overflow-wrap: anywhere; }
.gro-swap-save { font-size: var(--fs-sm); font-weight: var(--fw-bold); font-variant-numeric: tabular-nums; color: var(--text); white-space: nowrap; }
.gro-swap-btn { padding: 0 var(--space-3); }
.gro-swaps-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
@media (max-width: 720px) {
  .gro-trip-btn, .gro-swap-btn, .gro-swap-all, .gro-swap-undo, .gro-trip-actions .btn { min-height: 44px; }
}
@media (max-width: 480px) {
  .gro-trip { position: static; }
  .gro-compare { position: relative; }
  .gro-trip-pop { left: var(--space-3); right: var(--space-3); width: auto; top: 56px; }
  .gro-swaps { padding: var(--space-3); }
  .gro-swap { grid-template-columns: minmax(0, 1fr) auto; align-items: start; }
  .gro-swap-main { grid-column: 1; grid-row: 1 / span 2; }
  .gro-swap-save { grid-column: 2; grid-row: 1; justify-self: end; }
  .gro-swap-btn { grid-column: 2; grid-row: 2; justify-self: end; }
}
/* "I bought this" / "Mark basket as bought" (price-protection feature) */
.gro-bought-line { color: var(--muted); white-space: nowrap; }
.gro-list-foot-actions { display: flex; gap: var(--space-2); flex-wrap: wrap; align-items: center; }
.gro-bought-store { margin-top: var(--space-2); }
@media (max-width: 699px) {
  .gro-bought-line { display: inline-flex; align-items: center; min-height: 44px; padding: 0 var(--space-2) 0 0; }
  .gro-list-foot-actions .btn { min-height: 44px; }
}
/* === end grocery === */

/* === recipes === */
.rec-paste { display: flex; flex-direction: column; gap: var(--space-3); }
.rec-paste .card-head { margin-bottom: 0; }
.rec-text {
  width: 100%; min-height: 200px; resize: vertical;
  padding: var(--space-3) var(--space-4); border: 0; border-radius: var(--radius);
  background: var(--surface-2); color: var(--text); box-shadow: var(--shadow-input);
  font: var(--fs-sm)/1.55 var(--font);
}
.rec-text::placeholder { color: var(--muted-2); }
.rec-text:hover { box-shadow: var(--shadow-input-hover); }
.rec-text:focus-visible { outline: none; box-shadow: var(--shadow-input-focus); }
.rec-paste-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; }
.rec-soon { display: inline-flex; align-items: center; gap: var(--space-2); }
.rec-soon .btn:disabled { opacity: .45; }

.rec-result { display: grid; gap: var(--space-4); grid-template-columns: minmax(0, 1fr) 320px; align-items: start; }
.rec-result.loading-card { display: flex; }
.rec-ings { padding: var(--space-5) var(--space-4); }
.rec-ings-head { display: flex; gap: var(--space-3); align-items: flex-end; padding: 0 var(--space-1); }
.rec-title-field { flex: 1 1 auto; }
.rec-serv-field { flex: 0 0 110px; }
.rec-ings-hint { margin: var(--space-3) var(--space-1) var(--space-2); }

.rec-cols, .rec-row {
  display: grid; align-items: center; gap: var(--space-3);
  grid-template-columns: 40px minmax(0, .85fr) minmax(0, 1.6fr) 60px 104px;
}
.rec-cols { padding: var(--space-2) var(--space-2); font-size: var(--fs-xs); color: var(--muted); border-bottom: 1px solid var(--line); }
.rec-rows { list-style: none; margin: 0; padding: 0; }
.rec-row { padding: var(--space-2); border-radius: var(--radius-sm); }
.rec-row + .rec-row { border-top: 1px solid var(--line); }
.rec-row:hover { background: var(--surface-2); }
/* "have it" / skipped rows: muted color instead of low opacity keeps text >= 4.5:1 */
.rec-row.is-off .rec-ing-name { color: var(--muted); }
.rec-row.is-off .rec-pick { opacity: .75; }
.rec-row.is-off .art-thumb { opacity: .45; }
.rec-row.is-off .rec-ing-name { text-decoration: line-through; text-decoration-color: var(--muted-2); }
.rec-ing { min-width: 0; }
.rec-ing-name { font-size: var(--fs-sm); font-weight: var(--fw-bold); text-transform: capitalize; overflow-wrap: anywhere; }
.rec-ing-name .tag { text-transform: none; font-weight: var(--fw-regular); margin-left: 4px; }
.rec-ing-raw { font-size: var(--fs-xs); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.rec-pick { display: flex; align-items: center; gap: var(--space-2); min-width: 0; }
.rec-select { min-height: var(--control-sm); font-size: var(--fs-xs); padding-left: var(--space-3); min-width: 0; flex: 1 1 auto; text-overflow: ellipsis; }
.rec-pick .tag { flex: none; font-size: var(--fs-xs); }
.rec-qty { min-height: var(--control-sm); padding: 0 var(--space-2); text-align: center; }
.rec-have { display: inline-flex; align-items: center; gap: var(--space-2); font-size: var(--fs-xs); color: var(--muted); cursor: pointer; white-space: nowrap; }
.rec-have input { width: 18px; height: 18px; accent-color: var(--text); cursor: pointer; }
.rec-have:hover { color: var(--text); }
.rec-have:focus-within { color: var(--text); }
@media (max-width: 699px), (pointer: coarse) {
  .rec-have { min-height: var(--control-h); }
  .rec-have input { width: 22px; height: 22px; }
}

.rec-summary { position: sticky; top: var(--space-5); display: flex; flex-direction: column; gap: var(--space-4); }
.rec-cost-total { font-size: var(--fs-display); font-weight: var(--fw-bold); line-height: var(--lh-tight); margin-top: var(--space-1); }
.rec-cost-total.is-best { color: var(--good); }
.rec-cost-per { font-size: var(--fs-md); font-weight: var(--fw-bold); margin-top: var(--space-1); }
.rec-cost-per .muted { font-size: var(--fs-xs); font-weight: var(--fw-regular); }
.rec-summary .select { font-size: var(--fs-xs); }
.rec-add { width: 100%; white-space: normal; text-align: center; line-height: 1.2; }
.rec-added { color: var(--muted); text-align: center; }
.rec-link { color: var(--text); font-weight: var(--fw-bold); }

.rec-saved .empty svg { width: 28px; height: 28px; color: var(--muted-2); }
.rec-saved-list { list-style: none; margin: 0; padding: 0; }
.rec-saved-item { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-2); border-radius: var(--radius-sm); }
.rec-saved-item + .rec-saved-item { border-top: 1px solid var(--line); }
.rec-saved-item:hover { background: var(--surface-2); }
.rec-saved-icon { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: var(--radius); background: var(--surface-3); color: var(--muted); }
.rec-saved-main { flex: 1 1 auto; min-width: 0; }
.rec-saved-title { font-weight: var(--fw-bold); font-size: var(--fs-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rec-saved-actions { display: flex; align-items: center; gap: var(--space-1); flex: none; }

@media (max-width: 959px) {
  .rec-result { grid-template-columns: minmax(0, 1fr); }
  .rec-summary { position: static; }
}
@media (max-width: 699px) {
  .rec-cols { display: none; }
  .rec-row {
    grid-template-columns: 40px minmax(0, 1fr) 64px;
    grid-template-areas: "thumb ing qty" "pick pick pick" "have have have";
    row-gap: var(--space-2); padding: var(--space-3) var(--space-1);
  }
  .rec-row > .art-thumb { grid-area: thumb; }
  .rec-row > .rec-ing { grid-area: ing; }
  .rec-row > .rec-pick { grid-area: pick; }
  .rec-row > .rec-qty-wrap { grid-area: qty; }
  .rec-row > .rec-have { grid-area: have; }
  .rec-ings { padding: var(--space-4) var(--space-3); }
  .rec-ings-head { flex-wrap: wrap; }
  .rec-serv-field { flex-basis: 96px; }
  .rec-saved-item { flex-wrap: wrap; }
  .rec-saved-actions { width: 100%; justify-content: flex-end; }
}
/* --- meal plan from this week's deals --- */
.mp-sub { margin-top: var(--space-1); max-width: 60ch; }
.mp-card .card-head { margin-bottom: var(--space-3); }
.mp-form { display: grid; gap: var(--space-4); grid-template-columns: auto minmax(0, 1fr); align-items: end; }
.mp-field { border: 0; margin: 0; padding: 0; min-width: 0; }
.mp-field > legend { margin-bottom: var(--space-2); padding: 0; }
.mp-chips { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.mp-chips .chip { min-height: var(--control-h); min-width: var(--control-h); justify-content: center; }
.mp-nums { display: grid; grid-template-columns: 140px 200px; gap: var(--space-3); align-items: start; }
.mp-nums .hint { padding-left: var(--space-2); }
.mp-form > .mp-field:nth-of-type(2) { grid-column: 1 / -1; }
.mp-submit { grid-column: 1 / -1; }
.mp-submit .btn { min-width: 200px; }
.mp-saved { margin-top: var(--space-5); padding-top: var(--space-4); border-top: 1px solid var(--line); }
.mp-saved .eyebrow { margin-bottom: var(--space-2); }
.mp-saved-list { list-style: none; margin: 0; padding: 0; }
.mp-saved-item { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-2); border-radius: var(--radius-sm); }
.mp-saved-item + .mp-saved-item { border-top: 1px solid var(--line); }
.mp-saved-main { flex: 1 1 auto; min-width: 0; }
.mp-saved-title { font-size: var(--fs-sm); font-weight: var(--fw-bold); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mp-saved-actions { display: flex; gap: var(--space-1); flex: none; }

.mp-plan { display: flex; flex-direction: column; gap: var(--space-4); }
.mp-plan-head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--space-4); flex-wrap: wrap; }
.mp-plan-title { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-1); }
.mp-plan-title h2:focus { outline: none; }
.mp-plan-title h2:focus-visible { box-shadow: var(--focus-ring); border-radius: var(--radius-xs); }
.mp-total { text-align: right; }
.mp-total-num { font-size: var(--fs-display); font-weight: var(--fw-bold); line-height: var(--lh-tight); margin-top: var(--space-1); }
.mp-total-num.is-under, .mp-total-sub.is-under { color: var(--good); }
.mp-total-num.is-over, .mp-total-sub.is-over { color: var(--bad); }
.mp-total-sub { color: var(--muted); margin-top: 2px; }
.mp-note { color: var(--warn); }

.mp-days { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-3); grid-template-columns: repeat(auto-fill, minmax(min(100%, 172px), 1fr)); }
.mp-day { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-4); border-radius: var(--radius); background: var(--surface-2); min-width: 0; }
.mp-day:hover { background: var(--surface-3); }
.mp-day-top { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); min-height: 20px; }
.mp-day-title { font-size: var(--fs-md); font-weight: var(--fw-bold); line-height: var(--lh-tight); overflow-wrap: anywhere; }
.mp-day-desc { line-height: var(--lh); flex: 1 1 auto; }
.mp-day-cost .mp-cps { font-size: var(--fs-lg); font-weight: var(--fw-bold); }
.mp-day-actions { display: flex; gap: var(--space-2); flex-wrap: wrap; margin-top: var(--space-1); }
.mp-day-actions .btn { flex: 1 1 auto; min-height: var(--control-h); padding: 0 var(--space-3); }
.tag.mp-sale { background: var(--info-soft); color: var(--info); }

.mp-shop { border-radius: var(--radius); background: var(--surface-2); }
.mp-shop > summary {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap;
  min-height: var(--control-h); padding: var(--space-2) var(--space-4); cursor: pointer; font-weight: var(--fw-bold); font-size: var(--fs-sm);
  border-radius: var(--radius); list-style: none;
}
.mp-shop > summary::-webkit-details-marker { display: none; }
.mp-shop > summary::after { content: ""; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); margin-left: auto; }
.mp-shop[open] > summary::after { transform: rotate(-135deg); }
.mp-shop > summary:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.mp-shop-list { list-style: none; margin: 0; padding: 0 var(--space-4) var(--space-3); }
.mp-shop-item { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: var(--space-3); align-items: baseline; padding: var(--space-2) 0; font-size: var(--fs-sm); }
.mp-shop-item + .mp-shop-item { border-top: 1px solid var(--line); }
.mp-shop-qty { color: var(--muted); font-weight: var(--fw-bold); }
.mp-shop-name { min-width: 0; overflow-wrap: anywhere; }
.mp-shop-for { display: block; }
.mp-shop-price { font-weight: var(--fw-bold); white-space: nowrap; }
.mp-foot { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.mp-added { color: var(--muted); }

.mp-lib-tools { display: flex; flex-direction: column; gap: var(--space-3); margin-bottom: var(--space-3); }
.mp-lib-tools .input { max-width: 420px; }
.mp-lib-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: var(--space-2) var(--space-4); }
.mp-lib-item { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-2); border-radius: var(--radius-sm); border-bottom: 1px solid var(--line); }
.mp-lib-item:hover { background: var(--surface-2); }
.mp-lib-main { flex: 1 1 auto; min-width: 0; }
.mp-lib-title { font-size: var(--fs-sm); font-weight: var(--fw-bold); }
.mp-lib-meta { margin-top: 2px; font-size: var(--fs-xs); }
.mp-lib-item .btn { flex: none; }
.mp-lib-more { margin-top: var(--space-3); }

@media (max-width: 699px) {
  .mp-form { grid-template-columns: minmax(0, 1fr); }
  .mp-nums { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); }
  .mp-submit .btn { width: 100%; }
  .mp-chips { flex-wrap: wrap; }
  .mp-plan-head { flex-direction: column; }
  .mp-total { text-align: left; }
  .mp-foot .btn { flex: 1 1 100%; }
  .mp-days { grid-template-columns: minmax(0, 1fr); }
}
/* === end recipes === */

/* === shop mode === */
.shop-header { align-items: center; }
.shop-scan-btn svg { width: 18px; height: 18px; }
.shop-bar { position: sticky; top: var(--space-3); z-index: 5; display: flex; flex-direction: column; gap: var(--space-3); box-shadow: var(--shadow-lg); }
.shop-bar-top { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; }
.shop-store { display: flex; align-items: center; gap: var(--space-3); min-width: 0; flex: 1 1 240px; }
.shop-store-label { font-size: var(--fs-xs); font-weight: var(--fw-bold); letter-spacing: var(--eyebrow-tracking); text-transform: uppercase; color: var(--muted); }
.shop-store .select { flex: 1 1 auto; min-width: 0; max-width: 320px; }
.shop-progress { display: flex; flex-direction: column; gap: var(--space-2); }
.shop-progress-text strong { font-size: var(--fs-lg); }
.shop-meter { height: 8px; border-radius: var(--radius-pill); background: var(--track); overflow: hidden; }
.shop-meter span { display: block; height: 100%; width: 0; background: var(--text); border-radius: inherit; transition: width var(--dur) var(--ease); }
.shop-bar-actions { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.shop-hide[aria-pressed="true"] { background: var(--text); color: var(--bg); box-shadow: none; }

.shop-groups { display: flex; flex-direction: column; gap: var(--space-4); }
.shop-group { padding: var(--space-4) var(--space-4) var(--space-2); }
.shop-group-title { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-3); font-size: var(--fs-md); margin-bottom: var(--space-2); }
.shop-group-title .muted { font-size: var(--fs-sm); font-weight: var(--fw-regular); }
.shop-lines { list-style: none; margin: 0; padding: 0; }
.shop-line + .shop-line { border-top: 1px solid var(--line); }
.shop-line { position: relative; }
.shop-check { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.shop-line-label {
  display: flex; align-items: center; gap: var(--space-4);
  min-height: 72px; padding: var(--space-2) var(--space-1); cursor: pointer;
  border-radius: var(--radius-sm); -webkit-tap-highlight-color: transparent; user-select: none;
}
.shop-line-label:hover { background: var(--surface-2); }
.shop-box {
  flex: none; width: 56px; height: 56px; border-radius: var(--radius);
  display: grid; place-items: center; color: transparent;
  box-shadow: var(--line-input) 0 0 0 2px inset; background: var(--surface-2);
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.shop-box svg { width: 32px; height: 32px; }
.shop-check:focus-visible + .shop-line-label .shop-box { box-shadow: var(--focus-ring); }
.shop-line.is-checked .shop-box { background: var(--text); color: var(--bg); box-shadow: none; }
.shop-line-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.shop-line-name { font-size: var(--fs-lg); font-weight: var(--fw-bold); overflow-wrap: anywhere; }
.shop-qty { color: var(--muted); }
.shop-line-meta { font-size: var(--fs-xs); }
.shop-missing { color: var(--warn); }
.shop-line-price { flex: none; display: flex; flex-direction: column; align-items: flex-end; font-weight: var(--fw-bold); font-size: var(--fs-md); }
.shop-promo { font-size: var(--fs-micro); font-weight: var(--fw-bold); color: var(--warn); }
.shop-line.is-checked .shop-line-name,
.shop-line.is-checked .shop-line-price { text-decoration: line-through; text-decoration-thickness: 2px; color: var(--muted-2); }
.shop-line.is-checked .shop-line-meta { color: var(--muted-2); }
.shop-empty { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-3); }

.shop-scan {
  width: min(520px, calc(100vw - 2 * var(--space-4))); max-height: calc(100dvh - 2 * var(--space-4));
  padding: 0; border: 0; border-radius: var(--radius); background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg);
}
.shop-scan::backdrop { background: var(--overlay); }
.shop-scan-inner { display: flex; flex-direction: column; gap: var(--space-4); padding: var(--space-5); }
.shop-scan-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.shop-scan-close span { font-size: 24px; line-height: 1; }
.shop-cam { position: relative; border-radius: var(--radius); overflow: hidden; background: #000; aspect-ratio: 4 / 3; }
.shop-cam video { width: 100%; height: 100%; object-fit: cover; display: block; }
.shop-cam-frame { position: absolute; left: 12%; right: 12%; top: 32%; bottom: 32%; border-radius: var(--radius); box-shadow: 0 0 0 2px var(--text), 0 0 0 999px rgba(0, 0, 0, 0.35); }
.shop-cam-btn { align-self: flex-start; }
.shop-upc-form { display: flex; flex-direction: column; gap: var(--space-2); }
.shop-upc-label { font-size: var(--fs-sm); font-weight: var(--fw-bold); }
.shop-upc-row { flex-wrap: nowrap; }
.shop-upc-row .input { flex: 1 1 auto; min-width: 0; }
.shop-upc-try { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.shop-scan-result:empty { display: none; }
.shop-scan-found { display: flex; flex-direction: column; gap: var(--space-3); background: var(--surface-2); border-radius: var(--radius); padding: var(--space-4); }
.shop-scan-found-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; }
.shop-scan-title { font-size: var(--fs-md); margin-top: var(--space-1); }
.shop-offers { list-style: none; margin: 0; padding: 0; }
.shop-offer { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-2) 0; min-height: var(--control-h); }
.shop-offer + .shop-offer { border-top: 1px solid var(--line); }
.shop-offer-store { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; font-size: var(--fs-sm); }
.shop-offer-price { display: flex; flex-direction: column; align-items: flex-end; font-weight: var(--fw-bold); }
.shop-offer.is-cheapest .shop-offer-price { color: var(--good); }
.shop-offer.is-out { opacity: 0.6; }

/* six tabs in the mobile bar: shorter labels so each fits on one line at 360px */
.tab-short { display: none; }
@media (max-width: 699px) {
  .tab-long { display: none; }
  .tab-short { display: inline; }
  .tab > span { white-space: nowrap; }
}

.pwa-install { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-3); }

@media (max-width: 699px) {
  .shop-bar { position: static; box-shadow: var(--shadow); }
  .shop-header .shop-scan-btn { width: 100%; }
  .shop-scan-inner { padding: var(--space-4); }
}
@media (prefers-reduced-motion: reduce) {
  .shop-box, .shop-meter span { transition: none; }
}
/* === end shop mode === */

/* === snap/ebt + privacy (feat/snap-metrics) === */
/* EBT marker: informational blue, never green (green is for winners and CTAs only). */
.ebt-chip { background: var(--info-soft); color: var(--info); letter-spacing: 0.4px; }
.gro-line-ebt { align-self: flex-start; width: auto; margin: 2px 0; }
.ebt-split {
  display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); align-items: center;
  margin: var(--space-2) 0 0; font-size: var(--fs-sm); color: var(--muted);
}
.ebt-split strong { color: var(--text); font-weight: var(--fw-bold); }
.ebt-split-part { display: inline-flex; align-items: center; gap: 6px; }
.gro-store-body .ebt-split { margin: 0 0 var(--space-2); }
.ebt-note { margin: 0 0 var(--space-3); font-size: var(--fs-xs); }
.ebt-card .hint a, .privacy-card .hint a { color: var(--text); }
/* === end snap/ebt + privacy === */

/* === receipts === (#receipts: frontend/js/receipts.js) */
.rcp-page { display: flex; flex-direction: column; gap: var(--space-4); max-width: 880px; }
.rcp-h { font-size: var(--fs-lg); font-weight: var(--fw-bold); }
.rcp-privacy-list { margin: var(--space-3) 0 0; padding-left: var(--space-5); color: var(--muted); font-size: var(--fs-sm); display: grid; gap: var(--space-1); }
.rcp-privacy-list strong { color: var(--text); }
.rcp-input { display: flex; flex-direction: column; gap: var(--space-3); }
.rcp-photo { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-2); }
.rcp-photo[hidden], .rcp-nophoto[hidden] { display: none; }
.rcp-photo-btn { position: relative; cursor: pointer; gap: var(--space-2); }
.rcp-photo-btn svg { width: 18px; height: 18px; }
.rcp-photo-btn:focus-within { box-shadow: var(--focus-ring); }
.rcp-file { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.rcp-label { font-size: var(--fs-sm); font-weight: var(--fw-bold); }
.rcp-text { border-radius: var(--radius); padding: var(--space-3) var(--space-4); min-height: 160px; resize: vertical;
  font-family: var(--font-mono); font-size: var(--fs-xs); line-height: 1.5; }
.rcp-input-actions { align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.rcp-status { font-size: var(--fs-sm); color: var(--muted); }
.rcp-status.is-warn { color: var(--warn); }

.rcp-review { display: flex; flex-direction: column; gap: var(--space-4); }
.rcp-review[hidden] { display: none; }
.rcp-review-head { margin-bottom: 0; }
.rcp-review h2:focus { outline: none; }
.rcp-check { display: inline-flex; align-items: center; gap: var(--space-1); }
.rcp-check svg { width: 14px; height: 14px; }
.rcp-check.is-ok { background: var(--info-soft); color: var(--info); }
.rcp-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--space-3); }
.rcp-field { display: flex; flex-direction: column; gap: var(--space-1); }
.rcp-field .rcp-label { font-size: var(--fs-xs); color: var(--muted); font-weight: var(--fw-regular); }
.rcp-field input[type="date"] { color-scheme: dark; }

.rcp-rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.rcp-row { display: grid; grid-template-columns: minmax(0, 1fr) 84px 112px var(--control-sm); gap: var(--space-2) var(--space-3);
  align-items: start; padding: var(--space-3) 0; }
.rcp-row + .rcp-row { border-top: 1px solid var(--line); }
.rcp-cell { display: flex; flex-direction: column; gap: var(--space-1); min-width: 0; }
.rcp-desc .rcp-match { min-height: var(--control-sm); font-size: var(--fs-xs); color: var(--muted); }
.rcp-mini { font-size: var(--fs-micro); color: var(--muted); text-transform: uppercase; letter-spacing: 0.4px; }
.rcp-qty .rcp-mini, .rcp-price .rcp-mini { order: -1; }
.rcp-price .rcp-in { text-align: right; }
.rcp-saved { font-size: var(--fs-xs); color: var(--muted); text-align: right; }
.rcp-remove { margin-top: 22px; }
.rcp-add { align-self: flex-start; }

.rcp-totals { margin: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-3);
  background: var(--surface-2); border-radius: var(--radius); padding: var(--space-3) var(--space-4); }
.rcp-totals div { display: flex; flex-direction: column; gap: 2px; }
.rcp-totals dt { font-size: var(--fs-xs); color: var(--muted); }
.rcp-totals dd { margin: 0; font-weight: var(--fw-bold); }
.rcp-total dd { font-size: var(--fs-lg); }

.rcp-actions { display: flex; flex-wrap: wrap; gap: var(--space-3); }
.rcp-share { display: flex; flex-direction: column; gap: var(--space-1); padding-top: var(--space-3); border-top: 1px solid var(--line); }
.rcp-share-label { display: flex; align-items: center; gap: var(--space-3); min-height: var(--control-h); cursor: pointer; font-size: var(--fs-sm); font-weight: var(--fw-bold); }
.rcp-share-label input { width: 20px; height: 20px; accent-color: var(--text); flex: none; }
.rcp-queue { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-2); }
.rcp-done { font-size: var(--fs-sm); color: var(--text); min-height: 1.4em; margin: 0; }

@media (max-width: 699px) {
  .rcp-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) var(--control-sm); }
  .rcp-desc { grid-column: 1 / -1; }
  .rcp-remove { margin-top: 18px; }
  .rcp-totals { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rcp-actions .btn { flex: 1 1 100%; }
}
/* === end receipts === */
/* ===== Price history dialog + product card extras (price-history.js, product-actions.js) =====
   Dark only. Lines use the validated categorical set in price-history.js; green marks only the
   period's lowest price. Grid/axes are hairline and recessive; text never wears series colors. */
.prd-extra { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-3); }
.prd-extra .btn { flex: 1 1 auto; }
.ph-dialog { width: min(760px, calc(100vw - 24px)); max-height: calc(100vh - 24px); padding: 0; border: 0; border-radius: var(--radius); background: var(--surface); color: var(--text); box-shadow: rgba(0, 0, 0, 0.5) 0 8px 24px; overflow: auto; }
.ph-dialog::backdrop { background: var(--overlay); }
.ph-inner { padding: var(--space-5); display: flex; flex-direction: column; gap: var(--space-3); }
.ph-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-3); }
.ph-head h2 { font-size: var(--fs-lg); font-weight: var(--fw-bold); line-height: var(--lh-tight); }
.ph-product { font-size: var(--fs-sm); margin-top: 2px; }
.ph-close { width: var(--control-h); height: var(--control-h); flex: none; font-size: var(--fs-xl); }
.ph-body { display: flex; flex-direction: column; gap: var(--space-3); min-width: 0; }
.ph-src { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); font-size: var(--fs-xs); }
.ph-summary { font-size: var(--fs-md); font-weight: var(--fw-bold); }
.ph-hint { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px var(--space-2); padding: var(--space-3) var(--space-4); border-radius: var(--radius-sm); background: var(--surface-2); font-size: var(--fs-sm); }
.ph-hint-q { color: var(--muted); font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: var(--eyebrow-tracking); font-weight: var(--fw-bold); width: 100%; }
.ph-hint-label { color: var(--text); }
.ph-hint-wait .ph-hint-label { color: var(--warn); }
.ph-hint-text { font-size: var(--fs-xs); }
.ph-legend { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-4); list-style: none; padding: 0; margin: 0; font-size: var(--fs-xs); color: var(--muted); }
.ph-legend li, .ph-one { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-xs); }
.ph-key { display: inline-block; width: 14px; height: 2px; border-radius: 1px; background: var(--c); flex: none; }
.ph-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #1ed760; box-shadow: 0 0 0 2px var(--surface); flex: none; }
.ph-plot { position: relative; border-radius: var(--radius-sm); outline: none; touch-action: pan-y; }
.ph-plot:focus-visible { box-shadow: var(--focus-ring); }
.ph-svg { display: block; max-width: 100%; height: auto; overflow: visible; }
.ph-grid { stroke: var(--line); stroke-width: 1; }
.ph-base { stroke: var(--line-strong); stroke-width: 1; }
.ph-axis { fill: var(--muted); font-size: 11px; font-family: var(--font); font-variant-numeric: tabular-nums; }
.ph-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.ph-low { stroke: var(--surface); stroke-width: 2; }
.ph-low-label { fill: var(--text); font-size: 11px; font-weight: var(--fw-bold); font-family: var(--font); paint-order: stroke; stroke: var(--surface); stroke-width: 3px; }
.ph-crossline { stroke: var(--line-input); stroke-width: 1; }
.ph-hover-dot { stroke: var(--surface); stroke-width: 2; }
.ph-tip { position: absolute; top: 4px; min-width: 150px; padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm); background: var(--surface-3); box-shadow: rgba(0, 0, 0, 0.5) 0 8px 24px; font-size: var(--fs-xs); pointer-events: none; z-index: 1; }
.ph-tip-date { color: var(--muted); margin-bottom: 4px; }
.ph-tip-row { display: grid; grid-template-columns: 14px 1fr auto; align-items: center; gap: 6px; }
.ph-tip-row strong { font-variant-numeric: tabular-nums; }
.ph-table-wrap summary { cursor: pointer; font-size: var(--fs-sm); font-weight: var(--fw-bold); color: var(--muted); min-height: var(--control-h); display: flex; align-items: center; }
.ph-table-wrap summary:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 2px; }
.ph-table-scroll { max-height: 280px; overflow: auto; }
.ph-table { width: 100%; font-size: var(--fs-xs); font-variant-numeric: tabular-nums; }
.ph-table th, .ph-table td { text-align: left; padding: 4px var(--space-2) 4px 0; white-space: nowrap; }
.ph-empty { padding: var(--space-5) var(--space-3); }
@media (max-width: 480px) {
  .ph-inner { padding: var(--space-4); }
}

/* === rewards (Phase 21, js/rewards.js) === */
.rwd-card { display: flex; flex-direction: column; gap: var(--space-3); }
.rwd-head { margin-bottom: 0; align-items: flex-start; }
.rwd-sub { margin-top: var(--space-1); max-width: 60ch; }
.rwd-soon { flex: none; }
.rwd-balance { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); margin: 0; }
.rwd-bucket { background: var(--surface-2); border-radius: var(--radius); padding: var(--space-3) var(--space-4); }
.rwd-bucket dt { color: var(--muted); font-size: var(--fs-xs); }
.rwd-bucket dd { margin: var(--space-1) 0 0; font-size: var(--fs-xl); font-weight: var(--fw-bold); font-variant-numeric: tabular-nums; }
.rwd-bucket dd.rwd-cash { font-size: var(--fs-sm); font-weight: var(--fw-regular); color: var(--muted); margin-top: 0; }
.rwd-terms { display: flex; gap: var(--space-2); align-items: flex-start; font-size: var(--fs-sm); }
.rwd-terms a { color: var(--text); }
.rwd-msg { font-size: var(--fs-sm); padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm); background: var(--surface-2); }
.rwd-actions { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; }
.rwd-redeem[disabled] { opacity: 0.55; cursor: not-allowed; }
.rwd-h3 { font-size: var(--fs-md); font-weight: var(--fw-bold); margin-top: var(--space-2); }
.rwd-offers, .rwd-history { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); }
.rwd-offer { display: flex; justify-content: space-between; gap: var(--space-3); align-items: center;
  padding: var(--space-3); border-radius: var(--radius); background: var(--surface-2); }
.rwd-offer-main { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-2); align-items: center; min-width: 0; }
.rwd-offer-main p { flex-basis: 100%; margin: 0; }
.rwd-offer-title { font-weight: var(--fw-bold); }
.rwd-offer-pts { font-size: var(--fs-sm); color: var(--muted); text-align: right; flex: none; max-width: 45%; }
.rwd-sponsored { text-transform: uppercase; letter-spacing: 0.4px; }
.rwd-history li { display: grid; grid-template-columns: 1fr auto auto; gap: var(--space-3); align-items: center;
  font-size: var(--fs-sm); padding: var(--space-2) 0; border-bottom: 1px solid var(--line); }
.rwd-history li:last-child { border-bottom: 0; }
.rwd-fine { margin: 0; }
.bx-rewards-link { display: inline-block; margin-top: var(--space-1); padding: var(--space-1) 0; color: var(--muted); font-size: var(--fs-xs); }
.bx-rewards-link:hover { color: var(--text); }
@media (max-width: 520px) {
  .rwd-offer { flex-direction: column; align-items: flex-start; }
  .rwd-offer-pts { text-align: left; max-width: none; }
}
/* === end rewards === */

/* === UI polish (docs/design/review-2026-11.md) ===
   CSS-only fixes from the November design review. Kept in one block so it merges cleanly. */

/* R1 — the money answer is the biggest thing in the verdict (was 24px desktop / 18px phone,
   same size as the store name). */
.gro-winner-total { font-size: var(--fs-display); line-height: var(--lh-tight); }
@media (max-width: 480px) {
  .gro-winner-store { font-size: var(--fs-lg); }
  .gro-winner-total { font-size: 28px; }
}

/* R2 — grocery list rows on phones: the stepper moves under the item so the name and its
   links get the full width. Rows drop from ~150px to ~110px and the verdict comes up the page. */
@media (max-width: 480px) {
  .gro-line-row {
    display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto;
    align-items: center; column-gap: var(--space-2); row-gap: 2px;
  }
  .gro-line-row > .gro-check { grid-column: 1; grid-row: 1; }
  .gro-line-row > .gro-line-thumb { grid-column: 2; grid-row: 1; }
  .gro-line-row > .gro-line-main { grid-column: 3; grid-row: 1; }
  .gro-line-row > .gro-del { grid-column: 4; grid-row: 1; }
  .gro-line-row > .gro-qty { grid-column: 3 / 5; grid-row: 2; justify-self: end; }
  .gro-picker { padding-left: 0; }
}

/* R3 — green is for winners only: weekly-ad prices are white (the "Reg $x" line already shows the deal). */
.gro-deal-price.is-deal { color: var(--text); }

/* R4 — quick-add chips in empty states were the same shade as the box they sit in. */
.empty .chip { background: var(--surface-3); box-shadow: var(--line-strong) 0 0 0 1px inset; }
.empty .chip:hover { background: var(--surface-hover); }

/* R5 — developer setup hints don't belong in shopper-facing copy (Settings › Advanced still has it). */
.gro-dev-hint, .prd-dev-hint { display: none; }

/* R6 — product art is a placeholder; it no longer pushes the price below the fold. */
.prd-media { aspect-ratio: 16 / 9; }
@container (max-width: 419px) { .prd-media { aspect-ratio: auto; height: 112px; } }

/* R7 — budget: the hero already shows "Left to spend" in green; the repeat tile stays neutral
   (red still shows when over budget). */
.bud-stat dd.good { color: var(--text); }

/* R8 — transaction titles wrap to two lines instead of cutting off ("Transfer to savi…"). */
@media (max-width: 480px) {
  .bud-txn-title {
    white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
    line-height: var(--lh-tight);
  }
}
/* R9 — "Saved with MoneySavv" before anything is logged: $0.00 figures are muted, not shouted. */
.bx-saved:has(.bx-saved-hint) .bx-saved-value,
.bx-saved:has(.bx-saved-hint) .bx-saved-all { color: var(--muted); }
/* R10 — "Pick product" sits next to "I bought this" but was a 17px-tall target; both are 44px now
   (same line, so the row doesn't grow). */
@media (max-width: 699px) {
  .gro-line-sub [data-action="toggle-picker"] { display: inline-flex; align-items: center; min-height: 44px; padding-right: var(--space-2); }
}
/* === end UI polish === */

/* Store and retailer logos (js/brand-logo.js, Logo.dev). Decorative: the name is always beside it. */
.brand-logo { width: var(--logo, 24px); height: var(--logo, 24px); flex: none; display: inline-block; vertical-align: middle; object-fit: contain; border-radius: var(--radius-xs); margin-inline-end: 0.4em; }
.brand-badge { display: inline-flex; align-items: center; justify-content: center; background: var(--surface-3); color: var(--muted); font-size: calc(var(--logo, 24px) * 0.55); font-weight: var(--fw-bold); line-height: 1; letter-spacing: 0; text-transform: none; }
.brand-badge::before { content: attr(data-initial); }
.gro-store-name > .brand-logo { margin-inline-end: 0; }
.prd-retailer { display: inline-flex; align-items: center; white-space: nowrap; }
.prd-retailer .brand-logo { margin-inline-end: 0.35em; }
.site-foot .logo-credit { font-size: var(--fs-micro); }
