form {
  // Only apply when editing a node or taxonomy-term.
  &[class*="node-form"],
  &[id^="taxonomy-term"] {
    .form-checkboxes,
    .form-radios {
      &:not(.views-ui-dialog) {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        grid-gap: 5px;

        .form-item {
          margin-bottom: 0;
        }

        .field--widget-options-pretty & {
          display: block;
        }
      }
    }
  }
}
