/* ---------- tokens: the clearance-aisle system ---------- */
:root {
  --shelf: #eff1ed;   /* fluorescent-lit retail gray  */
  --ink:   #15181a;   /* price-gun black              */
  --paper: #ffffff;   /* the tag itself               */
  --tag:   #ffd23f;   /* clearance-sticker yellow     */
  --mark:  #da2c38;   /* markdown red                 */
  --mute:  #67706b;
  --display: 'Archivo Black', 'Arial Black', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --body: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--shelf);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.55;
}
.wrap { max-width: 1020px; margin: 0 auto; padding: 0 16px; }
a { color: inherit; }

/* ---------- centered layout ----------
   Center the feed and primary content within a comfortable max-width.
   Long-form prose blocks re-set their own alignment below for readability. */
main#main { text-align: center; }
/* long-form prose pages (about/disclosure/privacy/how-it-works) opt out of
   centered body text for readability, but keep their heading centered */
#main.prose { text-align: left; }
#main.prose h1 { text-align: center; }
.feed-head { text-align: center; }
.sub { margin-left: auto; margin-right: auto; }
.card { text-align: center; align-items: center; }
.deal { text-align: center; }
.deal-price { justify-content: center; }
.deal-desc { margin-left: auto; margin-right: auto; }
:focus-visible { outline: 3px solid var(--mark); outline-offset: 2px; }

