/* FoodPricePal. Rules: docs/design.md.
   Look: a supermarket's weekly price sheet. White page, black type, Archivo (narrow widths for headings and prices,
   like shelf signage), yellow shelf tags. Colour has one meaning each: green = good price / easing,
   red = pricey / rising, grey = typical, tag yellow = great price only. Light only, on purpose. */

@font-face { font-family: "Archivo"; font-style: normal; font-weight: 400 800; font-stretch: 78% 100%; font-display: swap;
  src: url("fonts/archivo-latin.woff2") format("woff2"); }

:root {
  color-scheme: light;
  --ink: #161616;
  --ink-2: #484848;
  --ink-3: #5c5c5c;
  --line: #e2e2e2;
  --line-2: #c8c8c8;
  --page: #ffffff;
  --band: #f4f4f1;
  --leaf: #12512f;
  --good: #12733b;
  --good-bg: #e9f4ec;
  --bad: #b42318;
  --bad-bg: #fbecea;
  --flat: #5d6470;
  --tag: #ffd84d;
  --fair: #8a5a00;
  --link: #12512f;
  --font: Archivo, "Helvetica Neue", Arial, sans-serif;
  --narrow: 78%;  /* Archivo's width axis: headings, prices and the logo */

  /* names the wholesale views and price-history script use */
  --surface: #ffffff; --surface-2: #f6f3ea; --muted: var(--ink-3); --bg: var(--page);
  --up: var(--bad); --up-bg: var(--bad-bg); --up-line: #efc6c1;
  --down: var(--good); --down-bg: var(--good-bg); --down-line: #bcdcc6;
  --usual: rgba(27, 27, 27, 0.08); --wash: rgba(27, 27, 27, 0.04);
  --border: var(--line); --accent: var(--link); --critical: var(--bad); --critical-text: var(--bad);
  --good-text: var(--good); --on: var(--ink); --on-ink: #fff;
  --grid: #ebe9e3; --axis: #c4c1b7; --band-chart: #e6e3db;
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100;
  --s5: #e87ba4; --s6: #008300; --s7: #4a3aa7; --s8: #e34948;
}
/* ---------- base: type scale 14 / 16 / 18 / 22 / 28 / 44 (56 for the one big wholesale price); weights 400 / 700 / 800;
   space 4-8-16-24-32-48-64-96. Body 18px, secondary 16px, captions 14px (labels on charts and meters only). ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--page); color: var(--ink); font: 18px/28px var(--font);
  font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; }
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--leaf); outline-offset: 2px; }
h1 { font-size: 44px; line-height: 48px; font-weight: 800; font-stretch: var(--narrow); letter-spacing: -0.01em; margin: 0 0 12px; max-width: 18ch; }
h2 { font-size: 28px; line-height: 34px; font-weight: 800; font-stretch: var(--narrow); margin: 0 0 20px; }
h3 { font-size: 18px; line-height: 26px; font-weight: 700; margin: 0 0 2px; }
p { margin: 0 0 16px; }
small { font-size: 16px; line-height: 22px; }
[hidden] { display: none !important; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; }
main.wrap > section, main.wrap > .panel > h2 { margin-top: 64px; }
main.wrap > section:first-child { margin-top: 0; }
.good { color: var(--good); } .bad { color: var(--bad); } .flat { color: var(--flat); }

/* ---------- header: logo, the two sides of the site, search; then the sub-nav ---------- */
.top { border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; gap: 10px 32px; flex-wrap: wrap; padding-top: 14px; padding-bottom: 14px; }
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none;
  font-size: 22px; font-weight: 800; font-stretch: var(--narrow); }
.logo svg { width: 30px; height: 30px; flex: none; }
.primary { display: flex; gap: 24px; font-size: 16px; }
.primary a { color: var(--ink-2); text-decoration: none; padding: 9px 0; }
.primary a:hover { color: var(--ink); text-decoration: underline; }
.primary a[aria-current="page"] { color: var(--ink); font-weight: 700; }

/* search: in the header, suggestions as you type */
.search { position: relative; flex: 0 1 300px; margin: 0 0 0 auto; }
.search input { width: 100%; height: 44px; padding: 0 12px 0 38px; border: 1px solid var(--line-2); border-radius: 4px;
  background: var(--page) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235d6470' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-4-4'/%3E%3C/svg%3E") no-repeat 12px 50% / 18px;
  font-size: 18px; }
.search input:focus { border-color: var(--ink); outline: none; }
.search input::-webkit-search-cancel-button { cursor: pointer; }
#q-list { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 20; list-style: none; margin: 0; padding: 6px;
  background: var(--page); border: 1px solid var(--line-2); border-radius: 4px; box-shadow: 0 6px 16px rgba(0, 0, 0, .1); }
