/* Opaque, validated per-form colors. All text and interactive states use the
 * same checked palette.
 *
 * This file has two parts. The rules up to "Accessibility guarantees" are
 * ordinary styles that site CSS may adjust. The properties the form's
 * accessibility depends on (focus indicator, readable text, visible and
 * clickable controls, boundaries and target sizes) are set once, in the
 * guarantees at the end, where theme CSS cannot quietly undo them. */
.af-wrap {
	--af-background: #ffffff;
	--af-text: #1d2327;
	--af-button: #1d2327;
	--af-button-text: #ffffff;
	--af-border: #737980;
	--af-font-size: 1rem;
	--af-spacing: 24px;
	--af-radius: 4px;
	--af-color-scheme: light;
	font-family: inherit;
	line-height: 1.6;
	padding: clamp(16px, 4vw, 32px);
	border-radius: var(--af-radius);
	margin-block: 1.5rem;
	max-inline-size: 46rem;
	overflow-wrap: anywhere;
	text-align: start;
}
.af-theme-test-note {
	margin-block: 24px;
	padding: 16px;
}
.af-wrap *,
.af-wrap *::before,
.af-wrap *::after {
	box-sizing: border-box;
}
.af-wrap [hidden] {
	display: none !important;
}
.af-wrap :is(input, select, textarea, button, [tabindex], a) {
	scroll-margin-block: 16px;
}
.af-wrap .af-heading {
	color: var(--af-text);
	font-size: 1.5em;
	font-weight: 700;
	line-height: 1.3;
	margin: 0 0 1em;
}
.af-wrap .af-form {
	/* Six equal tracks let fields share a row as halves, thirds or two thirds.
	 * Items stay in source order (no dense packing), so the visual order
	 * always matches the reading and keyboard order. */
	display: grid;
	grid-template-columns: repeat(6, minmax(0, 1fr));
	gap: var(--af-spacing);
	margin: 0;
	padding: 0;
}
.af-wrap .af-form > * {
	grid-column: 1 / -1;
	min-inline-size: 0;
}
.af-wrap .af-field {
	display: flex;
	flex-direction: column;
	gap: 0.4em;
	border: 0;
	margin: 0;
	padding: 0;
	min-inline-size: 0;
}
.af-wrap .af-label,
.af-wrap .af-legend {
	font-weight: 600;
	line-height: 1.4;
	padding: 0;
	margin: 0;
}
.af-wrap .af-req {
	font-weight: 400;
}
.af-wrap .af-help {
	margin: 0;
	line-height: 1.6;
}
/* Conditional-field announcements share the form's text palette. Keep text
 * spacing adjustable by the visitor, like every other form message. */
.af-wrap .af-condition-status {
	line-height: 1.5;
}
.af-wrap .af-condition-status:empty {
	margin: 0;
	padding: 0;
}
.af-wrap :is(input, select, textarea).af-input {
	inline-size: 100%;
	max-inline-size: 100%;
	padding: 0.65em 0.75em;
	margin: 0;
	font-family: inherit;
	font-weight: inherit;
	line-height: inherit;
	border-radius: var(--af-radius);
	box-shadow: none;
}
.af-wrap textarea.af-input {
	resize: vertical;
}
.af-wrap .af-input::placeholder {
	color: var(--af-text);
	opacity: 1;
}
.af-wrap .af-choice {
	display: flex;
	align-items: center;
	gap: 0.6em;
	min-block-size: 44px;
}
.af-wrap .af-choice__input {
	place-content: center;
	flex: none;
	font: inherit;
	border-radius: min(4px, var(--af-radius));
	box-shadow: none;
	cursor: pointer;
}
.af-wrap .af-choice__input[type='radio'] {
	border-radius: 50%;
}
.af-wrap .af-choice__input:checked::before {
	content: '';
	display: block;
	box-sizing: border-box;
}
.af-wrap .af-choice__input[type='checkbox']:checked::before {
	width: 0.4em;
	height: 0.7em;
	border: solid var(--af-button-text);
	border-width: 0 2px 2px 0;
	transform: translateY(-0.08em) rotate(45deg);
}
.af-wrap .af-choice__input[type='radio']:checked::before {
	width: 0.6em;
	height: 0.6em;
	border-radius: 50%;
	background: var(--af-button-text);
}
.af-wrap .af-choice__label {
	align-items: center;
	flex-wrap: wrap;
	gap: 0.3em;
	font-weight: 400;
	line-height: 1.4;
}
/* A shape cue (bar + icon) in the checked text color marks invalid fields,
 * so errors stand out without introducing an unchecked color. */
