.demo {
  display: grid;
  gap: 0.75rem;
  font: 0.875rem system-ui, sans-serif;
}

.option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.check {
  appearance: none;
  flex: none;
  inline-size: 1.25rem;
  block-size: 1.25rem;
  margin: 0;
  background-color: white;
  border: 2px solid gray;
  border-radius: 0.375rem;
  transition: background-color 0.15s, border-color 0.15s;
}

.check:checked {
  background-color: seagreen;
  background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2016%2016%27%3E%3Cpath%20d%3D%27M3.5%208.5l3%203%206-7%27%20fill%3D%27none%27%20stroke%3D%27white%27%20stroke-width%3D%272.2%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%2F%3E%3C%2Fsvg%3E");
  background-size: 100%;
  border-color: seagreen;
}

.check:disabled {
  background-color: gainsboro;
  border-color: silver;
}

.check:focus-visible,
.switch:focus-visible {
  outline: 2px solid seagreen;
  outline-offset: 2px;
}

.switch {
  appearance: none;
  flex: none;
  inline-size: 2.5rem;
  block-size: 1.5rem;
  margin: 0;
  background-color: silver;
  background-image: radial-gradient(circle, white 0.5rem, transparent calc(0.5rem + 1px));
  background-position: left center;
  background-repeat: no-repeat;
  background-size: 1.5rem 1.5rem;
  border-radius: 0.75rem;
  transition: background-color 0.2s, background-position 0.2s;
}

.switch:checked {
  background-color: seagreen;
  background-position: right center;
}