#q-list li { display: block; padding: 10px 12px; cursor: pointer; }
.q-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.qs-price { font-weight: 700; white-space: nowrap; }
.q-where { white-space: nowrap; }
#q-list li[aria-selected="true"] { background: var(--band); }
.q-name { font-weight: 700; }
.q-meta { display: block; color: var(--ink-2); font-size: 16px; margin-top: 2px; }
.q-meta.good { color: var(--good); font-weight: 700; } .q-meta.bad { color: var(--bad); font-weight: 700; }
#q-list .q-none { color: var(--ink-2); cursor: default; }

/* grocery aisles */
.aisles { display: flex; gap: 28px; margin: 0 0 36px; padding-top: 14px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.aisles::-webkit-scrollbar { display: none; }
.aisles a { padding: 4px 0 10px; color: var(--ink-2); text-decoration: none; font-weight: 700; font-size: 18px; white-space: nowrap;
  border-bottom: 3px solid transparent; margin-bottom: -1px; }
.aisles a:hover { color: var(--ink); }
.aisles a[aria-current="page"] { color: var(--ink); font-weight: 700; border-bottom-color: var(--ink); }

/* all prices A to Z */
.az { list-style: none; margin: 0; padding: 0; columns: 2 320px; column-gap: 48px; max-width: 900px; }
.az li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); break-inside: avoid; }
.az a { font-weight: 700; color: var(--ink); }
.az span { color: var(--ink-2); font-size: 16px; text-align: right; }

/* ---------- grocery: intro ---------- */
.intro { max-width: 760px; }
.date { color: var(--ink-2); font-size: 16px; line-height: 22px; margin: 0 0 8px; }
.date + p:not(.value) { margin-top: 16px; }
.value { font-size: 16px; line-height: 24px; color: var(--ink-2); margin: 0 0 20px; max-width: 54ch; }
.lede { font-size: 22px; line-height: 31px; margin: 0; max-width: 36ch; }
.sub { color: var(--ink-2); max-width: 60ch; margin: -12px 0 24px; }

.data tbody th { font-size: 18px; color: var(--ink); font-weight: 700; border-bottom: 1px solid var(--line); padding: 14px 16px 14px 0; vertical-align: top; }
.data tbody th a { color: var(--ink); }
.data tbody th .ql { display: block; }

/* best buys: a shelf tag and the reason, in two columns; no boxes */
.buys { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 48px;
  border-top: 1px solid var(--line-2); }
.buy { display: grid; grid-template-columns: 96px 1fr; gap: 16px; align-items: start; padding: 16px 0; border-bottom: 1px solid var(--line); }
.shelf { position: relative; background: var(--tag); color: #161616; padding: 8px 8px 7px 14px;
  clip-path: polygon(9px 0, 100% 0, 100% 100%, 9px 100%, 0 50%); text-align: left; }
.shelf-price { display: block; font-size: 28px; line-height: 30px; font-weight: 800; font-stretch: var(--narrow); padding-left: 4px; }
.shelf-unit { display: block; font-size: 14px; line-height: 18px; font-weight: 700; padding-left: 4px; }
.vs, .meta, .next { color: var(--ink-2); font-size: 16px; line-height: 24px; margin: 0; }
.meta .ql { display: inline; margin: 0; }
.next span { font-weight: 700; color: var(--ink); } .next span.good { color: var(--good); } .next span.bad { color: var(--bad); }
.pprice { float: right; font-weight: 700; }
.buy .ql { display: inline-block; margin: 2px 0 0; }
.cause { font-size: 16px; line-height: 24px; color: var(--ink-2); margin: 2px 0 0; }

