/* The whole site's look: plain, quick, and readable on a phone */

:root {
  --text: #1d2125; --muted: #5d6670; --line: #dde1e5; --back: #ffffff; --panel: #f4f6f7;
  --accent: #0b6e4f; --accent-text: #ffffff; --deal: #b3261e; --note: #8a5a00; --saved: #e8f5ee;
  --band: #204050; --band-text: #ffffff; --band-muted: #bfd0d9; --band-line: #35596b; --cta: #f5b82e; --cta-text: #1d2125;
}
@media (prefers-color-scheme: dark) {
  :root {
    --text: #e6e8ea; --muted: #a0a8b0; --line: #3a4046; --back: #16191c; --panel: #1f2327;
    --accent: #3fb68b; --accent-text: #0b1a14; --deal: #ff8a80; --note: #e0b050; --saved: #1d3329;
    --band: #172d38; --band-text: #e6e8ea; --band-muted: #a3b7c2; --band-line: #2b4554;
  }
  header.site .brand img { filter: invert(1); }  /* the drawing's black ink, in white */
}

* { box-sizing: border-box; }
body { display: flex; flex-direction: column; min-height: 100vh; margin: 0; font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--text); background: var(--back); }
a { color: var(--accent); }
h1 { font-size: 1.5em; margin: 0.4em 0; }
h2 { font-size: 1.15em; margin: 1.5em 0 0.5em; }
input, select, button { font: inherit; }
input[type=text], input[type=search], input[type=email], select {
  padding: 6px 8px; border: 1px solid var(--line); border-radius: 4px; background: var(--back); color: var(--text); min-width: 0;
}
button { padding: 6px 14px; border: 1px solid var(--accent); border-radius: 4px; background: var(--accent); color: var(--accent-text); cursor: pointer; }
button.quiet { background: transparent; color: var(--accent); }
button.link { border: 0; padding: 0; background: none; color: var(--accent); text-decoration: underline; }

/* Header, banner and footer each run full width, with their contents in a .bar as wide as the page */
.bar { max-width: 1100px; margin: 0 auto; padding: 0 16px; }
header.site { border-bottom: 1px solid var(--line); }
header.site .bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 28px; padding-top: 8px; padding-bottom: 8px; }
header.site .brand { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 1.4em; color: var(--text); text-decoration: none; }
header.site .brand img { display: block; width: auto; height: 64px; }
header.site nav { display: flex; gap: 20px; }
header.site nav a { color: var(--text); text-decoration: none; }
header.site nav a:hover { color: var(--accent); text-decoration: underline; }
header.site .member { margin: 0 0 0 auto; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; color: var(--muted); overflow-wrap: anywhere; }
header.site a.member { padding: 4px 16px; border: 1px solid var(--accent); border-radius: 18px; text-decoration: none; color: var(--accent); }
main { flex: 1 0 auto; width: 100%; max-width: 1100px; margin: 0 auto; padding: 16px; }
footer.site { margin-top: 40px; background: var(--band); color: var(--band-muted); font-size: 0.875em; }
footer.site .bar { padding-top: 20px; padding-bottom: 24px; }
footer.site nav { display: flex; flex-wrap: wrap; gap: 6px 20px; font-size: 1.1em; }
footer.site a { color: var(--band-text); }
footer.site p { max-width: 64em; margin: 12px 0 0; }

/* The home page's banner, and the three steps under it */
.hero { background: var(--band); color: var(--band-text); }
.hero .bar { padding-top: 40px; padding-bottom: 44px; }
.hero h1 { max-width: 20em; margin: 0 0 8px; font-size: 2.1em; line-height: 1.2; }
.hero .lead { max-width: 38em; margin: 0 0 22px; color: var(--band-muted); font-size: 1.1em; }
.hero form.search { max-width: 860px; margin: 0; }
.hero form.search input, .hero form.search select { padding: 10px 12px; border-color: transparent; }
.hero form.search button { padding: 10px 24px; border-color: var(--cta); background: var(--cta); color: var(--cta-text); font-weight: 600; }
.steps { list-style: none; padding: 0; margin: 24px 0 8px; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.steps li { display: flex; align-items: flex-start; gap: 14px; padding: 16px; border-radius: 8px; background: var(--panel); }
.steps svg { flex: none; width: 44px; height: 44px; padding: 10px; border-radius: 50%; background: var(--saved); fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.steps p { margin: 2px 0 0; color: var(--muted); font-size: 0.95em; }

.message { padding: 10px 14px; border-radius: 4px; background: var(--panel); border-left: 4px solid var(--accent); }
.message.error { border-left-color: var(--deal); }
.muted { color: var(--muted); font-size: 0.9em; }

form.search { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 16px; }
form.search input[type=search] { flex: 1 1 240px; }
form.search select { flex: 0 1 260px; }
form.search select.condition { flex: 0 1 160px; }
form.inline { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
input.price { width: 7em; }

.categories { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px 24px; }
.categories ul { list-style: none; padding: 0; margin: 4px 0 0; font-size: 0.9em; }

.results { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.result { display: flex; flex-direction: column; gap: 6px; padding: 12px; border: 1px solid var(--line); border-radius: 6px; }
.result img { display: block; width: 100%; height: 160px; object-fit: contain; background: #fff; border-radius: 4px; }
.result .title { font-weight: 600; color: var(--text); text-decoration: none; overflow-wrap: anywhere; }
.result .title:hover { text-decoration: underline; }
.result form.inline { margin-top: auto; padding-top: 6px; }
.result .why { color: var(--accent); font-size: 0.85em; font-weight: 600; text-decoration: none; }
.price-now { font-size: 1.25em; font-weight: 700; }
.was { margin-left: 6px; color: var(--muted); font-size: 0.75em; font-weight: 400; text-decoration: line-through; }
.badges { display: flex; flex-wrap: wrap; gap: 4px; }
.badge { padding: 0 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); font-size: 0.8em; }
.badge.deal { color: var(--deal); border-color: var(--deal); }
.badge.note { color: var(--note); border-color: var(--note); }
.pages { display: flex; justify-content: center; gap: 20px; margin: 24px 0; }

/* Phones: two tiles across, as the big shops do, rather than one */
@media (max-width: 520px) {
  .results { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
  .result { padding: 8px; }
  .result img { height: 120px; }
  header.site .brand img { height: 48px; }
  .hero .bar { padding-top: 24px; padding-bottom: 28px; }
  .hero h1 { font-size: 1.6em; }
}

.watchlist { list-style: none; padding: 0; }
.watchlist > li { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 24px; padding: 14px 8px; border-bottom: 1px solid var(--line); }
.watchlist > li.saved { background: var(--saved); }
.watchlist img { width: 64px; height: 64px; object-fit: contain; background: #fff; border-radius: 4px; }
.watchlist .what { flex: 1 1 280px; min-width: 0; overflow-wrap: anywhere; }
