*, *::before, *::after { box-sizing: border-box; }
body {
  font-family: system-ui, sans-serif;
  background: #0f1117;
  color: #e8e8e8;
  margin: 0;
  padding: 2rem;
}
h1 { font-size: 1.6rem; margin-bottom: 1.5rem; color: #fff; }
.card {
  background: #1a1d2e;
  border: 1px solid #2a2d3e;
  border-radius: 10px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}
label { display: block; font-size: 0.85rem; color: #aaa; margin-bottom: 0.3rem; }
input[type=text], textarea {
  width: 100%;
  background: #0f1117;
  border: 1px solid #3a3d4e;
  border-radius: 6px;
  color: #e8e8e8;
  padding: 0.5rem 0.75rem;
  font-size: 0.95rem;
  outline: none;
}
input[type=text]:focus, textarea:focus { border-color: #6c63ff; }
textarea { resize: vertical; min-height: 80px; font-family: monospace; font-size: 0.85rem; }
.row { display: flex; gap: 1rem; flex-wrap: wrap; align-items: flex-end; }
.col { flex: 1; min-width: 200px; }
.col-auto { flex: 0 0 auto; }
input[type=range] { width: 100%; accent-color: #6c63ff; }
.threshold-row { display: flex; align-items: center; gap: 0.75rem; }
.threshold-row input[type=range] { flex: 1; }
.threshold-val { min-width: 3rem; text-align: right; font-variant-numeric: tabular-nums; }
button {
  background: #6c63ff;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0.6rem 1.5rem;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.15s;
}
button:hover { background: #5a52d5; }
button:disabled { background: #3a3d4e; cursor: default; }
#error { color: #ff6b6b; margin-top: 0.5rem; font-size: 0.9rem; display: none; }
#spinner { display: none; color: #aaa; margin-top: 0.5rem; font-size: 0.9rem; }
#plot { width: 100%; min-height: 500px; }
.legend-hint { font-size: 0.8rem; color: #888; margin-top: 0.5rem; }
