/* CheddaStack v1 design tokens: the shelf tag, in Chedda yellow (STK laws 32 and 44; ledger 23). Picked by Mark on
   2026-10-16 from three directions: direction B's type and shelf-tag cards, Chedda yellow as CheddaStack's own color,
   saved green where B had a sale red. The names are fixed; the site and the app use only these.

   The shelf-tag card, the one signature device: a white card with a 1.5px --line border and a 6px --cheddar band across
   the top (with a --hairline of --cheddar-edge under it), the price set big in the display face, and a small --cheddar
   tab at the top right naming what the card is, edged in --cheddar-edge.

   Edges (STK law 45): every button, chip, tab and badge carries a --hairline border one shade darker than its own fill
   (--cheddar-edge on yellow, --saved-edge on green, --live-edge on blue, --warn-edge on amber, --ink-edge on white), so
   the edges pop. The art is Eye Formation (theme/art.mjs): seeded SVG, no script. */
:root {
  /* Ground and text */
  --paper: #ffffff;        /* the page */
  --panel: #fafaf8;        /* a quiet card or section ground */
  --ink: #1f2328;          /* text, never pure black */
  --ink-2: #59606b;        /* secondary text */
  --line: #e6e8eb;         /* hairlines and card borders */
  --line-strong: #cfd3d9;  /* quiet buttons and inputs */

  /* Chedda yellow: CheddaStack's own color. Primary buttons, the shelf-tag band and tab. Text on it is --ink. */
  --cheddar: #ffc21a;
  --cheddar-deep: #e0a800;
  --cheddar-soft: #ffe9a3;   /* a vibrant chip fill */
  --cheddar-edge: #b98200;   /* the hairline on anything yellow: one shade darker, so the edge pops (STK law 45) */

  /* Meaning colors. There is no sale red (STK law 44). */
  --saved: #138a52;        /* what you saved, the price at the register, a good deal */
  --saved-soft: #d3f3df;
  --saved-edge: #0d6b3e;
  --warn: #9a5b00;         /* not a deal at your Smith's, different at your Smith's */
  --warn-soft: #fde3bd;
  --warn-edge: #7a4700;
  --live: #2a64b0;         /* Kroger's live answer, shown and never kept */
  --live-soft: #dce9fb;
  --live-edge: #1d4c88;

  /* Shape */
  --radius: 8px;           /* cards and buttons: crisp, like a tag, not a pill */
  --radius-s: 6px;
  --band: 6px;             /* the shelf-tag band */
  --hairline: 1px;         /* every button, card, chip and tab edge: thin, in the darker shade of its own color */
  --ink-edge: #3b4149;     /* the hairline on white buttons and inputs */
  --shadow: 0 1px 2px rgba(31, 35, 40, 0.06), 0 4px 14px rgba(31, 35, 40, 0.06);
  --tap: 48px;             /* the smallest thing a thumb presses */
  --gutter: 16px;          /* phone side gutter */
  --measure: 40rem;        /* the longest line of reading text */

  /* Type: tall condensed headings and prices, like the tags in the aisle; an open, readable body. Body is never under
     18px on a phone. No all-caps headings. */
  --font-display: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
  --font-body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --text: 18px;
  --text-s: 16px;          /* captions and small print only */
  --text-l: 22px;
  --text-xl: 32px;
  --text-xxl: 44px;
  --price: 36px;           /* a price on a deal is big, in the display face */
  --weight-body: 400;
  --weight-strong: 700;
  --weight-display: 700;
}

/* Google Fonts, the one allowed font origin. Pages load:
   https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@600;700&family=Figtree:wght@400;600;700&display=swap */


/* The spacing scale (STK law 47: room between containers). Every stack spaces its children with these, by gap. */
:root { color-scheme: light; --space-1: 8px; --space-2: 12px; --space-3: 16px; --space-4: 24px; --space-5: 32px; }
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--text);
  font-weight: var(--weight-body);
  line-height: 1.5;
}
body.has-nav { padding-bottom: calc(var(--tap) + 40px + env(safe-area-inset-bottom)); }
[hidden] { display: none !important; }
h1, h2, h3, legend { font-family: var(--font-display); font-weight: var(--weight-display); line-height: 1.15; text-transform: none; letter-spacing: 0; }
h1, h2, h3 { margin: 0 0 8px; }
h1 { font-size: var(--text-xl); }
h2 { font-size: var(--text-l); }
h3 { font-size: var(--text-l); }
p { margin: 0 0 12px; }
a { color: var(--ink); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--live); outline-offset: 2px; }
[tabindex="-1"]:focus { outline: none; }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: var(--gutter); top: -200px; background: var(--paper); padding: 12px; border-radius: var(--radius); z-index: 20; }
.skip:focus { top: 8px; }