.af-wrap .af-field--error {
	border-inline-start: 4px solid var(--af-text);
	padding-inline-start: 0.85em;
}
.af-wrap .af-error {
	margin: 0;
	font-weight: 700;
}
.af-wrap .af-error::before,
.af-wrap .af-summary__heading::before {
	content: '';
	display: inline-block;
	inline-size: 1.05em;
	block-size: 1.05em;
	margin-inline-end: 0.4em;
	vertical-align: -0.15em;
	background: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M10 1a9 9 0 1 0 0 18 9 9 0 0 0 0-18Zm-1 4h2v7H9V5Zm0 8h2v2H9v-2Z'/%3E%3C/svg%3E")
		center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M10 1a9 9 0 1 0 0 18 9 9 0 0 0 0-18Zm-1 4h2v7H9V5Zm0 8h2v2H9v-2Z'/%3E%3C/svg%3E")
		center / contain no-repeat;
}
@media (forced-colors: active) {
	.af-wrap .af-error::before,
	.af-wrap .af-summary__heading::before {
		forced-color-adjust: none;
		background: CanvasText;
	}
}
.af-wrap .af-summary,
.af-wrap .af-status,
.af-wrap .af-network-error,
.af-wrap .af-unavailable {
	border: 2px solid var(--af-text);
	border-radius: var(--af-radius);
	padding: 1em;
	margin: 0 0 1.5em;
}
.af-wrap .af-summary {
	border-inline-start-width: 6px;
}
.af-wrap .af-summary__heading {
	margin: 0 0 0.5em;
	padding: 0;
	/* A real heading element, styled as part of the form rather than the page. */
	font-family: inherit;
	font-weight: 700;
	line-height: 1.3;
}
.af-wrap .af-summary__list {
	margin: 0;
	padding-inline-start: 1.2em;
}
.af-wrap .af-summary__list a {
	font-weight: 700;
}
.af-wrap .af-status,
.af-wrap .af-unavailable {
	font-weight: 600;
}
.af-wrap .af-network-error,
.af-wrap .af-unavailable {
	margin: 0;
}
.af-wrap .af-another {
	margin: 0;
}
.af-wrap .af-another a {
	font-weight: 600;
}
.af-wrap button.af-submit {
	font-family: inherit;
	font-weight: 600;
	line-height: inherit;
	border-radius: var(--af-radius);
	padding: 0.65em 1.25em;
	margin: 0;
	cursor: pointer;
	box-shadow: none;
	text-shadow: none;
	filter: none;
	opacity: 1;
}
.af-wrap button.af-submit:hover {
	text-decoration: underline;
}
/* Submissions are disabled in the form preview. */
.af-wrap button.af-submit:disabled {
	cursor: not-allowed;
}
/* While sending, the button reads "Sending…", is dimmed and shows a progress
 * ring, so the busy state never relies on colour alone. */
