:root {
  color: #17211c;
  background: #f4f7f5;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
a { color: inherit; }
button { font: inherit; }

.topbar {
  min-height: 68px;
  padding: 12px clamp(20px, 4vw, 64px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: #ffffff;
  border-bottom: 1px solid #d9e1dc;
}

.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  color: #ffffff;
  background: #163f70;
  border-radius: 6px;
  font-weight: 800;
}
.brand div { display: grid; }
.brand span:last-child { color: #68736d; font-size: 13px; }
nav { display: flex; gap: 20px; }
nav a { color: #315f4a; font-weight: 700; text-decoration: none; }

main { width: min(1420px, 100%); margin: 0 auto; padding: 36px clamp(20px, 4vw, 64px) 64px; }
.intro { display: flex; align-items: end; justify-content: space-between; gap: 24px; }
.eyebrow { margin: 0 0 8px; color: #c76d19; font-size: 12px; font-weight: 800; }
h1 { margin: 0; font-size: clamp(30px, 4vw, 48px); letter-spacing: 0; }
.intro p:last-child { margin: 10px 0 0; color: #5f6a64; }
#refresh, .action-link {
  min-height: 42px;
  padding: 0 16px;
  border: 0;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #246b4c;
  color: #ffffff;
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
}
#refresh:disabled { opacity: .55; cursor: wait; }
.action-link.secondary { background: #e7edf3; color: #163f70; }

.metrics {
  margin: 30px 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  background: #ffffff;
  border: 1px solid #d9e1dc;
}
.metrics div { min-height: 92px; padding: 18px 22px; display: grid; border-right: 1px solid #d9e1dc; }
.metrics div:last-child { border: 0; }
.metrics span { color: #68736d; font-size: 13px; }
.metrics strong { font-size: 27px; }

.workspace { display: grid; grid-template-columns: 280px minmax(0, 1fr); border-top: 1px solid #ccd6d0; }
.workspace aside { padding: 24px 20px 24px 0; border-right: 1px solid #ccd6d0; }
.workspace h2, .workspace h3 { margin-top: 0; letter-spacing: 0; }
.runs { display: grid; gap: 8px; }
.run {
  width: 100%;
  min-height: 88px;
  padding: 12px;
  display: grid;
  gap: 5px;
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
}
.run:hover { background: #edf2ef; }
.run.selected { background: #ffffff; border-color: #aebdb5; }
.run small { color: #68736d; }

.detail { min-width: 0; padding: 24px 0 24px 32px; }
.detail-head { display: flex; justify-content: space-between; gap: 24px; align-items: start; }
.detail-head h2 { margin: 10px 0 4px; }
.detail-head p { margin: 0; color: #68736d; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.status { width: fit-content; color: #5f6a64; font-size: 12px; font-weight: 800; text-transform: uppercase; }
.status.success, .status.passed { color: #187247; }
.status.failure, .status.failed, .status.timedOut { color: #b42318; }

.result-section { margin-top: 32px; padding-top: 24px; border-top: 1px solid #d9e1dc; }
.test-list { display: grid; }
.test-row { padding: 14px 0; display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 10px; border-bottom: 1px solid #e1e7e3; }
.test-marker { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: #f7d8d5; color: #a6271d; font-weight: 900; }
.test-marker.passed { background: #d9efe3; color: #16643f; }
.test-marker.skipped { background: #e5e9e7; color: #68736d; }
.test-row small { display: block; margin-top: 4px; color: #68736d; }
.test-error { margin: 8px 0 0; color: #9d2a22; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }

.video-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
figure { margin: 0; min-width: 0; }
video { width: 100%; aspect-ratio: 16 / 9; display: block; background: #111713; }
figcaption { padding-top: 8px; color: #5f6a64; font-size: 13px; }
.files { display: flex; flex-wrap: wrap; gap: 8px; }
.files h3 { width: 100%; }
.file-link { padding: 9px 12px; border: 1px solid #bdc9c2; border-radius: 5px; color: #315f4a; text-decoration: none; }
.empty { padding: 48px 0; color: #68736d; }
.muted { color: #68736d; }

@media (max-width: 780px) {
  .topbar, .intro, .detail-head { align-items: flex-start; }
  nav { display: none; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metrics div:nth-child(2) { border-right: 0; }
  .metrics div:nth-child(-n+2) { border-bottom: 1px solid #d9e1dc; }
  .workspace { grid-template-columns: 1fr; }
  .workspace aside { border-right: 0; border-bottom: 1px solid #ccd6d0; padding-right: 0; }
  .runs { grid-auto-flow: column; grid-auto-columns: minmax(220px, 80%); overflow-x: auto; }
  .detail { padding-left: 0; }
  .video-grid { grid-template-columns: 1fr; }
  .intro, .detail-head { flex-direction: column; }
}
