:root {
  --bg: #0d0f13;
  --surface: #161920;
  --surface-2: #1d212a;
  --line: #272c37;
  --text: #f2f3f5;
  --muted: #9aa1ae;
  --faint: #6b7280;
  --accent: #ff5b37;
  --accent-ink: #ffffff;
  --accent-soft: rgba(255, 91, 55, 0.14);
  --good: #3ddc84;
  --warn: #ffb020;
  --radius: 14px;
  --shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 16px; }
.hidden { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 30;
  background: rgba(13, 15, 19, 0.88);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.header-row { display: flex; align-items: center; gap: 16px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; flex-shrink: 0; }
.brand-mark { width: 34px; height: 34px; border-radius: 9px; background: var(--accent); display: grid; place-items: center; }
.brand-mark svg { width: 20px; height: 20px; }
.brand-name { font-weight: 800; font-size: 18px; letter-spacing: -0.02em; }
.search { flex: 1; position: relative; max-width: 560px; margin-left: auto; }
.search input {
  width: 100%; height: 42px; padding: 0 14px 0 40px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
  outline: none; transition: border-color .15s;
}
.search input:focus { border-color: var(--accent); }
.search input::placeholder { color: var(--faint); }
.search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--faint); pointer-events: none; }
.search-clear { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: none; border: 0; color: var(--muted); padding: 6px 10px; cursor: pointer; border-radius: 999px; }
.install-btn {
  flex-shrink: 0; height: 38px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); cursor: pointer; font-weight: 600; font-size: 14px;
}
.install-btn:hover { border-color: var(--accent); }