.af-wrap button.af-submit[aria-disabled='true'] {
	cursor: progress;
	opacity: 0.8;
	text-decoration: none;
}
.af-wrap button.af-submit[aria-disabled='true']::after {
	content: '';
	display: inline-block;
	inline-size: 0.9em;
	block-size: 0.9em;
	margin-inline-start: 0.5em;
	vertical-align: -0.1em;
	border: 2px solid currentColor;
	border-inline-end-color: transparent;
	border-radius: 50%;
	animation: af-spin 0.8s linear infinite;
}
@keyframes af-spin {
	to {
		transform: rotate(360deg);
	}
}
.af-wrap .af-submit-status {
	align-self: center;
}
/* An empty live region stays in the accessibility tree but takes no space. */
.af-wrap .af-submit-status:empty {
	position: absolute;
}
@media (prefers-reduced-motion: reduce) {
	.af-wrap * {
		transition: none !important;
		animation: none !important;
	}
	/* A still, dotted ring keeps the busy cue without movement. */
	.af-wrap button.af-submit[aria-disabled='true']::after {
		animation: none;
		border-style: dotted;
	}
}
@media (forced-colors: active) {
	.af-wrap .af-choice__input:checked::before {
		display: none;
	}
	.af-wrap button.af-submit[aria-disabled='true'] {
		opacity: 1;
		border-style: dashed;
	}
}
.af-wrap accessible-forms-altcha {
	--altcha-color-base: var(--af-background);
	--altcha-color-base-content: var(--af-text);
	--altcha-color-primary: var(--af-button);
	--altcha-color-primary-content: var(--af-button-text);
	--altcha-color-neutral: var(--af-border);
	--altcha-color-neutral-content: var(--af-text);
	--altcha-color-error: var(--af-text);
	--altcha-color-success: var(--af-text);
	--altcha-color-error-content: var(--af-background);
	--altcha-color-success-content: var(--af-background);
	--altcha-checkbox-border-color: var(--af-border);
	--altcha-border-color: var(--af-border);
	--altcha-checkbox-outline-color: var(--af-text);
	--altcha-border-radius: var(--af-radius);
	--altcha-max-width: 100%;
	display: block;
	font: inherit;
}
.af-verification > .af-help {
	margin-top: 8px;
}
.af-wrap accessible-forms-altcha .altcha-footer {
	opacity: 1;
}
.af-wrap accessible-forms-altcha a,
.af-wrap accessible-forms-altcha a:visited {
	color: var(--af-text);
	text-decoration: underline;
}

.af-wrap.af-width-narrow {
	max-width: 30rem;
}
.af-wrap.af-width-comfortable {
	max-width: 44rem;
}
.af-wrap.af-width-full {
	max-width: 100%;
}
.af-wrap .af-field-container {
	min-width: 0;
}
.af-wrap .af-section-heading {
	font: inherit;
	font-weight: 700;
	font-size: 1.2em;
	margin-block: 1.5em 0.5em;
	color: var(--af-text);
}
.af-wrap .af-actions {
	display: flex;
	gap: 12px;
	flex-wrap: wrap;
}
.af-wrap button.af-send-another {
	border-radius: var(--af-radius);
	padding: 0.65em 1em;
	font-family: inherit;
	line-height: inherit;
	cursor: pointer;
}
.af-wrap.af-button-center .af-actions {
	justify-content: center;
}
.af-wrap.af-button-end .af-actions {
	justify-content: flex-end;
}
.af-wrap.af-button-full .af-submit {
	width: 100%;
}
.af-wrap .af-client-summary {
	margin-block: 16px;
}
.af-standalone {
	margin: 0;
	padding: 32px 20px;
	color: #1d2327;
	background: #f6f7f7;
	font-family: system-ui, sans-serif;
}
.af-standalone main {
	max-width: 760px;
	margin: auto;
}
.af-standalone h1 {
	font-size: 1.5rem;
	line-height: 1.3;
}

.af-wrap .af-previous {
	border: 1px solid var(--af-border);
	border-radius: var(--af-radius);
	padding: 0 16px;
	margin: 20px 0;
}
.af-wrap .af-previous > summary {
	display: flex;
	align-items: center;
	min-height: 48px;
	list-style: none;
	cursor: pointer;
	font-weight: 600;
	padding: 12px 0;
	gap: 16px;
}
.af-wrap .af-previous > summary::-webkit-details-marker {
	display: none;
}
.af-wrap .af-previous > summary::after {
	content: '';
	width: 7px;
	height: 7px;
	flex: 0 0 7px;
	margin-inline-start: auto;
	border: solid currentColor;
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
}
.af-wrap .af-previous[open] > summary::after {
	transform: rotate(225deg);
}
.af-wrap .af-previous[open] > summary {
	border-bottom: 1px solid var(--af-border);
}

