:root {
  color-scheme: light;
  --paper: #fff;
  --ink: #202c27;
  --muted: #52605a;
  --rule: #dbe3dc;
  --link: #2354a4;
  --retail: #2354a4;
  --wholesale: #a02e39;
  --tag: #fff0bb;
  --chip: #f0f3ef;
  background: var(--paper) url("./assets/vegetable-doodles.svg") repeat;
  color: var(--ink);
  font: 16px/1.55 system-ui, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
.wrap { width: min(100% - 2rem, 72rem); margin-inline: auto; }
.masthead {
  padding-block: clamp(2rem, 5vw, 3.7rem) clamp(1.4rem, 4vw, 2.4rem);
  border-bottom: 1px solid var(--rule);
}
.masthead h1 { font-size: clamp(2.1rem, 6.5vw, 4.25rem); font-weight: 850; line-height: 1.15; }
.masthead p { margin-top: .65rem; color: var(--muted); }
main { padding-block: 1.6rem 2.5rem; }
h1, h2, h3, p { margin: 0; }
h2 { font-size: clamp(1.24rem, 3vw, 1.7rem); }
h3 { font-size: 1rem; }
a { color: var(--link); }
:focus-visible { outline: 3px solid var(--link); outline-offset: 3px; }
.muted { color: var(--muted); font-size: .875rem; overflow-wrap: anywhere; }
.notice {
  margin-bottom: 1rem;
  padding: .65rem .85rem;
  border: 1px solid #e6ce91;
  border-radius: .65rem;
  background: #fff7de;
  color: #634715;
}
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: .6rem 1rem; flex-wrap: wrap; margin-bottom: .8rem; }
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  gap: .9rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.cards li { min-width: 0; }
.card {
  display: block;
  height: 100%;
  padding: .9rem 1rem 1rem;
  border: 1px solid var(--rule);
  border-radius: 1rem;
  background: var(--paper);
  color: var(--ink);
  text-decoration: none;
}
.card-title { display: flex; align-items: center; gap: .65rem; margin-bottom: .6rem; }
.card-title::after { content: "→" / ""; margin-inline-start: auto; color: var(--link); }
.card:hover { border-color: var(--link); }
.card:hover .item-name { text-decoration: underline; text-underline-offset: .2em; }
.item-icon { display: block; width: 3rem; height: 3rem; flex-shrink: 0; }
.item-name { color: var(--link); font-size: 1.1rem; font-weight: 800; overflow-wrap: anywhere; }
.card-price, .latest-prices li { display: flex; align-items: center; flex-wrap: wrap; gap: .28rem .35rem; }
.card-price + .card-price { margin-top: .7rem; padding-top: .7rem; border-top: 1px solid var(--rule); }
.price-label { flex-basis: 100%; font-size: .84rem; font-weight: 700; }
.price-tag {
  display: inline-block;
  max-width: 100%;
  padding: .12rem .55rem;
  border-radius: .55rem;
  background: var(--tag);
  color: #49340c;
  font-size: 1.03rem;
  font-variant-numeric: tabular-nums;
}
.chip {
  display: inline-block;
  padding: .1rem .45rem;
  border-radius: 1rem;
  background: var(--chip);
  color: #43504a;
  font-size: .74rem;
  overflow-wrap: anywhere;
}
.card-note { flex-basis: 100%; color: var(--muted); font-size: .78rem; }
.retail { color: var(--retail); }
.wholesale { color: var(--wholesale); }

.item-heading { display: flex; align-items: center; gap: .85rem; margin-top: .75rem; }
.item-heading #item-icon { flex-shrink: 0; }
.item-heading #item-icon:empty { display: none; }
.item-heading .item-icon { width: clamp(3.4rem, 9vw, 5.5rem); height: auto; }
.item-heading h1 { min-width: 0; overflow-wrap: anywhere; }
.return-link { display: inline-block; padding-block: .35rem; font-size: .875rem; text-underline-offset: .2em; }
.panel {
  min-width: 0;
  margin-bottom: 1rem;
  padding: clamp(.75rem, 3vw, 1.45rem);
  border: 1px solid var(--rule);
  border-radius: 1rem;
  background: var(--paper);
}
.panel > .muted, #item-content > p { margin-top: .3rem; }
.panel > .notice { margin-top: .65rem; }
.latest-prices {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
  gap: .85rem;
  margin: .85rem 0 0;
  padding: 0;
  list-style: none;
}
.latest-prices li {
  align-content: start;
  border: 1px solid var(--rule);
  border-radius: .75rem;
  padding: .65rem;
}
.ranges { display: flex; gap: .28rem; flex-wrap: wrap; }
.ranges button {
  border: 1px solid #c2d0e1;
  border-radius: 1rem;
  background: #f0f5fc;
  color: var(--link);
  padding: .36rem .65rem;
  font: inherit;
  font-size: .82rem;
  cursor: pointer;
}
.ranges button[aria-pressed="true"] { background: var(--link); color: var(--paper); }
.legend { display: flex; flex-wrap: wrap; gap: .35rem .85rem; list-style: none; padding: 0; margin: .65rem 0 .25rem; font-size: .82rem; }
.legend li::before { content: ""; display: inline-block; vertical-align: .22em; width: 1rem; border-top: 3px solid currentColor; margin-right: .35rem; }
.chart { width: 100%; min-width: 0; overflow: hidden; }
.table-scroll { max-height: 22rem; overflow: auto; margin-top: .65rem; border: 1px solid var(--rule); border-radius: .55rem; }
table { width: 100%; border-collapse: collapse; text-align: right; font-size: .82rem; font-variant-numeric: tabular-nums; }
caption { padding: .55rem; font-weight: 700; text-align: left; overflow-wrap: anywhere; }
th, td { padding: .35rem .5rem; border-bottom: 1px solid var(--rule); }
thead { position: sticky; top: 0; background: #edf3ef; }
th:first-child { text-align: left; overflow-wrap: anywhere; }
tbody tr:nth-child(even) { background: #f7f9f7; }
.origin-bar { width: clamp(1.65rem, 10vw, 6rem); height: .85rem; margin-inline-end: .35rem; vertical-align: -.1em; accent-color: #527e54; }
#item-content h3 { margin-top: .75rem; }
#item-content ul { margin-block: .2rem 0; padding-inline-start: 1.2rem; overflow-wrap: anywhere; }
footer {
  padding-block: 1.4rem 2.5rem;
  border-top: 1px solid var(--rule);
  background: var(--paper);
  font-size: .9rem;
  overflow-wrap: anywhere;
}
footer p { margin-top: .5rem; max-width: 70ch; }
footer h3 { margin-top: 1rem; }
footer ul { margin: .4rem 0; padding-inline-start: 1.25rem; }

@media (max-width: 32rem) {
  .wrap { width: calc(100% - 1.5rem); }
  .card { padding-inline: .7rem; }
  th, td { padding-inline: .32rem; }
}
