:root {
  --bg: #fafafa;
  --fg: #1a1a1a;
  --muted: #6b6b6b;
  --line: #e3e3e3;
  --accent: #0a66c2;
  --ok: #1a7f37;
  --okbg: #e6f4ea;
  --no: #8a8a8a;
  --nobg: #f1f1f1;
  --new: #b45309;
  --newbg: #fff4dc;
  --err: #b91c1c;
}
* { box-sizing: border-box; }
html { font: 14px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--fg); background: var(--bg); }
body { margin: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
main { max-width: 1400px; margin: 0 auto; padding: 12px 16px 60px; }
h1 { font-size: 22px; margin: 8px 0 12px; }
h2 { font-size: 16px; margin: 22px 0 4px; }
code { background: #eee; padding: 1px 4px; border-radius: 3px; font-size: 12px; }
small { color: var(--muted); }
button { font: inherit; cursor: pointer; border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: 5px 10px; }
button:hover { border-color: #bbb; }
button.link { border: 0; background: none; color: var(--accent); padding: 0; }
button.small { padding: 2px 8px; font-size: 12px; }
input, select { font: inherit; padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.inline { display: inline; }
.err { color: var(--err); }
.warn { color: var(--new); background: var(--newbg); border-radius: 6px; padding: 6px 10px; margin: 0; }
.desc { color: var(--muted); margin: 0 0 8px; }
.empty { color: var(--muted); padding: 40px 0; text-align: center; }

/* nav */
nav.top { display: flex; gap: 18px; align-items: center; padding: 10px 16px; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 2; }
nav.top .brand { font-weight: 700; color: var(--fg); }
nav.top .right { margin-left: auto; }

/* login */
.login { max-width: 320px; margin: 90px auto; text-align: center; }
.login form { display: grid; gap: 10px; }
.login label { display: grid; gap: 4px; text-align: left; }

/* run box */
.runbox { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; display: grid; gap: 10px; }
.runform { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.runform button { background: var(--accent); color: #fff; border-color: var(--accent); }
.progress { display: flex; gap: 10px; align-items: center; color: var(--accent); }
.spinner { width: 12px; height: 12px; border: 2px solid var(--accent); border-right-color: transparent; border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* filters */
.filters { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; margin: 12px 0; }
.filters #ftext { min-width: 260px; }
.filters .tiers { display: inline-flex; gap: 6px; align-items: center; color: var(--muted); }
.filters .tiers label { display: inline-flex; align-items: center; gap: 2px; cursor: pointer; }
.filters #fcount { margin-left: auto; color: var(--muted); }

/* tables */
table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
th, td { padding: 6px 8px; text-align: left; vertical-align: top; border-top: 1px solid var(--line); }
thead th { border-top: 0; background: #f4f4f4; font-weight: 600; font-size: 12px; color: var(--muted); }
td.act { white-space: nowrap; width: 1%; }
td.act button { padding: 2px 7px; margin-right: 2px; }
td.act .ok { color: var(--ok); }
td.act .no { color: var(--no); }
td.act .undo { color: var(--muted); }
td.title { min-width: 280px; }
td.date { white-space: nowrap; color: var(--muted); }
td.num { text-align: right; }
td.hits { white-space: nowrap; }
td.who { color: var(--muted); white-space: nowrap; font-size: 12px; }
.hit { display: inline-block; font-size: 11px; color: var(--muted); background: #f0f0f0; border-radius: 3px; padding: 0 4px; margin: 1px 0; cursor: help; }
.mult { font-size: 11px; color: var(--muted); background: #eee; border-radius: 3px; padding: 0 5px; }
.new { font-size: 11px; color: var(--new); background: var(--newbg); border-radius: 3px; padding: 0 5px; }
tr.st-applied { background: var(--okbg); }
tr.st-applied td.title a { color: var(--ok); }
tr.st-skip { background: var(--nobg); color: var(--no); }
tr.st-skip td.title a { color: var(--no); text-decoration: line-through; }
.tcount { color: var(--muted); font-weight: 400; font-size: 14px; }

/* queries page */
table.queries td.links { white-space: nowrap; font-size: 12px; }
table.queries tr.off { color: var(--muted); }
table.queries code { white-space: normal; }
.addq { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0; }
.addq .wide { flex: 1; min-width: 320px; }

@media (max-width: 800px) {
  td.hits, th:nth-child(6), td.who, th:nth-child(7) { display: none; }
  .filters #fcount { margin-left: 0; }
}
