:root {
  --bg: #f7f7f5; --panel: #ffffff; --ink: #1c1c1a; --muted: #6b6b66; --line: #e3e3de;
  --accent: #2456d6; --accent-ink: #ffffff; --hover: #f0f3fb;
  --ok: #1f7a3a; --ok-bg: #e3f4e8; --bad: #b42318; --bad-bg: #fbe9e7; --busy: #8a5a00; --busy-bg: #fff3d6;
  --quiet: #55555f; --quiet-bg: #ececf1;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141416; --panel: #1d1d21; --ink: #ececea; --muted: #9a9a95; --line: #2d2d33;
    --accent: #7ea2ff; --accent-ink: #0d1733; --hover: #22252f;
    --ok: #7fd79a; --ok-bg: #16301f; --bad: #ff9a8f; --bad-bg: #3a1c19; --busy: #ffcf70; --busy-bg: #3a2d10;
    --quiet: #b7b7c2; --quiet-bg: #2a2a31;
  }
}
* { box-sizing: border-box; }
html { color-scheme: light dark; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  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; }
code { font-family: var(--mono); font-size: 0.9em; }
.top {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: 0.75rem 1.25rem; background: var(--panel); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 2;
}
.brand { font-weight: 650; letter-spacing: 0.01em; color: var(--ink); }
.top nav { display: flex; align-items: center; gap: 0.75rem; }
.who { color: var(--muted); }
.top form { margin: 0; }
button, .button {
  font: inherit; border: 1px solid var(--line); background: var(--panel); color: var(--ink);
  border-radius: 6px; padding: 0.45rem 0.8rem; cursor: pointer;
}
button.link { border: 0; background: none; color: var(--accent); padding: 0; }
.button { display: inline-block; background: var(--accent); color: var(--accent-ink); border-color: transparent; font-weight: 600; }
.button:hover { text-decoration: none; filter: brightness(1.08); }
main { max-width: 1240px; margin: 0 auto; padding: 1.25rem; }
h1 { font-size: 1.4rem; margin: 0.25rem 0 1rem; font-weight: 650; }
h2 { font-size: 1.1rem; margin: 1.75rem 0 0.5rem; }
.muted { color: var(--muted); font-weight: 400; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 1.5rem; }
.signin { max-width: 440px; margin: 10vh auto 0; text-align: center; }
.signin p { color: var(--muted); }
.filters {
  display: flex; flex-wrap: wrap; gap: 0.75rem 1rem; align-items: end;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 0.9rem 1rem; margin-bottom: 1rem;
}
.filters label { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.8rem; color: var(--muted); }
.filters select, .filters input {
  font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line);
  border-radius: 6px; padding: 0.4rem 0.55rem; min-width: 10rem;
}
.filters .reset { font-size: 0.9rem; align-self: center; }
.filters.htmx-request { opacity: 0.6; }
.count { color: var(--muted); font-size: 0.85rem; margin: 0 0 0.5rem; }
.empty { color: var(--muted); padding: 2rem; text-align: center; background: var(--panel); border: 1px dashed var(--line); border-radius: 10px; }
table { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
th, td { text-align: left; padding: 0.55rem 0.75rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); font-weight: 600; white-space: nowrap; }
th a { color: inherit; }
th a.active { color: var(--ink); }
tbody tr:hover { background: var(--hover); }
tbody tr:last-child td { border-bottom: 0; }
td.description { color: var(--muted); max-width: 28rem; }
.ref { font-weight: 500; }
time { white-space: nowrap; color: var(--muted); }
.state {
  display: inline-block; padding: 0.1rem 0.5rem; border-radius: 999px; font-size: 0.78rem; font-weight: 600;
  background: var(--quiet-bg); color: var(--quiet); white-space: nowrap;
}
.state-success { background: var(--ok-bg); color: var(--ok); }
.state-failure, .state-error { background: var(--bad-bg); color: var(--bad); }
.state-in_progress, .state-queued, .state-pending { background: var(--busy-bg); color: var(--busy); }
.crumbs { color: var(--muted); font-size: 0.9rem; margin: 0 0 0.25rem; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 0.4rem 1.25rem; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 1rem 1.25rem; margin: 0; }
.facts dt { color: var(--muted); font-size: 0.85rem; }
.facts dd { margin: 0; }
@media (max-width: 720px) {
  .filters select, .filters input { min-width: 0; width: 100%; }
  .filters label { flex: 1 1 45%; }
  th:nth-child(5), td:nth-child(5), th:nth-child(7), td:nth-child(7) { display: none; }
}
