/* cheapest first: calm, plain, like a well-made price tag. No framework, no web fonts. */
:root {
  --bg: #fbfbf9; --fg: #171717; --muted: #5b5b57; --line: #e3e2dd; --edge: #8a8984;
  --card: #ffffff; --ph: #eeede8; --accent: #1d4ed8; --on-accent: #ffffff;
  --g: #dff2e5; --g-ink: #12532c; --b: #e1e9fb; --b-ink: #1e3a8a; --a: #fbeecf; --a-ink: #6b3d06;
  --err: #a8201a; --r: 6px; --gut: 16px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121211; --fg: #ececea; --muted: #a5a5a0; --line: #2c2c29; --edge: #75756f;
    --card: #1a1a18; --ph: #242422; --accent: #8fb1ff; --on-accent: #0b1633;
    --g: #143221; --g-ink: #9ee3b6; --b: #172649; --b-ink: #b0c8ff; --a: #3a2a0b; --a-ink: #f4d08a;
    --err: #ff8b80;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: inherit; text-underline-offset: 2px; }
.prose a, .foot a, .shelf-h a, .pager a, .empty a, .muted a { color: var(--accent); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 2px; }
.wrap { max-width: 1360px; margin: 0 auto; padding: 0 var(--gut); }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 8px; top: 8px; z-index: 20; background: var(--card); padding: 8px 12px; }
.muted { color: var(--muted); }
.price, .bigprice, .note, .yl, .changes, .count, .pager { font-variant-numeric: tabular-nums; }

/* header */
.top { position: sticky; top: 0; z-index: 10; background: var(--bg); border-bottom: 1px solid var(--line); }
.bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding-top: 10px; padding-bottom: 10px; }
.mark { font-weight: 750; font-size: 15px; letter-spacing: -.01em; text-decoration: none; white-space: nowrap; }
.mark::before { content: ""; display: inline-block; width: 9px; height: 9px; margin-right: 7px; border: 2px solid currentColor; border-radius: 50%; vertical-align: 0; }
.search { flex: 1 1 260px; display: flex; gap: 8px; }
.search input { flex: 1; min-width: 0; }
input, select, button { font: inherit; color: inherit; }
input[type=search], input[type=email], input[type=number], input[type=text], select {
  background: var(--card); border: 1px solid var(--edge); border-radius: var(--r); padding: 9px 11px;
}
button, .btn {
  display: inline-block; font-weight: 650; padding: 9px 16px; border-radius: var(--r); cursor: pointer;
  border: 1px solid var(--fg); background: var(--fg); color: var(--bg); text-decoration: none;
}
.btn.go { background: var(--accent); border-color: var(--accent); color: var(--on-accent); padding: 12px 22px; }
button:hover, .btn:hover { filter: brightness(1.15); }

/* headings, text */
h1.h { font-size: 22px; letter-spacing: -.01em; margin: 22px 0 4px; }
.lede { margin: 0 0 4px; color: var(--muted); max-width: 60ch; }
.count { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.count b { color: var(--fg); }
.empty { padding: 20px; margin: 16px 0; border: 1px dashed var(--edge); border-radius: var(--r); color: var(--muted); }
.notice { padding: 8px 12px; border-radius: var(--r); background: var(--a); color: var(--a-ink); }

/* filters: one wrapping row of selects */
.filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 10px; margin: 14px 0 4px; }
.f { display: flex; flex-direction: column; gap: 2px; font-size: 12px; color: var(--muted); }
.f select { font-size: 14px; padding: 7px 8px; max-width: 12.5em; color: var(--fg); }
.f.chk { flex-direction: row; align-items: center; gap: 6px; font-size: 14px; color: var(--fg); padding-bottom: 8px; }
.f.chk input { width: 18px; height: 18px; accent-color: var(--accent); }
.filters .apply { padding: 7px 14px; font-size: 14px; }
.js .filters .apply { display: none; }

