:root {
  --bg: #f6f6f4; --panel: #ffffff; --text: #1d1d1b; --muted: #6b6b66; --line: #e3e2dc;
  --accent: #1f5fbf; --good: #1d7a3e; --bad: #b3261e; --warn: #a15c00; --chip: #eef0f4;
  --import: #1d7a3e; --skip: #8a8a84;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #151514; --panel: #1f1f1d; --text: #ecebe6; --muted: #a09f98; --line: #34332f;
    --accent: #7aa7ff; --good: #5cc584; --bad: #ff8a80; --warn: #f0b35a; --chip: #2a2c31;
    --import: #5cc584; --skip: #8f8e88;
  }
}
:root[data-theme="dark"] {
  --bg: #151514; --panel: #1f1f1d; --text: #ecebe6; --muted: #a09f98; --line: #34332f;
  --accent: #7aa7ff; --good: #5cc584; --bad: #ff8a80; --warn: #f0b35a; --chip: #2a2c31;
  --import: #5cc584; --skip: #8f8e88;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: var(--muted); }
.top { position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px;
  padding: 10px 16px; background: var(--panel); border-bottom: 1px solid var(--line); }
.brand { font-weight: 700; color: var(--text); }
nav { display: flex; flex-wrap: wrap; gap: 4px; max-width: 100%; }
nav a { padding: 6px 10px; border-radius: 6px; color: var(--muted); white-space: nowrap; }
nav a.on { background: var(--chip); color: var(--text); font-weight: 600; }
#asof { margin-left: auto; font-size: 13px; }
main { max-width: 1200px; margin: 0 auto; padding: 16px; }
h1 { font-size: 20px; margin: 4px 0 12px; }
h2 { font-size: 16px; margin: 22px 0 8px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.stat b { display: block; font-size: 22px; }
.stat span { color: var(--muted); font-size: 13px; }
.bad { color: var(--bad); } .good { color: var(--good); } .warn { color: var(--warn); }
.tablewrap { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { padding: 7px 10px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; vertical-align: middle; }
th { font-weight: 600; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .02em; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr:last-child td { border-bottom: 0; }
.chip { display: inline-block; padding: 1px 8px; border-radius: 999px; background: var(--chip); font-size: 12px;
  margin: 1px 2px 1px 0; white-space: nowrap; }
.chip.flag-scaling { background: color-mix(in srgb, var(--good) 18%, transparent); color: var(--good); }
.chip.flag-pulling { background: color-mix(in srgb, var(--bad) 16%, transparent); color: var(--bad); }
.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin-bottom: 12px; }
.filters input, .filters select { width: 100%; padding: 8px 10px; font-size: 15px; border: 1px solid var(--line);
  border-radius: 6px; background: var(--panel); color: var(--text); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; overflow: hidden;
  display: flex; flex-direction: column; }
.card .img { aspect-ratio: 1 / 1; background: var(--chip); display: block; }
.card .img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card .body { padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card .title { font-weight: 600; line-height: 1.3; }
.card .meta { font-size: 13px; color: var(--muted); }
.price b { font-size: 16px; } .price s { color: var(--muted); margin-left: 6px; }
.why { font-size: 13px; }
.spark { width: 100%; height: 48px; display: block; }
.spark path { fill: none; stroke: var(--accent); stroke-width: 2; }
.tspark { width: 90px; height: 22px; display: block; }
.tspark path { fill: none; stroke: var(--accent); stroke-width: 1.5; }
.spark .axis { stroke: var(--line); stroke-width: 1; }
.spark text { fill: var(--muted); font-size: 10px; }
.actions { display: flex; gap: 6px; margin-top: auto; padding-top: 4px; }
.actions button { flex: 1; padding: 8px; font-size: 14px; border-radius: 6px; border: 1px solid var(--line);
  background: var(--panel); color: var(--text); cursor: pointer; }
.actions button.on.import { background: var(--import); color: #fff; border-color: var(--import); }
.actions button.on.skip { background: var(--skip); color: #fff; border-color: var(--skip); }
.row { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.row img { width: 56px; height: 56px; object-fit: cover; border-radius: 6px; background: var(--chip); flex: none; }
.row .grow { flex: 1; min-width: 0; }
.row .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.twocol { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 720px) { .twocol { grid-template-columns: 1fr; } }
.btn { display: inline-block; padding: 8px 12px; border-radius: 6px; background: var(--accent); color: #fff; }
.btn:hover { text-decoration: none; opacity: .9; }
.more { margin-top: 12px; }
.more button { padding: 8px 14px; border-radius: 6px; border: 1px solid var(--line); background: var(--panel);
  color: var(--text); cursor: pointer; }
.err { color: var(--bad); }
