.controls-host {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.control {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.control-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.control-label {
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
}

.control-value,
.control-code {
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.control-code {
  overflow: hidden;
  max-width: 62%;
  text-overflow: ellipsis;
}

.control-range {
  width: 100%;
  height: 22px;
  margin: 0;
  background: transparent;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.control-range::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 2px;
  background: var(--surface-3);
}

.control-range::-moz-range-track {
  height: 4px;
  border-radius: 2px;
  background: var(--surface-3);
}

.control-range::-webkit-slider-thumb {
  width: 18px;
  height: 18px;
  margin-top: -7px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
  appearance: none;
  -webkit-appearance: none;
  transition: transform var(--dur-1) var(--ease-out);
}

.control-range::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.control-range:active::-webkit-slider-thumb {
  transform: scale(1.15);
}

.control-select {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-xs);
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
}

.control-toggle-field {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.control-switch {
  position: relative;
  width: 46px;
  height: 28px;
  padding: 3px;
  border: 0;
  border-radius: var(--r-pill);
  background: var(--surface-3);
  transition: background-color var(--dur-2) var(--ease-standard);
}

.control-switch[aria-checked="true"] {
  background: var(--accent);
}

.control-thumb {
  display: block;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.22);
  transition: transform var(--dur-2) var(--ease-overshoot);
}

.control-switch[aria-checked="true"] .control-thumb {
  transform: translateX(18px);
}

.control-bezier-host {
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
}

.control-spring-field .control-label {
  margin-bottom: 4px;
}

.control-subrange {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) 42px;
  align-items: center;
  gap: 10px;
}

.control-sub-label {
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 10.5px;
}

.controls-empty {
  color: var(--ink-3);
  font-size: 13px;
}

/* Bezier editor */
.bezier-editor {
  width: 100%;
}

.bez-svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
  touch-action: none;
}

.bez-bg {
  fill: var(--surface-3);
}

.bez-box {
  fill: var(--surface);
  stroke: var(--line);
}

.bez-grid line {
  stroke: var(--line);
  stroke-dasharray: 3 4;
}

.bez-diagonal {
  stroke: var(--line-strong);
  opacity: 0.7;
}

.bez-curve {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.5;
  stroke-linecap: round;
}

.bez-arm {
  stroke: var(--ink-3);
  stroke-dasharray: 2 3;
  opacity: 0.65;
}

.bez-handle {
  fill: #fff;
  stroke: var(--accent);
  stroke-width: 2;
  cursor: grab;
}

.bez-handle:active {
  cursor: grabbing;
}

.bez-handle:focus-visible {
  outline: none;
  stroke-width: 3;
  filter: drop-shadow(0 0 3px var(--accent));
}

.bez-label {
  fill: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 10px;
  pointer-events: none;
}

/* Code snippets */
.code-shell {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: #161618;
}

.code-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.code-tabs {
  display: flex;
  gap: 2px;
}

.code-tab {
  padding: 5px 10px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: rgba(255, 255, 255, 0.52);
  font-family: var(--font-mono);
  font-size: 10.5px;
}

.code-tab:hover {
  color: #fff;
}

.code-tab.is-active {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.code-copy {
  padding: 5px 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 6px;
  background: none;
  color: rgba(255, 255, 255, 0.7);
  font-size: 11px;
}

.code-copy:hover {
  border-color: rgba(255, 255, 255, 0.3);
  color: #fff;
}

.code-block {
  max-height: 320px;
  margin: 0;
  padding: 14px;
  overflow: auto;
  color: #e6e6eb;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.6;
  tab-size: 2;
}

.code-empty {
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: var(--r-sm);
  color: var(--ink-3);
  font-size: 12.5px;
}

.control-help { color:var(--ink-3); font-size:10.5px; line-height:1.65; margin-top:5px; }
