:root {
  --bg: #f5f4ef;
  --panel: #ffffff;
  --ink: #202428;
  --muted: #68707a;
  --line: #d9d4c8;
  --soft: #faf8f2;
  --blue: #235f8f;
  --green: #237457;
  --amber: #9a6818;
  --red: #a43d34;
  --shadow: 0 14px 34px rgba(35, 32, 25, 0.08);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
}

button,
select {
  font: inherit;
}

button {
  min-height: 36px;
  border: 1px solid #1d4f76;
  border-radius: 8px;
  background: var(--blue);
  color: #ffffff;
  font-weight: 800;
  padding: 0 14px;
}

select {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  padding: 0 10px;
}

.shell {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 22px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 28px;
  letter-spacing: 0;
}

h2 {
  font-size: 16px;
  letter-spacing: 0;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.toolbar label {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.status-pill,
.chip {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  padding: 0 10px;
}

.status-pill {
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--muted);
}

.status-ok {
  background: #e5f2eb;
  color: var(--green);
}

.status-warn {
  background: #f7ead1;
  color: var(--amber);
}

.status-dead {
  background: #f5dddd;
  color: var(--red);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.metric,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.metric {
  display: grid;
  gap: 7px;
  min-height: 94px;
  padding: 14px;
}

.metric span,
.checkpoint-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.metric strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 23px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.layout {
  display: grid;
  grid-template-columns: minmax(320px, 430px) minmax(0, 1fr);
  gap: 14px;
}

.panel {
  min-width: 0;
  padding: 16px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.panel-head.lower {
  margin-top: 18px;
}

.muted {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.runs-list {
  display: grid;
  gap: 10px;
}

.empty {
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--soft);
  color: var(--muted);
  padding: 16px;
}

.run-card {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  padding: 12px;
}

.run-title {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.run-title strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.run-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.agent-list {
  display: grid;
  gap: 7px;
}

.agent-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.agent-row small {
  display: block;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.checkpoint-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}

.checkpoint-grid div,
.blockers {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  padding: 12px;
}

.checkpoint-grid p {
  overflow-wrap: anywhere;
  margin-top: 5px;
  color: var(--ink);
}

.blockers {
  display: grid;
  gap: 8px;
}

.blocker {
  color: var(--red);
  font-size: 14px;
  font-weight: 750;
}

.progress-tail {
  overflow: auto;
  min-height: 360px;
  max-height: 620px;
  margin: 0;
  border: 1px solid #2d3339;
  border-radius: 8px;
  background: #202428;
  color: #f6f3ea;
  padding: 14px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
}

@media (max-width: 980px) {
  .summary-grid,
  .layout {
    grid-template-columns: 1fr;
  }

  .topbar {
    display: grid;
  }

  .toolbar {
    justify-content: flex-start;
  }
}

@media (max-width: 560px) {
  .shell {
    padding: 14px;
  }

  h1 {
    font-size: 24px;
  }

  .toolbar,
  .toolbar label,
  button,
  select {
    width: 100%;
  }

  .checkpoint-grid,
  .run-meta {
    grid-template-columns: 1fr;
  }
}
