* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, Roboto, sans-serif;
  color: #1a1a1a;
  background: #f5f5f7;
}
header {
  padding: 16px 24px;
  background: #1a1a1a;
  color: #f5f5f7;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
header h1 { font-size: 18px; font-weight: 600; margin: 0; }
.job-info { font-size: 13px; opacity: 0.85; }
main { padding: 24px; max-width: 1400px; margin: 0 auto; }
.card {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}
.card h2 { margin: 0 0 12px 0; font-size: 16px; font-weight: 600; }
.muted { color: #666; font-size: 13px; }
.hidden { display: none !important; }

form { display: flex; gap: 8px; }
input[type="text"] {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font: inherit;
}
button {
  padding: 10px 16px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  font: inherit;
  cursor: pointer;
}
button:hover { background: #f0f0f0; }
button.primary { background: #0066ff; color: #fff; border-color: #0066ff; }
button.primary:hover { background: #0052cc; }
button.danger { background: #ff3b30; color: #fff; border-color: #ff3b30; }

dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
dt { color: #666; font-size: 13px; }
dd { margin: 0; font-size: 14px; font-weight: 500; }

.actions { margin-top: 16px; display: flex; gap: 8px; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(640px, 1fr));
  gap: 20px;
}
.tag-card {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}
.tag-card.fail { border-left: 4px solid #ff3b30; }
.tag-card.pass { border-left: 4px solid #34c759; }

.tag-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.tag-id { font-weight: 600; font-size: 14px; }
.verdict-badge {
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}
.verdict-pass { background: #d4f7dc; color: #1c7c34; }
.verdict-fail { background: #ffd9d9; color: #b00020; }

.image-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.image-pair > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.image-pair img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  background: #eee;
  display: block;
  aspect-ratio: 1 / 1;
  object-fit: contain;
}
.image-pair .label {
  font-size: 11px;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.attempt-list {
  margin-top: 12px;
  font-size: 12px;
  color: #555;
}
.attempt-list li { margin: 2px 0; }

/* run history list */
.row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
#runs-table { width: 100%; border-collapse: collapse; font-size: 13px; }
#runs-table th { text-align: left; padding: 8px 12px; border-bottom: 1px solid #eee; color: #666; font-weight: 500; }
#runs-table td { padding: 12px; border-bottom: 1px solid #f0f0f0; vertical-align: top; }
#runs-table tr.run-row { cursor: pointer; }
#runs-table tr.run-row:hover { background: #f5f5f7; }
.status-badge {
  font-size: 11px; padding: 2px 8px; border-radius: 4px;
  text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600;
}
.status-badge.status-queued { background: #ddd; color: #555; }
.status-badge.status-running { background: #e3f2fd; color: #0066ff; }
.status-badge.status-review { background: #fff8d4; color: #8a6d00; }
.status-badge.status-done { background: #d4f7dc; color: #1c7c34; }
.status-badge.status-error { background: #ffd9d9; color: #b00020; }
.back-link { color: #0066ff; text-decoration: none; font-size: 13px; align-self: center; }
.back-link:hover { text-decoration: underline; }

/* manual run form */
#manual-form { display: grid; gap: 12px; }
#manual-form label { display: grid; gap: 4px; font-size: 13px; color: #666; font-weight: 500; }
#manual-form label input { padding: 10px 12px; border: 1px solid #ddd; border-radius: 8px; font: inherit; }
@media (max-width: 720px) {
  .grid { grid-template-columns: 1fr; }
  main { padding: 12px; }
  header { padding: 12px 16px; }
  #runs-table { font-size: 12px; }
  #runs-table td, #runs-table th { padding: 6px 8px; }
}
