/**
 * Assessment Toolkit styles.
 *
 * Everything is scoped under .atk-root and prefixed .atk-, because this lands
 * inside somebody else's theme. The block below re-establishes the few
 * properties themes most often set globally, so the tool looks the same
 * wherever it is dropped.
 */

.atk-root {
	--atk-fg: #1c1f24;
	--atk-fg-soft: #5a6270;
	--atk-bg: #ffffff;
	--atk-bg-soft: #f5f6f8;
	--atk-line: #dfe3e9;
	--atk-accent: #2f5d8c;
	--atk-accent-soft: #e8eef5;
	--atk-warn-bg: #fdf6e3;
	--atk-warn-line: #e6cf8f;
	--atk-danger: #97341f;
	--atk-radius: 10px;
	--atk-gap: 1.25rem;

	box-sizing: border-box;
	max-width: 46rem;
	margin: 0 auto;
	padding: 0;
	color: var(--atk-fg);
	background: var(--atk-bg);
	font-family: inherit;
	font-size: 1rem;
	line-height: 1.55;
	text-align: left;
	-webkit-text-size-adjust: 100%;
}

.atk-root,
.atk-root :where(*, *::before, *::after) {
	box-sizing: border-box;
}

/**
 * Defensive reset.
 *
 * Themes set these properties globally with a heavy hand — floated legends,
 * uppercased headings, 4px borders on every input, padding on every paragraph.
 * :where() holds this rule at the same specificity as a single class, so it
 * beats the bare element selectors a theme uses while still losing to every
 * component rule below it. Without that, this reset would out-specify the very
 * styles it exists to protect.
 */
.atk-root :where(
	p, h1, h2, h3, h4, h5, h6,
	ol, ul, li, dl, dt, dd,
	form, fieldset, legend, label, button, input, select, textarea,
	table, caption, thead, tbody, tr, th, td,
	div, span, a, svg, figure, details, summary,
	article, section, aside, header, footer
) {
	margin: 0;
	padding: 0;
	border: 0;
	float: none;
	clear: none;
	background: none;
	color: inherit;
	font-family: inherit;
	font-size: inherit;
	font-style: inherit;
	font-weight: inherit;
	line-height: inherit;
	letter-spacing: normal;
	text-align: left;
	text-indent: 0;
	text-transform: none;
	white-space: normal;
	list-style: none;
}

/* A floated legend is the single most destructive thing a theme does to a
   form: it pushes every following field into a narrow column beside it. */
.atk-root :where(legend) {
	width: auto;
	max-width: 100%;
}

.atk-root :where(svg) {
	max-width: none;
}

.atk-root p + p {
	margin-top: 0.75em;
}

.atk-root a {
	color: var(--atk-accent);
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 2px;
}

/* --- Typography ----------------------------------------------------------- */

.atk-header {
	margin-bottom: var(--atk-gap);
}

.atk-title {
	font-size: 1.6rem;
	line-height: 1.25;
	font-weight: 650;
	letter-spacing: -0.01em;
}

.atk-title:focus {
	outline: none;
}

.atk-title:focus-visible {
	outline: 2px solid var(--atk-accent);
	outline-offset: 4px;
}

.atk-title--section {
	font-size: 1.4rem;
}

.atk-subtitle {
	margin-top: 0.4rem;
	color: var(--atk-fg-soft);
}

.atk-h2 {
	margin-top: 1.5rem;
	margin-bottom: 0.5rem;
	font-size: 1.15rem;
	font-weight: 650;
}

.atk-h3 {
	margin-bottom: 0.75rem;
	font-size: 1.1rem;
	font-weight: 650;
}

.atk-view {
	padding: 0.25rem 0 2rem;
}

.atk-section {
	margin-top: 2rem;
}

.atk-footnote {
	margin-top: 2rem;
	color: var(--atk-fg-soft);
	font-size: 0.85rem;
}

/* --- Notes and callouts --------------------------------------------------- */

.atk-note {
	margin-top: var(--atk-gap);
	padding: 1rem 1.1rem;
	border: 1px solid var(--atk-line);
	border-radius: var(--atk-radius);
	background: var(--atk-bg-soft);
}

.atk-note__heading {
	margin-bottom: 0.35rem;
	font-size: 1rem;
	font-weight: 650;
}

.atk-note--privacy {
	border-color: var(--atk-accent);
	background: var(--atk-accent-soft);
}

.atk-note--warning {
	border-color: var(--atk-warn-line);
	background: var(--atk-warn-bg);
}

.atk-note--flag {
	border-left: 4px solid var(--atk-accent);
}

.atk-note__links {
	margin-top: 0.6rem;
}

.atk-note__links li + li {
	margin-top: 0.25rem;
}

/* --- Progress ------------------------------------------------------------- */

.atk-progress {
	margin-bottom: 1.5rem;
}

