body {
  font-family: Arial, sans-serif;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  flex-direction: column;
  background: #222;
  color: #eee;
  min-height: 100vh;
  margin: 0;
  padding: 10px 0 40px;
}

h1 {
  font-weight: 600;
  font-size: 20px;
  margin: 8px 0 6px 24px;
}

#oscilloscope {
  background-color: #000;
  border: 5px solid #4caf50;
  border-radius: 15px;
  display: block;
  margin: 6px 24px 0 24px;
  box-shadow: 0 0 12px rgba(0,0,0,0.5) inset;
}

#controls {
  margin: 10px 24px 0 24px;
  text-align: left;
}

#controls > div {
  margin-top: 8px;
}

#controls label {
  font-size: 1.05em;
  margin-right: 8px;
}

#controls input[type="range"] {
  width: 360px;
  margin-left: 10px;
  vertical-align: middle;
}

#controls .buttons {
  margin-top: 10px;
}

#controls button {
  margin-right: 10px;
  padding: 8px 15px;
  font-size: 1em;
  cursor: pointer;
  border: none;
  border-radius: 6px;
  background: #4caf50;
  color: white;
}

#controls button:hover {
  background: #45a049;
}

#legend {
  margin-top: 8px;
  font-size: 0.95em;
  color: #ddd;
}

.swatch {
  display: inline-block;
  width: 14px;
  height: 10px;
  margin: 0 6px 0 14px;
  border-radius: 2px;
  vertical-align: middle;
}
.swatch.abs { background: rgba(255, 64, 64, 0.28); }
.swatch.rel { background: rgba(255, 165, 0, 0.22); }

#message {
  margin-top: 8px;
  min-height: 1.4em;
  font-size: 1.05em;
  color: #ffd27f;
}

#trials {
  margin: 12px 24px;
}

#trials h2 {
  font-size: 16px;
  font-weight: 600;
  margin: 12px 0 6px 0;
}

#trials table {
  width: 92%;
  border-collapse: collapse;
  background: #111;
  color: #ddd;
}

#trials th, #trials td {
  border: 1px solid #333;
  padding: 6px 8px;
  text-align: center;
  font-family: monospace;
  font-size: 13px;
}

#trials thead th {
  background: #1e1e1e;
}
