:root {
  --bg: #fafafa;
  --surface: #ffffff;
  --text: #161616;
  --muted: #6b7280;
  --border: #e5e7eb;
  --accent: #e11d48;
  --accent-dark: #be123c;
  --accent-soft: #fff1f2;
  --gold: #b45309;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 4px 14px rgba(0, 0, 0, 0.05);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

a { color: var(--accent); }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }

/* Header */
header.site {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 22px 0 18px;
  position: sticky;
  top: 0;
  z-index: 10;
}
.logo {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin: 0;
}
.logo span { color: var(--accent); }
.tagline { margin: 2px 0 0; color: var(--muted); font-size: 15px; }
.updated { margin: 6px 0 0; color: var(--muted); font-size: 12.5px; }

/* Controls */
.controls { padding: 18px 0 6px; }
.search-row { display: flex; gap: 10px; flex-wrap: wrap; }
.search-row input[type="search"] {
  flex: 1;
  min-width: 200px;
  padding: 11px 14px;
  font-size: 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  outline: none;
}
.search-row input[type="search"]:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.tabs { display: flex; gap: 8px; }
.tab {
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.tab.active { background: var(--text); color: #fff; border-color: var(--text); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.chip {
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 14px;
  cursor: pointer;
}
.chip.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-dark); font-weight: 700; }

/* Alerts */
#alerts { margin: 14px 0 0; }
.alert-banner {
  background: #fef3c7;
  border: 1px solid #fcd34d;
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 15px;
}
.alert-banner strong { color: #92400e; }
.alert-banner ul { margin: 6px 0 0; padding-left: 20px; }

/* Grid + cards */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  padding: 18px 0 8px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  display: flex;
  flex-direction: column;
  position: relative;
}
.rank {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-weight: 800;
  font-size: 13px;
  padding: 3px 9px;
  border-radius: 999px;
}
.card h2 {
  font-size: 17px;
  line-height: 1.35;
  margin: 0 34px 8px 0;
}
.price-row { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.price { font-size: 21px; font-weight: 800; }
.rating { color: var(--gold); font-weight: 700; font-size: 14px; }
.sold { color: var(--muted); font-size: 13.5px; }
.retailer { color: var(--muted); font-size: 13.5px; margin-top: 2px; }
.why { font-size: 14.5px; margin: 10px 0 12px; flex: 1; }
.card-actions { display: flex; gap: 8px; align-items: center; margin-top: auto; }
.btn {
  display: inline-block;
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 14.5px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-ghost { background: var(--surface); border-color: var(--border); color: var(--text); }
.btn-ghost:hover { border-color: var(--text); }
.btn-tracked { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-dark); }
.source-line { color: var(--muted); font-size: 12.5px; margin-top: 8px; }
.source-line a { color: var(--muted); text-decoration: underline; }
.target-row { display: flex; gap: 6px; align-items: center; margin-top: 10px; font-size: 13.5px; color: var(--muted); flex-wrap: wrap; }
.target-row input {
  width: 90px;
  padding: 6px 8px;
  font-size: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.target-row button {
  padding: 6px 12px;
  font-size: 13.5px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  font-weight: 600;
}
.empty {
  text-align: center;
  color: var(--muted);
  padding: 48px 16px;
  font-size: 16px;
}
.count-line { color: var(--muted); font-size: 13.5px; margin: 4px 0 0; }

/* Footer */
footer.site {
  border-top: 1px solid var(--border);
  background: var(--surface);
  margin-top: 28px;
  padding: 24px 0 32px;
  font-size: 14px;
  color: var(--muted);
}
footer.site h2 { font-size: 16px; color: var(--text); margin: 0 0 6px; }
footer.site p { margin: 6px 0; max-width: 720px; }
.install-note {
  margin-top: 14px;
  padding: 10px 14px;
  background: var(--accent-soft);
  border-radius: 10px;
  font-size: 13.5px;
  color: var(--text);
}

@media (max-width: 560px) {
  .logo { font-size: 26px; }
  .grid { grid-template-columns: 1fr; }
}

/* Platform tabs */
.platform-tabs { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.ptab {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.ptab.active { background: var(--text); color: #fff; border-color: var(--text); }

/* Product thumbnails */
.thumb {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: 10px;
  overflow: hidden;
  margin: -4px 0 12px;
  background: var(--accent-soft);
}
.thumb-ph {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.thumb-ph span {
  font-size: 64px;
  font-weight: 800;
  color: rgba(0, 0, 0, 0.28);
}
.thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Privacy page */
.policy { max-width: 760px; }
.policy h2 { margin: 28px 0 8px; font-size: 19px; }
.policy p, .policy li { line-height: 1.65; }
.policy ul { padding-left: 20px; }
