: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; }
.cat { margin: 0 0 0.8rem; color: var(--muted); }
.browse { margin-top: 0.6rem; }

/* 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; }
.cats { columns: 2 280px; padding: 0; list-style: none; }
.cats > li { padding: 0.3rem 0 0.6rem; break-inside: avoid; font-weight: 600; }
.cats ul { list-style: none; padding: 0.2rem 0 0 1rem; font-weight: 400; }
.cats ul li { padding: 0.1rem 0; }
.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; }

/* Currencies: every price is in the page once per currency; show the one picked (cur.js). */
html[data-cur="USD"] [data-c]:not([data-c="USD"]),
html[data-cur="EUR"] [data-c]:not([data-c="EUR"]),
html[data-cur="GBP"] [data-c]:not([data-c="GBP"]) { display: none !important; }
.cur select {
  font: inherit; font-size: 0.9rem; padding: 0.3rem 0.4rem; border-radius: 8px;
  border: 1px solid var(--line); background: var(--bg); color: var(--text);
}
.offers .tax { text-transform: none; letter-spacing: 0; font-weight: 400; }
.offers tr.est > * { color: var(--muted); }
.offers tr.est strong { font-weight: 600; }
.deal-price .est { display: block; font-size: 0.8rem; color: var(--muted); }

/* Alerts: the watch form on product and developer pages, and the alert server's pages. */
.watch { margin-top: 2rem; padding: 0.2rem 1.1rem 0.8rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.watch h2 { margin-top: 1rem; }
.watch .fields { display: flex; flex-wrap: wrap; gap: 0.6rem 1rem; align-items: center; margin: 0.4rem 0 0.6rem; }
.watch .check, .stack label { display: block; margin: 0.25rem 0; }
input[type="email"], input[inputmode="decimal"], select {
  font: inherit; padding: 0.4rem 0.6rem; border-radius: 8px;
  border: 1px solid var(--line); background: var(--bg); color: var(--text);
}
input[type="email"] { min-width: 16rem; max-width: 100%; }
button { font: inherit; cursor: pointer; }
button:not(.go) { padding: 0.35rem 0.75rem; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text); }
button.go { border: 0; }
.stack { max-width: 30rem; }
.stack input[type="email"] { display: block; width: 100%; margin: 0.3rem 0 0.8rem; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); margin: 1rem 0; padding: 0.4rem 1rem; }
.alert-item { border-top: 1px solid var(--line); padding: 0.4rem 0 0.8rem; }
.row-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.6rem 0; }
.bell { display: inline-grid; place-items: center; width: 1.5rem; height: 1.5rem; border-radius: 999px; color: var(--muted); }
.bell svg { width: 1rem; height: 1rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.bell:hover { color: var(--accent); background: var(--accent-soft); }

/* The header search box's dropdown (search.js). */
.search { position: relative; }
.suggest {
  position: absolute; top: calc(100% + 4px); right: 0; z-index: 20; width: max(100%, 26rem); max-width: calc(100vw - 32px);
  list-style: none; margin: 0; padding: 0.25rem 0; max-height: 70vh; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 8px 24px rgb(0 0 0 / 0.12);
}
.suggest a { display: flex; gap: 0.5rem; align-items: center; padding: 0.35rem 0.6rem; color: var(--text); text-decoration: none; font-size: 0.92rem; }
.suggest .tile { width: 28px; height: 28px; border-radius: 7px; font-size: 0.7rem; }
.suggest .r-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suggest .r-price { color: var(--muted); white-space: nowrap; }
.suggest li.on a, .suggest a:hover { background: var(--accent-soft); }
.suggest .all a { color: var(--accent); font-weight: 500; }

/* Browse: filters and product cards (browse.js). */
.browse-ui { display: grid; gap: 1.5rem; grid-template-columns: 15.5rem 1fr; align-items: start; margin-top: 1rem; }
@media (max-width: 899px) { .browse-ui { grid-template-columns: 1fr; gap: 0.8rem; } }
.filters { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 0.4rem 0.8rem; }
.filters summary { cursor: pointer; font-weight: 600; padding: 0.3rem 0; }
@media (min-width: 900px) { .filters { position: sticky; top: 0.8rem; max-height: calc(100vh - 1.6rem); overflow-y: auto; } }
.ftext input { width: 100%; margin: 0.3rem 0 0.5rem; }
.ftext input, .frow input { font: inherit; padding: 0.35rem 0.55rem; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--text); }
.fgroup { border: 0; border-top: 1px solid var(--line); margin: 0; padding: 0.5rem 0; }
.fgroup legend { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); padding: 0.3rem 0 0.2rem; }
.fopt { display: flex; gap: 0.4rem; align-items: baseline; padding: 0.12rem 0; font-size: 0.92rem; cursor: pointer; }
.fopt .n { margin-left: auto; color: var(--muted); font-size: 0.8rem; }
.fopt.none { color: var(--muted); }
.fopt.sub { padding-left: 1.1rem; }
.fopt .hide { border: 0; background: none; padding: 0 0.2rem; color: var(--muted); }
.fopt .hide:hover { color: var(--deal); }
.frow { display: flex; gap: 0.4rem; align-items: center; }
.frow input { width: 5.5rem; }
.filters button.link, .filters .clear { border: 0; background: none; color: var(--accent); padding: 0.2rem 0; text-decoration: underline; }
.hidden-devs { font-size: 0.85rem; color: var(--muted); }
.chip-btn { font-size: 0.8rem; margin: 0.15rem; }
.bar { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; align-items: center; justify-content: space-between; margin-bottom: 0.5rem; }
.bar .count { margin: 0; color: var(--muted); }
.bar select { margin-left: 0.3rem; }
.cards { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line); }
.card { display: grid; grid-template-columns: auto 1fr auto; gap: 0.8rem; align-items: start; padding: 0.7rem 0.25rem; border-bottom: 1px solid var(--line); }
.card-name { color: var(--text); text-decoration: none; font-weight: 600; margin-right: 0.3rem; }
.card-name:hover { color: var(--accent); }
.card .chip { display: inline-block; font-size: 0.72rem; font-weight: 600; padding: 0.05rem 0.45rem; margin: 0 0.25rem 0 0; border-radius: 999px; background: var(--accent-soft); color: var(--accent); vertical-align: 0.15em; }
.card-stores { font-size: 0.83rem; color: var(--muted); margin-top: 0.2rem; }
.card-price { text-align: right; white-space: nowrap; display: flex; flex-direction: column; align-items: flex-end; gap: 0.1rem; }
.cards .empty { padding: 1rem 0; color: var(--muted); }
.more-btn { display: block; margin: 1rem auto; }