/* ---------- Hero ---------- */
.hero { padding: 28px 0 8px; }
.hero h1 { margin: 0; font-size: clamp(26px, 4vw, 40px); letter-spacing: -0.03em; line-height: 1.1; font-weight: 800; }
.hero p { margin: 8px 0 0; color: var(--muted); font-size: 16px; max-width: 640px; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.pill strong { color: var(--text); font-weight: 700; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 3px rgba(61, 220, 132, 0.18); }
.disclosure { margin: 10px 0 0; font-size: 13px; color: var(--muted); }
.disclosure.small { margin-top: 10px; font-size: 12px; color: var(--faint); }
.site-footer a { color: var(--muted); }
.socials { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.socials a { font-size: 13px; color: var(--muted); text-decoration: none; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); }
.socials a:hover { color: var(--text); border-color: var(--muted); }

/* ---------- Sections ---------- */
.section { padding: 28px 0 8px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-head h2 { margin: 0; font-size: 22px; letter-spacing: -0.02em; font-weight: 800; }
.section-head .sub { color: var(--muted); font-size: 14px; margin-top: 2px; }
.link-btn { background: none; border: 0; color: var(--accent); font-weight: 600; cursor: pointer; padding: 4px 0; text-decoration: none; font-size: 14px; white-space: nowrap; }

/* ---------- Videos ---------- */
.video-block { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 16px; margin-bottom: 14px; }
.video-block.spotlight { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow); }
.video-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.video-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent); margin-bottom: 2px; }
.video-title { margin: 0; font-size: 18px; font-weight: 700; letter-spacing: -0.01em; }
.video-meta { color: var(--faint); font-size: 13px; margin-top: 2px; }
.video-actions { display: flex; gap: 8px; flex-shrink: 0; }
.chip-btn { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); font-size: 13px; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap; }
.chip-btn:hover { border-color: var(--muted); }
.chip-btn svg { width: 14px; height: 14px; }
.rail { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(210px, 240px); gap: 12px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x mandatory; scrollbar-width: thin; }
.rail > * { scroll-snap-align: start; }
.more-videos { display: grid; gap: 8px; }
.rows-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--faint); margin: 6px 0 2px; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px 10px 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; text-decoration: none; transition: border-color .15s; }
.list-row:hover { border-color: #3a404d; }
.row-thumbs { display: flex; flex-shrink: 0; }
.row-thumb { width: 40px; height: 40px; border-radius: 8px; background: #fff; border: 2px solid var(--surface); padding: 3px; margin-left: -10px; overflow: hidden; }
.row-thumb:first-child { margin-left: 0; }
.row-thumb img { width: 100%; height: 100%; object-fit: contain; }
.row-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.row-title { font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-meta { font-size: 13px; color: var(--muted); }
.row-chev { color: var(--faint); font-size: 22px; line-height: 1; }

/* ---------- Filters ---------- */
.filters { position: sticky; top: 64px; z-index: 20; background: var(--bg); padding: 10px 0 12px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.store-seg { margin-bottom: 10px; }
.store-tag { position: absolute; left: 10px; bottom: 10px; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 6px; background: rgba(17, 17, 17, 0.82); color: #fff; letter-spacing: 0.02em; }
.store-tag.store-walmart { background: #0b4fbf; }
.rating { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 2px; }
.rating .star { color: var(--warn); }
.rating-count { color: var(--faint); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex-shrink: 0; height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-size: 13px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.chip:hover { color: var(--text); }
.chip[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.chip .count { font-weight: 500; opacity: 0.6; margin-left: 4px; }
.controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 10px; }
.segmented { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.segmented button { border: 0; background: none; height: 28px; padding: 0 12px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; }
.segmented button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.select { height: 34px; padding: 0 30px 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%239aa1ae' fill='none' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat right 12px center; -webkit-appearance: none; appearance: none; font-size: 13px; font-weight: 600; cursor: pointer; }
.toggle { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; user-select: none; }
.toggle input { width: 16px; height: 16px; accent-color: var(--accent); }
.result-count { margin-left: auto; color: var(--faint); font-size: 13px; }

/* ---------- Deal cards ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.card {
  position: relative; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; text-decoration: none; transition: transform .15s, border-color .15s;
}
.card:hover { transform: translateY(-2px); border-color: #3a404d; }
.card-img { position: relative; aspect-ratio: 1 / 1; background: #fff; display: grid; place-items: center; padding: 14px; }
.card-img img { width: 100%; height: 100%; object-fit: contain; }
.badge { position: absolute; top: 10px; left: 10px; background: var(--accent); color: var(--accent-ink); font-weight: 800; font-size: 13px; padding: 4px 8px; border-radius: 8px; letter-spacing: -0.01em; }
.badge-alt { position: absolute; top: 10px; right: 10px; background: #111; color: var(--warn); font-weight: 700; font-size: 11px; padding: 4px 8px; border-radius: 8px; text-transform: uppercase; letter-spacing: 0.04em; }
.card-body { padding: 12px 12px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-title { margin: 0; font-size: 14px; font-weight: 500; line-height: 1.35; color: var(--text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.7em; }
.price-row { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-top: auto; }
.price { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.was { color: var(--faint); font-size: 13px; text-decoration: line-through; font-variant-numeric: tabular-nums; }
.save { color: var(--good); font-size: 13px; font-weight: 600; }
.note { font-size: 13px; color: var(--muted); background: var(--surface-2); border-left: 3px solid var(--accent); padding: 6px 8px; border-radius: 0 8px 8px 0; }
.deal-timer { font-size: 12px; color: var(--warn); font-weight: 600; }
.claimed { height: 5px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.claimed > span { display: block; height: 100%; background: var(--warn); }
.cta { margin-top: 6px; display: flex; align-items: center; justify-content: center; min-height: 38px; padding: 6px 8px; border-radius: 10px; background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 14px; line-height: 1.2; text-align: center; }
.card:hover .cta { filter: brightness(1.08); }
.asof { font-size: 11px; color: var(--faint); }

/* Skeletons */
.skeleton { pointer-events: none; }
.skeleton .card-img { background: var(--surface-2); }
.sk-line { height: 12px; border-radius: 6px; background: var(--surface-2); }
.shimmer { position: relative; overflow: hidden; }
.shimmer::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255,255,255,0.05), transparent); animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { transform: translateX(100%); } }

/* ---------- Live search ---------- */
.live-cta { margin: 18px 0 0; padding: 16px; border: 1px dashed var(--line); border-radius: var(--radius); display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.live-cta p { margin: 0; color: var(--muted); }
.btn { height: 40px; padding: 0 18px; border-radius: 999px; border: 0; background: var(--accent); color: var(--accent-ink); font-weight: 700; cursor: pointer; }
.btn.secondary { background: var(--surface-2); color: var(--text); border: 1px solid var(--line); }
.btn:disabled { opacity: 0.6; cursor: default; }
.center { display: flex; justify-content: center; padding: 22px 0; }
.center.compact { padding: 12px 0 0; }
.btn.small { height: 34px; padding: 0 16px; font-size: 13px; }

.empty { text-align: center; padding: 48px 16px; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--radius); }
.empty h3 { color: var(--text); margin: 0 0 6px; font-size: 18px; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); margin-top: 40px; padding: 28px 0 40px; color: var(--faint); font-size: 13px; }
.site-footer p { margin: 0 0 8px; max-width: 760px; }
.site-footer strong { color: var(--muted); }

/* ---------- iOS install sheet ---------- */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 60; display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--surface); border: 1px solid var(--line); border-radius: 18px 18px 0 0; padding: 22px 20px 28px; width: 100%; max-width: 480px; }
.sheet h3 { margin: 0 0 10px; font-size: 18px; }
.sheet ol { margin: 0 0 16px; padding-left: 20px; color: var(--muted); }
.sheet li { margin-bottom: 6px; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 999px; font-weight: 600; font-size: 14px; z-index: 70; box-shadow: var(--shadow); }

/* Keep jump targets clear of the sticky header */
.video-block, #liveSection, #dealsSection { scroll-margin-top: 80px; }

/* ---------- Mobile ---------- */
@media (max-width: 720px) {
  .header-row { height: auto; flex-wrap: wrap; padding: 10px 16px; gap: 10px; }
  .filters { position: static; padding-top: 4px; }
  .controls { gap: 8px; }
  .select { flex: 1; min-width: 0; }
  .controls .select { flex: 1 1 calc(50% - 4px); }
  .controls .segmented { width: 100%; }
  .controls .segmented button { flex: 1; }
  .store-seg { display: flex; }
  .store-seg button { flex: 1; }
  .search { order: 3; flex-basis: 100%; max-width: none; }
  .install-btn { margin-left: auto; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .card-body { padding: 10px; }
  .price { font-size: 18px; }
  .card-title { font-size: 13px; }
  .rail { grid-auto-columns: 58%; }
  .cta { font-size: 13px; }
  /* Phones: get products on screen fast */
  .hero { padding: 14px 0 0; }
  .hero h1 { font-size: 22px; }
  #tagline, .hero-stats, .hero .socials { display: none; }
  .hero .disclosure { margin-top: 4px; font-size: 12px; line-height: 1.4; color: var(--faint); }
  #videosSection { padding-top: 12px; }
  #videosSection .section-head > div { display: none; }
  #videosSection .section-head { margin-bottom: 8px; }
  #videosSection .section-head:has(#allVideosBtn.hidden) { display: none; }
  .video-block { padding: 12px; border-radius: 16px; }
  .video-top { flex-direction: row; align-items: center; margin-bottom: 10px; gap: 8px; }
  .video-label { font-size: 11px; }
  .video-title { font-size: 17px; }
  .video-meta { font-size: 12px; margin-top: 0; }
  .video-actions .chip-btn { height: 32px; padding: 0 10px; font-size: 12px; }
  .footer-socials { margin: 0 0 12px; }
  .result-count { margin-left: auto; }
  .video-block, #liveSection, #dealsSection { scroll-margin-top: 124px; }
  .badge { font-size: 12px; }
}