/* the header: the wordmark, and Settings as a small link */
.app-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px var(--gutter); background: var(--paper); border-bottom: 1.5px solid var(--line); }
.wordmark { display: inline-flex; align-items: center; gap: 8px; min-height: var(--tap); font-family: var(--font-display); font-weight: var(--weight-display); font-size: var(--text-l); text-decoration: none; color: var(--ink); }
.wordmark::before { content: ""; width: 10px; height: 22px; border-radius: 2px; background: var(--cheddar); border: var(--hairline) solid var(--cheddar-edge); }
.head-link { display: inline-flex; align-items: center; min-height: var(--tap); padding: 0 12px; color: var(--ink-2); font-weight: var(--weight-strong); text-decoration: none; border-radius: var(--radius); border: var(--hairline) solid transparent; }
.head-link[aria-current="page"] { color: var(--ink); background: var(--cheddar-soft); border-color: var(--cheddar-edge); }

main { display: block; max-width: var(--measure); margin: 0 auto; padding: 16px var(--gutter) 24px; }
.page-this-week main, .page-list main { display: flex; flex-direction: column; gap: var(--space-3); padding-top: var(--space-2); }
.page-this-week main > :empty, .page-list main > :empty { display: none; }
.lead { color: var(--ink-2); }
.sub { color: var(--ink-2); margin-bottom: 4px; }
.note { color: var(--ink-2); font-size: var(--text-s); }
.loading { color: var(--ink-2); padding: 24px 0; }
.back { display: inline-flex; align-items: center; min-height: var(--tap); font-weight: var(--weight-strong); }
.page-top { margin-bottom: var(--space-1); }
.page-end { margin: var(--space-4) 0 var(--space-1); }
section.block { margin: var(--space-5) 0; display: flex; flex-direction: column; gap: var(--space-3); }
section.block > h2, section.block > h3 { margin: 0; }
.stack { display: flex; flex-direction: column; gap: var(--space-3); }
.stack:empty { display: none; }

/* the top bar on every signed-in screen: the wedge mark, the store chip, the cheese-stack meter (STK law 48) */
.top { position: sticky; top: 0; z-index: 15; display: flex; align-items: center; gap: var(--space-1); padding: 4px var(--gutter); background: var(--paper); border-bottom: var(--hairline) solid var(--line); }
.mark-link { display: inline-flex; align-items: center; justify-content: center; min-width: var(--tap); min-height: var(--tap); }
.mark { width: 30px; height: 30px; }
.mark .m-cheese { fill: var(--cheddar); stroke: var(--cheddar-edge); stroke-width: 1.4; stroke-linejoin: round; }
.mark .m-hole { fill: var(--paper); stroke: var(--cheddar-edge); stroke-width: 1; }
.mark .m-base { fill: var(--saved); stroke: var(--saved-edge); stroke-width: 1; }
.store-chip { display: inline-flex; align-items: center; min-height: var(--tap); min-width: 0; text-decoration: none; color: var(--ink-2); }
.store-chip span { display: inline-block; max-width: 9.5em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 2px 10px; border: var(--hairline) solid var(--line-strong); border-radius: 999px; font-size: var(--text-s); }
.meter { margin-left: auto; display: inline-flex; align-items: center; gap: var(--space-1); min-height: var(--tap); padding: 4px 10px 4px 8px; background: var(--saved-soft); border: var(--hairline) solid var(--saved-edge); border-radius: var(--radius); text-decoration: none; color: var(--ink); flex: none; }
.meter b { display: block; font-family: var(--font-display); font-weight: var(--weight-display); font-size: var(--text-l); line-height: 1; color: var(--saved); font-variant-numeric: tabular-nums; }
.meter small { display: block; font-size: var(--text-s); line-height: 1.1; color: var(--saved-edge); }
.slices { display: flex; flex-direction: column-reverse; gap: 2px; width: 26px; min-height: 34px; justify-content: flex-start; }
.slices i { display: block; height: 6px; border-radius: 2px; background: var(--cheddar); border: var(--hairline) solid var(--cheddar-edge); }
.slices i:nth-child(2) { margin-left: 2px; }
.slices i:nth-child(3) { margin-left: -1px; }
.slices i:nth-child(4) { margin-left: 1px; }
.slices i.new { animation: drop-in 420ms cubic-bezier(0.2, 0.8, 0.3, 1.15) both; }

