:root {
  color-scheme: light;
  --bg: #eef0f2;
  --ink: #050914;
  --muted: #3d4451;
  --line: #050914;
  --paper: #f8f8f4;
  --accent: #2448ff;
  --danger: #a02222;
  --ok: #155b35;
  --gap: 1rem;
}

* { box-sizing: border-box; }

html {
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
}

body { min-height: 100%; margin: 0; }
button, input, select, textarea { font: inherit; }

button {
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--ink);
  color: var(--paper);
  cursor: pointer;
  padding: 0.75rem 1rem;
  text-transform: uppercase;
}

button:hover:not(:disabled), button:focus-visible {
  background: var(--accent);
  outline: 2px solid var(--line);
  outline-offset: 2px;
}

.shell {
  width: min(1240px, calc(100vw - 2rem));
  margin: 1rem auto;
  border: 1px solid var(--line);
  background: var(--paper);
}

.site-header, .status-strip, .summary-grid, .panel { border-bottom: 1px solid var(--line); }

.site-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--gap);
  align-items: end;
  padding: 1rem;
}

h1, h2, p { margin: 0; }
h1 {
  font-size: clamp(2.6rem, 8vw, 6rem);
  line-height: 0.9;
  letter-spacing: -0.08em;
  text-transform: uppercase;
}
h2 {
  font-size: clamp(1.25rem, 3vw, 2rem);
  letter-spacing: -0.04em;
  text-transform: uppercase;
}

.eyebrow, .metric-label, .status-label, .panel-note, .copy-note, .origin, .axis-note {
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.header-actions { display: grid; gap: 0.5rem; justify-items: end; }
.origin { max-width: min(50vw, 34rem); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.status-strip {
  display: grid;
  grid-template-columns: auto minmax(12rem, auto) 1fr;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--bg);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.metric-card {
  min-width: 0;
  min-height: 9rem;
  padding: 1rem;
  display: grid;
  align-content: space-between;
  gap: 1rem;
  border-right: 1px solid var(--line);
}
.metric-card:last-child { border-right: 0; }
.metric-card.primary { grid-column: span 2; }

.metric-value {
  display: block;
  white-space: nowrap;
  font-size: clamp(2.2rem, 4.2vw, 4.4rem);
  line-height: 0.86;
  letter-spacing: -0.1em;
}
.metric-value.small { font-size: clamp(1.5rem, 2.4vw, 2.65rem); }

.panel { padding: 1rem; }
.panel:last-child { border-bottom: 0; }
.panel-heading {
  display: flex;
  justify-content: space-between;
  gap: var(--gap);
  align-items: start;
  margin-bottom: 1rem;
}

.latency-panel canvas {
  display: block;
  width: 100%;
  height: 26rem;
  border: 1px solid var(--line);
  background: var(--bg);
}
.axis-note { display: flex; justify-content: space-between; gap: var(--gap); margin-top: 0.5rem; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; min-width: 44rem; }
th, td { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 0.75rem; text-align: left; }
th:last-child, td:last-child { border-right: 0; }
tbody tr:last-child td { border-bottom: 0; }
th { background: var(--bg); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; }

.details-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(16rem, 0.75fr); gap: var(--gap); }
dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; margin: 0; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
dl > div { padding: 0.75rem; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
dt { color: var(--muted); font-size: 0.75rem; text-transform: uppercase; }
dd { margin: 0.35rem 0 0; font-size: 1.25rem; }
.copy-note { border: 1px solid var(--line); padding: 0.75rem; background: var(--bg); line-height: 1.5; text-transform: none; letter-spacing: 0; }

[data-state$="throughput"] .status-strip,
[data-state$="latency"] .status-strip,
[data-state="warming"] .status-strip {
  animation: scan 1.2s steps(2, end) infinite;
}
[data-state="complete"] #run-state { color: var(--ok); }
[data-state="failed"] #run-state, [data-state="aborted"] #run-state { color: var(--danger); }

@keyframes scan { 0%, 100% { background: var(--bg); } 50% { background: #dde3ea; } }

@media (max-width: 900px) {
  .site-header, .status-strip, .details-grid { grid-template-columns: 1fr; }
  .header-actions { justify-items: stretch; }
  .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric-card.primary { grid-column: span 1; }
  .metric-card { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
  .latency-panel canvas { height: 22rem; }
}

@media (max-width: 560px) {
  .shell { width: calc(100vw - 0.75rem); margin: 0.375rem auto; }
  .summary-grid, dl { grid-template-columns: 1fr; }
  .metric-card { min-height: 7rem; border-right: 0; }
  .panel-heading { display: block; }
}
