:root {
  color-scheme: light dark;
  --bg: #f6f7f8;
  --surface: #ffffff;
  --text: #1c2024;
  --muted: #5f6b76;
  --border: #d9dee3;
  --accent: #1f5fbf;
  --accent-text: #ffffff;
  --ok: #1b7a43;
  --warn: #9a6200;
  --danger: #b3261e;
  --danger-surface: #fbeaea;
  --highlight-surface: #fff4dc;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14171a;
    --surface: #1d2125;
    --text: #e6e9ec;
    --muted: #9aa5b0;
    --border: #333a41;
    --accent: #7fb0f5;
    --accent-text: #10151b;
    --ok: #62c98f;
    --warn: #e0ad55;
    --danger: #f2837b;
    --danger-surface: #3a2020;
    --highlight-surface: #3a2f18;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

main {
  max-width: 76rem;
  margin: 0 auto;
  padding: 1.5rem 1rem 4rem;
}

h1 {
  margin: 0 0 1rem;
  font-size: 1.5rem;
}

h2 {
  margin: 2rem 0 0.75rem;
  font-size: 1.125rem;
}

a {
  color: var(--accent);
}

code,
.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.875em;
  overflow-wrap: anywhere;
}

.muted {
  color: var(--muted);
}

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.5rem;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.site-header nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  flex: 1;
}

.site-header nav a {
  color: var(--text);
  text-decoration: none;
}

.site-header nav a[aria-current="page"] {
  color: var(--accent);
  font-weight: 600;
}

.brand {
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
}

.login {
  max-width: 24rem;
  margin: 3rem auto;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.875rem;
  color: var(--muted);
}

input,
textarea {
  width: 100%;
  padding: 0.5rem 0.625rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  font: inherit;
}

.button {
  padding: 0.5rem 0.875rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  font: inherit;
  cursor: pointer;
}

.button--primary {
  width: 100%;
  margin-bottom: 0.5rem;
  color: var(--accent-text);
  background: var(--accent);
  border-color: var(--accent);
}

.button--quiet {
  padding: 0.25rem 0.625rem;
  font-size: 0.875rem;
}

.button--danger {
  color: var(--danger);
}

.notice {
  padding: 0.625rem 0.875rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.notice--error {
  color: var(--danger);
  background: var(--danger-surface);
  border-color: var(--danger);
}

.notice--once {
  background: var(--highlight-surface);
  border-color: var(--warn);
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 1rem;
}

.card {
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.card h2 {
  margin: 0 0 0.75rem;
}

.card dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.25rem 1rem;
  margin: 0;
}

.card dt {
  color: var(--muted);
}

.card dd {
  margin: 0;
  text-align: right;
  overflow-wrap: anywhere;
}

.table-scroll {
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

tr:last-child td {
  border-bottom: 0;
}

th {
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 600;
}

.status-ok {
  color: var(--ok);
}

.status-warn {
  color: var(--warn);
}

.status-bad {
  color: var(--danger);
  font-weight: 600;
}

.row-kernel td {
  background: var(--highlight-surface);
}

.inline-form {
  display: inline;
}

.row-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.5rem;
}

.row-form label {
  flex: 1 1 10rem;
}