/* the tab bar: This week, Your list, the big yellow Send a deal, Saved, You */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: grid; grid-template-columns: repeat(5, 1fr); align-items: end; background: var(--paper); border-top: var(--hairline) solid var(--line); padding: 6px 2px calc(6px + env(safe-area-inset-bottom)); }
.tabs a, .tabs .center { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 2px; min-height: var(--tap); color: var(--ink-2); font-size: var(--text-s); font-weight: var(--weight-strong); text-decoration: none; white-space: nowrap; }
.tabs a[aria-current="page"] { color: var(--ink); }
.tabs svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tabs a[aria-current="page"] svg { stroke-width: 2.4; }
.tabs .badge { position: absolute; top: -4px; left: calc(50% + 4px); min-width: 22px; padding: 0 6px; border-radius: 999px; background: var(--saved); color: var(--paper); border: var(--hairline) solid var(--saved-edge); font-size: var(--text-s); line-height: 1.25; text-align: center; }
.tabs .center { margin-top: -30px; padding: 0; border: 0; background: none; font: inherit; font-size: var(--text-s); font-weight: var(--weight-strong); color: var(--ink); cursor: pointer; }
.tabs .center b { display: grid; place-items: center; width: 60px; height: 60px; border-radius: 50%; background: var(--cheddar); border: 2px solid var(--cheddar-edge); box-shadow: var(--shadow); }
.tabs .center b svg { width: 28px; height: 28px; stroke: var(--ink); stroke-width: 2.6; }
body.has-nav { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
body.has-sticky { padding-bottom: calc(84px + 112px + env(safe-area-inset-bottom)); }
body.drawer-open { overflow: hidden; }

/* bottom sheets: a dimmed backdrop, a handle, detail one tap away */
.drawer-host { position: fixed; inset: 0; z-index: 30; }
.dim { position: absolute; inset: 0; background: var(--ink); opacity: 0.42; }
.drawer { position: absolute; left: 0; right: 0; bottom: 0; max-height: 90vh; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-1) var(--gutter) calc(var(--space-4) + env(safe-area-inset-bottom)); background: var(--paper); border-top: var(--hairline) solid var(--line-strong); border-radius: calc(var(--radius) * 2) calc(var(--radius) * 2) 0 0; animation: drawer-up 220ms ease-out both; }
@keyframes drawer-up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.drawer:focus { outline: none; }
.handle { align-self: center; width: 44px; height: 5px; margin: 4px 0; border-radius: 4px; background: var(--line-strong); flex: none; }
.drawer-h { margin: 0; font-size: var(--text-xl); line-height: 1.05; }
.src { margin: 0; color: var(--ink-2); font-size: var(--text-s); }
.stackrow { display: flex; flex-direction: column; gap: 6px; }
.spart { display: flex; justify-content: space-between; gap: var(--space-1); padding: 8px 12px; border-radius: var(--radius); background: var(--cheddar-soft); border: var(--hairline) solid var(--cheddar-edge); font-variant-numeric: tabular-nums; }
.spart.shelf { background: var(--paper); border-color: var(--line-strong); }
.spart.maybe { background: var(--paper); border-style: dashed; border-color: var(--line-strong); color: var(--ink-2); }
.spart b { white-space: nowrap; }
.big { display: flex; align-items: baseline; gap: var(--space-1); flex-wrap: wrap; }
.big > b { font-family: var(--font-display); font-weight: var(--weight-display); font-size: var(--text-xxl); line-height: 0.95; color: var(--saved); font-variant-numeric: tabular-nums; }
.big .chip { margin: 0; }
.fold { border: var(--hairline) solid var(--line-strong); border-radius: var(--radius); padding: 0 12px; }
.fold > summary { justify-content: space-between; }
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary { list-style: none; }
.fold > summary::after { content: "+"; color: var(--ink-2); font-size: var(--text-l); }
.fold[open] > summary::after { content: "\2212"; }
.fold-body { display: flex; flex-direction: column; gap: var(--space-2); padding-bottom: var(--space-2); }
.fresh-tag .stackrow > * { animation: drop-in 420ms cubic-bezier(0.2, 0.8, 0.3, 1.15) both; }
.price-num.was { color: var(--ink-2); text-decoration: line-through; }
.price-num.landed { display: inline-block; animation: drop-in 420ms cubic-bezier(0.2, 0.8, 0.3, 1.15) both; }
.fresh-tag .stackrow > :nth-child(2) { animation-delay: 160ms; }
.fresh-tag .stackrow > :nth-child(3) { animation-delay: 320ms; }
.fresh-tag .stackrow > :nth-child(n+4) { animation-delay: 480ms; }

/* This week: Chedda's research strip, the filter pills, the tile grid */
.research { display: flex; align-items: center; gap: var(--space-2); width: 100%; padding: var(--space-1) var(--space-2); background: var(--cheddar-soft); border: var(--hairline) solid var(--cheddar-edge); border-radius: var(--radius); font: inherit; text-align: left; color: var(--ink); cursor: pointer; }
.research p { margin: 0; font-size: var(--text-s); line-height: 1.35; }
.research b { font-family: var(--font-display); font-weight: var(--weight-display); font-size: var(--text); }
.research .go { margin-left: auto; font-size: var(--text-l); color: var(--cheddar-edge); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2); }
.tile { position: relative; display: flex; flex-direction: column; overflow: hidden; border: var(--hairline) solid var(--line-strong); border-radius: var(--radius); background: var(--paper); }
.tile::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: var(--band); background: var(--cheddar); border-bottom: var(--hairline) solid var(--cheddar-edge); }
.tile .pct { position: absolute; top: var(--band); left: var(--space-1); z-index: 1; padding: 0 7px 2px; background: var(--cheddar); border: var(--hairline) solid var(--cheddar-edge); border-top: 0; border-radius: 0 0 var(--radius-s) var(--radius-s); font-family: var(--font-display); font-weight: var(--weight-display); font-size: var(--text-s); pointer-events: none; }
.tile-open { display: flex; flex: 1; flex-direction: column; gap: 4px; width: 100%; min-height: 150px; padding: calc(var(--band) + 30px) var(--space-1) var(--space-1); border: 0; background: none; font: inherit; text-align: left; color: var(--ink); cursor: pointer; }
.tprice { font-family: var(--font-display); font-weight: var(--weight-display); font-size: var(--text-xl); line-height: 1; color: var(--saved); font-variant-numeric: tabular-nums; }
.tprice small { font-family: var(--font-body); font-size: var(--text-s); font-weight: var(--weight-strong); color: var(--ink-2); }
.tname { font-weight: var(--weight-strong); font-size: var(--text-s); line-height: 1.25; }
.tmeta { display: flex; align-items: center; gap: 6px; min-height: var(--tap); margin-top: auto; padding-right: 52px; font-size: var(--text-s); color: var(--ink-2); }
.stackmark { display: inline-flex; flex-direction: column; gap: 1px; width: 14px; flex: none; }
.stackmark i { display: block; height: 4px; border-radius: 1px; background: var(--cheddar); border: var(--hairline) solid var(--cheddar-edge); }
.tadd { position: absolute; right: var(--space-1); bottom: var(--space-1); display: grid; place-items: center; width: var(--tap); height: var(--tap); border-radius: 50%; background: var(--cheddar); border: var(--hairline) solid var(--cheddar-edge); color: var(--ink); font: inherit; font-weight: var(--weight-display); font-size: var(--text-l); line-height: 1; cursor: pointer; }
.tadd svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.tadd[aria-pressed="true"] { background: var(--saved); border-color: var(--saved-edge); color: var(--paper); }

