/*
	CSS Reset
	=========
*/

@layer preflight {
	*,
	*::before,
	*::after,
	::backdrop,
	::file-selector-button {
		box-sizing: border-box;
		margin: 0;
		border-width: 0;
		border-style: solid;
		border-color: currentcolor;
		padding: 0;
	}

	:root,
	:host {
		block-size: 100%;
		line-height: 1.5;
		-webkit-text-size-adjust: 100%;
		-webkit-font-smoothing: antialiased;
		-moz-osx-font-smoothing: grayscale;
		tab-size: 4;
		-webkit-tap-highlight-color: transparent;
		hanging-punctuation: first last;
		font-kerning: normal;
		font-optical-sizing: auto;
		font-variant-ligatures: common-ligatures;
		text-wrap: pretty;
		quotes: "\201C" "\201D";
	}

	@media (prefers-reduced-motion: no-preference) {
		:root {
			scroll-behavior: smooth;
		}
	}

	body {
		block-size: 100%;
	}

	h1,
	h2,
	h3,
	h4,
	h5,
	h6 {
		font-size: inherit;
		font-weight: inherit;
		text-wrap: balance;
	}

	p,
	h1,
	h2,
	h3,
	h4,
	h5,
	h6 {
		overflow-wrap: break-word;
	}

	a {
		color: inherit;
		text-decoration: inherit;
	}

	ol,
	ul,
	menu {
		list-style: none;
	}

	/* Add the correct text decoration in Chrome, Edge, and Safari. */
	abbr:where([title]) {
		text-decoration: underline dotted;
	}

	/* Add the correct font weight in Edge and Safari. */
	b,
	strong {
		font-weight: bolder;
	}

	small {
		font-size: 80%;
	}

	code,
	kbd,
	samp,
	pre {
		font-family:
			ui-monospace, "SFMono-Regular", "Menlo", "Monaco", "Consolas", "Liberation Mono",
			"Courier New", monospace;
		font-size: 1em;
	}

	/*
		Correct table border color inheritance and remove text indentation from
		table contents in Chrome and Safari.
		(https://bugs.chromium.org/p/chromium/issues/detail?id=935729)
		(https://bugs.webkit.org/show_bug.cgi?id=195016)
		(https://bugs.chromium.org/p/chromium/issues/detail?id=999088)
		(https://bugs.webkit.org/show_bug.cgi?id=201297)
	*/
	table {
		border-color: inherit;
		border-collapse: collapse;
		text-indent: 0;
	}

	/* Add the correct vertical alignment in Chrome and Firefox. */
	progress {
		vertical-align: baseline;
	}

	/* Add the correct display in Chrome and Safari. */
	summary {
		display: list-item;
	}

	hr {
		block-size: 0;
		color: inherit;
		border-block-start-width: 1px;
	}

	dialog {
		padding: 0;
	}

	textarea {
		resize: vertical;
	}

	/* Form control resets. */
	button,
	input,
	optgroup,
	select,
	textarea,
	::file-selector-button {
		font: inherit;
		color: inherit;
		background: transparent;
	}

	button,
	input:where([type="button"], [type="reset"], [type="submit"]),
	::file-selector-button {
		appearance: button;
	}

	::placeholder {
		opacity: 1;
		color: color-mix(in oklab, currentcolor 50%, transparent);
	}

	/* Correct the inability to style clickable types in iOS and Safari. */
	:-moz-focusring {
		outline: auto;
	}

	/* Remove the inner padding in Chrome and Safari on macOS. */
	::-webkit-search-decoration {
		appearance: none;
	}

	/*
		Ensure date / time inputs have the same height when empty and their text
		alignment can be changed in iOS Safari.
	*/
	::-webkit-date-and-time-value {
		min-block-size: 1lh;
		text-align: inherit;
	}

	/*
		Prevent height from changing on date / time inputs in macOS Safari when the
		input is set to `display: block`.
	*/
	::-webkit-datetime-edit {
		display: inline-flex;
	}

	/*
		Remove excess padding from pseudo-elements in date / time inputs to ensure
		consistent height across browsers.
	*/
	::-webkit-datetime-edit-fields-wrapper {
		padding: 0;
	}
	::-webkit-datetime-edit,
	::-webkit-datetime-edit-year-field,
	::-webkit-datetime-edit-month-field,
	::-webkit-datetime-edit-day-field,
	::-webkit-datetime-edit-hour-field,
	::-webkit-datetime-edit-minute-field,
	::-webkit-datetime-edit-second-field,
	::-webkit-datetime-edit-millisecond-field,
	::-webkit-datetime-edit-meridiem-field {
		padding-block: 0;
	}

	/*
		Remove the additional `:invalid` styles in Firefox.
		(https://github.com/mozilla/gecko-dev/blob/2f9eacd9d3d995c937b4251a5557d95d494c9be1/layout/style/res/forms.css#L728-L737)
	*/
	:-moz-ui-invalid {
		box-shadow: none;
	}

	/* Correct the cursor style of increment and decrement buttons in Safari. */
	::-webkit-inner-spin-button,
	::-webkit-outer-spin-button {
		block-size: auto;
	}

	/* Media elements default to block and responsive. */
	img,
	svg,
	video,
	canvas,
	audio,
	iframe,
	embed,
	object {
		display: block;
		vertical-align: middle;
	}

	img,
	video {
		max-width: 100%;
		height: auto;
	}

	/* Make elements with the HTML hidden attribute stay hidden by default. */
	[hidden]:where(:not([hidden="until-found"])) {
		display: none !important;
	}

	/* Prevent `sub` and `sup` elements from affecting the line height. */
	sub,
	sup {
		position: relative;
		vertical-align: baseline;
		font-size: 75%;
		line-height: 0;
	}
	sub {
		inset-block-end: -0.25em;
	}
	sup {
		inset-block-start: -0.5em;
	}
}