/* ------------------------------------------------------------------ Layout */

/* Fields respond to the width of the form itself, not the screen, so a
 * two-column form in a narrow sidebar still stacks. */
.af-wrap {
	container: af-form / inline-size;
}
.af-wrap .af-form > .af-col-half {
	grid-column: span 3;
}
.af-wrap .af-form > .af-col-third {
	grid-column: span 2;
}
.af-wrap .af-form > .af-col-two-thirds {
	grid-column: span 4;
}
@container af-form (max-width: 34rem) {
	.af-wrap .af-form > .af-field-container {
		grid-column: 1 / -1;
	}
}
/* Browsers without container queries fall back to one column on small screens. */
@supports not (container-type: inline-size) {
	@media (max-width: 40rem) {
		.af-wrap .af-form > .af-field-container {
			grid-column: 1 / -1;
		}
	}
}
/* Side-by-side fields align their tops, so a longer label or help text on one
 * field never pushes its neighbour's input out of line with the label. */
.af-wrap .af-form > .af-field-container {
	align-self: start;
}

/* The label and the control of a field each come in their own wrapper, so
 * content filters such as wpautop() cannot split them into paragraphs. The
 * wrappers take no box (display: contents, set in the guarantees), so the
 * label and control lay out as direct children of the field. */

/* Labels beside fields: a label column on wide forms, stacked on narrow ones.
 * Choice groups and consent keep their legend or label above the options. */
.af-wrap .af-field-container {
	container: af-field / inline-size;
}
@container af-field (min-width: 30rem) {
	.af-labels-beside .af-field:not(.af-field--radio):not(.af-field--checkbox):not(.af-field--consent) {
		display: grid;
		grid-template-columns: minmax(8rem, 32%) minmax(0, 1fr);
		column-gap: 1.25em;
		row-gap: 0.4em;
		align-items: start;
	}
	.af-labels-beside .af-field:not(.af-field--radio):not(.af-field--checkbox):not(.af-field--consent) > *,
	.af-labels-beside .af-field:not(.af-field--radio):not(.af-field--checkbox):not(.af-field--consent) > .af-field__control > * {
		grid-column: 2;
	}
	.af-labels-beside .af-field:not(.af-field--radio):not(.af-field--checkbox):not(.af-field--consent) .af-label {
		grid-column: 1;
		grid-row: 1 / span 6;
		/* Line the label up with the first line of text inside the control. */
		padding-block-start: calc(0.65em + 1px);
	}
}

/* Floating labels: a real, always-visible <label> inside the field's top edge.
 * It rests at full size in an empty field and rises when the field has focus,
 * a value or an autofilled value. Its measured height reserves space even
 * when the label wraps or the visitor changes text spacing. Without that
 * enhancement, it has its own row above the control. */
.af-labels-floating .af-field:is(.af-field--text, .af-field--email, .af-field--tel, .af-field--url, .af-field--number, .af-field--textarea, .af-field--select, .af-field--date, .af-field--time) {
	display: grid;
	grid-template-areas: 'error' 'label' 'control' 'help';
	grid-template-columns: minmax(0, 1fr);
	row-gap: 0.4em;
}
.af-labels-floating .af-field:is(.af-field--text, .af-field--email, .af-field--tel, .af-field--url, .af-field--number, .af-field--textarea, .af-field--select, .af-field--date, .af-field--time) .af-label {
	grid-area: label;
	align-self: start;
	z-index: 1;
	margin: 0;
	line-height: 1.3;
	transform-origin: 0 0;
	transition: transform 0.15s ease, font-size 0.15s ease;
}
.af-labels-floating .af-field.af-floating-ready {
	grid-template-areas: 'error' 'control' 'help';
}
.af-labels-floating .af-field.af-floating-ready .af-label {
	grid-area: control;
	margin: 0.35em 0.75em 0;
}
.af-labels-floating .af-field:is(.af-field--text, .af-field--email, .af-field--tel, .af-field--url, .af-field--number, .af-field--textarea, .af-field--select, .af-field--date, .af-field--time) .af-input {
	grid-area: control;
}
.af-labels-floating .af-field .af-error {
	grid-area: error;
}
.af-labels-floating .af-field .af-help {
	grid-area: help;
}
/* Resting state: only once form.js has marked the field empty, and only when
 * it has no focus and no autofilled value. */
