:root {
  --bg: #121212;
  --bg-elevated: #1a1a1a;
  --bg-card: #1f1f1f;
  --text: #f7fffc;
  --muted: #bababa;
  --line: #2b2b2b;
  --accent: #bf0a30;
  --accent-hover: #d11b41;
  --danger: #bc0f0f;
  --ok: #3d8c6e;
  --warn: #c4a35a;
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 var(--font);
  letter-spacing: 0.01em;
}
a { color: var(--text); }
a:hover { color: var(--accent-hover); }
h1, h2, h3 { font-weight: 650; letter-spacing: 0.02em; }
h1 { font-size: 2.1rem; margin: 0 0 0.4rem; }
h2 { font-size: 1.1rem; margin: 0 0 0.75rem; }
h3 { font-size: 1rem; margin: 0.5rem 0; }
p { margin: 0 0 0.8rem; color: var(--muted); }
.lede { font-size: 1.05rem; max-width: 42rem; }
.muted { color: var(--muted); }
.shell { width: min(1120px, calc(100% - 2rem)); margin: 0 auto; }
.skip-link { position: absolute; left: -999px; }
.skip-link:focus { left: 1rem; top: 1rem; background: var(--bg-elevated); padding: 0.4rem 0.7rem; }

.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--bg-elevated);
  position: sticky;
  top: 0;
}
.header-row {
  display: flex;
  gap: 1.25rem;
  align-items: center;
  justify-content: space-between;
  min-height: 3.6rem;
  flex-wrap: wrap;
}
.brand { font-weight: 700; text-decoration: none; letter-spacing: 0.04em; }
.nav { display: flex; gap: 0.9rem; flex-wrap: wrap; align-items: center; }
.nav a { text-decoration: none; color: var(--muted); font-size: 0.92rem; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); }
.header-account { display: flex; gap: 0.75rem; align-items: center; }
.site-footer { border-top: 1px solid var(--line); margin-top: 3rem; padding: 1.5rem 0 2.5rem; font-size: 0.85rem; }
main.shell { padding: 2rem 0 3rem; }

.hero { padding: 2.5rem 0 1.5rem; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.72rem; color: var(--accent); }
.actions { display: flex; gap: 0.75rem; margin: 1.25rem 0; flex-wrap: wrap; }
.page-header { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-end; margin-bottom: 1.25rem; flex-wrap: wrap; }

.btn {
  display: inline-block;
  background: var(--accent);
  color: var(--text);
  text-decoration: none;
  border: 0;
  border-radius: 4px;
  padding: 0.55rem 0.95rem;
  font: inherit;
  cursor: pointer;
}
.btn:hover { background: var(--accent-hover); color: var(--text); }
.btn-ghost { background: transparent; border: 1px solid var(--line); }
.btn-danger { background: var(--danger); }

.card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1.1rem 1.2rem;
  margin-bottom: 1rem;
}
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; margin: 1rem 0; }
.metric { font-size: 1.8rem; color: var(--text); margin: 0.2rem 0 0.5rem; }
.list { list-style: none; padding: 0; margin: 0; }

.form { display: grid; gap: 0.85rem; max-width: 28rem; }
.form label { display: grid; gap: 0.35rem; color: var(--muted); font-size: 0.92rem; }
.form input, .form textarea {
  background: #141414;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.55rem 0.65rem;
  font: inherit;
}
.check { display: flex; gap: 0.5rem; align-items: center; }

.table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.table th, .table td { text-align: left; padding: 0.55rem 0.4rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { color: var(--muted); font-weight: 600; }

.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0.7rem 1rem; }
.kv dt { color: var(--muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; }
.kv dd { margin: 0.15rem 0 0; }

.flash { padding: 0.7rem 0.85rem; border-radius: 6px; }
.flash-notice { background: #163226; }
.flash-alert { background: #3a1218; }
.empty { color: var(--muted); padding: 1rem 0; }
.pre { white-space: pre-wrap; color: var(--text); }
.steps { padding-left: 1.1rem; }
.steps li { margin-bottom: 0.9rem; }

.status { display: inline-block; text-transform: lowercase; }
.status-completed, .status-active, .status-approve, .status-approved, .status-ok { color: var(--ok); }
.status-failed, .status-block, .status-rejected, .status-suspended { color: #e36b6b; }
.status-needs-attention, .status-repair-required, .status-stalled, .status-awaiting-approval { color: var(--warn); }

.filters { display: flex; gap: 0.9rem; flex-wrap: wrap; margin: 0 0 1rem; }
.filters a { color: var(--muted); text-decoration: none; font-size: 0.92rem; }
.filters a:hover, .filters a[aria-current="page"] { color: var(--text); }
.raw-status { font-size: 0.78rem; }
.banner p { margin-bottom: 0.4rem; }
.timeline { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.35rem; }
.timeline li { display: flex; justify-content: space-between; gap: 1rem; font-size: 0.92rem; }
.timeline-completed .timeline-label { color: var(--ok); }
.timeline-current .timeline-label { color: var(--accent); }
.timeline-failed .timeline-label { color: #e36b6b; }
.timeline-waiting .timeline-label, .timeline-not-applicable .timeline-label { color: var(--muted); }

@media (max-width: 720px) {
  h1 { font-size: 1.7rem; }
  .header-row { padding: 0.6rem 0; }
}
