* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Space Grotesk", "Helvetica Neue", Arial, sans-serif;
  background: radial-gradient(circle at 20% 20%, #f2f2ff 0, #eef7ff 30%, #fefefe 60%);
  color: #121417;
}

.page {
  max-width: none;
  margin: 0;
  padding: 16px 20px 32px;
}

.hero {
  display: flex;
  align-items: center;
  gap: 16px;
  justify-content: space-between;
  width: 100%;
  padding: 20px 18px;
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 18px;
  background: linear-gradient(120deg, rgba(80, 120, 255, 0.1), rgba(0, 180, 180, 0.08));
}

.eyebrow {
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 12px;
  color: #4a5568;
  margin: 0 0 4px 0;
}

.hero h1 {
  margin: 0 0 8px 0;
  font-size: 26px;
  font-weight: 600;
}

.subhead {
  margin: 0;
  color: #475467;
  max-width: 780px;
  line-height: 1.4;
}

.actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

button {
  border: none;
  border-radius: 999px;
  padding: 10px 16px;
  font-weight: 600;
  cursor: pointer;
  font-size: 14px;
  transition: transform 120ms ease, box-shadow 120ms ease, opacity 120ms ease;
}

button:active {
  transform: translateY(1px);
}

button.primary {
  background: #173cff;
  color: white;
  box-shadow: 0 8px 24px rgba(23, 60, 255, 0.28);
}

button.ghost {
  background: rgba(0, 0, 0, 0.05);
  color: #111827;
}

.layout {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 18px;
  margin-top: 18px;
  width: 100%;
  align-items: start;
  align-content: stretch;
}

.controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 100%;
}

.stack {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.stack .control-block:last-child {
  margin-top: auto;
}

.control-block {
  background: white;
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 14px;
  padding: 14px 14px 10px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.03);
}

.control-block h3 {
  margin: 0 0 8px 0;
  font-size: 15px;
  font-weight: 800;
}

.control-block.wide {
  grid-column: 1 / -1;
}

label {
  display: block;
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 4px;
}

label.inline {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}

textarea, input, select {
  width: 100%;
  font-size: 14px;
  padding: 8px 10px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 10px;
  background: #f9fafb;
  font-family: inherit;
}

textarea {
  resize: vertical;
}

.field {
  margin-bottom: 10px;
}

.field.two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.field.three-col {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.field.mini input[type="range"] {
  width: 100%;
}

.field.four-col {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.field.four-col.tight input {
  padding: 6px 8px;
}

.inline-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.inline-row.compact {
  gap: 8px;
}

label.small {
  font-weight: 600;
  font-size: 13px;
}

.value-chip {
  display: inline-block;
  margin-left: 8px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #eef2ff;
  color: #111827;
  font-size: 12px;
}

.progress {
  position: relative;
  height: 12px;
  border-radius: 999px;
  background: #eef2f7;
  overflow: hidden;
}

#progress-bar {
  position: absolute;
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #1a46ff, #3ae0e0);
  transition: width 160ms ease;
}

#status-graph {
  width: 100%;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.status {
  margin: 6px 0 0 0;
  font-size: 13px;
  color: #475467;
}

.error {
  color: #b42318;
  font-size: 13px;
  min-height: 18px;
}

.panels {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
  margin-top: 8px;
  align-items: stretch;
  grid-auto-rows: 1fr;
  align-content: stretch;
  align-self: stretch;
}

.panel {
  background: white;
  border-radius: 16px;
  border: 1px solid rgba(0, 0, 0, 0.04);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.04);
  padding: 12px 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.panel h4 {
  margin: 0;
  font-size: 14px;
  color: #0f172a;
  font-weight: 800;
}

.swatch-column {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.swatch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 13px;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.labels {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

.channel-bars {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 6px;
}

.channel-bar {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 170px;
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  overflow: visible;
  background: linear-gradient(180deg, #fff, #000);
}

.channel-dot {
  position: absolute;
  left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.25);
}

.channel-dot.square {
  border-radius: 0;
}

.channel-headings {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  font-weight: 700;
  font-size: 12px;
  color: #111827;
  text-align: center;
  text-transform: uppercase;
}

.muted-input {
  color: #9ca3af;
}

.legend-marker {
  display: inline-block;
  width: 10px;
  height: 10px;
  border: 1px solid #111827;
  margin-left: 6px;
  vertical-align: middle;
}

.legend-marker.circle {
  border-radius: 50%;
  background: #111827;
}

.legend-marker.square {
  border-radius: 2px;
  background: #111827;
}

.wheel {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 14px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  background: #f8fafc;
}

.wheel canvas {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 14px;
}

.control-block.status {
  align-self: stretch;
}

.right-side {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 14px;
  align-items: stretch;
  align-content: stretch;
  height: 100%;
}

.status-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 100%;
  align-self: stretch;
}

.results-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

@media (max-width: 720px) {
  .hero {
    flex-direction: column;
    align-items: flex-start;
  }
  .actions {
    width: 100%;
  }
  button {
    width: 100%;
    text-align: center;
  }
  .labels {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 1100px) {
  .layout {
    grid-template-columns: 1fr;
  }
  .right-side {
    grid-template-columns: 1fr;
  }
}
