.litm--sro {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border-width: 0;
}

:where(.litm--checkbox),
.app.litm.litm :where(.litm--checkbox) {
	-webkit-appearance: none;
	flex: none;
	appearance: none;
	background-color: transparent;
	margin: 0;
	font: inherit;
	color: currentColor;
	height: 0.8em;
	width: 0.8em;
	border: 0.1em solid currentColor;
	border-radius: 0.1em;
	transform: translateY(0.025em);
	display: grid;
	place-content: center;
	rotate: 45deg;

	&::after {
		content: "";
		width: 0.36em;
		height: 0.36em;
		scale: 0;
		transition: scale 120ms ease-in-out;
		box-shadow: inset 1em 1em currentColor;
	}

	&.checked::after,
	&:checked::after {
		scale: 1;
	}

	&:is([type="checkbox"]) {
		cursor: pointer;
	}

	&:disabled {
		cursor: auto;
	}
}

:where(.litm--checkbox-with-bg),
.app.litm.litm :where(.litm--checkbox-with-bg) {
	background: url("../assets/media/checkbox.svg") no-repeat;
	height: 1.1em;
	width: 1.1em;
	background-size: contain;
	background-position: center;
	border: none;
	rotate: 0deg;
	position: relative;

	&.checked,
	&:checked {
		background-image: url("../assets/media/checkbox-c.svg");
	}

	&::after {
		display: none;
	}

	&:disabled {
		cursor: auto;
	}
}

:where(.litm--burn),
.app.litm.litm :where(.litm--burn) {
	-webkit-appearance: none;
	flex: none;
	appearance: none;
	margin: 0;
	font: inherit;
	color: currentColor;
	aspect-ratio: 5 / 6;
	height: 1.5em;
	width: unset;
	background: url("../assets/media/burn.svg") no-repeat;
	background-color: inherit;
	background-size: contain;
	background-position: center;

	&.transparent {
		background-image: url("../assets/media/burn-t.svg");
		filter: none;
	}

	&:checked,
	&.checked {
		background-image: url("../assets/media/burn-c.svg");
	}

	&:is([type="checkbox"]) {
		cursor: pointer;
	}

	&:disabled {
		cursor: auto;
	}
}

:where(.litm--activate) {
	flex: none;
	appearance: none;
	margin: 0px;
	padding: 0px;
	border: 1px solid currentColor;
	font: inherit;
	color: currentColor;
	background: white;
	rotate: 45deg;
	border-radius: 0.3em;
	display: grid;
	place-content: center;

	&::before {
		content: "–";
		display: block;
		rotate: -45deg;
		-webkit-text-stroke-width: 0.1em;
	}

	&:checked,
	&.checked {
		background-color: currentColor;

		&::before {
			color: white;
		}
	}

	&:disabled {
		cursor: auto;
	}
}

.litm--accent-bg {
	background: url("/ui/parchment.jpg") repeat;
	background-color: var(--litm-color-accent-bg);
	background-blend-mode: color-burn;
	color: var(--litm-color-accent);
}

:where(.litm--tag),
:where(.litm--status),
:where(.litm--limit),
:where(.litm--powerTag),
:where(.litm--weaknessTag),
:where(.litm--themeTag),
:where(.litm--backpack) {
	padding: 0px 0.4em;
	border-radius: 0.2em;
	white-space: nowrap;
	-webkit-box-decoration-break: clone;
	box-decoration-break: clone;
	color: var(--litm-color-primary);
	font-style: italic;
	font-weight: 400;
	box-shadow: 1px 1px 1px var(--litm-color-weakness-bg);

	&.litm--tag {
		background: var(--litm-color-tag-bg);
	}

	&.litm--status {
		background: var(--litm-color-status-bg);
	}

	&.litm--limit,
	&.litm--weaknessTag {
		background: var(--litm-color-limit-bg);
	}

	&.litm--powerTag,
	&.litm--themeTag,
	&.litm--backpack {
		background: color-mix(in hsl, var(--litm-color-accent-bg) 60%, transparent);
	}
}

:where(.litm--kbd) {
	flex: none;
	padding: 0 4px;
	min-width: 24px;
	background: rgba(255, 255, 255, 0.25);
	border: 1px solid var(--color-border-light-2);
	border-radius: 5px;
	box-shadow: 1px 1px #444;
	text-align: center;
}

:where(.litm--red-leaf) {
	filter: hue-rotate(-25deg);
}

:where(.litm--green-leaf) {
	filter: hue-rotate(45deg);

	/* For some reason filters bug out inputs */
	& + * input {
		filter: hue-rotate(0deg);
	}
}

/* Custom Elements */
litm-toggled-input {
	display: block;
	flex: 1;

	& [role="presentation"]:empty {
		min-width: 100px;
		min-height: 50px;
		background-color: rgb(0, 0, 0, 0.2);
	}
}

/* Custom App */

.litm.litm--new-tag {
	& .window-header {
		background: url(/ui/parchment.jpg) repeat;
		background-color: var(--litm-color-accent-bg);
		background-blend-mode: color-burn;
		color: var(--litm-color-accent);

		& h4 {
			display: inline;
		}
	}
}

.litm--import-actor {
	width: -webkit-fill-available;
}

.litm.litm--confirm-delete {
	outline: 2px solid var(--litm-color);
	outline-offset: -10px;
	padding: 10px;
	border-radius: 0px;

	& .window-header {
		background: url("../assets/media/origin-theme-alt-bg-top.webp") no-repeat
			bottom / cover;
		color: var(--litm-color-accent);
		flex: 0 0 32px;

		& h4 {
			display: inline;
			text-transform: uppercase;
			font-size: var(--font-size-12);
		}
	}

	& .window-content {
		padding: var(--litm-space-3);

		& .dialog-buttons {
			margin-block-start: var(--litm-space-2);
			display: flex;
			justify-content: space-between;
			gap: var(--litm-space-2);
		}

		& button {
			background: var(--litm-color-accent);
			color: var(--litm-color-primary);
			border: 2px solid transparent;
			border-image: url(../assets/media/button-border.webp) 13 / 4;
			border-image-outset: 2px;
			text-transform: uppercase;

			&.yes {
				color: var(--litm-color-accent);
				background-color: var(--litm-color-accent-bg);
			}
		}
	}
}

/* Experimental Features */
@supports (field-sizing: content) {
	[data-size-input] {
		field-sizing: content;
		min-inline-size: 7ch;
		width: unset !important;
	}
}
