:root {
  color-scheme: light;
  --bg: #f6f7f4;
  --surface: #ffffff;
  --surface-soft: #eef2ed;
  --ink: #18201c;
  --muted: #6b746d;
  --line: #d9dfd8;
  --blue: #2e6f95;
  --green: #1f7a53;
  --amber: #a36319;
  --red: #a13b36;
  --shadow: 0 18px 50px rgba(32, 48, 39, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 44px;
}

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

.eyebrow {
  margin: 0 0 6px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: clamp(26px, 3vw, 40px);
  line-height: 1.05;
  letter-spacing: 0;
}

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

h3 {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  color: var(--ink);
  background: var(--surface);
  cursor: pointer;
  transition:
    transform 0.16s ease,
    border-color 0.16s ease,
    background 0.16s ease;
}

.button svg {
  width: 17px;
  height: 17px;
}

.button:hover {
  border-color: #b7c1b9;
  transform: translateY(-1px);
}

.button:disabled {
  cursor: wait;
  opacity: 0.65;
  transform: none;
}

.button.primary {
  border-color: var(--green);
  background: var(--green);
  color: white;
}

.button.secondary {
  background: rgba(255, 255, 255, 0.82);
}

.status-band {
  display: grid;
  grid-template-columns: 1fr minmax(420px, 0.95fr);
  gap: 18px;
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.status-line {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  color: var(--muted);
}

.dot {
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--amber);
  box-shadow: 0 0 0 5px rgba(163, 99, 25, 0.13);
}

.dot.ok {
  background: var(--green);
  box-shadow: 0 0 0 5px rgba(31, 122, 83, 0.13);
}

.dot.error {
  background: var(--red);
  box-shadow: 0 0 0 5px rgba(161, 59, 54, 0.13);
}

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

.meta-grid div,
.metrics article {
  min-width: 0;
  border-radius: 8px;
  padding: 13px 14px;
  background: var(--surface-soft);
}

.meta-grid span,
.metrics span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0;
}

.meta-grid strong,
.metrics strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 20px;
  line-height: 1.1;
  letter-spacing: 0;
}

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

.metrics article {
  background: var(--surface);
  border: 1px solid var(--line);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: 16px;
}

.panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 16px 18px;
}

.panel-heading span {
  color: var(--muted);
  font-size: 13px;
}

.runs {
  display: grid;
  gap: 0;
}

.run-row {
  display: grid;
  grid-template-columns: minmax(132px, 0.8fr) minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 14px 18px;
}

.run-row:last-child {
  border-bottom: 0;
}

.run-row strong {
  font-size: 14px;
}

.run-row small,
.muted {
  color: var(--muted);
  font-size: 12px;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 9px;
  color: white;
  background: var(--green);
  font-size: 12px;
  font-weight: 700;
}

.badge.dry {
  background: var(--blue);
}

.badge.failed {
  background: var(--red);
}

.details {
  min-height: 310px;
  max-height: 520px;
  margin: 0;
  overflow: auto;
  padding: 18px;
  color: #27352e;
  background: #fbfcfa;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.samples {
  margin-top: 16px;
}

.sample-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  padding: 18px;
}

.sample-list {
  display: grid;
  gap: 8px;
}

.sample-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfa;
  font-size: 13px;
}

.sample-item code {
  color: var(--blue);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

@media (max-width: 920px) {
  .topbar,
  .status-band,
  .workspace,
  .sample-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: flex-start;
  }

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

  .meta-grid,
  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .shell {
    width: min(100% - 20px, 1180px);
    padding-top: 18px;
  }

  .actions,
  .button {
    width: 100%;
  }

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

  .run-row {
    grid-template-columns: 1fr;
  }
}
