:root {
  --bg: #f7f8fa; --panel: #fff; --text: #1b2230; --muted: #5f6b7d; --line: #e3e7ee;
  --accent: #1d5fd1; --good: #137a3f; --good-bg: #e4f5ea; --alt: #8a4b00; --alt-bg: #fdf0dc;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #12161d; --panel: #1b212b; --text: #e7ebf1; --muted: #9aa5b6; --line: #2c3442;
          --accent: #6f9dff; --good: #7fd69b; --good-bg: #173222; --alt: #f0b65a; --alt-bg: #3a2a10; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: var(--accent); }
.top { position: sticky; top: 0; z-index: 2; display: flex; gap: 16px; align-items: center; flex-wrap: wrap;
       padding: 10px 16px; background: var(--panel); border-bottom: 1px solid var(--line); }
.logo { font-weight: 700; font-size: 18px; text-decoration: none; color: var(--text); }
.search { flex: 1; display: flex; gap: 8px; min-width: 240px; }
.search input { flex: 1; font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--text); }
.search button, .more { font: inherit; padding: 8px 14px; border-radius: 8px; border: 0; background: var(--accent); color: #fff; cursor: pointer; }
main { max-width: 1200px; margin: 0 auto; padding: 16px; }
.filters { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: end; margin-bottom: 8px; }
.filters label { display: flex; flex-direction: column; font-size: 12.5px; color: var(--muted); gap: 3px; }
.filters label.check { flex-direction: row; align-items: center; gap: 6px; font-size: 14px; color: var(--text); }
.filters select { font: inherit; color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: 7px; padding: 6px 8px; max-width: 260px; }
.status { color: var(--muted); }
.results { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.card { display: flex; flex-direction: column; height: 100%; text-decoration: none; color: inherit; background: var(--panel);
        border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.card:hover { border-color: var(--accent); }
.card img, .card .noimg { width: 100%; aspect-ratio: 4 / 3; object-fit: contain; background: #fff; }
.card .body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 3px; }
.brand { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.title { font-weight: 600; }
.price { font-size: 18px; font-weight: 700; }
.where { font-size: 13px; font-weight: 400; color: var(--muted); }
.meta, .sub { font-size: 12.5px; color: var(--muted); }
.badge { align-self: flex-start; font-size: 12px; padding: 2px 8px; border-radius: 10px; background: var(--good-bg); color: var(--good); }
.badge.alt { background: var(--alt-bg); color: var(--alt); }
.more { display: block; margin: 16px auto; }
.detail-head { display: flex; gap: 20px; flex-wrap: wrap; align-items: flex-start; margin-bottom: 12px; }
.detail-head img { width: 260px; max-width: 100%; aspect-ratio: 1; object-fit: contain; background: #fff; border-radius: 10px; border: 1px solid var(--line); }
.detail-head h1 { margin: 2px 0 6px; font-size: 22px; }
.big { font-size: 24px; font-weight: 700; margin: 4px 0; }
.note { background: var(--alt-bg); color: var(--alt); padding: 6px 10px; border-radius: 8px; }
.offers { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.offers th, .offers td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.offers .num { text-align: right; white-space: nowrap; }
.offers tr.out td { color: var(--muted); }
.chart { width: 100%; max-width: 760px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; }
.chart text { fill: var(--muted); font-size: 11px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; margin-top: 6px; }
.legend i { display: inline-block; width: 12px; height: 3px; margin-right: 5px; vertical-align: middle; }
.foot { max-width: 1200px; margin: 24px auto; padding: 0 16px 24px; font-size: 12.5px; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }
@media (max-width: 640px) {
  .offers th:nth-child(2), .offers td:nth-child(2) { display: none; }
  .filters select { max-width: 100%; }
}
.filters.tech { padding: 10px 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; margin: 4px 0 10px; }
.range { display: flex; gap: 4px; }
.range input { width: 80px; font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 7px; padding: 5px 6px; }
button.link { background: none; border: 0; color: var(--accent); cursor: pointer; font: inherit; padding: 6px 0; }