.af-labels-floating .af-field.af-floating-ready:has(.af-input.af-empty):not(:has(.af-input:focus)):not(:has(.af-input:autofill)) .af-label {
	transform: translateY(0.8em);
}
.af-labels-floating .af-field--textarea.af-floating-ready:has(.af-input.af-empty):not(:has(.af-input:focus)):not(:has(.af-input:autofill)) .af-label {
	transform: translateY(0.45em);
}
@media (forced-colors: active) {
	.af-labels-floating .af-field .af-label {
		forced-color-adjust: auto;
	}
}

/* Block alignment: in a wide or full-width block, an "Available width" form
 * fills the space and narrower forms stay centred. */
.wp-block-accessible-forms-form:is(.alignwide, .alignfull) > .af-wrap {
	margin-inline: auto;
}
.wp-block-accessible-forms-form.alignfull > .af-wrap.af-width-full {
	border-radius: 0;
}

/* ------------------------------------------------- Accessibility guarantees
 *
 * Theme, page-builder and site CSS loads after this file and often restyles
 * every input, label or button on the page. The rules below hold the
 * properties the form's accessibility depends on. Everything above stays
 * open to ordinary theming, and fonts, spacing and colours chosen in the
 * Style step always apply because they arrive as --af-* custom properties.
 *
 * - Scope: ".af-wrap:not(#af-guard)" matches every form. The :not(#id)
 *   carries one ID's worth of specificity, so ordinary theme rules, including
 *   ones scoped to #content or #page, cannot outrank these. No cascade
 *   layers: unlayered theme CSS would beat any layered rule.
 * - !important is used only for the focus indicator, for keeping real
 *   controls visible and clickable, and for floors (minimum text and target
 *   size). Floors use max(), so larger Style step sizes still apply.
 * - Colours, borders and display are not !important. A site that overrides
 *   them with !important on purpose keeps that choice; the plugin's live
 *   check reports it when it breaks contrast or boundaries.
 * - Line height, letter spacing and word spacing are never !important, so a
 *   visitor's own text-spacing overrides (WCAG 1.4.12) always win.
 * - Visibility and pointer events are inherited, never forced on, so a
 *   theme that hides or disables a whole panel containing the form still
 *   can; only rules aimed at the form's own elements are undone. */

.af-wrap:not(#af-guard) {
	/* Text floors: body and control text, and small text (help, required, errors). */
	--af-min-text: max(16px, var(--af-font-size));
	--af-min-small: max(14px, calc(0.875 * var(--af-font-size)));
	background-color: var(--af-background);
	color: var(--af-text);
	font-size: max(16px, var(--af-font-size));
	text-transform: none;
	letter-spacing: normal;
	word-spacing: normal;
}
/* Reflow (WCAG 1.4.10): a theme's "form { min-width: 480px }" must not force
   sideways scrolling at 320px or 400% zoom. The form always fits its column. */
