/* Deliberately light: inherits the theme's type and colours via currentColor. */
.svp-survey {
	margin: 2rem 0;
	padding: 1.25rem;
	border: 1px solid #2d99e7;
	background-color: #fafdff;
	border-radius: 4px;
}

.svp-survey__title {
	margin-top: 0;
	margin-bottom: 1.5rem;
}

.svp-survey__notice {
	margin: 0 0 1rem;
}

.svp-survey__choices {
	border: 0;
	margin: 0 0 1rem;
	padding: 0;
	min-width: 0;
}

.svp-survey__option {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	margin-bottom: 0.5rem;
	cursor: pointer;
}

/* Image surveys: a grid of image choices */
.svp-survey--image .svp-survey__choices {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
	gap: 1rem;
}

.svp-survey--image .svp-survey__option {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 0.5rem;
	text-align: center;
	margin: 0;
	padding: 0.5rem;
	border: 2px solid transparent;
	border-radius: 6px;
	background: #ffffff;
	transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.svp-survey--image .svp-survey__option:hover {
	border-color: #bdd3e3;
}

/* Selected state: border, tint and a tick, so selection doesn't rely on colour alone */
.svp-survey--image .svp-survey__option:has(input:checked) {
	border-color: #2d99e7;
	background: #e8f4fd;
	box-shadow: 0 0.25rem 0 #003d69;
}

.svp-survey--image .svp-survey__option:has(input:checked)::after {
	content: "\2713";
	position: absolute;
	top: 1rem;
	right: 1rem;
	display: grid;
	place-items: center;
	width: 2rem;
	height: 2rem;
	border-radius: 50%;
	background: #2d99e7;
	color: #ffffff;
	font-size: 1.1rem;
	font-weight: 700;
	line-height: 1;
}

.svp-survey--image .svp-survey__option:has(input:checked) .svp-survey__label {
	font-weight: 600;
}

/* Keyboard focus, since the radio itself is hidden */
.svp-survey--image .svp-survey__option:has(input:focus-visible) {
	outline: 3px solid #003d69;
	outline-offset: 3px;
}

/* Visually hidden but still focusable and announced */
.svp-survey__radio--hidden {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

.svp-survey__image img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 1;
	object-fit: cover;
	border-radius: 4px;
}

/* Signed-out preview: visible but not interactive */
.svp-survey__form.is-preview .svp-survey__option {
	cursor: default;
	opacity: 0.6;
}

.svp-survey--image .svp-survey__form.is-preview .svp-survey__option:hover {
	border-color: transparent;
}

.svp-survey .signin-gate {
	margin-top: 1rem;
}

.svp-survey__error {
	margin-top: 0.75rem;
	color: #b32d2e;
}

.svp-survey__results-wrap:focus {
	outline: none;
}

.svp-survey__results {
	list-style: none;
	margin: 0;
	padding: 0;
}

.svp-survey__result {
	display: grid;
	grid-template-columns: 1fr auto;
	align-items: center;
	gap: 0.25rem 0.75rem;
	margin-bottom: 0.75rem;
}

.svp-survey--image .svp-survey__result {
	grid-template-columns: auto 1fr auto;
}

.svp-survey__thumb img {
	display: block;
	width: 3rem;
	height: 3rem;
	object-fit: cover;
	border-radius: 4px;
}

.svp-survey__percent {
	font-variant-numeric: tabular-nums;
}

.svp-survey__bar {
	grid-column: 1 / -1;
	display: block;
	height: 0.5rem;
	border-radius: 999px;
	background: rgba(127, 127, 127, 0.2);
	overflow: hidden;
}

.svp-survey__bar > span {
	display: block;
	height: 100%;
	background: #2d99e7;
}

/* Administrator-only statistics on the single survey page */
.svp-admin-stats {
	margin: 0 0 2rem;
	padding: 1rem 1.25rem;
	border: 2px dashed #bdd3e3;
	border-radius: 4px;
	font-size: 0.95rem;
}

.svp-admin-stats__heading {
	margin-bottom: 0.75rem;
	font-weight: 700;
}

.svp-admin-stats__list {
	list-style: none;
	margin: 0 0 0.75rem;
	padding: 0;
}

.svp-admin-stats__list li {
	display: flex;
	justify-content: space-between;
	gap: 1rem;
	padding: 0.35rem 0;
	border-bottom: 1px solid #bdd3e3;
}

.svp-admin-stats__count {
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.svp-admin-stats__note {
	font-size: 0.85rem;
	color: #555;
}