/* price check bar: low / typical / high */
.pbar { max-width: 340px; margin-top: 14px; }
.pbar-track { position: relative; display: grid; grid-template-columns: 25fr 50fr 25fr; gap: 3px; height: 8px; }
.pbar-track span:not(.pbar-mark) { border-radius: 2px; }
.z-low { background: #8fcaa2; } .z-typ { background: var(--line-2); } .z-high { background: #eba59d; }
.pbar-mark { position: absolute; top: -5px; width: 4px; height: 18px; margin-left: -2px; border-radius: 2px; background: var(--ink); box-shadow: 0 0 0 2px var(--page); }
.pbar-labels { display: grid; grid-template-columns: 25fr 50fr 25fr; font-size: 14px; line-height: 20px; color: var(--ink-3); margin-top: 6px; }
.pbar-labels span:nth-child(2) { text-align: center; } .pbar-labels span:nth-child(3) { text-align: right; }
.pbar-note { font-size: 16px; line-height: 22px; color: var(--ink-2); margin: 4px 0 0; }

/* quality: one word; the reason on hover or tap */
.ql { position: relative; display: inline-block; margin: 2px 0 6px; }
.ql-btn { border: 0; background: none; padding: 0; font: inherit; font-size: 16px; font-weight: 700; cursor: help; white-space: nowrap;
  text-decoration: underline dotted 1px; text-underline-offset: 4px; }
.q-excellent { color: var(--good); } .q-good { color: var(--ink-2); } .q-fair { color: var(--fair); } .q-poor { color: var(--bad); }
.ql-tip { display: none; position: absolute; left: 0; top: calc(100% + 6px); z-index: 5; width: max-content; max-width: 280px;
  padding: 10px 12px; background: var(--ink); color: var(--page); font-size: 16px; line-height: 22px; font-weight: 400; border-radius: 4px; }
.ql-btn:hover + .ql-tip, .ql-btn:focus-visible + .ql-tip, .ql-btn[aria-expanded="true"] + .ql-tip { display: block; }
.season-list .ql { display: block; margin: 0; }
.season-list .ql-btn { font-size: 16px; }

/* season calendar: 12 months, quality and typical ad price */
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.cal { margin: 0 0 16px; max-width: 760px; }
.cal table { width: 100%; border-collapse: separate; border-spacing: 3px 0; table-layout: fixed; }
.cal th { font-size: 14px; font-weight: 700; color: var(--ink-2); padding: 0 0 6px; text-align: center; }
.cal th[scope="row"] { width: 84px; text-align: left; padding: 0 8px 0 0; font-size: 14px; color: var(--ink); vertical-align: middle; }
.cal thead th { font-weight: 400; }
.cal thead th.now { color: var(--ink); font-weight: 800; }
.cal .mone { display: none; }
.cal td { padding: 0; }
.cal .cq { height: 30px; border-radius: 3px; background: var(--line); }
.cq.q-excellent, .sw.q-excellent { background: var(--good); }
.cq.q-good, .sw.q-good { background: #9fd3ae; }
.cq.q-fair, .sw.q-fair { background: #efd28f; }
.cq.q-poor, .sw.q-poor { background: #eba59d; }
.sw { display: inline-block; width: 14px; height: 14px; border-radius: 3px; vertical-align: -2px; }
.cal .legend { margin-top: 0; }
/* typical price by month: a labeled line, aligned with the month columns */
.cal .lc-row td, .cal .lc-row th { padding: 30px 0 26px; }
.lc { position: relative; height: 112px; }
.lc svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.lc polyline { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linejoin: round; }
.lc-axis { position: relative; display: block; height: 112px; }
.lc-tick { position: absolute; left: 0; right: 8px; text-align: right; transform: translateY(-50%); font-size: 14px; line-height: 16px;
  font-weight: 400; color: var(--ink-3); }
.lc-grid { position: absolute; left: 0; right: 0; border-top: 1px solid var(--line); }
.lc-dot { position: absolute; width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%; background: var(--ink); }
.lc-dot.now, .lc-dot.low { width: 12px; height: 12px; margin: -6px 0 0 -6px; box-shadow: 0 0 0 2px var(--page); }
.lc-dot.low { background: var(--good); }
.lc-val { position: absolute; transform: translateX(-50%); font-size: 14px; line-height: 16px; font-weight: 700; color: var(--ink);
  white-space: nowrap; padding: 0 3px; background: var(--page); }
.lc-val.above { margin-top: -28px; } .lc-val.below { margin-top: 12px; }
.lc-val.start { transform: none; margin-left: -12px; } .lc-val.end { transform: translateX(-100%); margin-left: 12px; }
.cal thead td:first-child { width: 84px; padding: 0; }
.cal-note { max-width: 760px; margin: 0 0 8px; }
.cal-all { max-width: 420px; margin: 0 0 32px; font-size: 16px; }
.cal-all summary { cursor: pointer; color: var(--link); font-weight: 700; padding: 6px 0; }
.cal-all ul { list-style: none; margin: 4px 0 0; padding: 0; border-top: 1px solid var(--line-2); }
.cal-all li { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid var(--line); }

/* grocery item page */
.gquote { display: grid; grid-template-columns: 132px 1fr; gap: 24px; align-items: start; margin-top: 40px; max-width: 640px; }
.organic { max-width: 640px; margin: 16px 0 0; font-size: 16px; line-height: 24px; color: var(--ink-2); }
.gword { font-size: 22px; line-height: 28px; font-weight: 800; margin: 0 0 4px; }
.gword.good { color: var(--good); } .gword.bad { color: var(--bad); } .gword.flat { color: var(--ink); }
.facts { list-style: none; margin: 0; padding: 0; max-width: 640px; border-top: 1px solid var(--line-2); }
.facts li { display: grid; grid-template-columns: 220px 1fr; gap: 4px 24px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.facts span { color: var(--ink-2); }
a.sname { color: var(--ink); text-decoration: none; }
a.sname:hover, .buy h3 a:hover, .pricey h3 a:hover, .all th a:hover { text-decoration: underline; }
.buy h3 a, .pricey h3 a, .all th a { color: var(--ink); text-decoration: none; }
.buy h3 a, .pricey h3 a, .all th a, a.sname { display: inline-block; padding: 2px 0; }  /* 24px+ tap targets (WCAG 2.5.8) */

/* in season: one tinted band, a simple list */
.band { background: var(--band); margin-left: -24px; margin-right: -24px; padding: 48px 24px; border-radius: 0; }
/* a grid, not CSS columns: a tooltip near the bottom of a column would otherwise flow into the next column */
.season-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); column-gap: 48px; }
.season-list li { position: relative; display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.sname { font-weight: 700; }
.sword { font-size: 16px; font-weight: 700; }
.sword.good { color: var(--good); } .sword.bad { color: var(--bad); } .sword.flat { color: var(--ink-3); font-weight: 400; }
/* what's in season: price on top, the verdict under it, right-aligned */
.sprice { text-align: right; font-stretch: var(--narrow); font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sprice small { font-weight: 400; font-size: 16px; }
.sprice .sword { display: block; }

/* pricey */
.pricey { list-style: none; margin: 0; padding: 0; max-width: 760px; }
.pricey li { padding: 14px 0; border-bottom: 1px solid var(--line); }
.pricey h3 { margin: 0 0 2px; }
.pricey li:first-child { border-top: 1px solid var(--line-2); }

/* every item */
.find { display: block; max-width: 420px; margin-bottom: 24px; }
.find span { display: block; font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.find input { width: 100%; height: 44px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 4px; background: var(--page); }
.find input:focus { border-color: var(--leaf); outline: none; }
.all { width: 100%; max-width: 860px; border-collapse: collapse; }
.all th, .all td { text-align: left; padding: 14px 16px 14px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.all thead th { font-size: 16px; color: var(--ink-2); font-weight: 700; border-bottom: 1px solid var(--line-2); padding-bottom: 10px; }
.all tbody th { font-weight: 700; }
.all td:nth-child(3) { min-width: 11em; }
.sortable th button { border: 0; background: none; padding: 0; font: inherit; color: inherit; cursor: pointer; text-decoration: underline dotted 1px; text-underline-offset: 4px; }
.sortable th button:hover { color: var(--ink); }
.sortable th[aria-sort] button { color: var(--ink); text-decoration: none; }
.sortable th[aria-sort="ascending"] button::after { content: " \25B2"; font-size: 14px; }
.sortable th[aria-sort="descending"] button::after { content: " \25BC"; font-size: 14px; }
.all .n { text-align: right; white-space: nowrap; font-weight: 700; }
.all small { display: block; color: var(--ink-2); font-weight: 400; }
.word { font-weight: 700; } .word.good { color: var(--good); } .word.bad { color: var(--bad); } .word.flat { color: var(--ink-2); font-weight: 400; }
.insea { display: block; margin: 0; font-size: 16px; line-height: 24px; font-weight: 600; color: var(--good); }  /* always its own line under the name, like the price and vs-usual columns */
.how { max-width: 760px; color: var(--ink-2); }
.how h2 { color: var(--ink); }

/* ---------- wholesale: head and market tabs ---------- */
.pagehead { max-width: 820px; }
.tabs { display: flex; gap: 32px; border-bottom: 1px solid var(--line); margin: 32px 0 0; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { padding: 2px 0 12px; color: var(--ink-2); text-decoration: none; font-weight: 700; font-size: 18px; white-space: nowrap; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--ink); }
.tabs a[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ink); }
.mkts { display: flex; flex-wrap: wrap; gap: 0 24px; margin: 24px 0 0; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.mkts a { padding: 8px 0; color: var(--ink-2); font-size: 18px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.mkts a:hover { color: var(--ink); text-decoration: underline; }
.mkts a[aria-current] { color: var(--ink); text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 6px; }
.panel .lede { margin-top: 32px; max-width: 40ch; }
.note { color: var(--ink-2); margin: -16px 0 24px; max-width: 60ch; }
.up { --tone: var(--bad); --tone-bg: var(--bad-bg); --tone-line: var(--up-line); }
.down { --tone: var(--good); --tone-bg: var(--good-bg); --tone-line: var(--down-line); }
.flat { --tone: var(--flat); --tone-bg: var(--band); --tone-line: var(--line-2); }

/* what to do: headed columns, no cards */
.acts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 48px 56px; align-items: start; }
.act h3 { color: var(--tone); font-size: 22px; }
.act p { color: var(--ink-2); font-size: 16px; line-height: 24px; margin: 0 0 12px; max-width: 46ch; }
.act ul { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line-2); }
.act li a { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 12px 0;
  border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; font-weight: 700; }
.act li a:hover span:first-child { text-decoration: underline; }
.act .num { white-space: nowrap; }
.act .to { color: var(--tone); }
.act .turn { display: block; color: var(--ink-3); font-weight: 400; font-size: 16px; }
.act .none { color: var(--ink-3); padding: 12px 0; border-bottom: 1px solid var(--line); }

/* the board: watchlist rows */
.bhead, .brow { display: grid; grid-template-columns: minmax(180px, 1.5fr) minmax(170px, 1fr) 128px 120px minmax(150px, 1fr);
  gap: 20px; align-items: center; }
.bhead { font-size: 16px; font-weight: 700; color: var(--ink-2); padding-bottom: 10px; border-bottom: 1px solid var(--line-2); }
.bhead .r, .b-price { text-align: right; }
.brow { padding: 16px 0; color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line); }
.brow:hover .b-item b { text-decoration: underline; }
.b-item b { display: block; font-size: 18px; }
.b-item small, .season small, .out small { display: block; color: var(--ink-2); font-size: 16px; font-weight: 400; }
.b-price b { display: block; font-size: 22px; }
.season b, .out b { color: var(--tone); font-size: 16px; font-weight: 700; white-space: nowrap; }
.chg { font-size: 16px; font-weight: 700; color: var(--tone); }
.chg.up { --tone: var(--bad); } .chg.down { --tone: var(--good); } .chg.flat { --tone: var(--ink-3); font-weight: 400; }
.unit { display: block; color: var(--ink-2); font-size: 16px; }
.b-price .chg { display: block; }
.spark { display: block; width: 128px; height: 38px; }
.spark .ln { fill: none; stroke: var(--ink); stroke-width: 1.75; stroke-linejoin: round; stroke-linecap: round; }
.spark .fc { fill: var(--tone-bg); stroke: var(--tone-line); stroke-width: 1; }
.spark .dot { fill: var(--ink); }

/* signs of a move, supply news: plain lists */
.warns, .notes { list-style: none; margin: 0; padding: 0; max-width: 860px; border-top: 1px solid var(--line-2); }
.warns li, .notes li { padding: 16px 0; border-bottom: 1px solid var(--line); }
.warns b { display: block; color: var(--tone); font-size: 18px; }
.warns span { display: block; color: var(--ink-2); }
.warns small { color: var(--ink-3); }
.notes li { display: grid; grid-template-columns: 200px 1fr; gap: 4px 24px; }
.notes a { color: var(--ink); font-weight: 700; text-decoration: none; }
.notes a:hover { text-decoration: underline; }
.notes span { color: var(--ink-2); }
.record { color: var(--ink-2); margin-top: 48px; }

/* ---------- wholesale item page ---------- */
.crumbs { display: flex; flex-wrap: wrap; gap: 0 8px; font-size: 16px; color: var(--ink-2); margin-bottom: 16px; }
.crumbs a { color: var(--ink-2); }
.answer { font-size: 22px; line-height: 31px; color: var(--ink-2); max-width: 60ch; margin: 0; }
.answer strong { color: var(--ink); }
.quote { display: grid; grid-template-columns: auto 1fr; gap: 24px 64px; align-items: end; margin-top: 40px; padding-bottom: 32px; border-bottom: 1px solid var(--line); }
.q-main { display: grid; }
.q-price { font-size: 56px; line-height: 58px; font-weight: 800; letter-spacing: -0.03em; }
.q-unit { color: var(--ink-2); font-size: 16px; margin-top: 8px; }
.q-pack { color: var(--ink-2); font-size: 16px; }
.q-range { font-size: 16px; font-weight: 600; margin-top: 8px; }
.q-areas { margin-top: 12px; font-size: 16px; }
.q-areas p { font-weight: 400; color: var(--ink-2); margin: 0 0 4px; }
.q-areas ul { list-style: none; margin: 0; padding: 0; }
.q-areas li { display: flex; justify-content: space-between; gap: 12px; max-width: 320px; }
.markets td small { display: block; color: var(--ink-2); font-size: 16px; }
.q-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; margin: 0; }
.q-facts dt { font-size: 16px; color: var(--ink-2); margin-bottom: 4px; }
.q-facts dd { margin: 0; overflow-wrap: anywhere; }
.q-facts .chg, .q-facts .season b, .q-facts .out b { font-size: 22px; }
.q-facts .path { grid-column: 1 / -1; }
.q-facts .path dd { color: var(--ink-2); }
.q-facts .path b { color: var(--ink); }
.todo { margin-top: 32px; background: var(--tone-bg); padding: 24px 28px; border-radius: 8px; }
.todo h2 { font-size: 16px; line-height: 24px; margin: 0 0 4px; color: var(--tone); }
.todo p { margin: 0; font-size: 22px; line-height: 30px; max-width: 56ch; }
.todo.flat h2 { color: var(--ink); }
.supply-note { margin-top: 32px; max-width: 70ch; }
.supply-note h2 { font-size: 16px; line-height: 24px; margin: 0 0 4px; }
.supply-note p { margin: 0; color: var(--ink-2); }
.chart { margin: 48px 0 0; }
.chart svg { display: block; width: 100%; height: auto; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .ylab { fill: var(--ink-3); font: 14px var(--font); text-anchor: end; }
.chart .xlab { fill: var(--ink-3); font: 14px var(--font); text-anchor: middle; }
.chart .usual { fill: var(--usual); }
.chart .price { fill: none; stroke: var(--ink); stroke-width: 2.25; stroke-linejoin: round; stroke-linecap: round; }
.chart .fc { fill: var(--tone-bg); stroke: var(--tone-line); }
.chart .fcmid { fill: none; stroke: var(--tone); stroke-width: 2; stroke-dasharray: 4 4; }
.chart .now { fill: var(--ink); stroke: var(--page); stroke-width: 2; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 24px; font-size: 16px; color: var(--ink-2); margin-top: 12px; }
.legend span { display: inline-flex; align-items: center; gap: 8px; }
.legend i { display: inline-block; width: 18px; height: 10px; }
.legend .k-price { height: 2px; background: var(--ink); }
.legend .k-usual { background: var(--usual); }
.legend .k-fc { background: var(--tone-bg); border: 1px solid var(--tone-line); }
.numbers { margin-top: 12px; font-size: 16px; }
.numbers summary { cursor: pointer; color: var(--link); }
.panel > h3 { margin-top: 40px; margin-bottom: 12px; }

/* tables (item pages, track record) */
.t, .data { width: 100%; max-width: 860px; border-collapse: collapse; }
.t th, .data th { text-align: left; font-size: 16px; font-weight: 700; color: var(--ink-2); padding: 0 16px 10px 0; border-bottom: 1px solid var(--line-2); }
.t td, .data td { padding: 14px 16px 14px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.t .n, .data .num { text-align: right; white-space: nowrap; font-weight: 700; }
.data td small { display: block; color: var(--ink-2); font-weight: 400; }
.data caption { text-align: left; color: var(--ink-2); padding-bottom: 12px; }
.sizes { max-width: 420px; }
.pick { margin: 0 0 16px; max-width: 60ch; }
.coming { margin: 0; padding-left: 20px; max-width: 60ch; }
.coming li { margin: 0 0 4px; }
.sizes tr.main td { font-weight: 600; }
.faq { max-width: 68ch; }
.faq h3 { margin-top: 32px; }
.faq p { color: var(--ink-2); }
.others { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.others a { font-weight: 700; }
.tag { font-weight: 700; } .tag.good { color: var(--good); } .tag.bad { color: var(--bad); }
.fine { color: var(--ink-2); font-size: 16px; line-height: 22px; margin-top: 24px; }
.cta { display: inline-block; background: var(--leaf); color: #fff !important; text-decoration: none; font-weight: 700; padding: 14px 24px; border-radius: 8px; margin: 8px 0; }
.landing { max-width: 860px; }
.landing ul { padding-left: 24px; }
.landing li { margin-bottom: 12px; }
.landing h2 { margin-top: 64px; }

/* weekly email sign-up */
.signup { margin-top: 64px; padding: 28px 24px; background: var(--band); max-width: 760px; }
.signup h2 { margin-bottom: 8px; }
.signup p { color: var(--ink-2); font-size: 16px; line-height: 24px; max-width: 54ch; }
.signup-form { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.signup-form input { flex: 1 1 240px; height: 44px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 4px;
  font-size: 18px; background: var(--page); }
.signup-form input:focus { border-color: var(--ink); outline: none; }
.signup-form button { height: 44px; padding: 0 20px; border: 0; border-radius: 4px; background: var(--leaf); color: #fff;
  font: inherit; font-weight: 700; cursor: pointer; }
.signup-form button:hover { background: var(--ink); }

/* ---------- footer ---------- */
.foot { margin-top: 96px; border-top: 1px solid var(--line); padding: 32px 0 64px; color: var(--ink-2); font-size: 16px; line-height: 24px; }
.foot p { max-width: 75ch; }
.foot nav { display: flex; flex-wrap: wrap; gap: 4px 20px; margin-top: 16px; }
.foot a { color: var(--ink-2); }

/* ---------- price history page (filters + chart) ---------- */
.layout { max-width: 1080px; margin: 0 auto; padding: 0 24px; display: grid; grid-template-columns: 250px 1fr; gap: 48px; }
main.dash { min-width: 0; }
.dash-intro { max-width: 1080px; margin: 0 auto; padding: 0 24px 24px; display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.dash-intro h1 { margin-bottom: 8px; }
.card { min-width: 0; overflow-wrap: anywhere; padding: 0 0 40px; }
.sh { font-size: 22px; font-weight: 800; margin: 0 0 12px; }
.hint { color: var(--ink-2); font-size: 16px; margin: 8px 0 0; }
.btn { border: 2px solid var(--line-2); background: var(--page); border-radius: 8px; padding: 8px 16px; min-height: 44px; cursor: pointer; font-weight: 700; }
.link { border: 0; background: none; color: var(--link); cursor: pointer; padding: 4px; font-size: 16px; text-decoration: underline; }
.filters { position: sticky; top: 16px; align-self: start; max-height: calc(100vh - 32px); overflow-y: auto; background: var(--page); }
.sheet-head { display: none; }
.filters-btn { display: none; }
.fgroup + .fgroup { margin-top: 24px; }
.fh { font-size: 16px; font-weight: 700; color: var(--ink); margin: 0 0 8px; }
.fh-row { display: flex; justify-content: space-between; align-items: center; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button { border: 1px solid var(--line-2); background: var(--page); border-radius: 6px; padding: 6px 12px; min-height: 40px; cursor: pointer; font-size: 16px; font-weight: 700; color: var(--ink-2); }
.seg button[aria-checked="true"] { background: var(--ink); color: var(--page); border-color: var(--ink); }
.checks { list-style: none; margin: 0; padding: 0; }
.checks li { display: flex; align-items: center; gap: 8px; min-height: 40px; border-bottom: 1px solid var(--line); }
.checks label { flex: 1; display: flex; align-items: center; gap: 10px; cursor: pointer; min-height: 40px; font-size: 16px; }
.checks input { width: 20px; height: 20px; accent-color: var(--leaf); margin: 0; }
.checks .sw { width: 10px; height: 10px; border-radius: 2px; flex: none; }
.checks .only { visibility: hidden; }
.checks li:hover .only, .checks li:focus-within .only { visibility: visible; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.dot.cheap { background: var(--good); } .dot.expensive { background: var(--bad); }
.dot.normal, .dot.none { background: transparent; border: 1px solid var(--axis); }
.moves { display: grid; }
.move, .alert { display: grid; grid-template-columns: 22px 1fr; gap: 2px 8px; text-align: left; width: 100%; border: 0;
  border-bottom: 1px solid var(--line); background: transparent; padding: 12px 0; cursor: pointer; }
.move .arrow, .alert .arrow { grid-row: span 3; }
.arrow.up { color: var(--bad); } .arrow.down { color: var(--good); }
.move .why, .alert .e { color: var(--ink-2); font-size: 16px; }
.news { list-style: none; margin: 0; padding: 0; }
.news li { display: grid; grid-template-columns: 12px 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.news .sw { width: 10px; height: 10px; border-radius: 2px; margin-top: 9px; }
.news .t { font-weight: 700; }
.news .d { color: var(--ink-2); font-size: 16px; }
.badge { font-size: 16px; font-weight: 700; white-space: nowrap; margin-left: 4px; }
.badge.cheap { color: var(--good); } .badge.expensive { color: var(--bad); } .badge.normal, .badge.none { color: var(--ink-3); font-weight: 400; }
.chart-head { display: flex; gap: 4px 12px; align-items: baseline; flex-wrap: wrap; }
.chart-head .sh { margin: 0; }
#legend.legend .ln { width: 18px; height: 2px; }
#legend.legend .bd { width: 14px; height: 10px; background: var(--band-chart); }
#legend.legend .zero { width: 18px; height: 0; border-top: 1px dashed var(--ink-3); }
#legend.legend .fc { width: 18px; height: 0; border-top: 2px dashed; }
#chart { position: relative; min-height: 240px; }
#chart svg { display: block; overflow: visible; touch-action: pan-y; }
.tip { position: absolute; top: 0; pointer-events: none; background: var(--page); border: 1px solid var(--line-2); border-radius: 6px; padding: 8px 10px; font-size: 16px; min-width: 160px; z-index: 1; box-shadow: 0 2px 8px rgba(0,0,0,.1); }
.tip .trow { display: flex; gap: 10px; align-items: center; justify-content: space-between; }
.tip .trow span:first-child { display: inline-flex; gap: 6px; align-items: center; }
.tip i { width: 8px; height: 8px; display: inline-block; }
.empty-chart { color: var(--ink-2); padding: 48px 0; text-align: center; }
.table-view { margin-top: 12px; font-size: 16px; }
.table-view summary { cursor: pointer; color: var(--link); }
.table-view table { border-collapse: collapse; width: 100%; }
.table-view td, .table-view th { padding: 6px 8px; border-bottom: 1px solid var(--grid); text-align: right; }
.table-view th:first-child, .table-view td:first-child { text-align: left; }
.table-wrap { overflow-x: auto; max-height: 320px; }
.list { list-style: none; margin: 8px 0 0; padding: 0; }
.row { display: grid; grid-template-columns: 12px 1fr auto; gap: 2px 12px; align-items: center; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--line); background: transparent; padding: 12px 0; cursor: pointer; }
.row:hover { background: var(--wash); }
.row .sw { width: 10px; height: 10px; border-radius: 2px; border: 1px solid var(--axis); }
.row .name { font-weight: 700; }
.row .det { color: var(--ink-2); font-size: 16px; grid-column: 2; }
.row .right { grid-column: 3; grid-row: 1 / span 2; text-align: right; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: var(--page); padding: 10px 18px; border-radius: 8px; font-size: 16px; z-index: 30; }

/* ---------- tablet and phone ---------- */
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; gap: 0; }
  .filters-btn { display: inline-block; flex: none; }
  .filters { position: fixed; left: 0; right: 0; bottom: 0; top: auto; max-height: 80vh; z-index: 20; padding: 16px 20px 32px;
    border-radius: 16px 16px 0 0; box-shadow: 0 -4px 24px rgba(0,0,0,.18); transform: translateY(105%); transition: transform .2s ease; }
  .filters.open { transform: none; }
  .sheet-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; position: sticky; top: -16px; background: var(--page); padding: 8px 0; z-index: 1; }
  .checks .only { visibility: visible; }
  .scrim { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 10; }
  .buys { grid-template-columns: 1fr; }
  .acts { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  body { font-size: 18px; line-height: 27px; }
  .wrap, .layout, .dash-intro { padding-left: 16px; padding-right: 16px; }
  h1 { font-size: 34px; line-height: 38px; }
  h2 { font-size: 24px; line-height: 30px; }
  main.wrap > section, main.wrap > .panel > h2 { margin-top: 48px; }
  .top .wrap { gap: 6px 20px; padding-top: 12px; padding-bottom: 12px; }
  .logo { font-size: 20px; } .logo svg { width: 26px; height: 26px; }
  .primary { order: 2; flex-basis: 100%; gap: 20px; font-size: 16px; }
  .search { order: 3; flex-basis: 100%; margin: 4px 0 0; }
  .aisles { gap: 2px 22px; flex-wrap: wrap; margin: 0 0 28px; padding-top: 12px; }
  .aisles a { font-size: 16px; }
  .lede { font-size: 20px; line-height: 28px; }
  .buy { grid-template-columns: 88px 1fr; gap: 14px; padding: 14px 0; }
  .shelf-price { font-size: 24px; line-height: 26px; }
  .band { margin-left: -16px; margin-right: -16px; padding: 40px 16px; }
  .season-list { grid-template-columns: 1fr; }
  .all thead { display: block; }
  .all thead tr { display: flex; gap: 20px; padding: 0 0 10px; border-bottom: 1px solid var(--line-2); }
  .all thead th { border: 0; padding: 0; }
  .all thead th.n { display: none; }
  .all, .all tbody { display: block; }
  .all tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
  .all th, .all td { display: block; padding: 0; border: 0; }
  .all td:nth-child(3), .all td:last-child { grid-column: 1 / -1; }
  .all td:nth-child(3) small { display: inline; margin-left: 8px; }
  .all .ql { margin: 0; }
  .tabs { gap: 24px; }
  .bhead { display: none; }
  .brow { grid-template-columns: minmax(0, 1fr) 84px 92px; grid-template-areas: "item spark price" "out season season"; gap: 6px 12px; }
  .b-item { grid-area: item; min-width: 0; } .b-spark { grid-area: spark; } .b-price { grid-area: price; }
  .b-out { grid-area: out; white-space: nowrap; } .b-season { grid-area: season; text-align: right; min-width: 0; }
  .b-out small { display: inline; margin-left: 6px; }
  .b-season small { display: none; }
  .spark { width: 84px; height: 32px; }
  .notes li { grid-template-columns: 1fr; }
  .ql { display: block; }
  .ql-tip { position: static; width: auto; max-width: none; margin-top: 6px; }
  .ql-btn:hover + .ql-tip { display: none; }
  .ql-btn[aria-expanded="true"] + .ql-tip { display: block; }
  .facts li { grid-template-columns: 1fr; }
  .cal table { border-spacing: 2px 0; }
  .cal th[scope="row"], .cal thead td:first-child { width: 58px; font-size: 14px; }
  .cal .mfull { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .cal .mone { display: inline; }
  .cal .cq { height: 26px; }
  .gquote { grid-template-columns: 1fr; gap: 12px; }
  .gquote .shelf { justify-self: start; min-width: 112px; }
  .quote { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .q-price { font-size: 44px; line-height: 46px; }
  .q-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .todo { padding: 20px; }
  .chart .ylab, .chart .xlab { font-size: 24px; }
  .chart .xlab.odd { display: none; }
  .chart .price { stroke-width: 3.5; }
  .chart .fcmid { stroke-width: 3; }
  .markets th:nth-child(3), .markets td:nth-child(3) { display: none; }
  .stack thead { display: none; }
  .stack, .stack tbody, .stack tr, .stack td { display: block; width: 100%; }
  .stack tr { border-bottom: 1px solid var(--line); padding: 14px 0; }
  .stack td { border: 0; padding: 2px 0; text-align: left !important; }
  .stack td:first-child { font-weight: 700; }
  .stack tbody th { display: block; border: 0; padding: 0 0 4px; }
  .stack td[data-label]::before { content: attr(data-label) ": "; color: var(--ink-2); font-weight: 400; }
}
@media (prefers-reduced-motion: reduce) { .filters { transition: none; } }
@media print { .top, .tabs, .mkts, .filters, .filters-btn, .cta { display: none; } }

.skip { position: absolute; left: 16px; top: -48px; z-index: 10; padding: 8px 12px; background: var(--page); color: var(--ink); border: 1px solid var(--ink); }
.skip:focus { top: 8px; }
@media (max-width: 360px) {
  .t th, .data th, .t td, .data td { padding-right: 8px; }
  .data .num { white-space: normal; }
}
.q-facts .season b { white-space: normal; }
.band p.more { margin: 24px 0 0; }