/* Your list: the win on top, the track one step at a time, checklist rows, one next action at the thumb */
.hero { display: flex; flex-direction: column; gap: 4px; padding-top: var(--space-1); }
.lbar { display: block; width: 100%; height: 10px; border: var(--hairline) solid var(--line-strong); border-radius: 999px; background: var(--line); overflow: hidden; appearance: none; -webkit-appearance: none; }
.lbar::-webkit-progress-bar { background: var(--line); }
.lbar::-webkit-progress-value { background: var(--cheddar); border-right: var(--hairline) solid var(--cheddar-edge); }
.lbar::-moz-progress-bar { background: var(--cheddar); }
.ltrack { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-1); }
.lstep { display: flex; flex-direction: column; gap: 2px; min-height: var(--tap); padding: 8px 10px; border: var(--hairline) solid var(--line-strong); border-radius: var(--radius); background: var(--paper); font: inherit; font-size: var(--text-s); text-align: left; color: var(--ink); cursor: pointer; }
.lstep b { font-family: var(--font-display); font-weight: var(--weight-display); font-size: var(--text-l); line-height: 1.1; }
.lstep.done { background: var(--saved-soft); border-color: var(--saved-edge); }
.lstep[aria-current="step"] { background: var(--cheddar-soft); border-color: var(--cheddar-edge); }
.says { display: flex; gap: var(--space-2); align-items: center; }
.says .bubble { margin: 0; flex: 1; }
.clist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-1); }
.crow { display: flex; gap: var(--space-2); align-items: center; min-height: var(--tap); padding: 6px var(--space-2); border: var(--hairline) solid var(--line-strong); border-radius: var(--radius); background: var(--paper); }
.crow > input[type="checkbox"] { width: 28px; height: 28px; flex: none; margin: 0; accent-color: var(--cheddar); }
.crow-text { flex: 1; min-width: 0; margin: 0; font-weight: var(--weight-strong); cursor: pointer; }
.crow-text small { display: block; font-weight: var(--weight-body); font-size: var(--text-s); color: var(--ink-2); }
.crow .more { display: grid; place-items: center; min-width: var(--tap); min-height: var(--tap); border: 0; background: none; color: var(--ink-2); font: inherit; font-size: var(--text-l); cursor: pointer; }
.crow-cart { flex-wrap: wrap; }
.crow-cart .live { flex-basis: 100%; }
.sticky { position: fixed; left: 0; right: 0; bottom: calc(68px + env(safe-area-inset-bottom)); z-index: 9; display: flex; flex-direction: column; gap: 6px; padding: var(--space-2) var(--gutter); background: var(--paper); border-top: var(--hairline) solid var(--line); }
.sticky small { text-align: center; color: var(--ink-2); font-size: var(--text-s); }