.atk-progress__label {
	display: flex;
	justify-content: space-between;
	gap: 1rem;
	margin-bottom: 0.4rem;
	color: var(--atk-fg-soft);
	font-size: 0.85rem;
}

.atk-progress__track {
	height: 6px;
	border-radius: 999px;
	background: var(--atk-bg-soft);
	overflow: hidden;
}

.atk-progress__fill {
	height: 100%;
	background: var(--atk-accent);
	transition: width 0.25s ease;
}

/* --- Questions ------------------------------------------------------------ */

.atk-question {
	display: block;
	padding: 1rem 0;
	border-bottom: 1px solid var(--atk-line);
}

.atk-question__legend {
	display: flex;
	gap: 0.6rem;
	width: 100%;
	margin-bottom: 0.7rem;
	font-weight: 500;
}

.atk-question__number {
	flex: none;
	min-width: 1.5rem;
	color: var(--atk-fg-soft);
	font-variant-numeric: tabular-nums;
}

.atk-question__help {
	margin: -0.4rem 0 0.7rem 2.1rem;
	color: var(--atk-fg-soft);
	font-size: 0.88rem;
}

.atk-options {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-left: 2.1rem;
}

.atk-option__input {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	border: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
}

.atk-option__label {
	display: inline-block;
	min-width: 5.5rem;
	min-height: 2.75rem;
	padding: 0.6rem 1rem;
	border: 1px solid var(--atk-line);
	border-radius: var(--atk-radius);
	background: var(--atk-bg);
	color: inherit;
	font-size: 0.95rem;
	line-height: 1.5;
	text-align: center;
	cursor: pointer;
	transition: background 0.12s ease, border-color 0.12s ease;
}

.atk-option__label:hover {
	border-color: var(--atk-accent);
}

.atk-option__input:checked + .atk-option__label {
	border-color: var(--atk-accent);
	background: var(--atk-accent);
	color: #fff;
	font-weight: 550;
}

.atk-option__input:focus-visible + .atk-option__label {
	outline: 2px solid var(--atk-accent);
	outline-offset: 2px;
}

/* --- Free text and selects ------------------------------------------------ */

.atk-context {
	margin-top: 1.25rem;
}

.atk-context__label {
	display: block;
	margin-bottom: 0.4rem;
	font-weight: 500;
}

.atk-textarea,
.atk-select {
	display: block;
	width: 100%;
	max-width: 100%;
	min-height: 2.75rem;
	padding: 0.55rem 0.7rem;
	border: 1px solid var(--atk-line);
	border-radius: var(--atk-radius);
	background: var(--atk-bg);
	color: inherit;
	font: inherit;
	font-size: 1rem; /* Stops iOS zooming on focus. */
}

.atk-textarea:focus-visible,
.atk-select:focus-visible {
	outline: 2px solid var(--atk-accent);
	outline-offset: 1px;
}

.atk-textarea {
	resize: vertical;
}

/* --- Buttons -------------------------------------------------------------- */

.atk-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	margin-top: 1.75rem;
}

.atk-actions--nav {
	justify-content: space-between;
}

.atk-button {
	min-height: 2.9rem;
	padding: 0.65rem 1.25rem;
	border: 1px solid transparent;
	border-radius: var(--atk-radius);
	font: inherit;
	font-size: 1rem;
	font-weight: 550;
	line-height: 1.4;
	text-align: center;
	cursor: pointer;
	transition: background 0.12s ease, border-color 0.12s ease;
}

.atk-button:focus-visible {
	outline: 2px solid var(--atk-accent);
	outline-offset: 2px;
}

.atk-button--primary {
	border-color: var(--atk-accent);
	background: var(--atk-accent);
	color: #fff;
}

.atk-button--primary:hover {
	background: #24486c;
}

.atk-button--ghost {
	border-color: var(--atk-line);
	background: var(--atk-bg);
	color: var(--atk-fg);
}

.atk-button--ghost:hover {
	border-color: var(--atk-accent);
}

.atk-button--danger {
	border-color: var(--atk-danger);
	background: var(--atk-bg);
	color: var(--atk-danger);
}

.atk-button--danger:hover {
	background: var(--atk-danger);
	color: #fff;
}

/* --- Charts --------------------------------------------------------------- */

.atk-charts {
	padding: 1.25rem;
	border: 1px solid var(--atk-line);
	border-radius: var(--atk-radius);
}

.atk-radar {
	display: block;
	width: 100%;
	max-width: 30rem;
	height: auto;
	margin: 0 auto 1.5rem;
	overflow: visible;
}

.atk-radar__ring,
.atk-radar__spoke {
	fill: none;
	stroke: var(--atk-line);
	stroke-width: 1;
}

.atk-radar__ring {
	fill: var(--atk-bg-soft);
	fill-opacity: 0.45;
}

.atk-radar__shape {
	fill: var(--atk-accent);
	fill-opacity: 0.24;
	stroke: var(--atk-accent);
	stroke-width: 2;
	stroke-linejoin: round;
}

