:root {
  --bg: #f6f7f9;
  --card: #fff;
  --text: #111;
  --muted: #8a8a8a;
  --line: #e6e6e6;
  --brand: #ee4d2d;
  --brand-dark: #d73211;
  --chip: #f2f2f2;
  --max: 1180px;
}
* { box-sizing: border-box; }
html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, "Segoe UI", Roboto, sans-serif;
}
a { color: inherit; }
.wrap { width: min(var(--max), calc(100% - 32px)); margin: 0 auto; }

.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: #fff;
  border-bottom: 1px solid #eee;
}
.nav-in {
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 22px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  font-weight: 800;
  font-size: 17px;
  white-space: nowrap;
}
.brand-logo {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: block;
  box-shadow: 0 4px 10px rgba(255, 90, 31, 0.28);
}
.nav-links { display: flex; gap: 16px; font-size: 14px; }
.nav-links a { text-decoration: none; color: #444; }
.nav-links a.on { color: var(--brand); font-weight: 700; }
.nav-search { margin-left: auto; }
.nav-search input {
  width: min(260px, 32vw);
  border: 1px solid #e6e6e6;
  border-radius: 999px;
  padding: 8px 14px;
  font: inherit;
  outline: 0;
  background: #fafafa;
}

.hero {
  background: #fff;
  padding: 36px 0 28px;
  text-align: center;
  border-bottom: 1px solid #eee;
}
.hero h1 { margin: 0 0 18px; font-size: 28px; font-weight: 800; letter-spacing: -0.02em; }
.finder {
  display: flex;
  max-width: 720px;
  margin: 0 auto;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}
.finder input {
  flex: 1;
  border: 0;
  padding: 14px 16px;
  font: inherit;
  font-size: 15px;
  outline: 0;
  min-width: 0;
}
.finder button {
  border: 0;
  background: var(--brand);
  color: #fff;
  font: inherit;
  font-weight: 700;
  padding: 0 22px;
  cursor: pointer;
}
.finder button:hover { background: var(--brand-dark); }
.finder #paste {
  background: #fff1ea;
  color: var(--brand);
  padding: 0 16px;
}