/* the Send a deal sheet */
.opts { display: flex; flex-direction: column; gap: var(--space-1); }
.opt { position: relative; display: flex; gap: var(--space-2); align-items: center; width: 100%; min-height: var(--tap); padding: var(--space-2); border: var(--hairline) solid var(--ink-edge); border-radius: var(--radius); background: var(--paper); font: inherit; font-weight: var(--weight-strong); text-align: left; color: var(--ink); cursor: pointer; }
.opt .ico { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: var(--radius); background: var(--cheddar-soft); border: var(--hairline) solid var(--cheddar-edge); }
.opt .ico svg { width: 22px; height: 22px; fill: none; stroke: var(--ink); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.opt small { display: block; font-weight: var(--weight-body); font-size: var(--text-s); color: var(--ink-2); }
.opt input[type="file"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.opt:focus-within { outline: 3px solid var(--live); outline-offset: 2px; }
.help { display: flex; gap: var(--space-1); align-items: center; padding: var(--space-1) var(--space-2); background: var(--saved-soft); border: var(--hairline) solid var(--saved-edge); border-radius: var(--radius); font-size: var(--text-s); }
.help b { font-family: var(--font-display); font-weight: var(--weight-display); font-size: var(--text-l); color: var(--saved); }
.kind-pick { flex-direction: row; flex-wrap: wrap; gap: var(--space-1); }
.kind-pick legend { flex-basis: 100%; }
.kind-pick .check { flex: 1 1 40%; }

/* the win, and sharing it */
.win { display: flex; flex-direction: column; gap: var(--space-3); }
.artband { height: 40px; overflow: hidden; border-radius: var(--radius); border: var(--hairline) solid var(--cheddar-edge); }
.artband img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ring-sm { padding: 3px; }
.ring-44 img { width: 44px; height: 44px; }
.ring-48 img { width: 48px; height: 48px; }
.ring-64 img { width: 64px; height: 64px; }
.ring-96 img { width: 96px; height: 96px; }
.share-preview canvas { display: block; width: 100%; height: auto; border-radius: var(--radius); border: var(--hairline) solid var(--line-strong); }
.shares { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-1); }
.from-tag { display: inline-block; align-self: flex-start; padding: 0 8px; border-radius: var(--radius-s); background: var(--cheddar-soft); border: var(--hairline) solid var(--cheddar-edge); color: var(--ink); font-size: var(--text-s); font-weight: var(--weight-strong); }
.mine-tag { display: inline-block; align-self: flex-start; padding: 0 8px; border-radius: var(--radius-s); background: var(--saved-soft); border: var(--hairline) solid var(--saved-edge); color: var(--ink); font-size: var(--text-s); font-weight: var(--weight-strong); }
.btn-danger { border-color: var(--warn-edge); color: var(--warn-edge); }
.cf-turnstile { min-height: 65px; }

/* buttons: crisp like a tag, every one a thumb's size; one primary per screen */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--tap); padding: 10px 18px; border: var(--hairline) solid var(--ink-edge); border-radius: var(--radius); background: var(--paper); color: var(--ink); font: inherit; font-weight: var(--weight-strong); line-height: 1.2; text-align: center; text-decoration: none; cursor: pointer; }
.btn:hover { border-color: var(--ink); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.55; cursor: default; }
.btn-primary { display: flex; width: 100%; background: var(--cheddar); border: var(--hairline) solid var(--cheddar-edge); color: var(--ink); font-family: var(--font-display); font-weight: var(--weight-display); font-size: var(--text-l); padding: 12px 20px; }
.btn-primary:hover { background: var(--cheddar-deep); border-color: var(--cheddar-edge); }
.btn-add { background: var(--cheddar); border-color: var(--cheddar-edge); }
.btn-add:hover { background: var(--cheddar-deep); border-color: var(--cheddar-edge); }
.btn-wide { display: flex; width: 100%; }
.btn-live { background: var(--live-soft); border-color: var(--live-edge); }
.btn-quiet { display: inline-flex; align-items: center; min-height: var(--tap); padding: 0 4px; border: 0; background: none; color: var(--ink-2); font: inherit; font-size: var(--text-s); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.btn[aria-pressed="true"] { background: var(--saved-soft); border-color: var(--saved-edge); color: var(--ink); }
.row { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.decide { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-1); margin: var(--space-2) 0 var(--space-1); }
.decide.decide-main { grid-template-columns: 1fr 1fr; }
.decide.decide-main .btn-primary { grid-column: 1 / -1; }
.decided { color: var(--ink-2); font-size: var(--text-s); margin: 4px 0; }

/* cards, and the shelf tag: the band across the top, the tab at the top right */
.card { background: var(--paper); border: 1.5px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: var(--space-3); margin: var(--space-4) 0; }
.card-soft { background: var(--panel); box-shadow: none; }
.tag-card { position: relative; overflow: hidden; padding-top: calc(var(--band) + 12px); }
.tag-card::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: var(--band); background: var(--cheddar); border-bottom: var(--hairline) solid var(--cheddar-edge); }
.tab { float: right; margin: -12px -4px 8px 12px; padding: 2px 10px 4px; border: var(--hairline) solid var(--cheddar-edge); border-top: 0; border-radius: 0 0 var(--radius-s) var(--radius-s); background: var(--cheddar); color: var(--ink); font-size: var(--text-s); font-weight: var(--weight-strong); line-height: 1.4; }
.deal-title { font-size: var(--text-l); margin-bottom: 2px; }
.deal-page h1 { margin-bottom: 2px; }
.deal-title a { text-decoration: none; }
.deal-size { color: var(--ink-2); margin: 0 0 8px; }
.tag { display: inline-block; padding: 2px 10px; border: var(--hairline) solid var(--cheddar-edge); border-radius: var(--radius-s); background: var(--cheddar-soft); color: var(--ink); font-size: var(--text-s); font-weight: var(--weight-strong); }
.price-block { clear: both; margin: 8px 0 12px; }
.price-label { margin: 0; color: var(--ink-2); font-size: var(--text-s); font-weight: var(--weight-strong); }
.price { margin: 0; font-family: var(--font-display); font-weight: var(--weight-display); font-size: var(--price); line-height: 1.05; color: var(--saved); }
.price-for { font-size: var(--text-l); color: var(--ink); }
.price-each { margin: 2px 0 0; color: var(--ink-2); font-weight: var(--weight-strong); }
.each { color: var(--ink-2); font-size: var(--text-s); font-weight: var(--weight-body); }
.regular { margin: 6px 0 0; color: var(--ink-2); }
.chip { display: inline-flex; align-items: center; gap: 6px; margin: 8px 0 0; padding: 2px 10px; border-radius: var(--radius-s); line-height: 1.35; }
.chip-saved { background: var(--saved); color: var(--paper); border: var(--hairline) solid var(--saved-edge); font-family: var(--font-display); font-weight: var(--weight-display); font-size: var(--text-l); }
.chip-soft { background: var(--saved-soft); color: var(--ink); border: var(--hairline) solid var(--saved-edge); font-weight: var(--weight-strong); }
.chips-line { margin: 0; }
.after { margin: 6px 0 0; font-weight: var(--weight-strong); }
.parts { list-style: none; margin: 0 0 12px; padding: 0; }
.parts li { padding: 6px 0; border-top: 1.5px solid var(--line); }
.part-label { font-weight: var(--weight-strong); }
.part-amount { font-weight: var(--weight-strong); color: var(--saved); }
.part-note { color: var(--ink-2); }
.source { color: var(--ink-2); font-size: var(--text-s); }
.math { width: 100%; border-collapse: collapse; margin: 8px 0 12px; }
.math caption { text-align: left; font-weight: var(--weight-strong); padding-bottom: 4px; }
.math td { padding: 6px 0; border-top: 1.5px solid var(--line); }
.math td.num { text-align: right; font-weight: var(--weight-strong); white-space: nowrap; }
.math tr.total td { font-family: var(--font-display); font-weight: var(--weight-display); font-size: var(--text-l); color: var(--saved); }

