.legend-lesson-extensions {
	max-width: 920px;
	margin: 0 auto 56px;
	padding: 0 24px;
}

.legend-lesson-content > .legend-lesson-extensions {
	width: 100%;
	max-width: none;
	margin: 34px 0 0;
	padding: 0;
}

.legend-lesson-content > .legend-lesson-extensions > :first-child {
	margin-top: 0;
}

.legend-lesson-content > .legend-lesson-extensions + .legend-notes {
	margin-top: 28px;
}

.legend-lesson-outcome,
.legend-lesson-resources,
.legend-assessment {
	margin-top: 22px;
	padding: 24px;
	border: 1px solid var(--legend-line, #dfe4ee);
	border-radius: 16px;
	background: #fff;
}

.legend-lesson-outcome {
	border-left: 5px solid var(--legend-primary, #3157d5);
	background: #f6f8ff;
}

.legend-lesson-outcome p,
.legend-assessment header p {
	margin-bottom: 0;
}

.legend-lesson-resources ul {
	display: grid;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.legend-lesson-resources a {
	display: flex;
	justify-content: space-between;
	padding: 11px 13px;
	border-radius: 9px;
	background: #f6f8fb;
	font-weight: 700;
	text-decoration: none;
}

.legend-assessment header > span {
	color: var(--legend-primary, #3157d5);
	font-size: 11px;
	font-weight: 900;
	letter-spacing: .08em;
	text-transform: uppercase;
}

.legend-assessment fieldset {
	display: grid;
	gap: 9px;
	margin: 20px 0;
	padding: 18px;
	border: 1px solid #e5e9f1;
	border-radius: 12px;
}

.legend-assessment legend {
	padding: 0 6px;
	font-weight: 800;
}

.legend-assessment fieldset label {
	display: flex;
	gap: 9px;
	align-items: flex-start;
	padding: 10px;
	border: 1px solid transparent;
	border-radius: 8px;
	background: #f8f9fc;
	cursor: pointer;
	transition: border-color .18s ease, background-color .18s ease;
}

.legend-assessment fieldset label:hover {
	background: #f1f5ff;
}

.legend-assessment fieldset label:has(input:checked) {
	border-color: color-mix(in srgb, var(--legend-primary, #3157d5) 42%, #fff);
	background: color-mix(in srgb, var(--legend-primary, #3157d5) 8%, #fff);
}

.legend-assessment input[type="radio"],
.legend-assessment input[type="checkbox"] {
	width: 18px;
	height: 18px;
	min-height: 18px;
	flex: 0 0 18px;
	margin: 2px 0 0;
	padding: 0;
	accent-color: var(--legend-primary, #3157d5);
}

.legend-assessment input[type="radio"]:focus-visible,
.legend-assessment input[type="checkbox"]:focus-visible {
	outline: 2px solid color-mix(in srgb, var(--legend-primary, #3157d5) 52%, transparent);
	outline-offset: 2px;
}

.legend-assessment input[type="text"],
.legend-assessment textarea {
	width: 100%;
	padding: 11px;
	border: 1px solid #cfd6e4;
	border-radius: 9px;
}

.legend-assessment-result {
	margin-top: 13px;
	font-weight: 800;
}

.legend-assessment-result.is-success {
	padding: 11px 13px;
	border-radius: 9px;
	background: #eaf8ef;
	color: #176738;
}

.legend-assessment-result.is-error {
	padding: 11px 13px;
	border-radius: 9px;
	background: #fff0f0;
	color: #a32222;
}

.legend-assessment button[disabled] {
	opacity: .68;
	box-shadow: none;
	cursor: not-allowed;
	transform: none;
}

.legend-quiz [hidden] {
	display: none !important;
}

.legend-quiz {
	position: relative;
	overflow: hidden;
	padding: 30px;
	background:
		radial-gradient(circle at 100% 0, color-mix(in srgb, var(--legend-primary, #3157d5) 10%, transparent), transparent 38%),
		#fff;
}

.legend-quiz-overview > header h2 {
	margin: 7px 0 4px;
}

.legend-quiz-overview > header p,
.legend-quiz-overview .legend-assessment__intro {
	color: #59667d;
}

.legend-quiz-meta {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 10px;
	margin: 24px 0;
}

.legend-quiz-meta > span {
	display: grid;
	gap: 2px;
	padding: 14px 16px;
	border: 1px solid #e4e9f3;
	border-radius: 12px;
	background: rgba(248, 250, 255, .88);
	color: #657187;
	font-size: 12px;
	font-weight: 700;
}

.legend-quiz-meta strong {
	color: #172235;
	font-size: 20px;
	line-height: 1.1;
}

.legend-quiz-start {
	min-width: 160px;
	justify-content: center;
}

.legend-quiz-runner__header {
	display: grid;
	gap: 12px;
	margin-bottom: 24px;
}

.legend-quiz-runner__header > div:first-child {
	display: flex;
	justify-content: space-between;
	gap: 18px;
	color: #5f6c82;
	font-size: 13px;
}

.legend-quiz-runner__header strong {
	color: var(--legend-primary, #3157d5);
}

.legend-quiz-progress {
	height: 8px;
	overflow: hidden;
	border-radius: 999px;
	background: #e9edf5;
}

.legend-quiz-progress > span {
	display: block;
	height: 100%;
	border-radius: inherit;
	background: linear-gradient(90deg, var(--legend-primary, #3157d5), #6d87ec);
	transition: width .24s ease;
}

.legend-quiz-runner fieldset {
	min-height: 300px;
	align-content: start;
	gap: 11px;
	margin: 0 0 22px;
	padding: 26px;
	border-color: #dde4f0;
	background: rgba(255, 255, 255, .9);
}

.legend-quiz-runner fieldset:focus {
	outline: none;
}

.legend-quiz-runner legend {
	display: grid;
	gap: 8px;
	max-width: 94%;
	padding: 0 8px;
	font-size: 20px;
	line-height: 1.35;
}

.legend-quiz-runner legend > span {
	color: var(--legend-primary, #3157d5);
	font-size: 11px;
	font-weight: 900;
	letter-spacing: .08em;
	text-transform: uppercase;
}

.legend-quiz-runner fieldset label {
	align-items: center;
	min-height: 50px;
	padding: 13px 14px;
	border-color: #edf0f6;
	background: #f8faff;
}

.legend-quiz-navigation {
	display: grid;
	grid-template-columns: minmax(130px, auto) 1fr minmax(160px, auto);
	align-items: center;
	gap: 14px;
}

.legend-quiz-navigation > span {
	grid-column: 2;
	color: #6b7588;
	font-size: 13px;
	font-weight: 800;
	text-align: center;
}

.legend-quiz-navigation [data-legend-quiz-previous] {
	grid-column: 1;
}

.legend-quiz-navigation [data-legend-quiz-next],
.legend-quiz-navigation [data-legend-quiz-submit] {
	grid-column: 3;
}

.legend-quiz-results {
	display: grid;
	justify-items: center;
	padding: 30px 20px 12px;
	text-align: center;
}

.legend-quiz-results:focus {
	outline: none;
}

.legend-quiz-results__score,
.legend-quiz-results__icon {
	display: grid;
	place-content: center;
	width: 112px;
	height: 112px;
	margin-bottom: 22px;
	border-radius: 50%;
}

.legend-quiz-results__score {
	position: relative;
	background: conic-gradient(var(--legend-primary, #3157d5) calc(var(--legend-quiz-score, 0) * 1%), #e8edf6 0);
}

.legend-quiz-results__score::before {
	position: absolute;
	inset: 8px;
	border-radius: inherit;
	background: #fff;
	content: '';
}

.legend-quiz-results__score strong,
.legend-quiz-results__score span {
	position: relative;
	z-index: 1;
}

.legend-quiz-results__score strong {
	font-size: 25px;
	line-height: 1;
}

.legend-quiz-results__score span {
	margin-top: 4px;
	color: #6a7589;
	font-size: 11px;
	font-weight: 700;
}

.legend-quiz-results__icon {
	background: #e9f8ef;
	color: #16834b;
	font-size: 42px;
	font-weight: 900;
}

.legend-quiz-results.is-success .legend-quiz-results__score {
	background: conic-gradient(#20a465 calc(var(--legend-quiz-score, 0) * 1%), #e7f3ec 0);
}

.legend-quiz-results.is-error .legend-quiz-results__score {
	background: conic-gradient(#e3a128 calc(var(--legend-quiz-score, 0) * 1%), #f5eee2 0);
}

.legend-quiz-results h3 {
	margin: 8px 0 6px;
	font-size: 26px;
}

.legend-quiz-results > p {
	max-width: 520px;
	margin: 0;
	color: #5f6a7e;
}

.legend-quiz-results__actions {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 10px;
	margin-top: 24px;
}

.legend-quiz-answer-review {
	width: min(100%, 680px);
	margin-top: 26px;
	border: 1px solid #d9e1ee;
	border-radius: 14px;
	background: #fff;
	color: #172033;
	text-align: left;
	overflow: hidden;
}

.legend-quiz-answer-review > summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 18px;
	padding: 17px 19px;
	cursor: pointer;
	font-weight: 800;
	list-style: none;
}

.legend-quiz-answer-review > summary::-webkit-details-marker,
.legend-quiz-review__item > summary::-webkit-details-marker { display: none; }

.legend-quiz-answer-review > summary::after {
	color: #61708a;
	content: '+';
	font-size: 22px;
	line-height: 1;
}

.legend-quiz-answer-review[open] > summary::after { content: '−'; }

.legend-quiz-answer-review > summary strong {
	margin-left: auto;
	color: #65718a;
	font-size: 13px;
}

.legend-quiz-review-list {
	display: grid;
	gap: 10px;
	padding: 0 14px 14px;
}

.legend-quiz-review__item {
	border: 1px solid #e0e6ef;
	border-left: 4px solid #d98b22;
	border-radius: 10px;
	background: #fbfcfe;
	overflow: hidden;
}

.legend-quiz-review__item.is-correct { border-left-color: #1d9a5e; }

.legend-quiz-review__item > summary {
	display: grid;
	grid-template-columns: 28px 1fr auto;
	align-items: center;
	gap: 8px;
	padding: 13px 14px;
	cursor: pointer;
	list-style: none;
}

.legend-quiz-review__item > summary > span {
	display: grid;
	place-items: center;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	background: #fff1db;
	color: #a65c00;
	font-weight: 900;
}

.legend-quiz-review__item.is-correct > summary > span {
	background: #e5f7ed;
	color: #147847;
}

.legend-quiz-review__item > summary em {
	color: #a65c00;
	font-size: 12px;
	font-style: normal;
	font-weight: 800;
}

.legend-quiz-review__item.is-correct > summary em { color: #147847; }

.legend-quiz-review__body {
	padding: 0 16px 16px 50px;
	border-top: 1px solid #e8edf4;
}

.legend-quiz-review__prompt { margin: 14px 0; font-weight: 800; }
.legend-quiz-review__body dl { display: grid; grid-template-columns: 120px 1fr; gap: 6px 14px; margin: 0; }
.legend-quiz-review__body dt { color: #69758a; font-size: 12px; font-weight: 800; }
.legend-quiz-review__body dd { margin: 0; }
.legend-quiz-review__explanation { margin: 14px 0 0; padding: 12px; border-radius: 8px; background: #f1f5fb; color: #4f5d73; }

@media (max-width: 640px) {
	.legend-lesson-extensions { padding: 0 14px; }
	.legend-lesson-content > .legend-lesson-extensions { padding: 0; }
	.legend-assessment,
	.legend-lesson-outcome,
	.legend-lesson-resources { padding: 18px; }
	.legend-quiz-meta { grid-template-columns: 1fr; }
	.legend-quiz-runner fieldset { min-height: 260px; padding: 18px; }
	.legend-quiz-runner legend { font-size: 18px; }
	.legend-quiz-navigation { grid-template-columns: 1fr 1fr; }
	.legend-quiz-navigation > span { grid-column: 1 / -1; grid-row: 1; }
	.legend-quiz-navigation button { width: 100%; }
	.legend-quiz-navigation [data-legend-quiz-previous] { grid-column: 1; grid-row: 2; }
	.legend-quiz-navigation [data-legend-quiz-next],
	.legend-quiz-navigation [data-legend-quiz-submit] { grid-column: 2; grid-row: 2; }
	.legend-quiz-answer-review > summary { align-items: flex-start; flex-wrap: wrap; }
	.legend-quiz-answer-review > summary strong { order: 3; width: 100%; margin-left: 0; }
	.legend-quiz-review__body { padding-left: 16px; }
	.legend-quiz-review__body dl { grid-template-columns: 1fr; }
	.legend-quiz-review__body dd + dt { margin-top: 7px; }
}
