/* Switch, Range, Field */
.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  min-height: 56px;
  padding: var(--space-2) 0;
  cursor: pointer;
}
.switch-row.is-disabled {
  cursor: not-allowed;
  opacity: 0.5;
}
.switch-row__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.switch-row__label {
  font-weight: var(--weight-semibold);
}
.switch-row__desc {
  color: var(--text-3);
  font-size: var(--text-sm);
}
.switch {
  appearance: none;
  position: relative;
  flex: none;
  width: 52px;
  height: 32px;
  margin: 0;
  border-radius: var(--radius-pill);
  background: var(--ink-400);
  box-shadow: inset 0 0 0 1px var(--line-3);
  cursor: inherit;
  transition: background var(--dur-base) var(--ease-out);
}
.switch::after {
  content: '';
  position: absolute;
  top: 4px;
  left: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--text-2);
  box-shadow: 0 2px 4px rgb(0 0 0 / 0.4);
  transition:
    transform var(--dur-base) var(--ease-spring),
    background var(--dur-base) var(--ease-out);
}
.switch:checked {
  background: var(--volt-400);
  box-shadow: none;
}
.switch:checked::after {
  transform: translateX(20px);
  background: var(--on-volt);
}
.switch:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 3px;
  border-radius: var(--radius-pill);
}

.range {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.range.is-disabled {
  opacity: 0.5;
}
.range__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}
.range__label {
  font-weight: var(--weight-semibold);
}
.range__value {
  font-size: 20px;
  color: var(--volt-300);
}
.range__input {
  --fraction: 0.5;
  appearance: none;
  width: 100%;
  height: var(--touch);
  margin: 0;
  background: transparent;
  cursor: pointer;
}
.range__input:disabled {
  cursor: not-allowed;
}
.range__input::-webkit-slider-runnable-track {
  height: 8px;
  border-radius: var(--radius-pill);
  background: linear-gradient(
    90deg,
    var(--volt-400) calc(var(--fraction) * 100%),
    var(--ink-400) calc(var(--fraction) * 100%)
  );
}
.range__input::-moz-range-track {
  height: 8px;
  border-radius: var(--radius-pill);
  background: var(--ink-400);
}
.range__input::-moz-range-progress {
  height: 8px;
  border-radius: var(--radius-pill);
  background: var(--volt-400);
}
.range__input::-webkit-slider-thumb {
  appearance: none;
  width: 26px;
  height: 26px;
  margin-top: -9px;
  border-radius: 50%;
  background: var(--text-1);
  border: 0;
  box-shadow:
    0 0 0 4px rgb(205 245 69 / 0.25),
    0 2px 6px rgb(0 0 0 / 0.5);
}
.range__input::-moz-range-thumb {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--text-1);
  border: 0;
  box-shadow:
    0 0 0 4px rgb(205 245 69 / 0.25),
    0 2px 6px rgb(0 0 0 / 0.5);
}
.range__input:focus-visible {
  outline: none;
}
.range__input:focus-visible::-webkit-slider-thumb {
  box-shadow:
    0 0 0 3px var(--bg),
    0 0 0 5px var(--focus-ring);
}
.range__input:focus-visible::-moz-range-thumb {
  box-shadow:
    0 0 0 3px var(--bg),
    0 0 0 5px var(--focus-ring);
}

.field {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.field__label {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--text-2);
}
.field__hint {
  color: var(--text-3);
  font-size: var(--text-xs);
}
.field select,
.field input[type='text'],
.field input[type='search'] {
  min-height: var(--touch);
  padding: 0 var(--space-3);
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-3);
  background: var(--surface-1);
  color: var(--text-1);
}
