:root {
  --bg: #fff;
  --fg: #1a1a1a;
  --muted: #666;
  --line: #ddd;
  --accent: #1d4ed8;
  --up: #15803d;
  --down: #b91c1c;
  --chip: #f2f2f2;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141414;
    --fg: #e8e8e8;
    --muted: #999;
    --line: #333;
    --accent: #7aa2ff;
    --up: #4ade80;
    --down: #f87171;
    --chip: #222;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif;
}
a { color: var(--accent); }
main { max-width: 60rem; margin: 0 auto; padding: 1rem; }
h1 { font-size: 1.4rem; }
code { font-size: 0.9em; }

.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--line);
}
.top nav { display: flex; gap: 1.2rem; }
.top .brand { font-weight: 700; color: var(--fg); text-decoration: none; }
button.link { background: none; border: 0; color: var(--accent); cursor: pointer; font: inherit; padding: 0; }

input, select, button {
  font: inherit;
  color: inherit;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.35rem 0.5rem;
}
button { cursor: pointer; background: var(--accent); color: #fff; border-color: var(--accent); }

.filters { display: flex; flex-wrap: wrap; gap: 0.6rem 1rem; align-items: end; margin-bottom: 0.5rem; }
.filters input[type="search"] { flex: 1 1 100%; }
.filters label { display: flex; flex-direction: column; font-size: 0.8rem; color: var(--muted); gap: 0.15rem; }
.filters label.check { flex-direction: row; align-items: center; gap: 0.3rem; font-size: 0.9rem; }
.filters input[type="number"] { width: 5rem; }
.count { color: var(--muted); font-size: 0.9rem; }

.job { display: flex; gap: 0.9rem; padding: 0.8rem 0; border-top: 1px solid var(--line); }
.job.blocked { opacity: 0.55; }
.job h2 { font-size: 1.05rem; margin: 0 0 0.15rem; }
.job h2 a { text-decoration: none; }
.job h2 a:hover { text-decoration: underline; }
.body { min-width: 0; flex: 1; }
.score {
  flex: 0 0 2.6rem;
  height: 2.6rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-weight: 700;
  border: 2px solid var(--line);
}
.score.s80, .score.s100 { border-color: var(--up); color: var(--up); }
.score.s60 { border-color: var(--accent); color: var(--accent); }
.score.s0, .score.s20 { color: var(--muted); }
.new {
  font-size: 0.7rem;
  font-weight: 600;
  background: var(--accent);
  color: #fff;
  border-radius: 3px;
  padding: 0.05rem 0.35rem;
  vertical-align: middle;
}
.meta { margin: 0.1rem 0; color: var(--muted); display: flex; flex-wrap: wrap; gap: 0.2rem 0.8rem; }
.meta strong { color: var(--fg); }
.meta .pay { color: var(--fg); }
.sources { font-size: 0.85rem; }
.reasons { list-style: none; padding: 0; margin: 0.35rem 0 0; display: flex; flex-wrap: wrap; gap: 0.3rem; }
.reasons li { font-size: 0.75rem; background: var(--chip); border-radius: 3px; padding: 0.05rem 0.4rem; color: var(--muted); }
.reasons li.up { color: var(--up); }
.reasons li.down { color: var(--down); }
.empty { color: var(--muted); }
.pager { display: flex; justify-content: space-between; padding: 1rem 0; }

.detail .actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.button {
  display: inline-block;
  padding: 0.35rem 0.7rem;
  border-radius: 4px;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
}
.button.quiet { background: var(--chip); color: var(--fg); }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 0.2rem 1rem; font-size: 0.9rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.description { white-space: pre-wrap; border-top: 1px solid var(--line); margin-top: 1rem; padding-top: 1rem; max-width: 45rem; }

.login { max-width: 20rem; margin: 15vh auto; display: flex; flex-direction: column; gap: 0.8rem; }
.login label { display: flex; flex-direction: column; gap: 0.2rem; }
.error { color: var(--down); }

.scroll { overflow-x: auto; }
table.sources { border-collapse: collapse; width: 100%; font-size: 0.9rem; }
table.sources th, table.sources td { text-align: left; padding: 0.45rem 0.6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
table.sources tr.off { color: var(--muted); }
table.sources tr.bad td:first-child { box-shadow: inset 3px 0 var(--down); }
table.sources pre { white-space: pre-wrap; max-width: 30rem; font-size: 0.8rem; }

@media (max-width: 600px) {
  main { padding: 0.75rem; }
  .filters label { flex: 1 1 40%; }
}

.tabs { display: flex; gap: 1.2rem; border-bottom: 1px solid var(--line); margin-bottom: 0.8rem; }
.tabs a { padding: 0.4rem 0; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; }
.tabs a.active { color: var(--fg); border-bottom-color: var(--accent); font-weight: 600; }
.tabs .n { font-size: 0.75rem; background: var(--chip); border-radius: 3px; padding: 0 0.3rem; }
.marks { display: inline-flex; gap: 0.3rem; }
.marks form { display: inline; }
.mark-btn { font-size: 0.75rem; padding: 0.05rem 0.45rem; background: var(--chip); color: var(--fg); border: 1px solid var(--line); }
.mark-btn.applied { border-color: var(--up); color: var(--up); }
.tag { font-size: 0.7rem; font-weight: 600; border: 1px solid var(--up); color: var(--up); border-radius: 3px; padding: 0 0.3rem; vertical-align: middle; }
.tag.muted { border-color: var(--line); color: var(--muted); }
