:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --text: #1c2326;
  --muted: #5d686d;
  --line: #e3e1db;
  --accent: #0f6b6b;
  --accent-soft: #e2f0ee;
  --deal: #b4361f;
  --s0: #0f6b6b;
  --s1: #c26a12;
  --s2: #5b4fb0;
  --s3: #6b7d1a;
  --radius: 10px;
  /* Tile backgrounds: all dark enough for white initials (4.5:1 or better). */
  --t0: #0f6b6b; --t1: #a4441b; --t2: #4b47a6; --t3: #5a6815;
  --t4: #8a3a73; --t5: #3f5866; --t6: #7a5320; --t7: #2f6b3a;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111618;
    --surface: #182024;
    --text: #e6ebec;
    --muted: #9aa7ab;
    --line: #2a3438;
    --accent: #5cc3bb;
    --accent-soft: #17312f;
    --deal: #ff8a70;
    --s0: #5cc3bb;
    --s1: #f0a24a;
    --s2: #a99cf2;
    --s3: #b8cc5a;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
}
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
h1, h2 { line-height: 1.2; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); margin: 1.2rem 0 0.6rem; }
h2 { font-size: 1.2rem; margin: 2rem 0 0.4rem; display: flex; align-items: baseline; gap: 0.75rem; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted, .hint { color: var(--muted); }
.hint { font-size: 0.9rem; margin: 0 0 0.6rem; }
.dev { color: var(--muted); font-weight: 400; }
.pct { color: var(--deal); font-weight: 600; white-space: nowrap; }
.tag {
  display: inline-block; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.02em;
  padding: 0.05rem 0.45rem; border-radius: 999px; vertical-align: 0.15em;
  background: var(--accent-soft); color: var(--accent);
}

/* Header */
.top { background: var(--surface); border-bottom: 1px solid var(--line); }
.top-inner { display: flex; align-items: center; gap: 1.25rem; min-height: 60px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
.brand { display: flex; align-items: center; gap: 0.45rem; font-weight: 700; font-size: 1.15rem; color: var(--text); text-decoration: none; }
.brand svg { width: 28px; height: 28px; fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round; }
nav[aria-label="Main"] { display: flex; gap: 1rem; }
nav[aria-label="Main"] a { color: var(--text); text-decoration: none; }
nav[aria-label="Main"] a[aria-current="page"], nav[aria-label="Main"] a:hover { color: var(--accent); }
.search { margin-left: auto; flex: 1 1 200px; max-width: 320px; }
.search input {
  width: 100%; font: inherit; padding: 0.45rem 0.75rem; border-radius: 999px;
  border: 1px solid var(--line); background: var(--bg); color: var(--text);
}
.search input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.search.big { max-width: none; margin: 0 0 1rem; }
@media (max-width: 640px) {
  .search { margin-left: 0; max-width: none; flex-basis: 100%; }
  .chart .tick { font-size: 20px; }
}
.search.big input { font-size: 1.1rem; padding: 0.7rem 1rem; }

/* Home */
.hero { padding: 1.5rem 0 0.5rem; max-width: 46rem; }
.hero p { font-size: 1.1rem; color: var(--muted); margin: 0; }
.cols { display: grid; gap: 0 2rem; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.more { font-size: 0.85rem; font-weight: 500; margin-left: auto; }
.jump { display: flex; gap: 1rem; flex-wrap: wrap; }

/* Product tiles (stand-ins for product images) */
.tile {
  display: inline-grid; place-items: center; flex: none;
  width: 44px; height: 44px; border-radius: 10px;
  color: #fff; font-weight: 700; font-size: 0.95rem; letter-spacing: 0.02em;
  background: var(--t0);
}
.tile.big { width: 72px; height: 72px; border-radius: 14px; font-size: 1.5rem; }
.tile.t1 { background: var(--t1); } .tile.t2 { background: var(--t2); }
.tile.t3 { background: var(--t3); } .tile.t4 { background: var(--t4); }
.tile.t5 { background: var(--t5); } .tile.t6 { background: var(--t6); }
.tile.t7 { background: var(--t7); }
.title-row { display: flex; align-items: center; gap: 1rem; margin: 1.2rem 0 0.6rem; }
.title-row h1 { margin: 0; }

/* Deal lists */
.deals { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line); }
.deals li { border-bottom: 1px solid var(--line); }
.deals .empty { padding: 0.8rem 0; color: var(--muted); }
.deal {
  display: grid; grid-template-columns: auto 1fr auto; gap: 0.1rem 0.8rem; padding: 0.6rem 0.25rem;
  color: var(--text); text-decoration: none; align-items: center;
}
.deal .tile { grid-column: 1; grid-row: 1 / span 2; }
.deal:hover { background: var(--accent-soft); }
.deal-name { grid-column: 2; }
.deal-price { grid-column: 3; grid-row: 1 / span 2; text-align: right; white-space: nowrap; }
.deal-price s { color: var(--muted); font-size: 0.85rem; margin-left: 0.3rem; }
.deal-price .pct { display: block; }
.deal-store { grid-column: 2; font-size: 0.82rem; color: var(--muted); }

/* Product page */
.crumbs { font-size: 0.9rem; margin-top: 1rem; color: var(--muted); }
.note { background: var(--accent-soft); padding: 0.6rem 0.9rem; border-radius: var(--radius); }
.offers { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.offers th, .offers td { text-align: left; padding: 0.7rem 0.8rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.offers thead th { font-size: 0.8rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.offers tbody tr:last-child > * { border-bottom: 0; }
.offers td strong { font-size: 1.15rem; }
.offers .was { display: block; font-size: 0.85rem; color: var(--muted); }
.offers .muted { font-size: 0.85rem; }
.best { background: var(--accent-soft); }
.badge { font-size: 0.7rem; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: 0.05em; margin-left: 0.3rem; }
.go {
  display: inline-block; padding: 0.4rem 0.8rem; border-radius: 999px; white-space: nowrap;
  background: var(--accent); color: var(--surface); text-decoration: none; font-weight: 600; font-size: 0.9rem;
}
.go:hover { filter: brightness(1.1); }
@media (max-width: 640px) {
  .offers thead { display: none; }
  .offers tr { display: grid; grid-template-columns: 1fr auto; padding: 0.6rem 0.8rem; border-bottom: 1px solid var(--line); }
  .offers th, .offers td { border: 0; padding: 0.15rem 0; }
  .offers td:last-child { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
}

.chart { width: 100%; height: auto; display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .tick { fill: var(--muted); font-size: 12px; }
.chart .series path { fill: none; stroke-width: 2.25; }
.series.s0 path { stroke: var(--s0); } .series.s0 circle { fill: var(--s0); }
.series.s1 path { stroke: var(--s1); } .series.s1 circle { fill: var(--s1); }
.series.s2 path { stroke: var(--s2); } .series.s2 circle { fill: var(--s2); }
.series.s3 path { stroke: var(--s3); } .series.s3 circle { fill: var(--s3); }
.legend { list-style: none; display: flex; gap: 1rem; padding: 0; margin: 0.5rem 0; font-size: 0.9rem; flex-wrap: wrap; }
.legend li::before { content: ""; display: inline-block; width: 12px; height: 3px; border-radius: 2px; margin-right: 0.4rem; vertical-align: middle; }
.legend .s0::before { background: var(--s0); } .legend .s1::before { background: var(--s1); }
.legend .s2::before { background: var(--s2); } .legend .s3::before { background: var(--s3); }
.stats { margin: 0.4rem 0; }

.used { margin-top: 2rem; padding: 0.2rem 1.1rem 0.6rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.used h2 { margin-top: 1rem; }
.used-links { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; padding: 0; list-style: none; }

/* Lists */
.plist { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line); }
.plist li { display: flex; gap: 0.5rem; align-items: baseline; padding: 0.45rem 0.25rem; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.plist-price { margin-left: auto; white-space: nowrap; }
.devs { columns: 3 220px; padding: 0; list-style: none; }
.devs li { padding: 0.15rem 0; break-inside: avoid; }
.results { list-style: none; padding: 0; border-top: 1px solid var(--line); }
.results li { border-bottom: 1px solid var(--line); }
.results a { display: flex; gap: 0.6rem; padding: 0.5rem 0.25rem; text-decoration: none; color: var(--text); align-items: center; }
.results .tile { width: 36px; height: 36px; border-radius: 8px; font-size: 0.8rem; }
.results a:hover { background: var(--accent-soft); }
.results .r-price { margin-left: auto; }

.prose { max-width: 42rem; }
.prose pre { background: var(--surface); border: 1px solid var(--line); padding: 0.75rem; border-radius: var(--radius); overflow-x: auto; }

.foot { margin-top: 3rem; padding: 1.5rem 0 2rem; border-top: 1px solid var(--line); font-size: 0.88rem; color: var(--muted); }
.foot p { margin: 0.3rem 0; max-width: 46rem; }
