* { box-sizing: border-box; }
body {
  margin: 0; padding: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #050712; color: #f4f4f7;
}
header {
  padding: 1.5rem 2rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  background: radial-gradient(circle at top, #1d2b64, #050712 60%);
}
h1 { margin: 0; font-size: 1.8rem; }
.subtitle { margin: 0.25rem 0 0; color: #a7b0d0; font-size: 0.95rem; }
main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
section {
  background: rgba(9, 12, 30, 0.96);
  border-radius: 12px;
  padding: 1.2rem 1.4rem;
  border: 1px solid rgba(255,255,255,0.06);
  box-shadow: 0 18px 40px rgba(0,0,0,0.4);
}
#controls { display: flex; flex-direction: column; gap: 0.75rem; }
.controlRow {
  display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap;
}
.backendSelect label { margin-right: 0.35rem; font-size: 0.85rem; color: #a7b0d0; }
select {
  background: rgba(15,23,42,0.9);
  border-radius: 999px;
  border: 1px solid rgba(148,163,184,0.6);
  color: #e5e7eb;
  padding: 0.3rem 0.6rem;
  font-size: 0.85rem;
}
button {
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: #fff; border: none; border-radius: 999px;
  padding: 0.6rem 1.3rem; font-size: 0.95rem; font-weight: 600;
  cursor: pointer; display: inline-flex; align-items: center; gap: 0.5rem;
  box-shadow: 0 10px 25px rgba(79,70,229,0.6);
  transition: transform 0.1s ease, box-shadow 0.1s ease, opacity 0.1s ease;
  width: fit-content;
}
button[disabled] { opacity: 0.55; cursor: default; box-shadow: none; }
button:hover:not([disabled]) {
  transform: translateY(-1px);
  box-shadow: 0 16px 30px rgba(79,70,229,0.7);
}
#progressBarOuter {
  width: 100%; height: 6px; border-radius: 999px;
  background: rgba(255,255,255,0.08); overflow: hidden;
}
#progressBarInner {
  height: 100%; width: 0%; border-radius: inherit;
  background: linear-gradient(90deg, #22c55e, #22d3ee);
  transition: width 0.1s linear;
}
#progressLabel { font-size: 0.9rem; color: #a7b0d0; }
#statusMessage { font-size: 0.9rem; color: #c4d0ff; }
table {
  width: 100%; border-collapse: collapse; font-size: 0.9rem;
}
th, td { padding: 0.4rem 0.5rem; text-align: left; }
thead th {
  border-bottom: 1px solid rgba(255,255,255,0.12);
  color: #d0d7ff; font-weight: 600;
}
tbody tr:nth-child(odd) { background: rgba(255,255,255,0.02); }
tbody tr:nth-child(even) { background: rgba(255,255,255,0.04); }
#scoreBlock {
  margin-top: 1rem; padding: 0.8rem 1rem; border-radius: 10px;
  background: radial-gradient(circle at top left, rgba(56,189,248,0.22), rgba(15,23,42,0.95));
  border: 1px solid rgba(56,189,248,0.4);
}
.scoreValue { font-size: 1.8rem; font-weight: 700; margin: 0.25rem 0; }
.scoreDetails { margin: 0; font-size: 0.85rem; color: #cbd5f5; }
#targetForm { display: flex; flex-direction: column; gap: 0.8rem; }
.fieldRow { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.fieldRow label { min-width: 130px; }
input[type="number"], textarea {
  background: rgba(15,23,42,0.9);
  border: 1px solid rgba(148,163,184,0.6);
  border-radius: 8px;
  padding: 0.35rem 0.55rem;
  color: #e5e7eb;
  font-size: 0.9rem;
}
textarea { width: 100%; resize: vertical; }
.metricGrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-top: 0.5rem;
}
.metricGrid h4 { margin: 0 0 0.25rem; }
.metricGrid label {
  display: block; font-size: 0.85rem; margin-bottom: 0.2rem;
}
details summary { cursor: pointer; font-size: 0.95rem; margin-top: 0.5rem; }
#loadedTargetInfo pre {
  max-height: 200px; overflow: auto;
  background: rgba(15,23,42,0.9);
  border-radius: 8px; padding: 0.5rem 0.7rem; font-size: 0.8rem;
}
#targetCompareTable td, #targetCompareTable th { font-size: 0.85rem; }
.status-pass { color: #4ade80; font-weight: 600; }
.status-rec  { color: #22d3ee; font-weight: 600; }
.status-fail { color: #f97373; font-weight: 600; }
.hidden { display: none; }
footer {
  text-align: center; font-size: 0.8rem; color: #6b7280;
  padding: 1rem 0 1.4rem;
}
