/* Shared control panel for lab/ prototypes. */
.controls {
  position: fixed;
  right: 1.25rem;
  top: 3.75rem;
  width: 280px;
  max-height: calc(100vh - 5rem);
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid #E8E8E8;
  font-family: 'IBM Plex Mono', ui-monospace, Menlo, monospace;
  font-size: 0.75rem;
  color: #0A0A0A;
  z-index: 100;
  pointer-events: auto;
  overflow-y: auto;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.controls header {
  position: sticky;
  top: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #E8E8E8;
  background: rgba(255, 255, 255, 0.96);
  z-index: 2;
}
.controls h3 {
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #6B6B6B;
  margin: 0;
}
.controls .toggle {
  background: none;
  border: 1px solid #E8E8E8;
  font-family: inherit;
  font-size: 0.75rem;
  color: #6B6B6B;
  padding: 0.125rem 0.5rem;
  cursor: pointer;
  line-height: 1;
  min-width: 28px;
}
.controls .toggle:hover { color: #0A0A0A; border-color: #B8B8B8; }
.controls.collapsed { width: auto; max-height: none; }
.controls.collapsed .panel { display: none; }
.controls.collapsed header { border-bottom: 0; }

.controls .panel {
  padding: 1rem 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}
.controls label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.controls label .row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
}
.controls label .name {
  text-transform: lowercase;
  letter-spacing: 0.04em;
  color: #0A0A0A;
}
.controls label .val {
  color: #6B6B6B;
  font-size: 0.6875rem;
  font-variant-numeric: tabular-nums;
}
.controls input[type=range] {
  width: 100%;
  margin: 0;
  height: 14px;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
}
.controls input[type=range]:focus { outline: none; }
.controls input[type=range]::-webkit-slider-runnable-track {
  height: 1px;
  background: #B8B8B8;
}
.controls input[type=range]::-moz-range-track {
  height: 1px;
  background: #B8B8B8;
}
.controls input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  background: #0A0A0A;
  border-radius: 50%;
  margin-top: -5.5px;
  cursor: pointer;
}
.controls input[type=range]::-moz-range-thumb {
  width: 12px;
  height: 12px;
  background: #0A0A0A;
  border-radius: 50%;
  border: 0;
  cursor: pointer;
}

.controls .actions {
  display: flex;
  gap: 0.5rem;
  padding-top: 0.875rem;
  margin-top: 0.25rem;
  border-top: 1px solid #E8E8E8;
}
.controls .actions button {
  flex: 1;
  background: none;
  border: 1px solid #E8E8E8;
  font-family: inherit;
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #0A0A0A;
  padding: 0.5rem 0.5rem;
  cursor: pointer;
  transition: background 150ms, color 150ms;
}
.controls .actions button:hover { background: #0A0A0A; color: #FFFFFF; }

.controls .config-out {
  margin-top: 0.5rem;
  padding: 0.625rem 0.75rem;
  background: #F2F2F2;
  border: 1px solid #E8E8E8;
  font-size: 0.6875rem;
  line-height: 1.5;
  color: #0A0A0A;
  white-space: pre;
  overflow-x: auto;
  display: none;
}
.controls .config-out.visible { display: block; }

@media (max-width: 720px) {
  .controls {
    right: 0.5rem;
    left: 0.5rem;
    width: auto;
    top: 3.25rem;
    max-height: 50vh;
  }
}