.af-wrap:not(#af-guard),
.af-wrap:not(#af-guard) :is(form, .af-form, .af-field-container, .af-field, fieldset) {
	min-width: 0 !important;
	max-width: 100%;
}
/* Links inside the form (the no-JavaScript link, help text links) use the
   form's checked text colour, not the page's link colour, which may be chosen
   for a different background. */
.af-wrap:not(#af-guard) :is(.af-noscript, .af-help, .af-status, .af-another) a {
	color: var(--af-text);
	text-decoration: underline;
}
/* Case and tracking come from the form, not from "form *" rules in a theme. */
.af-wrap:not(#af-guard) * {
	text-transform: inherit;
	letter-spacing: inherit;
	word-spacing: inherit;
}

/* Structure: never collapsed, clipped, shrunk or painted over. */
.af-wrap:not(#af-guard) :is(.af-form, .af-field-container, .af-field, .af-choice, .af-actions, .af-another, .af-summary__list, .af-summary__list li) {
	visibility: inherit;
	pointer-events: inherit;
	opacity: 1;
	block-size: auto;
	max-block-size: none;
	overflow: visible;
	font-size: inherit;
	background: none;
}
.af-wrap:not(#af-guard) :is(.af-field__label, .af-field__control) {
	display: contents;
	visibility: inherit;
	pointer-events: inherit;
}

/* Text that must stay visible and readable. */
.af-wrap:not(#af-guard) :is(.af-label, .af-legend, .af-req, .af-help, .af-error, .af-error__prefix, .af-reselect, .af-summary, .af-summary__heading, .af-summary__message, .af-summary__list a, .af-status, .af-another a, .af-network-error, .af-unavailable, .af-choice__label, .af-step-status, .af-draft-status, .af-review, .af-review-heading, .af-review-list, .af-review-value, .af-review-row dt) {
	visibility: inherit;
	opacity: 1;
	position: static;
	clip: auto;
	clip-path: none;
	inline-size: auto;
	block-size: auto;
	max-block-size: none;
	overflow: visible;
	text-indent: 0;
	white-space: normal;
	text-transform: inherit;
	letter-spacing: inherit;
	word-spacing: inherit;
	color: var(--af-text);
}
.af-wrap:not(#af-guard) :is(.af-label, .af-legend, .af-help, .af-error, .af-reselect, .af-summary, .af-summary__heading, .af-summary__message, .af-status, .af-network-error, .af-unavailable, .af-step-status, .af-draft-status) {
	display: block;
}
.af-wrap:not(#af-guard) :is(.af-req, .af-error__prefix) {
	display: inline;
}
.af-wrap:not(#af-guard) .af-choice__label {
	display: flex;
	min-block-size: 44px !important;
	pointer-events: inherit !important;
}
/* Messages sit on the form background; other text has none of its own. */
.af-wrap:not(#af-guard) :is(.af-summary, .af-status, .af-network-error, .af-unavailable) {
	background-color: var(--af-background);
	background-image: none;
}
.af-wrap:not(#af-guard) :is(.af-label, .af-legend, .af-req, .af-help, .af-error, .af-error__prefix, .af-reselect, .af-summary__heading, .af-summary__message, .af-summary__list a, .af-another a, .af-choice__label, .af-step-status, .af-draft-status) {
	background: none;
}
.af-wrap:not(#af-guard) :is(.af-summary__list a, .af-another a) {
	text-decoration: underline;
}
/* A theme's "custom checkbox" draws a fake box in the label; the form
 * already shows the real one. */
.af-wrap:not(#af-guard) .af-choice__label::before,
.af-wrap:not(#af-guard) .af-choice__label::after {
	content: none;
}

/* Minimum text sizes. The plugin's own size wins when it is larger. */
.af-wrap:not(#af-guard) :is(.af-label, .af-legend, .af-choice__label, .af-status, .af-network-error, .af-unavailable, .af-summary, .af-summary__message, .af-summary__list a, .af-another a, .af-step-status, .af-draft-status) {
	font-size: max(var(--af-min-text), 1em) !important;
}
.af-wrap:not(#af-guard) .af-summary__heading {
	font-size: max(var(--af-min-text), 1.1em) !important;
}
.af-wrap:not(#af-guard) :is(.af-help, .af-req) {
	font-size: max(var(--af-min-small), 0.875em) !important;
}
.af-wrap:not(#af-guard) :is(.af-error, .af-reselect) {
	font-size: max(var(--af-min-small), 0.95em) !important;
}
.af-wrap:not(#af-guard) .af-error__prefix {
	font-size: inherit !important;
}
.af-wrap:not(#af-guard) .af-submit-status {
	font-size: max(var(--af-min-small), 0.875em) !important;
	color: var(--af-text);
	opacity: 1;
}
.af-wrap:not(#af-guard) .af-condition-status {
	font-size: max(var(--af-min-text), 1em) !important;
}
/* A raised floating label is smaller by design, never below 12px; its
 * "(required)" matches it. At rest it is full size. */
.af-wrap:not(#af-guard).af-labels-floating .af-field:is(.af-field--text, .af-field--email, .af-field--tel, .af-field--url, .af-field--number, .af-field--textarea, .af-field--select, .af-field--date, .af-field--time) .af-label {
	font-size: max(12px, 0.8em) !important;
	pointer-events: none;
}
.af-wrap:not(#af-guard).af-labels-floating .af-field:is(.af-field--text, .af-field--email, .af-field--tel, .af-field--url, .af-field--number, .af-field--textarea, .af-field--select, .af-field--date, .af-field--time) .af-label .af-req {
	font-size: 1em !important;
}
.af-wrap:not(#af-guard).af-labels-floating .af-field.af-floating-ready:has(.af-input.af-empty):not(:has(.af-input:focus)):not(:has(.af-input:autofill)) .af-label {
	font-size: max(var(--af-min-text), 1em) !important;
}
/* Measured label height includes wrapped lines; no fixed-height text slot. */
.af-wrap:not(#af-guard).af-labels-floating .af-field.af-floating-ready .af-input {
	padding-block: max(1.7em, var(--af-floating-space, 1.7em)) 0.45em;
}

/* Fields: visible, bounded, readable and at least 44px tall. */
.af-wrap:not(#af-guard) .af-input {
	display: block;
	visibility: inherit;
	opacity: 1;
	position: static;
	clip-path: none;
	block-size: auto;
	color: var(--af-text);
	/* Match native calendar/clock icons and picker UI to this form's surface. */
	color-scheme: var(--af-color-scheme, light);
	background-color: var(--af-background);
	background-image: none;
	border-style: solid;
	border-width: 1px;
	border-color: var(--af-border);
	text-indent: 0;
	text-transform: inherit;
	letter-spacing: inherit;
	word-spacing: inherit;
	font-size: max(var(--af-min-text), 1em) !important;
	min-block-size: 44px !important;
	pointer-events: inherit !important;
}
/* Menus draw their own arrow. WebKit ignores padding and height on a native
   menu, which left it 25px tall and let a floating label cover the chosen
   value; without the native look every engine lays it out like a text field.
   The arrow is two gradients in the text colour, so it follows the palette. */
.af-wrap:not(#af-guard) select.af-input {
	-webkit-appearance: none !important;
	appearance: none !important;
	padding-inline-end: 2.5em;
	background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
	background-position: calc(100% - 1.25em) 50%, calc(100% - 0.9em) 50%;
	background-size: 0.35em 0.35em, 0.35em 0.35em;
	background-repeat: no-repeat;
}
.af-wrap:not(#af-guard)[dir='rtl'] select.af-input,
[dir='rtl'] .af-wrap:not(#af-guard) select.af-input {
	background-position: 0.9em 50%, 1.25em 50%;
}
@media (forced-colors: active) {
	/* The system draws the menu and its arrow in the user's colours. */
	.af-wrap:not(#af-guard) select.af-input {
		-webkit-appearance: auto !important;
		appearance: auto !important;
		background-image: none;
	}
}
.af-wrap:not(#af-guard) textarea.af-input {
	min-block-size: max(44px, 8em) !important;
}
/* Errors use words and a heavier border, never color alone. */
.af-wrap:not(#af-guard) .af-field--error .af-input {
	border-width: 2px;
	border-color: var(--af-text);
}

/* Radios and checkboxes: always the real, visible control, at least 24px. */
.af-wrap:not(#af-guard) .af-choice__input {
	appearance: none;
	-webkit-appearance: none;
	display: grid;
	inline-size: max(24px, 1.4em);
	block-size: max(24px, 1.4em);
	margin: 0;
	border: 2px solid var(--af-border);
	background-color: var(--af-background);
	background-image: none;
	opacity: 1 !important;
	visibility: inherit !important;
	position: static !important;
	clip-path: none !important;
	min-inline-size: 24px !important;
	min-block-size: 24px !important;
	pointer-events: inherit !important;
}
.af-wrap:not(#af-guard) .af-choice__input:checked {
	background-color: var(--af-button);
	border-color: var(--af-button);
}

/* Buttons: readable, bounded and at least 44px in both directions. */
.af-wrap:not(#af-guard) :is(button.af-submit, button.af-step-back, button.af-step-next, button.af-review-edit, button.af-send-another, .af-save-progress button) {
	visibility: inherit;
	position: static;
	clip-path: none;
	block-size: auto;
	overflow: visible;
	white-space: normal;
	text-indent: 0;
	text-transform: inherit;
	letter-spacing: inherit;
	word-spacing: inherit;
	border-style: solid;
	border-width: 2px;
	background-image: none;
	font-size: max(var(--af-min-text), 1em) !important;
	min-block-size: 44px !important;
	min-inline-size: 44px !important;
	pointer-events: inherit !important;
}
.af-wrap:not(#af-guard) button.af-submit {
	color: var(--af-button-text);
	background-color: var(--af-button);
	border-color: var(--af-button);
}
.af-wrap:not(#af-guard) :is(button.af-step-back, button.af-step-next, button.af-review-edit, button.af-send-another, .af-save-progress button) {
	color: var(--af-text);
	background-color: var(--af-background);
	border-color: var(--af-border);
}

/* Keyboard focus is always visible: a 3px ring in the checked text colour,
 * outside the control. Messages that receive focus from script (and so
 * carry no live-region role) show it too. Fields you type into, and radio
 * buttons, show it on any focus: WebKit does not match :focus-visible for date
 * and time fields reached with the keyboard, nor for radio buttons reached with
 * the arrow keys. */
.af-wrap:not(#af-guard) :focus-visible,
.af-wrap:not(#af-guard) :is(input:not([type='checkbox'], [type='button'], [type='submit'], [type='reset'], [type='file']), select, textarea):focus,
.af-wrap:not(#af-guard) :is(.af-summary, .af-status, .af-network-error, .af-step-status, .af-review-heading):focus {
	outline-style: solid !important;
	outline-width: 3px !important;
	outline-color: var(--af-text) !important;
	outline-offset: 3px !important;
}

/* The spam check's own checkbox: its Safari-only focus rule sets a width but no
   colour, which falls back to a pale system ring (1.85:1 on white). */
.af-wrap:not(#af-guard) accessible-forms-altcha .altcha-checkbox input:focus {
	outline-style: solid !important;
	outline-width: 3px !important;
	outline-color: var(--af-text) !important;
	outline-offset: 2px !important;
}

@media (forced-colors: active) {
	.af-wrap:not(#af-guard) accessible-forms-altcha .altcha-checkbox input:focus {
		outline-color: Highlight !important;
	}
	.af-wrap:not(#af-guard) {
		background-color: Canvas;
		color: CanvasText;
	}
	.af-wrap:not(#af-guard) :focus-visible,
	.af-wrap:not(#af-guard) :is(input:not([type='checkbox'], [type='button'], [type='submit'], [type='reset'], [type='file']), select, textarea):focus,
	.af-wrap:not(#af-guard) :is(.af-summary, .af-status, .af-network-error, .af-step-status, .af-review-heading):focus {
		outline-color: Highlight !important;
	}
	.af-wrap:not(#af-guard) .af-choice__input {
		appearance: auto;
		-webkit-appearance: auto;
	}
	.af-wrap:not(#af-guard) :is(button.af-submit, button.af-step-back, button.af-step-next, button.af-review-edit, button.af-send-another, .af-save-progress button) {
		border-color: ButtonText;
	}
	/* In forced colours every field needs a boundary, even when a theme strips
	   borders with !important; this is the only way to see where a field is. */
	.af-wrap:not(#af-guard) .af-input {
		border: 1px solid CanvasText !important;
		/* Let the browser choose the user's forced palette instead. */
		color-scheme: light dark;
	}
	.af-wrap:not(#af-guard) :is(.af-noscript, .af-help, .af-status, .af-another) a {
		color: LinkText;
	}
	.af-wrap:not(#af-guard) button.af-submit[aria-disabled='true'] {
		border-style: dashed;
	}
}
