/* How can we help?'s prompt with the engine picker on its right edge (Ian,
   Nov 16). STOPGAP: Eddie has no icon-only radio group or a field with a
   trailing control, so this composes one from Eddie tokens. Delete it when
   Eddie ships either. Tokens only. */

/* The column lines up with the bottom of the textarea: ed-textarea-field
   still shows its label above the box (hideLabel lands with Eddie 0.75,
   eddie-design-system#2716), and the empty-prompt error is its own note
   under the row, so the field's bottom is the box's bottom. */
.hcwh-prompt {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	align-items: end;
}

/* The column reads as part of the box: the form's own background and border,
   with no border between them. */
.hcwh-engines {
	display: flex;
	flex-direction: column;
	gap: var(--ed-theme-spacing-xs);
	margin: 0;
	padding: var(--ed-theme-spacing-xs);
	border: var(--ed-theme-border-width-sm) solid var(--ed-theme-form-color-border-default);
	border-inline-start: 0;
	border-start-end-radius: var(--ed-theme-form-border-radius);
	border-end-end-radius: var(--ed-theme-form-border-radius);
	background: var(--ed-theme-form-color-background-default);
}

.hcwh-engine {
	position: relative;
	display: grid;
	place-items: center;
	inline-size: var(--ed-theme-spacing-xl);
	block-size: var(--ed-theme-spacing-xl);
	border-radius: var(--ed-theme-form-border-radius);
	color: var(--ed-theme-form-color-content-subtle);
	cursor: pointer;
}

/* The real radio covers the label, invisible, so clicks, keys and screen
   readers all work on it. */
.hcwh-engine input {
	position: absolute;
	inset: 0;
	margin: 0;
	opacity: 0;
	cursor: pointer;
}

.hcwh-engine:hover {
	color: var(--ed-theme-form-color-content-default);
}

.hcwh-engine:has(input:checked) {
	background: var(--ed-theme-button-primary-color-background-default);
	color: var(--ed-theme-button-primary-color-content-default);
}

.hcwh-engine:has(input:focus-visible) {
	outline: var(--ed-theme-border-width-lg) solid var(--ed-theme-focus-ring-color-border-knockout);
	outline-offset: var(--ed-theme-border-width-sm);
}

.hcwh-engine ed-icon,
.hcwh-engine img {
	pointer-events: none;
}

/* The real radio is clickable; the tooltip isn't part of it. */
.hcwh-engine input {
	z-index: 0;
}

/* Each icon's name and description, beside it on hover and focus (Ian,
   Nov 16): ed-tooltip leaves showing and placing it to the page. To the
   left of the column, over the prompt; hovering the tooltip keeps it open,
   and Escape closes it (convince.js). */
.hcwh-engine__tip {
	position: absolute;
	inset-inline-end: calc(100% + var(--ed-theme-spacing-sm));
	inset-block-start: 50%;
	transform: translateY(-50%);
	z-index: 1;
	display: none;
	cursor: default;
}

.hcwh-engine:hover .hcwh-engine__tip,
.hcwh-engine:has(input:focus) .hcwh-engine__tip {
	display: block;
}

/* More specific than the :has(input:focus) rule above, so Escape wins. */
.hcwh-engines.hcwh-engines--quiet .hcwh-engine .hcwh-engine__tip {
	display: none;
}