/* ---------- header ---------- */
.site-head { background: var(--ink); color: var(--paper); padding: 14px 0 0; }
.head-row { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.logo {
  font-family: var(--display);
  font-size: 26px;
  letter-spacing: .5px;
  text-decoration: none;
  color: var(--paper);
  display: inline-flex; align-items: center; gap: 8px;
}
.logo-tag {
  background: var(--tag); color: var(--ink);
  font-size: 18px; line-height: 1;
  padding: 5px 7px; transform: rotate(-6deg);
  box-shadow: 2px 2px 0 rgba(0,0,0,.45);
}
.head-note { font-family: var(--mono); font-size: 12px; color: #b9c0ba; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-top: 12px; padding-bottom: 12px; }
.chip {
  font-family: var(--mono); font-size: 13px; font-weight: 600; white-space: nowrap;
  color: var(--paper); text-decoration: none;
  border: 1px solid #3a3f42; padding: 5px 12px; border-radius: 999px;
}
/* neutral fallback for any retailer without a defined brand color */
.chip:hover { background: var(--tag); color: var(--ink); border-color: var(--tag); }

/* ---- retailer brand chips: official brand color at rest, auto-contrast text ----
   --brand-fg is chosen per retailer for WCAG-readable text on that background
   (dark ink on light oranges, white on the darker blues/reds/green).
   --brand-dark is the hover/pressed fill so interaction is obvious. */
.chip-amazon    { --brand:#FF9900; --brand-fg:#15181a; --brand-dark:#E08A00; }
.chip-walmart   { --brand:#0071CE; --brand-fg:#ffffff; --brand-dark:#005CA8; }
.chip-target    { --brand:#CC0000; --brand-fg:#ffffff; --brand-dark:#A30000; }
.chip-woot      { --brand:#5C7C3B; --brand-fg:#ffffff; --brand-dark:#496330; }
.chip-bestbuy   { --brand:#0046BE; --brand-fg:#ffffff; --brand-dark:#003795; }
.chip-homedepot { --brand:#F96302; --brand-fg:#15181a; --brand-dark:#D25402; }
.chip-lowes     { --brand:#004990; --brand-fg:#ffffff; --brand-dark:#003970; }
/* eBay: deepened from the #E53238 brand red to clear WCAG AA on small text
   (white on #E53238 is only 4.33:1; #C31E24 is ~5.9:1) while staying eBay-red */
.chip-ebay      { --brand:#C31E24; --brand-fg:#ffffff; --brand-dark:#A5171D; }

.chip-amazon, .chip-walmart, .chip-target, .chip-woot,
.chip-bestbuy, .chip-homedepot, .chip-lowes, .chip-ebay {
  background: var(--brand); color: var(--brand-fg); border-color: var(--brand);
}
.chip-amazon:hover, .chip-walmart:hover, .chip-target:hover, .chip-woot:hover,
.chip-bestbuy:hover, .chip-homedepot:hover, .chip-lowes:hover, .chip-ebay:hover,
.chip-amazon:focus-visible, .chip-walmart:focus-visible, .chip-target:focus-visible, .chip-woot:focus-visible,
.chip-bestbuy:focus-visible, .chip-homedepot:focus-visible, .chip-lowes:focus-visible, .chip-ebay:focus-visible {
  background: var(--brand-dark); border-color: var(--brand-dark); color: var(--brand-fg);
}
.chip-amazon:active, .chip-walmart:active, .chip-target:active, .chip-woot:active,
.chip-bestbuy:active, .chip-homedepot:active, .chip-lowes:active, .chip-ebay:active {
  transform: translateY(1px);
}
/* current-page retailer keeps its brand fill but gains a ring so it reads as selected */
.chip-amazon.on, .chip-walmart.on, .chip-target.on, .chip-woot.on,
.chip-bestbuy.on, .chip-homedepot.on, .chip-lowes.on, .chip-ebay.on {
  background: var(--brand-dark); border-color: var(--paper);
}

/* ---------- feed ---------- */
.feed-head { padding: 26px 0 6px; }
.feed-head h1 { font-family: var(--display); font-size: clamp(28px, 5vw, 44px); margin: 0; }
.sub { color: var(--mute); margin: 6px 0 0; max-width: 60ch; }
.mono { font-family: var(--mono); }

.grid {
  display: grid; gap: 14px;
  /* fixed-width tracks (not 1fr) leave free space so the feed can center on
     wide screens instead of stretching edge-to-edge */
  grid-template-columns: repeat(auto-fill, minmax(230px, 300px));
  justify-content: center;
  padding: 18px 0 8px;
}
.card {
  position: relative;
  background: var(--paper);
  text-decoration: none;
  padding: 40px 16px 16px;
  border: 1px solid #dde1db;
  box-shadow: 0 1px 0 rgba(21,24,26,.08);
  display: flex; flex-direction: column; gap: 8px;
}
@media (prefers-reduced-motion: no-preference) {
  .card { transition: transform .12s ease, box-shadow .12s ease; }
  .card:hover { transform: translateY(-2px); box-shadow: 0 4px 0 rgba(21,24,26,.14); }
}
.sticker {
  position: absolute; top: 10px; right: 10px;
  background: var(--tag); color: var(--ink);
  font-family: var(--display); font-size: 13px;
  padding: 5px 8px; transform: rotate(4deg);
  box-shadow: 1px 2px 0 rgba(21,24,26,.35);
}
.sticker.big { position: static; display: inline-block; font-size: 16px; transform: rotate(-3deg); }
.card-retailer { font-family: var(--mono); font-size: 11px; text-transform: uppercase; color: var(--mute); letter-spacing: .08em; }
.card-title { font-size: 16px; font-weight: 700; line-height: 1.3; margin: 0; }
.card-price { margin: 0; font-family: var(--mono); }
.now { font-size: 22px; font-weight: 600; }
.was { color: var(--mark); margin-left: 8px; }
.card-go { font-family: var(--mono); font-size: 13px; margin-top: auto; }
.card:hover .card-go { text-decoration: underline; }
.card.dead { opacity: .55; }
.dead-flag { font-family: var(--mono); font-size: 12px; color: var(--mark); text-transform: uppercase; }
.empty { padding: 30px 0; color: var(--mute); }

/* ---------- deal page ---------- */
.deal { background: var(--paper); border: 1px solid #dde1db; padding: 26px 22px; margin-top: 26px; }
.crumb { font-family: var(--mono); font-size: 13px; color: var(--mute); margin: 0 0 8px; }
.deal h1 { font-family: var(--display); font-size: clamp(24px, 4.4vw, 38px); line-height: 1.12; margin: 0 0 14px; }
.deal-price { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-family: var(--mono); }
.deal-price .now { font-size: clamp(34px, 6vw, 52px); font-weight: 600; }
.deal-price .was { font-size: 20px; }
.promo { font-family: var(--mono); margin: 14px 0 0; }
.promo code { border: 2px dashed var(--ink); padding: 3px 10px; font-weight: 600; background: #fff8e0; }
.deal-desc { max-width: 62ch; }
.cta {
  display: block; text-align: center; text-decoration: none;
  background: var(--tag); color: var(--ink);
  font-family: var(--display); font-size: 20px;
  padding: 16px 20px; margin: 20px 0 0;
  border: 2px solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
}
.cta:hover { background: #ffdd66; }
.cta:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--ink); }
.fineprint { font-size: 12.5px; color: var(--mute); margin-top: 12px; }
.dead-banner {
  background: var(--mark); color: #fff;
  font-family: var(--mono); font-size: 14px;
  padding: 10px 14px; margin: 0 0 18px;
}

/* ---------- shared bits ---------- */
.tearline { border: 0; border-top: 2px dashed #c6ccc4; margin: 34px 0 22px; }
.related h2, .capture h2 { font-family: var(--display); font-size: 22px; margin: 0 0 4px; }
.capture { padding-bottom: 46px; }
.capture form { display: flex; gap: 8px; max-width: 460px; margin-top: 12px; flex-wrap: wrap; }
.capture input[type=email] {
  flex: 1 1 220px; padding: 12px; font-family: var(--mono); font-size: 15px;
  border: 2px solid var(--ink); background: var(--paper);
}
.capture button {
  font-family: var(--display); font-size: 15px; cursor: pointer;
  background: var(--ink); color: var(--tag); border: 2px solid var(--ink);
  padding: 12px 18px;
}
.capture button:hover { background: #000; }
.page { background: var(--paper); border: 1px solid #dde1db; padding: 26px 22px; margin: 26px 0 46px; max-width: 74ch; }
.page h1 { font-family: var(--display); font-size: 28px; margin-top: 0; }

/* ---------- footer ---------- */
.site-foot { background: var(--shelf); color: var(--mute); font-size: 13px; padding: 6px 0 40px; }
.foot-links a { color: var(--mute); }

/* ---------- admin ---------- */
.panel { background: var(--paper); border: 1px solid #dde1db; padding: 20px 18px; margin: 20px 0; }
.panel h2 { font-family: var(--display); font-size: 19px; margin: 0 0 12px; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.stack label { display: flex; flex-direction: column; gap: 4px; font-family: var(--mono); font-size: 13px; }
.stack input, .stack select {
  padding: 9px; border: 1.5px solid #b9c0ba; font-size: 15px; font-family: var(--body); background: #fff;
}
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stack button, .actions button {
  font-family: var(--display); font-size: 14px; cursor: pointer;
  background: var(--tag); color: var(--ink); border: 2px solid var(--ink); padding: 9px 14px;
  align-self: flex-start;
}
.actions button.ghost { background: transparent; font-family: var(--mono); border-width: 1px; }
.postbox { width: 100%; font-family: var(--mono); font-size: 14px; padding: 12px; border: 2px dashed var(--ink); background: #fff8e0; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-family: var(--mono); font-size: 12px; text-transform: uppercase; color: var(--mute); }
th, td { padding: 8px 8px 8px 0; border-bottom: 1px solid #e7eae4; vertical-align: top; }
.dim { color: var(--mute); font-size: 12px; display: block; }
.dead-row { opacity: .55; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.actions form { display: flex; gap: 6px; }

@media (max-width: 560px) {
  .row2 { grid-template-columns: 1fr; }
  .deal { padding: 20px 14px; }
}

/* ---------- phase 1.5: errors + queue tooling ---------- */
.sticker.err { background: var(--mark); color: #fff; }
.chip-err { border-color: var(--mark); color: #ffb3b8; }
.chip-err:hover { background: var(--mark); color: #fff; border-color: var(--mark); }
.errbadge { font-family: var(--mono); font-size: 11px; background: var(--mark); color: #fff; padding: 2px 6px; }
.rlinks { display: block; font-family: var(--mono); font-size: 12px; margin-top: 3px; }
.rlinks a { margin-right: 10px; color: #1f5fbf; }
.tabs a { margin-right: 14px; text-decoration: none; color: var(--mute); border-bottom: 2px solid transparent; padding-bottom: 2px; }
.tabs a.on { color: var(--ink); border-bottom-color: var(--tag); font-weight: 600; }
.rip .sub { margin-bottom: 0; }

/* ---------- trust + mobile UX round ---------- */
.skip { position: absolute; left: -999px; top: 0; background: var(--tag); color: var(--ink);
  padding: 10px 14px; font-family: var(--mono); z-index: 60; }
.skip:focus { left: 8px; }

.chip { padding: 8px 12px; }                 /* >=44px tap with line-height */
.chip.on { background: var(--tag); color: var(--ink); border-color: var(--tag); font-weight: 700; }
.chip-err.on { background: var(--mark); color: #fff; border-color: var(--mark); }

.trustbar { display: flex; gap: 18px; flex-wrap: wrap; font-size: 12.5px; color: var(--mute);
  border: 1px dashed #c6ccc4; background: #f6f7f4; padding: 10px 14px; margin-top: 14px; }
.trustbar a { color: var(--ink); }
.foot-trust { color: #8a938c; font-size: 12px; }

/* forms: 16px inputs stop iOS auto-zoom; bigger buttons everywhere */
input, select, button, textarea { font-size: 16px !important; }
.capture button, .stack button, .cta { min-height: 46px; }
.actions button { min-height: 40px; }

.copybtn { font-family: var(--mono); font-size: 13px !important; min-height: 0;
  border: 1.5px solid var(--ink); background: var(--paper); padding: 4px 10px;
  cursor: pointer; margin-left: 8px; }
.copybtn:hover { background: var(--tag); }

/* sticky mobile CTA on deal pages */
.sticky-cta { display: none; }
@media (max-width: 640px) {
  .sticky-cta { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    gap: 12px; align-items: center; background: var(--ink); padding: 10px 14px
    calc(10px + env(safe-area-inset-bottom)); }
  .sticky-price { color: var(--tag); font-size: 20px; font-weight: 600; }
  .cta-small { flex: 1; margin: 0; font-size: 17px; padding: 12px 10px;
    box-shadow: none; border-color: var(--tag); }
  .deal { margin-bottom: 76px; }
}

/* denser 2-col deal grid on phones */
@media (max-width: 560px) {
  .grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .card { padding: 34px 12px 12px; }
  .card-title { font-size: 14.5px; }
  .now { font-size: 19px; }
  .sticker { font-size: 11px; padding: 4px 6px; }
  .feed-head h1 { font-size: 30px; }
}
@media (max-width: 350px) { .grid { grid-template-columns: 1fr; } }

/* admin tables become stacked cards on phones */
@media (max-width: 720px) {
  .panel table, .panel tr, .panel td { display: block; width: 100%; }
  .panel thead, .panel th { display: none; }
  .panel tr { border: 1px solid #e2e5df; padding: 10px; margin-bottom: 10px; }
  .panel td { border: 0; padding: 4px 0; }
  .actions { flex-direction: column; }
  .actions form { width: 100%; }
  .stack input[name="dest_url"] { width: 100%; }
}

/* ================= design system v2: storefront trust =================
   Research-backed: rounded CTAs outperform sharp; contrast > hue; green
   primary against warm-white; one primary action per view; images sell. */
:root {
  --shelf: #fafaf8;            /* cleaner storefront white  */
  --go: #0b7c4e;               /* primary "get deal" green  */
  --go-dark: #08633d;
  --r: 12px; --r-s: 8px;
  --shadow: 0 1px 2px rgba(21,24,26,.06), 0 10px 28px -18px rgba(21,24,26,.25);
}

/* surfaces + radius */
.card, .deal, .page, .panel, .trustbar { border-radius: var(--r); }
.card { box-shadow: var(--shadow); border-color: #e7e9e3; }
.deal, .page, .panel { box-shadow: var(--shadow); border-color: #e7e9e3; }
.sticker { border-radius: 6px; }
.chip { border-radius: 999px; }
input, select, textarea, .postbox { border-radius: var(--r-s) !important; }

/* button system: green = money action, dark = subscribe, outline = tertiary */
button, .cta { border-radius: 10px; }
.cta {
  background: var(--go); color: #fff; border: 0;
  font-family: var(--body); font-weight: 800; letter-spacing: .01em;
  box-shadow: 0 2px 0 var(--go-dark), 0 10px 22px -12px rgba(11,124,78,.55);
  transition: background .12s ease, transform .06s ease;
}
.cta:hover { background: var(--go-dark); }
.cta:active { transform: translateY(1px); box-shadow: 0 1px 0 var(--go-dark); }
.capture button, .stack button, .actions button:not(.ghost) {
  background: var(--ink); color: #fff; border: 0; border-radius: 10px;
  font-family: var(--body); font-weight: 700;
}
.capture button:hover, .stack button:hover, .actions button:not(.ghost):hover { background: #000; }
.actions button.ghost { border-radius: 10px; border: 1.5px solid #c9cec7; color: var(--mute); background: #fff; }
.copybtn { border-radius: 8px; }
.cta-small { border: 0; }
@media (max-width: 640px) { .cta-small { border: 0; box-shadow: none; } }

/* card media: square, contained, white stage (Baymard: thumbnails sell) */
.card { padding-top: 12px; }
.card-media { display: block; aspect-ratio: 1 / 1; border-radius: var(--r-s);
  background: #fff; border: 1px solid #eef0ea; overflow: hidden;
  display: flex; align-items: center; justify-content: center; }
.card-media img { width: 100%; height: 100%; object-fit: contain; padding: 8px; }
.card-media .ph { font-family: var(--display); font-size: 40px; color: #d7dbd2; }
.sticker { z-index: 2; }

/* deal hero: media beside info on wide screens */
.deal-hero { display: flex; gap: 26px; align-items: flex-start; }
.deal-media { flex: 0 0 320px; max-width: 320px; aspect-ratio: 1/1; background: #fff;
  border: 1px solid #eef0ea; border-radius: var(--r); display: flex;
  align-items: center; justify-content: center; overflow: hidden; }
.deal-media img { width: 100%; height: 100%; object-fit: contain; padding: 14px; }
.deal-info { flex: 1; min-width: 0; }
@media (max-width: 760px) {
  .deal-hero { flex-direction: column; }
  .deal-media { width: 100%; max-width: none; flex-basis: auto; aspect-ratio: 4/3; }
}

/* admin queue thumbs */
.qthumb { width: 56px; height: 56px; object-fit: contain; background: #fff;
  border: 1px solid #eceee8; border-radius: 8px; float: left; margin: 0 10px 4px 0; }

/* softer chrome details */
.site-head { padding-top: 16px; }
.trustbar { border-style: solid; border-color: #e7e9e3; background: #fff; }
.tearline { border-top-style: dotted; }

/* ---------- verification + gating round ---------- */
.badge { font-family: var(--mono); font-size: 11.5px; padding: 3px 8px; border-radius: 999px; margin-left: 6px; }
.badge.live { background: #e3f5ec; color: #0b7c4e; border: 1px solid #bfe6d2; }
.badge.stale { background: #f4f4ef; color: var(--mute); border: 1px solid #e2e4dc; }
.dotlive { color: var(--go); font-size: 14px; margin-left: 4px; }
.howto { background: #f7f9f4; border: 1px solid #e3e8dd; border-radius: var(--r-s); padding: 12px 16px; margin: 16px 0 0; }
.howto h2 { font-family: var(--display); font-size: 16px; margin: 0 0 6px; }
.howto ol { margin: 0; padding-left: 20px; }
.howto li { margin: 4px 0; }
.odds { font-size: 14px; background: #fff8e0; border: 1px dashed #e6cf6a; border-radius: var(--r-s); padding: 10px 12px; }
.ymmv { font-size: 13px; color: var(--mute); }
.lockedcard { position: relative; }
.lockedcard .blurred { filter: blur(5px); user-select: none; }
.lockedcard .card-go { color: var(--go); font-weight: 700; }
.lockedwrap h2 { font-family: var(--display); font-size: 22px; margin: 0 0 4px; }

/* click-safe status framing + secondary check-price CTA */
.badge.tested { background: #eef4ee; color: #2f5d43; border: 1px solid #d5e4d8; }
.cta-ghost { background: #fff; color: var(--go); border: 2px solid var(--go);
  box-shadow: none; }
.cta-ghost:hover { background: #f0faf5; color: var(--go-dark); border-color: var(--go-dark); }

/* revenue layer */
.flip { background: #eefaf3; border: 1px solid #cdeeda; border-radius: var(--r-s); padding: 10px 12px; font-size: 14px; }
.flip .dim { color: var(--mute); font-size: 12px; }
.bounty { font-size: 13.5px; background: #f4f6fb; border: 1px solid #dfe5f2; border-radius: var(--r-s); padding: 9px 12px; }
.carttip { color: #4a5450; }
.capture-card { justify-content: center; }
.capture-card form { display: flex; flex-direction: column; gap: 8px; }
.capture-card input[type=email] { padding: 10px; border: 2px solid var(--ink); border-radius: var(--r-s); font-family: var(--mono); }
.capture-card button { background: var(--ink); color: #fff; border: 0; border-radius: 10px; padding: 10px; font-weight: 700; cursor: pointer; }
.seo-intro { max-width: 68ch; color: #4a5450; font-size: 15px; margin: 10px 0 0; }

/* SEO round */
.disclosure-bar { font-size: 11.5px; color: #9aa39c; padding-bottom: 10px; margin: 0; }
.disclosure-bar a { color: #b9c0ba; }
.foot-fresh { font-size: 12px; }
.foot-fresh a { color: var(--mute); }
.roundup-item { border-bottom: 2px dashed #e2e5df; padding: 14px 0; }
.roundup-item img { max-width: 260px; width: 100%; border-radius: var(--r-s); border: 1px solid #eceee8; }
.roundup-item h2 { font-size: 19px; margin: 8px 0 4px; }
.calc label { display: flex; flex-direction: column; gap: 4px; font-family: var(--mono); font-size: 13px; margin-bottom: 10px; }
.calc input { padding: 10px; border: 2px solid var(--ink); border-radius: var(--r-s); max-width: 220px; }
.calc-out { font-size: 22px; font-weight: 600; margin-top: 6px; }

/* store stock checker */
.sc-stores { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.sc-store { font-family: var(--mono); font-size: 13px; padding: 8px 12px; border-radius: 999px;
  border: 1.5px solid #c9cec7; background: #fff; cursor: pointer; }
.sc-store.on { background: var(--go); color: #fff; border-color: var(--go); }
.sc-out { font-size: 18px; font-weight: 600; margin-top: 8px; min-height: 22px; }
