:root {
  --ink: #1c1917;
  --paper: #f4efe6;
  --card: #fffaf3;
  --line: #d6cbb8;
  --muted: #6b6258;
  --accent: #9a3412;
  --ready: #3f6212;
  --busy: #a16207;
  --paused: #9a3412;
  --offline: #57534e;
  --alert: #9f1239;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--paper); color: var(--ink); }
body {
  font: 15px/1.45 "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
}
code, .mono, input, button, nav a, .brand {
  font-family: "IBM Plex Mono", "ui-monospace", Menlo, Consolas, monospace;
}

.top {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0.75rem 1.5rem;
  background: var(--ink);
  color: var(--paper);
}
.brand { color: var(--paper); text-decoration: none; font-weight: 700; letter-spacing: 0.04em; }
nav { display: flex; gap: 1rem; flex: 1; }
nav a, .account span { color: #e7e5e4; text-decoration: none; font-size: 13px; }
nav a:hover { color: #fff; }
.account { display: flex; gap: 0.75rem; align-items: center; font-size: 13px; }
.account button, .actions button, .login button {
  background: var(--accent);
  color: #fffaf3;
  border: 0;
  padding: 0.35rem 0.7rem;
  cursor: pointer;
}

.page { padding: 1.5rem 1.75rem 3rem; max-width: 1200px; }
.auth { min-height: 100vh; display: grid; place-items: center; }
.login {
  width: min(24rem, 92vw);
  background: var(--card);
  border: 1px solid var(--line);
  padding: 1.75rem;
}
.login h1 { margin: 0 0 0.25rem; }
.login p { margin: 0 0 1.25rem; color: var(--muted); }
label { display: grid; gap: 0.3rem; margin-bottom: 0.9rem; font-size: 13px; }
input {
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--line);
  background: #fff;
}

h1 { font-size: 1.75rem; margin: 0 0 0.35rem; }
h2 { font-size: 1.15rem; margin: 2rem 0 0.6rem; }
.lede { color: var(--muted); margin: 0 0 1rem; }
.lede .current { color: var(--ink); font-weight: 700; }

.grid { width: 100%; border-collapse: collapse; background: var(--card); }
.grid th, .grid td { text-align: left; padding: 0.55rem 0.7rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.grid th { font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.actions { display: flex; gap: 0.5rem; flex-wrap: wrap; margin: 0.75rem 0 1.25rem; }
.actions form, td.actions form { display: inline; }

.status {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  border: 1px solid currentColor;
  font-size: 12px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.status-ready, .status-active { color: var(--ready); }
.status-busy, .status-running, .status-assigned, .status-updating { color: var(--busy); }
.status-paused, .status-queued, .status-pending { color: var(--paused); }
.status-offline, .status-revoked, .status-cancelled, .status-denied, .status-expired { color: var(--offline); }
.status-failed, .status-low-battery, .status-alert, .status-update-failed, .status-abandoned { color: var(--alert); }
.status-completed, .status-approved { color: var(--ready); }

.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); gap: 0.9rem 1.25rem; }
.facts div { background: var(--card); border: 1px solid var(--line); padding: 0.65rem 0.75rem; }
.facts dt { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.facts dd { margin: 0.15rem 0 0; }

.flash { padding: 0.6rem 0.8rem; margin: 0 0 1rem; border: 1px solid var(--line); }
.flash.notice { background: #ecfccb; }
.flash.alert { background: #ffe4e6; color: var(--alert); }
a { color: var(--accent); }
.mono { font-size: 12px; word-break: break-all; }
.error-excerpt { color: var(--alert); font-size: 13px; max-width: 22rem; }
.stack { margin: 0 0 1.5rem; }
.stack-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin: 2rem 0 0.6rem;
}
.stack-heading h2 { margin: 0; }
.stack-copy {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
  padding: 0.25rem 0.65rem;
  cursor: pointer;
  font: 12px/1.3 "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
}
.stack-copy:hover { border-color: var(--ink); }
.stack .lede { margin-bottom: 0.55rem; }
.log {
  background: var(--ink);
  color: var(--paper);
  padding: 0.9rem 1rem;
  overflow: auto;
  font-family: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.55;
  tab-size: 4;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 24rem;
}
.stack-body { margin: 0; }
label.check { display: flex; align-items: center; gap: 0.5rem; }
input[type="text"], input[type="number"], input[type="email"] { width: min(36rem, 100%); }
.actions a { align-self: center; }
.secret-panel {
  background: var(--card);
  border: 1px solid var(--line);
  padding: 1rem 1.1rem;
  max-width: 42rem;
}
.secret-panel p:first-child { color: var(--alert); margin-top: 0; }

.host-panel {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  background: var(--card);
  border: 1px solid var(--line);
  padding: 1rem 1.1rem;
  margin: 0 0 1.25rem;
}
.host-panel h2 { margin: 0 0 0.25rem; }
.chart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(22rem, 1fr));
  gap: 1.25rem;
  margin: 0 0 1.5rem;
}
.chart-grid section {
  background: var(--card);
  border: 1px solid var(--line);
  padding: 0.9rem 1rem 1rem;
}
.chart-grid h2 { margin-top: 0; }
.kind-filter { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0 0 0.6rem; }
.kind-filter button {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 0.2rem 0.55rem;
  cursor: pointer;
  font: inherit;
}
.kind-filter button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.compute-chart svg { width: 100%; height: 13rem; display: block; }
.compute-chart-line { stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.compute-chart-bar { opacity: 0.92; }
.compute-chart-grid { stroke: currentColor; stroke-width: 1; opacity: 0.18; }
.compute-chart-empty { fill: var(--muted); font-size: 11px; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 0.5rem 0 0; color: var(--muted); font-size: 13px; }
.chart-legend i { display: inline-block; width: 0.6rem; height: 0.6rem; margin-right: 0.3rem; }
dialog { border: 1px solid var(--line); background: var(--card); color: var(--ink); padding: 1rem; max-width: 36rem; width: 94vw; }
.dialog-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 0.75rem; }
.dialog-head h2 { margin: 0; }
.endpoint { margin: 0 0 1.25rem; padding-bottom: 0.75rem; border-bottom: 1px solid var(--line); }
.endpoint h2 { font-size: 1rem; }

.site { min-height: 100vh; display: flex; flex-direction: column; }
.site-top, .site-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.5rem;
}
.site-brand { color: var(--ink); text-decoration: none; font-weight: 700; letter-spacing: 0.02em; }
.site-top { border-bottom: 1px solid var(--line); }
.site-top nav { display: flex; gap: 1rem; }
.site-top nav a, .site-foot a { color: var(--muted); text-decoration: none; font-size: 14px; }
.site-top nav a:hover, .site-foot a:hover { color: var(--ink); }
.site-main { flex: 1; max-width: 42rem; padding: 8vh 1.5rem 4rem; }
.site-main h1 { font-size: clamp(2rem, 5vw, 3.1rem); line-height: 1.15; margin: 0 0 1rem; }
.eyebrow { margin: 0 0 0.75rem; color: var(--muted); letter-spacing: 0.06em; text-transform: uppercase; font-size: 12px; }
a.site-button {
  display: inline-block;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  padding: 0.55rem 0.95rem;
}
.site-foot { border-top: 1px solid var(--line); }