.atk-radar__dot {
	fill: var(--atk-accent);
}

.atk-radar__label {
	fill: var(--atk-fg);
	font-size: 13px;
	font-weight: 550;
}

.atk-radar__label-value {
	fill: var(--atk-fg-soft);
	font-weight: 400;
}

.atk-bars {
	margin-top: 0.5rem;
}

.atk-bar + .atk-bar {
	margin-top: 0.9rem;
}

.atk-bar__head {
	display: flex;
	align-items: baseline;
	gap: 0.6rem;
	margin-bottom: 0.3rem;
}

.atk-bar__rank {
	min-width: 1.4rem;
	color: var(--atk-fg-soft);
	font-variant-numeric: tabular-nums;
}

.atk-bar__name {
	flex: 1 1 auto;
	font-weight: 550;
}

.atk-bar__value {
	font-variant-numeric: tabular-nums;
}

.atk-bar__track {
	height: 12px;
	border-radius: 999px;
	background: var(--atk-bg-soft);
	overflow: hidden;
}

.atk-bar__fill {
	height: 100%;
	border-radius: 999px;
	background: var(--atk-accent);
}

.atk-details {
	margin-top: 1.5rem;
}

.atk-details > summary {
	cursor: pointer;
	font-weight: 550;
}

.atk-table {
	width: 100%;
	margin-top: 0.75rem;
	border-collapse: collapse;
	font-size: 0.92rem;
}

.atk-table caption {
	margin-bottom: 0.5rem;
	color: var(--atk-fg-soft);
	text-align: left;
}

.atk-table th,
.atk-table td {
	padding: 0.45rem 0.6rem;
	border-bottom: 1px solid var(--atk-line);
	text-align: left;
}

.atk-table tbody th {
	font-weight: 550;
}

.atk-table thead th {
	color: var(--atk-fg-soft);
	font-size: 0.85rem;
	font-weight: 550;
}

/* --- Results detail ------------------------------------------------------- */

.atk-domain {
	padding: 1.1rem 0;
	border-bottom: 1px solid var(--atk-line);
}

.atk-domain__heading {
	display: flex;
	align-items: baseline;
	gap: 0.6rem;
	margin-bottom: 0.5rem;
	font-size: 1.05rem;
	font-weight: 650;
}

.atk-domain__rank {
	min-width: 1.4rem;
	color: var(--atk-fg-soft);
	font-variant-numeric: tabular-nums;
}

.atk-domain__score {
	margin-left: auto;
	color: var(--atk-accent);
	font-variant-numeric: tabular-nums;
}

.atk-domain__skipped {
	margin-top: 0.5rem;
	color: var(--atk-fg-soft);
	font-size: 0.88rem;
}

/* --- Tailored results ---------------------------------------------------- */

.atk-summary {
	padding: 1rem 1.1rem;
	border: 1px solid var(--atk-line);
	border-left: 3px solid var(--atk-accent);
	border-radius: var(--atk-radius);
	background: var(--atk-bg-soft);
}

.atk-summary__heading {
	margin-bottom: 0.4rem;
}

.atk-endorsed {
	margin-top: 0.75rem;
}

.atk-endorsed__heading {
	margin-bottom: 0.4rem;
	color: var(--atk-fg-soft);
	font-size: 0.9rem;
	font-weight: 650;
}

.atk-endorsed__list {
	margin: 0;
	padding-left: 1.1rem;
	list-style: disc;
}

.atk-endorsed__item {
	margin-bottom: 0.2rem;
	font-size: 0.94rem;
}

.atk-endorsed__more,
.atk-endorsed__none {
	margin-top: 0.45rem;
	color: var(--atk-fg-soft);
	font-size: 0.88rem;
}

.atk-context-note {
	margin-top: 0.75rem;
	padding: 0.7rem 0.9rem;
	border-radius: var(--atk-radius);
	background: var(--atk-accent-soft);
	font-size: 0.94rem;
}

.atk-context-note p:last-child {
	margin-bottom: 0;
}

.atk-note-item + .atk-note-item {
	margin-top: 1rem;
}

.atk-note-item__label {
	margin-bottom: 0.25rem;
	color: var(--atk-fg-soft);
	font-size: 0.85rem;
	font-weight: 550;
}

.atk-note-item__value {
	padding-left: 0.85rem;
	border-left: 3px solid var(--atk-line);
	white-space: pre-wrap;
}

/* --- Small screens -------------------------------------------------------- */

@media (max-width: 30rem) {
	.atk-options {
		margin-left: 0;
	}

	.atk-option {
		flex: 1 1 auto;
	}

	.atk-option__label {
		display: block;
		min-width: 0;
		padding: 0.6rem 0.5rem;
	}

	.atk-question__help {
		margin-left: 0;
	}

	.atk-actions--nav .atk-button {
		flex: 1 1 100%;
	}

	.atk-charts {
		padding: 1rem 0.75rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	.atk-root * {
		transition: none !important;
	}
}