/* product grid: 2 / 3-4 / 5-6 columns */
.grid { list-style: none; margin: 14px 0 24px; padding: 0; display: grid; gap: 20px 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 600px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px 14px; } }
@media (min-width: 840px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1080px) { .grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
@media (min-width: 1300px) { .grid { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.card a { display: block; text-decoration: none; }
.card a:hover h3 { text-decoration: underline; }
.ph { aspect-ratio: 4 / 5; background: var(--ph); border-radius: var(--r); overflow: hidden; display: grid; place-items: center; color: var(--muted); font-size: 13px; }
.ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card h3 {
  font-size: 14px; font-weight: 500; line-height: 1.3; margin: 8px 0 2px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.store { font-size: 13px; color: var(--muted); margin: 0; }
.price { margin: 3px 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; font-size: 16px; }
.price b, .bigprice b { font-weight: 750; }
.note { margin: 2px 0 0; font-size: 13px; font-weight: 600; }
.meta { margin: 3px 0 0; display: flex; flex-direction: column; font-size: 12px; color: var(--muted); }
.sz { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* badges */
.pill { display: inline-block; font-size: 11.5px; font-weight: 650; line-height: 1.5; padding: 1px 8px; border-radius: 99px; white-space: nowrap; }
.pill.real_deal { background: var(--g); color: var(--g-ink); }
.pill.dropped { background: var(--b); color: var(--b-ink); }
.pill.not_really_sale { background: var(--a); color: var(--a-ink); }

/* home shelves: one row that scrolls sideways on small screens */
.shelf { margin-top: 26px; }
.shelf-h { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); padding-top: 14px; }
.shelf-h h2 { font-size: 17px; margin: 0; }
.shelf-h a, .shelf-h span { font-size: 14px; }
.grid.row { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 42%; overflow-x: auto; padding-bottom: 8px; margin-bottom: 8px; }
@media (min-width: 600px) { .grid.row { grid-auto-columns: 27%; } }
@media (min-width: 840px) { .grid.row { grid-auto-flow: row; grid-template-columns: repeat(6, minmax(0, 1fr)); overflow: visible; } }

.pager { display: flex; justify-content: center; align-items: center; gap: 18px; margin: 0 0 24px; font-size: 15px; }

/* item page */
.item { display: grid; gap: 18px; margin: 18px 0 8px; }
@media (min-width: 760px) { .item { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 36px; } }
.ph.big { max-width: 520px; width: 100%; }
@media (max-width: 759px) { .ph.big { width: 72%; margin: 0 auto; } }
.item h1 { font-size: 22px; line-height: 1.25; margin: 2px 0 6px; letter-spacing: -.01em; }
.bigprice { font-size: 30px; margin: 0; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.bigprice .pill { font-size: 13px; }
.verdict { margin: 4px 0 12px; }
.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 16px; font-size: 14px; margin: 16px 0 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.hist, .alert { margin: 28px 0; max-width: 760px; }
.hist h2, .alert h2 { font-size: 18px; margin: 0 0 10px; }

/* chart: the svg stretches, labels are html */
.chart { margin: 0; }
.plot { position: relative; height: 180px; margin-right: 64px; border-left: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.plot svg { display: block; width: 100%; height: 100%; overflow: visible; }
.plot .pl { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round; }
.plot .oos { fill: none; stroke: var(--muted); stroke-width: 2; stroke-dasharray: 5 4; }
.plot .lvl { stroke: var(--line); stroke-width: 1; stroke-dasharray: 3 4; }
.yl { position: absolute; left: 100%; transform: translateY(-50%); padding-left: 8px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.xl { display: flex; justify-content: space-between; margin-right: 64px; padding-top: 4px; font-size: 12px; color: var(--muted); }
figcaption { margin-top: 6px; font-size: 13px; color: var(--muted); }
details { margin-top: 12px; font-size: 14px; }
summary { cursor: pointer; color: var(--accent); }
.changes { border-collapse: collapse; margin-top: 8px; }
.changes th, .changes td { text-align: left; padding: 4px 14px 4px 0; border-bottom: 1px solid var(--line); }
.changes th { font-weight: 600; color: var(--muted); }

/* alert form */
.alert { border: 1px solid var(--line); border-radius: var(--r); background: var(--card); padding: 18px; max-width: 520px; }
.alert form { display: grid; gap: 4px; }
.alert label { font-size: 14px; font-weight: 600; margin-top: 8px; }
.alert input, .alert select { background: var(--bg); width: 100%; }
.alert button { margin-top: 14px; justify-self: start; }
.alert p { margin: 0 0 8px; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.ok { padding: 8px 12px; border-radius: var(--r); background: var(--g); color: var(--g-ink); }
.err { color: var(--err); font-weight: 600; }

/* static pages */
.prose { max-width: 680px; margin: 22px 0 8px; }
.prose h1 { font-size: 26px; letter-spacing: -.01em; margin: 0 0 12px; }
.prose h2 { font-size: 18px; margin: 26px 0 6px; }
.prose li { margin: 6px 0; }
.prose dl.badges dt { margin-top: 12px; }
.prose dd { margin: 4px 0 0; }
code, pre { font: 14px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
pre { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; overflow-x: auto; }

.foot { border-top: 1px solid var(--line); margin-top: 36px; padding-top: 14px; padding-bottom: 36px; font-size: 14px; color: var(--muted); }
.foot p { margin: 0 0 6px; }

@media (max-width: 420px) {
  :root { --gut: 12px; }
  .mark { font-size: 14px; }
  .f select { max-width: 10.5em; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }
