/*
 * Tailwind v4's preflight, scoped to the app root.
 *
 * It is Tailwind's own reset (tailwindcss/preflight.css) with two changes:
 * every selector is nested under `#mailpuff-root`, and the `html` rules apply
 * to the root itself. It is deliberately NOT in a cascade layer: wp-admin's
 * element rules (`p`, `a`, `h1`, `input[type=text]`…) are unlayered, and
 * only an unlayered rule with higher specificity beats them inside the app.
 *
 * The font-family lives with the brand tokens in theme.css.
 */
#mailpuff-root {
	/* Tailwind v4 sets buttons to the default cursor; a support tool is
	   clicked all day, so everything pressable gets the hand. */
	button:not(:disabled),
	[role="button"]:not([aria-disabled="true"]),
	summary {
		cursor: pointer;
	}

	box-sizing: border-box;
	line-height: 1.5;
	-webkit-text-size-adjust: 100%;
	tab-size: 4;
	-webkit-tap-highlight-color: transparent;

	/* 1. Padding and border don't affect element width. 2. No default
	   margins or padding. 3. Borders reset to 0 solid, so `border-*` width
	   utilities work on their own. */
	*,
	::after,
	::before,
	::backdrop,
	::file-selector-button {
		box-sizing: border-box;
		margin: 0;
		padding: 0;
		border: 0 solid;
	}

	hr {
		height: 0;
		color: inherit;
		border-top-width: 1px;
	}

	abbr:where([title]) {
		-webkit-text-decoration: underline dotted;
		text-decoration: underline dotted;
	}

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

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

	b,
	strong {
		font-weight: bolder;
	}

	code,
	kbd,
	samp,
	pre {
		font-family: var(--font-mono);
		font-feature-settings: normal;
		font-variation-settings: normal;
		font-size: 1em;
	}

	small {
		font-size: 80%;
	}

	sub,
	sup {
		font-size: 75%;
		line-height: 0;
		position: relative;
		vertical-align: baseline;
	}

	sub {
		bottom: -0.25em;
	}

	sup {
		top: -0.5em;
	}

	table {
		text-indent: 0;
		border-color: inherit;
		border-collapse: collapse;
	}

	:-moz-focusring:where(:not(iframe)) {
		outline: auto;
	}

	progress {
		vertical-align: baseline;
	}

	summary {
		display: list-item;
	}

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

	img,
	svg,
	video,
	canvas,
	audio,
	iframe,
	embed,
	object {
		display: block;
		vertical-align: middle;
	}

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

	/* Form controls inherit the app's type and lose the UA chrome. */
	button,
	input,
	select,
	optgroup,
	textarea,
	::file-selector-button {
		font: inherit;
		font-feature-settings: inherit;
		font-variation-settings: inherit;
		letter-spacing: inherit;
		color: inherit;
		border-radius: 0;
		background-color: transparent;
		opacity: 1;
	}

	:where(select:is([multiple], [size])) optgroup {
		font-weight: bolder;
	}

	:where(select:is([multiple], [size])) optgroup option {
		padding-inline-start: 20px;
	}

	::file-selector-button {
		margin-inline-end: 4px;
	}

	::placeholder {
		opacity: 1;
	}

	@supports (not (-webkit-appearance: -apple-pay-button)) or
		(contain-intrinsic-size: 1px) {
		::placeholder {
			color: color-mix(in oklab, currentcolor 50%, transparent);
		}
	}

	textarea {
		resize: vertical;
	}

	::-webkit-search-decoration {
		-webkit-appearance: none;
	}

	::-webkit-date-and-time-value {
		min-height: 1lh;
		text-align: inherit;
	}

	::-webkit-datetime-edit {
		display: inline-flex;
	}

	::-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;
	}

	::-webkit-calendar-picker-indicator {
		line-height: 1;
	}

	:-moz-ui-invalid {
		box-shadow: none;
	}

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

	::-webkit-inner-spin-button,
	::-webkit-outer-spin-button {
		height: auto;
	}

	[hidden]:where(:not([hidden='until-found'])) {
		display: none !important;
	}
}
