:root {
  color-scheme: dark light;
  --bg: #0d1117;
  --panel: #161b22;
  --panel-border: #30363d;
  --text: #e6edf3;
  --muted: #8b949e;
  --accent: #58a6ff;
  --good: #3fb950;
  --bad: #f85149;
  --warn: #d29922;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace; font-size: 0.92em; }

.topbar {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 14px 28px;
  border-bottom: 1px solid var(--panel-border);
  background: var(--panel);
}

.brand { font-weight: 700; font-size: 16px; color: var(--text); }
.nav { display: flex; gap: 18px; flex: 1; flex-wrap: wrap; }
.nav-link { color: var(--muted); padding-bottom: 2px; }
.nav-link[aria-current="page"] { color: var(--text); border-bottom: 2px solid var(--accent); }

.banner {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 12px;
  padding: 12px 28px;
  border-bottom: 1px solid var(--panel-border);
}

.banner-stopped { background: rgba(248, 81, 73, 0.14); border-bottom-color: var(--bad); }
.banner-warn { background: rgba(210, 153, 34, 0.14); border-bottom-color: var(--warn); }
.banner span { color: var(--muted); }

.content { flex: 1; padding: 28px; max-width: 1180px; width: 100%; margin: 0 auto; }
.breadcrumbs { color: var(--muted); font-size: 13px; margin-bottom: 14px; }
.crumb-separator { padding: 0 4px; }

h1 { font-size: 22px; margin: 0 0 6px; }
h2 { font-size: 16px; margin: 0 0 12px; display: flex; align-items: center; gap: 6px; }
.muted { color: var(--muted); }
.lede { color: var(--muted); margin: 0 0 22px; }

.panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  padding: 18px 20px;
  margin-bottom: 20px;
}

.error-panel { border-color: var(--bad); }
.danger-panel { border-color: var(--bad); }

.stat-row { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 20px; }

.stat-card {
  position: relative;
  flex: 1 1 220px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  padding: 16px 18px;
}

.stat-label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; }
.stat-value { font-size: 26px; font-weight: 600; margin-top: 6px; }
.stat-value.good { color: var(--good); }
.stat-value.bad { color: var(--bad); }
.stat-value.warn { color: var(--warn); }
.stat-note { color: var(--muted); font-size: 12px; margin-top: 6px; }

.info {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid var(--muted);
  color: var(--muted);
  font-size: 11px;
  font-style: italic;
  font-weight: 700;
  cursor: help;
}

.stat-card .info { position: absolute; top: 12px; right: 12px; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--panel-border); vertical-align: top; }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; }
tbody tr:last-child td { border-bottom: none; }
td.numeric { text-align: right; font-variant-numeric: tabular-nums; }

.table-wrap { overflow-x: auto; }

.timestamp { display: flex; flex-direction: column; cursor: help; }
.timestamp-relative { color: var(--text); font-weight: 600; }
/* The precise line must not wrap: "2026-08-17 20:51:20 UTC" broken across four lines triples the
   height of every row in a table whose whole value is being scannable. */
.timestamp-precise { color: var(--muted); font-size: 12px; white-space: nowrap; }
.timestamp-unparsed .timestamp-relative { color: var(--warn); font-weight: 600; }
.timestamp-overdue .timestamp-relative { color: var(--bad); font-weight: 600; }

.badge {
  display: inline-block;
  border-radius: 999px;
  padding: 2px 9px;
  font-size: 12px;
  border: 1px solid var(--panel-border);
  color: var(--muted);
  cursor: help;
}

.badge.on { border-color: var(--good); color: var(--good); }
.badge.off { border-color: var(--muted); color: var(--muted); }
.badge.stopped { border-color: var(--bad); color: var(--bad); }
.badge.warn { border-color: var(--warn); color: var(--warn); }
.badge.address { font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace; cursor: auto; }

.empty { color: var(--muted); padding: 18px 0; }