/* Kroger's live answer: shown, never kept */
.live { margin: 12px 0; padding: 12px; border: var(--hairline) solid var(--live-edge); border-radius: var(--radius); background: var(--live-soft); }
.live-label { margin: 0 0 4px; font-weight: var(--weight-strong); }
.live-match { display: flex; gap: 12px; align-items: flex-start; margin: 8px 0; }
.live-match img { width: 64px; height: 64px; object-fit: contain; border-radius: var(--radius-s); background: var(--paper); flex: none; }
.live-match p { margin: 0; }
.live-off { border-color: var(--ink-edge); background: var(--panel); }
.warn { margin: 8px 0; padding: 10px 12px; border: var(--hairline) solid var(--warn-edge); border-radius: var(--radius); background: var(--warn-soft); color: var(--ink); }
.good { margin: 8px 0; padding: 10px 12px; border: var(--hairline) solid var(--saved-edge); border-radius: var(--radius); background: var(--saved-soft); color: var(--ink); }
details > summary { min-height: var(--tap); display: flex; align-items: center; cursor: pointer; font-weight: var(--weight-strong); }

/* Chedda, small, beside a tip or an empty state */
.tip { display: flex; gap: var(--space-2); align-items: center; margin: var(--space-3) 0; padding: var(--space-2); border: 1.5px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.tip-body p:last-child { margin-bottom: 0; }
.pose { width: 72px; height: 72px; flex: none; border-radius: var(--radius); }
.empty { flex-wrap: wrap; }
.empty .tip-body { flex: 1 1 100%; }
.empty-art { display: flex; gap: 8px; flex: none; }

/* Chedda's voice: a speech bubble beside her, never over the art */
.voice { display: flex; gap: var(--space-2); align-items: flex-start; margin: var(--space-2) 0 var(--space-3); }
.bubble { position: relative; margin: 6px 0 0; padding: 12px 14px; background: var(--cheddar-soft); border: var(--hairline) solid var(--cheddar-edge); border-radius: var(--radius); font-weight: var(--weight-strong); }
.bubble::before { content: ""; position: absolute; left: -7px; top: 20px; width: 12px; height: 12px; background: var(--cheddar-soft); border-left: var(--hairline) solid var(--cheddar-edge); border-bottom: var(--hairline) solid var(--cheddar-edge); transform: rotate(45deg); }

/* Eye Formation, the art: its own picture, never under text */
.art-strip { display: block; width: 100%; height: 28px; object-fit: cover; border-bottom: var(--hairline) solid var(--cheddar-edge); }
.art-square { width: 72px; height: 72px; flex: none; object-fit: cover; border-radius: var(--radius); border: var(--hairline) solid var(--cheddar-edge); }
.art-banner { display: block; width: 100%; height: 140px; object-fit: cover; border-bottom: var(--hairline) solid var(--cheddar-edge); }
.panel { padding: 0; overflow: hidden; }
.panel-body { padding: var(--space-3); display: flex; flex-direction: column; gap: var(--space-3); }
.panel-body > h1 { margin: 0; }

/* Chedda leads onboarding (STK law 46): large, in her yellow ring, her line in a bubble beside her */
.ring { display: inline-flex; flex: none; padding: 6px; border-radius: 50%; background: var(--cheddar); border: var(--hairline) solid var(--cheddar-edge); }
.ring img { display: block; border-radius: 50%; border: var(--hairline) solid var(--cheddar-edge); object-fit: cover; }
.ring-140 img { width: 140px; height: 140px; }
.ring-112 img { width: 112px; height: 112px; }
.lead-chedda { display: flex; flex-direction: column; align-items: center; gap: var(--space-3); text-align: center; }
.lead-chedda .bubble::before { left: calc(50% - 6px); top: -7px; border-left: var(--hairline) solid var(--cheddar-edge); border-top: var(--hairline) solid var(--cheddar-edge); border-bottom: 0; }
.bubble-up::before { left: calc(50% - 6px); top: -7px; border-left: var(--hairline) solid var(--cheddar-edge); border-top: var(--hairline) solid var(--cheddar-edge); border-bottom: 0; }
.step { display: flex; flex-direction: column; gap: var(--space-4); }
.step > h1 { margin: 0; }
@keyframes bob { 0%, 100% { transform: none; } 35% { transform: translateY(-10px); } 65% { transform: translateY(3px); } }
.ring.bob { animation: bob 700ms ease-out both; }

/* the step track: a small Chedda moves along it as the steps complete */
.track-wrap { display: flex; flex-direction: column; gap: var(--space-1); margin: var(--space-2) 0 var(--space-4); }
.track { position: relative; height: 40px; margin: 0 18px; }
.track-line { position: absolute; left: 0; right: 0; top: 19px; height: 3px; border-radius: 2px; background: var(--line); }
.track-dot { position: absolute; top: 13px; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; background: var(--paper); border: var(--hairline) solid var(--cheddar-edge); }
.track-dot[data-n="1"] { left: 0; }
.track-dot[data-n="2"] { left: 50%; }
.track-dot[data-n="3"] { left: 100%; }
.track[data-at="2"] .track-dot[data-n="1"], .track[data-at="3"] .track-dot { background: var(--cheddar); }
.walker { position: absolute; top: 2px; left: 0; width: 36px; height: 36px; margin-left: -18px; border-radius: 50%; border: var(--hairline) solid var(--cheddar-edge); transition: left 600ms ease-out; }
.track[data-at="2"] .walker { left: 50%; }
.track[data-at="3"] .walker { left: 100%; }
.step-of { margin: 0; text-align: center; color: var(--ink-2); font-weight: var(--weight-strong); }

/* the welcome: Chedda over the art, her words below it, never on it */
.done-panel { position: relative; display: flex; align-items: center; justify-content: center; height: 240px; border-radius: var(--radius); overflow: hidden; border: var(--hairline) solid var(--cheddar-edge); }
.done-panel .art-panel { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.done-panel .ring { position: relative; }

/* forms: a field keeps its label on its input; the form spaces its fields, its words and its buttons on the scale */
form { display: flex; flex-direction: column; gap: var(--space-3); }
form > p, fieldset > p { margin: 0; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
label { display: block; font-weight: var(--weight-strong); margin: 0; }
input[type="text"], input[type="email"], input[type="number"], input[type="date"], input[type="search"], input:not([type]), select, textarea {
  display: block; width: 100%; min-height: var(--tap); padding: 10px 12px; border: var(--hairline) solid var(--ink-edge); border-radius: var(--radius);
  background: var(--paper); color: var(--ink); font: inherit;
}
input:focus, select:focus, textarea:focus { border-color: var(--live); }
.code-input { font-family: var(--font-display); font-size: var(--text-xl); letter-spacing: 6px; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; display: flex; flex-direction: column; gap: var(--space-2); }
legend { font-size: var(--text-l); padding: 0; margin-bottom: 4px; }
.check { display: flex; align-items: center; gap: var(--space-2); min-height: var(--tap); margin: 0; font-weight: var(--weight-body); cursor: pointer; }
.check input { width: 28px; height: 28px; flex: none; accent-color: var(--saved); margin: 0; }
.check-strong { font-weight: var(--weight-strong); }
.choice { display: flex; align-items: center; gap: var(--space-2); width: 100%; min-height: var(--tap); padding: var(--space-2); margin: 0; border: var(--hairline) solid var(--ink-edge); border-radius: var(--radius); background: var(--paper); text-align: left; font: inherit; color: var(--ink); cursor: pointer; }
.choice:hover { border-color: var(--ink); }
.choice strong { display: block; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-1); }
.seg .btn { padding: 8px 6px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2); }
.chips { display: flex; flex-wrap: wrap; gap: var(--space-1); margin: var(--space-1) 0; }
.chips .btn { padding: 8px 14px; }
.say { margin: 0; color: var(--ink-2); }
.say:empty { display: none; }
.say-bad { color: var(--warn); font-weight: var(--weight-strong); }
.file-pick { position: relative; }
.file-pick input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.file-pick:focus-within { outline: 3px solid var(--live); outline-offset: 2px; }

/* This week: the groups, the compact rows, the filter chips */
.group { display: flex; flex-direction: column; gap: var(--space-3); margin: var(--space-5) 0; }
.group > h2 { margin: 0; }
.group > .card { margin: 0; }
.rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-1); }
.deal-row { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-1) var(--space-2); border: 1.5px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.deal-row.open { display: block; padding: 0; border: 0; background: none; }
.row-open { flex: 1; display: grid; grid-template-columns: 1fr auto; gap: 2px var(--space-2); align-items: center; min-height: var(--tap); padding: 4px 0; border: 0; background: none; color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.row-title { font-weight: var(--weight-strong); }
.row-title .sub { display: block; font-weight: var(--weight-body); font-size: var(--text-s); }
.row-price { font-family: var(--font-display); font-weight: var(--weight-display); font-size: var(--text-l); color: var(--saved); text-align: right; }
.row-open .chip { grid-column: 1 / -1; justify-self: start; margin: 0; font-size: var(--text-s); }
.filters { display: flex; flex-wrap: nowrap; gap: var(--space-1); margin: 0; overflow-x: auto; scrollbar-width: none; padding: 2px 0; }
.filters::-webkit-scrollbar { display: none; }
.filter { flex: none; min-height: var(--tap); padding: 6px 14px; border-radius: 999px; border: var(--hairline) solid var(--ink-edge); background: var(--paper); color: var(--ink); font: inherit; font-weight: var(--weight-strong); white-space: nowrap; cursor: pointer; }
.filter[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.filter .n { margin-left: 4px; color: var(--ink-2); font-weight: var(--weight-body); }
.filter[aria-pressed="true"] .n { color: var(--paper); }

/* the list */
.steps { list-style: none; margin: 0; padding: 0; }
.steps > li { padding: var(--space-3) 0; border-top: 1.5px solid var(--line); display: flex; flex-direction: column; gap: var(--space-1); }
.steps > li > p { margin: 0; }
.steps > li:first-child { border-top: 0; }
.coupon-name { font-weight: var(--weight-strong); }
.where { color: var(--ink-2); margin: 4px 0; }
.qty { display: inline-flex; align-items: center; justify-content: center; min-width: 36px; height: 36px; margin-right: 8px; border: var(--hairline) solid var(--cheddar-edge); border-radius: var(--radius-s); background: var(--cheddar); font-family: var(--font-display); font-weight: var(--weight-display); font-size: var(--text-l); }
.cando { margin: 8px 0 12px; padding-left: 20px; }
.cando li { padding: 4px 0; }
.totals { width: 100%; border-collapse: collapse; }
.totals td { padding: 8px 0; border-top: 1.5px solid var(--line); }
.totals td.num { text-align: right; font-weight: var(--weight-strong); }
.totals tr.total td { font-family: var(--font-display); font-weight: var(--weight-display); font-size: var(--text-l); color: var(--saved); }

/* what you saved */
.saved-total { margin: 4px 0 0; font-family: var(--font-display); font-weight: var(--weight-display); font-size: var(--text-xxl); color: var(--saved); line-height: 1.05; }
.order h3 { margin-bottom: 4px; }

/* add deals: the picture beside what Chedda read */
.upload { display: grid; grid-template-columns: 112px 1fr; gap: var(--space-2); align-items: start; }
.shot { width: 112px; min-height: 112px; border-radius: var(--radius-s); background: var(--panel); border: 1.5px solid var(--line); overflow: hidden; display: flex; align-items: center; justify-content: center; color: var(--ink-2); font-size: var(--text-s); text-align: center; padding: 4px; }
.shot canvas { display: block; width: 100%; height: auto; }
.unsure { display: inline-block; margin-left: 4px; padding: 0 8px; border: var(--hairline) solid var(--warn-edge); border-radius: var(--radius-s); background: var(--warn-soft); color: var(--warn-edge); font-size: var(--text-s); font-weight: var(--weight-strong); }
.is-unsure { border-color: var(--warn) !important; }

@media (min-width: 720px) {
  .upload { grid-template-columns: 200px 1fr; }
  .shot { width: 200px; }
}
/* The stack moment: the first time a deal shows, its savings drop onto the tag one after another */
@keyframes drop-in { from { opacity: 0; transform: translateY(-16px); } to { opacity: 1; transform: none; } }
.fresh-tag .parts li { animation: drop-in 420ms cubic-bezier(0.2, 0.8, 0.3, 1.15) both; }
.fresh-tag .parts li:nth-child(1) { animation-delay: 120ms; }
.fresh-tag .parts li:nth-child(2) { animation-delay: 300ms; }
.fresh-tag .parts li:nth-child(3) { animation-delay: 480ms; }
.fresh-tag .parts li:nth-child(4) { animation-delay: 660ms; }
.fresh-tag .parts li:nth-child(n+5) { animation-delay: 840ms; }
.fresh-tag .chips-line { animation: drop-in 420ms cubic-bezier(0.2, 0.8, 0.3, 1.15) 900ms both; }
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; animation: none !important; } }
