div.#{$prefix}--#{$charts-prefix}--legend {
	display: flex;
	user-select: none;
	-webkit-flex-wrap: wrap;
	flex-wrap: wrap;

	&[data-name='legend-items'] {
		width: 100%;
		margin: -5px;
	}

	div.legend-item {
		display: flex;
		align-items: center;
		margin: 5px;

		div.checkbox {
			width: 13px;
			height: 13px;
			margin-right: 4px;
			border-radius: 2px;
			border: solid 1px $ui-background;
			box-shadow: 0 0 0 2px transparent;

			@media (forced-colors: active) {
				forced-color-adjust: none;
			}

			&:not(.active) {
				border-color: $text-02;
				background: $ui-background;
			}

			svg {
				display: none;
				vertical-align: text-top;
				fill: $ui-background;
				stroke: $ui-background;
			}
		}

		&.additional {
			svg.icon {
				margin-right: 4px;
			}
		}

		p {
			font-size: 12px;
			fill: $text-02;
			line-height: 1rem;
		}
	}

	&.center-aligned {
		justify-content: center;
	}

	&.right-aligned {
		justify-content: flex-end;
	}

	&.has-deactivated-items {
		div.legend-item {
			div.checkbox {
				svg {
					display: block;
				}
			}
		}
	}

	&.vertical {
		margin: -5px;
		flex-direction: column;

		div.legend-item {
			margin-right: 0;
			margin-bottom: 10px;
		}
	}

	&.clickable div.legend-item:not(.additional):hover {
		cursor: pointer;

		div.checkbox {
			border: solid 1px $ui-background;
			box-shadow: 0 0 0 2px $carbon--blue-60;

			&:not(.active) {
				border-color: $text-02;
			}
		}
	}
}
