:root {
  color-scheme: light dark;
  --bg: #0f1115;
  --panel: #171a21;
  --border: #2a2e37;
  --text: #e8eaed;
  --muted: #9aa1ac;
  --accent: #4f8cff;
  --badge: #2e6b3f;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f5f6f8;
    --panel: #ffffff;
    --border: #dde1e7;
    --text: #1b1f27;
    --muted: #5b6270;
    --accent: #2563eb;
    --badge: #2e7d46;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  padding: 24px;
}

header h1 { margin: 0 0 4px; font-size: 1.5rem; }
.subtitle { margin: 0 0 20px; color: var(--muted); font-size: 0.9rem; }

.filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.filters input, .filters select, .filters button {
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  font-size: 0.9rem;
}

.filters button {
  background: var(--accent);
  color: #fff;
  border: none;
  cursor: pointer;
}

.status { color: var(--muted); font-size: 0.85rem; margin-bottom: 12px; }

.listings {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.card.priority { border-color: var(--accent); }

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 8px;
}

.card h3 { margin: 0; font-size: 1rem; }

.badge {
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--badge);
  color: #fff;
  white-space: nowrap;
}

.source-badge {
  display: inline-block;
  margin-right: 6px;
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
  white-space: nowrap;
}

.price { font-size: 1.1rem; font-weight: 600; }
.meta { color: var(--muted); font-size: 0.85rem; }

.card a.link {
  margin-top: 6px;
  color: var(--accent);
  text-decoration: none;
  font-size: 0.85rem;
}
.card a.link:hover { text-decoration: underline; }