.product {
  max-width: 720px;
  margin: 18px auto 0;
  text-align: left;
  background: #fff;
  border: 1px solid #eee;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(16, 24, 40, 0.06);
  overflow: visible;
}
.product-card {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 14px;
  padding: 14px;
  align-items: center;
}
.product-card img {
  width: 112px;
  height: 112px;
  object-fit: cover;
  border-radius: 10px;
  background: #f3f3f3;
}
.product-card .name {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
}
.product-card .facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.product-card .facts div {
  background: #f7f7f8;
  border-radius: 8px;
  padding: 8px 10px;
}
.product-card .facts span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 2px;
}
.product-card .facts b { color: var(--text); font-size: 16px; }
.product-card .facts .cash { color: #16a34a; font-size: 18px; }
.product-card .go {
  display: inline-flex;
  margin-top: 12px;
  background: var(--brand);
  color: #fff;
  text-decoration: none;
  border-radius: 8px;
  padding: 10px 14px;
  font-weight: 700;
  font-size: 14px;
}
.product-card .go:hover { background: var(--brand-dark); }
.product.err {
  padding: 14px 16px;
  color: #b42318;
  text-align: center;
}
.match-box {
  border-top: 1px solid #eee;
  padding: 12px 14px 16px;
  text-align: left;
}
.match-box h3 {
  margin: 0 0 2px;
  font-size: 16px;
  font-weight: 800;
}
.match-box .match-sub {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}
.match-stamps {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.page { padding: 22px 0 56px; }
.list-title { margin: 0 0 8px; font-size: 22px; text-align: center; }

.filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 4px 14px;
  padding: 6px 0 12px;
  border-bottom: 1px solid #eee;
  margin-bottom: 14px;
  scroll-margin-top: 72px;
}
.chip {
  border: 0;
  background: transparent;
  color: #555;
  border-radius: 0;
  padding: 8px 2px 10px;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}
.chip.on {
  background: transparent;
  color: var(--brand);
  font-weight: 700;
  box-shadow: inset 0 -2px 0 var(--brand);
}

.stamps {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 10px;
}
.stamp {
  display: flex;
  align-items: stretch;
  position: relative;
  min-height: 118px;
  background: #fff;
  color: #222;
  cursor: pointer;
  filter: drop-shadow(0 1px 3px rgba(16, 24, 40, 0.12));
}
.stamp:hover { filter: drop-shadow(0 2px 8px rgba(16, 24, 40, 0.18)); }
.stamp::before,
.stamp::after {
  content: "";
  position: absolute;
  left: 90px;
  width: 12px;
  height: 12px;
  background: var(--bg);
  border-radius: 50%;
  z-index: 4;
  pointer-events: none;
}
.stamp::before { top: -6px; }
.stamp::after { bottom: -6px; }
.stamp-badge {
  flex: 0 0 96px;
  width: 96px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #fff;
  background: var(--brand);
  padding: 12px 14px 12px 8px;
  position: relative;
}
.stamp-badge::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 10px;
  height: 100%;
  background:
    linear-gradient(45deg, #fff 5px, transparent 5.5px) 0 0 / 10px 10px,
    linear-gradient(-45deg, #fff 5px, transparent 5.5px) 0 5px / 10px 10px;
  pointer-events: none;
}
.stamp-badge .logo {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #fff;
  overflow: hidden;
  flex: 0 0 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.stamp-badge .logo img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center;
  background: #fff;
  display: block;
  flex: none;
}
.stamp-badge .logo svg {
  width: 48px;
  height: 48px;
  display: block;
}
.stamp-badge .logo .logo-fb[hidden] { display: none; }
.stamp-badge .shop {
  margin-top: 6px;
  font-size: 11px;
  line-height: 1.25;
  font-weight: 600;
  max-width: 80px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.stamp-body {
  flex: 1;
  min-width: 0;
  position: relative;
  padding: 10px 44px 8px 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: #fff;
}
.stamp-body::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 12px;
  bottom: 12px;
  border-left: 1px dashed #e0e0e0;
}
.offer {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  color: #222;
}
.offer .limited {
  display: inline-block;
  vertical-align: middle;
  margin-right: 4px;
  margin-bottom: 2px;
  background: #111;
  color: #ffe14d;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 2px;
  line-height: 1.2;
}
.qty {
  position: absolute;
  top: 8px;
  right: 8px;
  background: #ffe14d;
  color: #333;
  font-size: 11px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 2px;
  line-height: 16px;
}
.brand-pill {
  display: inline-block;
  margin-top: 6px;
  border: 1px solid var(--brand);
  color: var(--brand);
  font-size: 11px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 2px;
  width: fit-content;
}
.stamp-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  font-size: 12px;
  flex-wrap: wrap;
}
.stamp-foot .time {
  color: #888;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.stamp-foot .time svg {
  width: 13px;
  height: 13px;
  flex: none;
  fill: none;
  stroke: #999;
  stroke-width: 1.8;
}
.stamp-foot .cond {
  color: #1876f2;
  text-decoration: none;
  font-weight: 600;
}
.stamp-foot .later {
  position: absolute;
  top: 10px;
  right: 8px;
  border: 0;
  background: transparent;
  color: var(--brand);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  white-space: nowrap;
}
.stamp-body:has(.qty) .later { top: 28px; }
.stamp-foot .later:hover { color: var(--brand-dark); }
.stamp.is-match .stamp-body { padding-top: 22px; }
.stamp-ribbon {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 5;
  background: #c81e1e;
  color: #ffe14d;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.03em;
  padding: 5px 8px 5px 12px;
  clip-path: polygon(8px 0, 100% 0, 100% 100%, 0 100%);
}
.stamp.is-match { outline: none; }

.tone-orange .stamp-badge { background: #ee4d2d; }
.tone-red .stamp-badge { background: #ee2c4a; }
.tone-blue .stamp-badge { background: #2563eb; }
.tone-sky .stamp-badge { background: #0284c7; }
.tone-green .stamp-badge { background: #0f766e; }

.empty { text-align: center; color: var(--muted); padding: 40px 0; }

.foot {
  border-top: 1px solid #eee;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  padding: 18px 0 28px;
  text-align: center;
}

@media (max-width: 720px) {
  .nav-links { display: none; }
  .nav-search input { width: 140px; }
  .hero { padding: 22px 0 18px; }
  .hero h1 { font-size: 22px; }
  .product-card { grid-template-columns: 84px minmax(0, 1fr); }
  .product-card img { width: 84px; height: 84px; }
  .finder #paste { display: none; }
  .stamps,
  .match-stamps { grid-template-columns: 1fr; }
  .stamp-badge { width: 88px; flex-basis: 88px; padding-right: 12px; }
  .stamp::before,
  .stamp::after { left: 82px; }
  .stamp { min-height: 110px; }
  .offer { font-size: 13px; }
  .stamp-body { padding-right: 40px; }
}