form.controls { display: flex; flex-direction: column; gap: 14px; max-width: 620px; }
form.controls label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
form.controls label > span { display: block; }
form.controls .checkbox { flex-direction: row; align-items: center; gap: 8px; color: var(--text); font-size: 14px; }

input[type="text"] {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--panel-border);
  border-radius: 6px;
  padding: 8px 10px;
  font: inherit;
  width: 100%;
}

button {
  font: inherit;
  font-weight: 600;
  border-radius: 6px;
  padding: 8px 14px;
  border: 1px solid var(--panel-border);
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  align-self: flex-start;
}

button:hover { border-color: var(--accent); }
button.danger { border-color: var(--bad); color: var(--bad); }
button.danger:hover { background: rgba(248, 81, 73, 0.12); }
button:disabled { opacity: 0.5; cursor: not-allowed; border-color: var(--panel-border); }

/*
 * The per-row terminate control. Deliberately quieter than button.danger: a table of 150 rows each
 * shouting in red reads as an alarm about the fleet rather than an available action, and this button
 * only opens a confirmation — the loud one is on the confirmation itself, where the destructive
 * click actually happens.
 */
/* A link that looks like a button, for actions that navigate rather than submit. */
.button-link {
  display: inline-block;
  text-decoration: none;
  border-radius: 6px;
  border: 1px solid var(--panel-border);
  background: var(--panel);
}
.button-link:hover { border-color: var(--accent); }

button.danger-quiet, a.danger-quiet {
  padding: 4px 10px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--muted);
}
button.danger-quiet:hover, a.danger-quiet:hover { border-color: var(--bad); color: var(--bad); }

.report-list { margin: 8px 0 0; padding-left: 18px; }
.report-list li { margin-bottom: 4px; }
.report-failure { color: var(--bad); }

.footer {
  display: flex;
  gap: 18px;
  padding: 14px 28px;
  border-top: 1px solid var(--panel-border);
  color: var(--muted);
  font-size: 12px;
}

/* Row actions. Quiet by default: a table where every row shouts reads as an alarm about CI rather
   than as a list of things a reader may do. */
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.inline-form { display: inline-flex; gap: 6px; align-items: center; margin: 0; }
/* Fixed rather than filling: a row action that grows to the column's width squeezes the columns
   that carry the reading matter, and a repository's reason for its build rate ends up one word per
   line. */
.inline-form input[type="text"] { width: 8.5rem; min-width: 0; }

.sha { font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace; font-size: 0.9em; }

/* The result of an action the reader just took, shown above the page it returns to. */
.notice { border-radius: 8px; border: 1px solid var(--panel-border); padding: 12px 16px; margin-bottom: 20px; }
.notice-good { border-color: var(--good); }
.notice-bad { border-color: var(--bad); }
.notice-warn { border-color: var(--warn); }
.notice p { margin: 0 0 6px; }
.notice p:last-child { margin-bottom: 0; }

.filters { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 16px; }
.filters label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.filters button { align-self: flex-end; }

select {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--panel-border);
  border-radius: 6px;
  padding: 8px 10px;
  font: inherit;
}

.detail-cell { max-width: 560px; }

/* The build rate and the reason it was set are the reading matter of the repositories table. */
.rate-cell { min-width: 250px; }

/* A timestamp inside a sentence: the distance reads inline, the exact moment is on hover. */
.when { border-bottom: 1px dotted var(--muted); cursor: help; }

/* The second heading level inside a panel, separating two forms that would otherwise run together. */
.subheading {
  font-size: 14px;
  margin: 26px 0 4px;
  padding-top: 18px;
  border-top: 1px solid var(--panel-border);
}
.entry-meta { color: var(--muted); font-size: 12px; }


@media (prefers-color-scheme: light) {
  :root {
    --bg: #ffffff;
    --panel: #f6f8fa;
    --panel-border: #d0d7de;
    --text: #1f2328;
    --muted: #656d76;
    --accent: #0969da;
    --good: #1a7f37;
    --bad: #cf222e;
    --warn: #9a6700;
  }
}