/*
 * Exam practice app: additions and overrides on top of the design build (index.min.css).
 * Uses the design's colour variables (--blue-1, --neutrals-4 ...) so it matches.
 */

/* The design gives many elements an explicit display, which beats the browser's own
   [hidden] rule, so make hidden mean hidden everywhere in the app. */
.exam [hidden] {
	display: none !important;
}

.visually-hidden {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

.button {
	border: 0;
	display: inline-block;
}

.button:disabled {
	opacity: 0.45;
	cursor: not-allowed;
}

.button--ghost {
	background: var(--neutrals-white);
	color: var(--blue-1);
	box-shadow: inset 0 0 0 0.0625rem var(--blue-2);
}

.quiz-link {
	background: none;
	border: 0;
	padding: 0.5rem 0.25rem;
	font-size: 0.875rem;
	line-height: 1.4;
	color: var(--blue-1);
	cursor: pointer;
	text-decoration: underline;
	text-underline-offset: 0.2em;
	text-decoration-color: var(--blue-3);
}

/* ---------- header ---------- */

.line-progress::before {
	width: var(--progress, 0%);
	min-width: 0;
	transition: width 0.5s ease;
}

.side-progress__block {
	gap: 1rem;
}

.avatar--initial {
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--blue-2);
	color: var(--neutrals-white);
	font-weight: 500;
	font-size: 1rem;
}

.side-account__login {
	border-radius: 2rem;
	padding: 0.375rem 1rem;
	font-weight: 500;
	font-size: 0.875rem;
	color: var(--neutrals-white) !important;
	background: var(--blue-2);
	white-space: nowrap;
}

.side-account__note {
	max-width: 8rem;
	line-height: 1.3;
}

/* ---------- left side: course tree ---------- */

.course-dashboard__title {
	display: block;
}

.smart-link {
	display: block;
	margin-bottom: 1.5rem;
	padding: 0.75rem 1rem;
	border-radius: 0.5rem;
	background: var(--neutrals-white);
	border: 0.0625rem solid var(--blue-3);
	box-shadow: 0 0.0625rem 0.125rem rgba(0, 0, 0, 0.06);
	transition: border-color 0.3s, box-shadow 0.3s;
}

.smart-link__title {
	display: block;
	font-weight: 500;
	line-height: 1.5;
	color: var(--blue-1);
}

.smart-link__title::before {
	content: "\2726";
	margin-right: 0.375rem;
	color: var(--orange-1);
}

.smart-link__text {
	display: block;
	font-size: 0.75rem;
	line-height: 1.5;
	color: var(--neutrals-2);
}

.smart-link--active {
	border-color: var(--blue-2);
	background: var(--blue-4);
}

.topic-group:not(:first-child) {
	margin-top: 0.5rem;
}

.topic-group__label {
	padding: 0.5rem 0.875rem 0.25rem;
	font-size: 0.6875rem;
	line-height: 1.45;
	font-weight: 500;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--neutrals-3);
}

a.topic-item {
	display: flex;
}

.topic-item:not(.topic-item--start) .topic-item__stats {
	display: none;
}

.topic-item__stats {
	flex: 0 0 auto;
}

.donut-chart {
	flex: 0 0 1.25rem;
	background: conic-gradient(var(--green-1) 0 var(--pct, 0%), #e9e9ed var(--pct, 0%) 100%);
}

.topic-item--active .donut-chart {
	background: conic-gradient(var(--neutrals-1) 0 var(--pct, 0%), var(--neutrals-white) var(--pct, 0%) 100%);
}

.topic-item--empty {
	cursor: default;
}

.topic-item--empty .topic-item__label {
	color: var(--neutrals-3);
}

.topic-item__soon {
	flex: 0 0 auto;
	font-size: 0.6875rem;
	line-height: 1.6;
	padding: 0 0.5rem;
	border-radius: 1rem;
	border: 0.0625rem solid var(--neutrals-4);
	color: var(--neutrals-3);
}

.topic-filter-empty {
	padding: 1rem 0.875rem;
	font-weight: 300;
	color: var(--neutrals-2);
}

/* ---------- home: course picker ---------- */

.main--home {
	display: block;
	height: auto;
	min-height: calc(100svh - 3.0625rem);
	background: radial-gradient(58.35% 76.33% at 7.55% 100.98%, #f9dccf 0%, #dee8f8 55.29%, #f2f6fc 100%);
}

.main--home .main__center {
	background: transparent;
}

.exam-home__body {
	max-width: 62rem;
	margin: 0 auto;
	padding: 4rem 1.5rem 5rem;
}

.exam-home__title {
	font-weight: 500;
	font-size: 2.75rem;
	line-height: 1.15;
	max-width: 36rem;
	margin-bottom: 1rem;
}

.exam-home__lead {
	font-weight: 300;
	font-size: 1.125rem;
	line-height: 1.6;
	color: var(--neutrals-2);
	max-width: 40rem;
	margin-bottom: 2.5rem;
}

.course-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
	gap: 1.25rem;
	margin-bottom: 3.5rem;
}

/* Courses are grouped by exam board and qualification ("AQA GCSE"), with jump links above. */
.board-nav {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin: -1rem 0 3rem;
}

.board-nav__item {
	padding: 0.375rem 0.875rem;
	border-radius: 2rem;
	background: var(--neutrals-white);
	border: 0.0625rem solid var(--neutrals-4);
	font-size: 0.875rem;
	line-height: 1.5;
	color: var(--blue-1);
	transition: border-color 0.3s, box-shadow 0.3s;
}

.board-group {
	margin-bottom: 3.5rem;
	scroll-margin-top: 4.5rem;
}

.board-group__head {
	display: flex;
	align-items: baseline;
	flex-wrap: wrap;
	gap: 0.25rem 1rem;
	margin-bottom: 1.25rem;
	padding-bottom: 0.75rem;
	border-bottom: 0.0625rem solid var(--neutrals-4);
}

.board-group__title {
	font-weight: 500;
	font-size: 1.75rem;
	line-height: 1.2;
}

.board-group__meta {
	font-weight: 300;
	font-size: 0.875rem;
	color: var(--neutrals-2);
}

.board-group__subject {
	font-weight: 500;
	font-size: 1.125rem;
	line-height: 1.4;
	margin: 0.5rem 0 0.875rem;
}

.board-group .course-grid {
	margin-bottom: 1.75rem;
}

.board-group .course-card__title {
	font-size: 1.375rem;
}

.course-card {
	display: flex;
	flex-direction: column;
	gap: 0.625rem;
	padding: 1.5rem;
	border-radius: 0.75rem;
	background: var(--neutrals-white);
	border: 0.0625rem solid var(--neutrals-4);
	box-shadow: 0 0.0625rem 0.125rem rgba(0, 0, 0, 0.06);
	transition: border-color 0.3s, box-shadow 0.3s, transform 0.3s;
}

.course-card__badge {
	align-self: flex-start;
	border: 0.0625rem solid var(--green-2);
	border-radius: 0.25rem;
	padding: 0.125rem 0.5rem;
	font-weight: 300;
	font-size: 0.75rem;
	line-height: 1.67;
	color: var(--green-1);
}

.course-card__title {
	font-weight: 500;
	font-size: 1.75rem;
	line-height: 1.2;
}

.course-card__meta {
	font-weight: 300;
	color: var(--neutrals-2);
}

.course-card__bar,
.unit-progress__bar {
	position: relative;
	height: 0.5rem;
	border-radius: 1rem;
	background: var(--neutrals-4);
	overflow: hidden;
}

.course-card__bar::before,
.unit-progress__bar::before {
	content: "";
	position: absolute;
	inset: 0 auto 0 0;
	width: var(--progress, 0%);
	border-radius: 1rem;
	background: var(--green-2);
}

.course-card__foot {
	display: flex;
	justify-content: space-between;
	gap: 0.75rem;
	flex-wrap: wrap;
	font-size: 0.875rem;
	line-height: 1.5;
	color: var(--neutrals-2);
}

.course-card__go {
	font-weight: 500;
	color: var(--blue-1);
}

.exam-steps {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
	gap: 1.25rem;
	counter-reset: step;
}

.exam-steps__item {
	list-style: none;
	counter-increment: step;
	display: flex;
	flex-direction: column;
	gap: 0.375rem;
	line-height: 1.5;
}

.exam-steps__item::before {
	content: counter(step);
	display: flex;
	align-items: center;
	justify-content: center;
	width: 2rem;
	height: 2rem;
	border-radius: 50%;
	margin-bottom: 0.25rem;
	background: var(--blue-2);
	color: var(--neutrals-white);
	font-weight: 500;
}

.exam-steps__item span {
	font-weight: 300;
	color: var(--neutrals-2);
}

.exam-empty {
	padding: 2rem 0;
	font-weight: 300;
	line-height: 1.6;
	color: var(--neutrals-2);
}

.exam-empty .button {
	margin: 1rem 0 0;
	max-width: none;
}

/* ---------- course overview ---------- */

.overview-stats {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 0.75rem;
	margin-bottom: 2rem;
}

.overview-stat {
	padding: 1rem;
	border-radius: 0.625rem;
	background: var(--neutrals-5);
}

.overview-stat__value {
	font-weight: 300;
	font-size: 2rem;
	line-height: 1.25;
}

.overview-stat__value small {
	font-size: 1rem;
	color: var(--neutrals-2);
}

.overview-stat__label {
	font-size: 0.75rem;
	line-height: 1.6;
	color: var(--neutrals-2);
}

.overview-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	margin-bottom: 0.75rem;
}

.overview-actions .button {
	margin: 0;
	max-width: none;
}

.overview-note {
	font-weight: 300;
	font-size: 0.875rem;
	line-height: 1.6;
	color: var(--neutrals-2);
	margin-bottom: 2.5rem;
}

.overview-heading {
	font-weight: 500;
	font-size: 1.25rem;
	line-height: 1.4;
	margin-bottom: 1rem;
}

.rec-list {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 0.75rem;
	margin-bottom: 2.5rem;
}

.rec-item {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
	padding: 0.875rem 1rem;
	border-radius: 0.5rem;
	border: 0.0625rem solid var(--neutrals-4);
	transition: border-color 0.3s, box-shadow 0.3s;
}

.rec-item__name {
	font-weight: 500;
	line-height: 1.4;
}

.rec-item__why {
	font-size: 0.75rem;
	line-height: 1.6;
	color: var(--neutrals-2);
}

.unit-progress {
	display: grid;
	gap: 1rem;
}

.unit-progress__row {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 9rem;
	grid-template-areas: "name value" "bar bar";
	gap: 0.375rem 1rem;
	align-items: baseline;
}

.unit-progress__name {
	grid-area: name;
	line-height: 1.5;
}

.unit-progress__name span {
	font-size: 0.75rem;
	color: var(--green-1);
	margin-right: 0.25rem;
}

.unit-progress__bar {
	grid-area: bar;
}

.unit-progress__value {
	grid-area: value;
	text-align: right;
	font-size: 0.75rem;
	color: var(--neutrals-2);
}

/* ---------- question card ---------- */

.quiz-card__heading {
	min-width: 0;
}

.quiz-card__topic {
	display: inline-block;
	margin-top: 0.5rem;
	font-size: 0.875rem;
	line-height: 1.5;
	color: var(--blue-1);
}

.quiz-card__topic::before {
	content: "Topic: ";
	color: var(--neutrals-2);
}

.quiz-card__meta {
	flex: 0 0 auto;
}

.quiz-card__text p + p {
	margin-top: 0.75rem;
}

/* Question figures are SVGs drawn at their natural size (up to ~780px wide); they
   scale down to the card and never up. */
.quiz-figure {
	margin: 0 0 1.25rem;
	padding: 0.75rem;
	border: 0.0625rem solid var(--neutrals-4);
	border-radius: 0.5rem;
	background: var(--neutrals-white);
}

.quiz-figure img {
	display: block;
	max-width: 100%;
	height: auto;
	margin: 0 auto;
}

.quiz-card__marks {
	white-space: nowrap;
}

.quiz-tip {
	margin: -2.5rem 0 1.5rem;
	padding: 0.625rem 0.875rem;
	border-radius: 0.5rem;
	background: var(--green-3);
	font-size: 0.875rem;
	line-height: 1.5;
}

.quiz-notice {
	margin-bottom: 1.5rem;
	padding: 0.625rem 0.875rem;
	border-radius: 0.5rem;
	background: var(--blue-4);
	font-size: 0.875rem;
	line-height: 1.5;
}

.box-quiz__area {
	position: relative;
}

.box-quiz__area:not(:last-child) {
	margin-bottom: 1rem;
}

.box-quiz__textarea {
	display: block;
	color: var(--neutrals-1);
	font-size: 1rem;
}

.box-quiz__textarea::placeholder {
	color: var(--neutrals-3);
}

.box-quiz__textarea[readonly] {
	background: var(--neutrals-6);
	border-color: var(--neutrals-4);
}

.box-quiz__keys {
	margin-top: 0.375rem;
	text-align: right;
}

@media (any-hover: none) {
	.box-quiz__keys {
		display: none;
	}
}

.box-quiz__actions {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 0.5rem 1rem;
}

.box-quiz__actions .button {
	margin: 0;
	max-width: none;
	min-width: 9.375rem;
}

/* ---------- marking feedback ---------- */

.feedback {
	margin-top: 1.5rem;
}

.feedback__loading,
.feedback__error {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	padding: 1rem;
	border-radius: 0.5rem;
	background: var(--neutrals-5);
	line-height: 1.5;
	color: var(--neutrals-2);
}

.feedback__error {
	background: #fdecea;
	color: #a1281c;
}

.spinner {
	flex: 0 0 1.25rem;
	width: 1.25rem;
	height: 1.25rem;
	border-radius: 50%;
	border: 0.1875rem solid var(--blue-3);
	border-top-color: var(--blue-1);
	animation: exam-spin 0.8s linear infinite;
}

@keyframes exam-spin {
	to {
		transform: rotate(360deg);
	}
}

.feedback__head {
	display: flex;
	align-items: center;
	gap: 1rem;
	padding: 1rem 1.25rem;
	border-radius: 0.625rem 0.625rem 0 0;
	background: var(--neutrals-5);
}

.feedback__head--full {
	background: var(--green-3);
}

.feedback__head--partial {
	background: var(--orange-2);
}

.feedback__score {
	font-weight: 500;
	font-size: 2rem;
	line-height: 1;
}

.feedback__score span {
	font-size: 1.125rem;
	color: var(--neutrals-2);
}

.feedback__verdict {
	font-weight: 500;
	font-size: 1.125rem;
	line-height: 1.4;
}

.feedback__comment {
	padding: 1rem 1.25rem;
	border: 0.0625rem solid var(--neutrals-4);
	border-top: 0;
	line-height: 1.6;
}

.feedback__points {
	border: 0.0625rem solid var(--neutrals-4);
	border-top: 0;
	border-radius: 0 0 0.625rem 0.625rem;
	overflow: hidden;
}

.feedback__point {
	list-style: none;
	display: flex;
	gap: 0.75rem;
	padding: 0.75rem 1.25rem;
	line-height: 1.5;
}

.feedback__point + .feedback__point {
	border-top: 0.0625rem solid var(--neutrals-4);
}

.feedback__point strong {
	font-weight: 500;
}

.feedback__point div div {
	color: var(--neutrals-2);
	font-weight: 300;
}

.feedback__icon {
	flex: 0 0 1.5rem;
	height: 1.5rem;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 0.875rem;
	font-weight: 700;
}

.feedback__point.is-awarded .feedback__icon {
	background: var(--green-1);
	color: var(--neutrals-white);
}

.feedback__point.is-missed .feedback__icon {
	background: var(--neutrals-4);
	color: var(--neutrals-2);
}

.feedback__pts {
	font-size: 0.75rem;
	color: var(--neutrals-2);
}

.feedback__model {
	margin-top: 1rem;
	border-radius: 0.625rem;
	border: 0.0625rem solid var(--blue-3);
	background: var(--neutrals-6);
}

.feedback__model summary {
	cursor: pointer;
	padding: 0.875rem 1.25rem;
	font-weight: 500;
	color: var(--blue-1);
}

.feedback__model-body {
	padding: 0 1.25rem 1rem;
	line-height: 1.6;
}

.feedback__model-body h3 {
	margin: 0.75rem 0 0.25rem;
	font-size: 0.75rem;
	font-weight: 500;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--neutrals-2);
}

.feedback__actions {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 0.5rem 1rem;
	margin-top: 1.5rem;
}

.feedback__actions .button {
	margin: 0;
	max-width: none;
	min-width: 9.375rem;
}

/* ---------- end of round ---------- */

.round-summary {
	text-align: center;
	padding: 1rem 0 2rem;
	line-height: 1.6;
}

.round-summary h2 {
	font-weight: 500;
	font-size: 1.75rem;
	margin-bottom: 0.75rem;
}

.round-summary p {
	max-width: 30rem;
	margin: 0 auto 0.75rem;
	color: var(--neutrals-2);
}

.round-summary strong {
	color: var(--neutrals-1);
	font-weight: 500;
}

.round-summary__ring {
	width: 7.5rem;
	height: 7.5rem;
	margin: 0 auto 1.5rem;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	background:
		radial-gradient(closest-side, var(--neutrals-white) 78%, transparent 79%),
		conic-gradient(var(--green-2) 0 var(--pct, 0%), var(--neutrals-4) var(--pct, 0%) 100%);
}

.round-summary__ring span {
	font-weight: 300;
	font-size: 1.75rem;
}

.round-summary__actions {
	display: flex;
	justify-content: center;
	align-items: center;
	flex-wrap: wrap;
	gap: 0.75rem 1rem;
	margin-top: 1.75rem;
}

.round-summary__actions .button {
	margin: 0;
	max-width: none;
}

/* ---------- AI tutor ---------- */

.right-side__body {
	min-height: 0;
}

.tutor-head {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 0.25rem 0.5rem;
	margin-bottom: 0.75rem;
}

.tutor-head__dot {
	width: 0.5rem;
	height: 0.5rem;
	border-radius: 50%;
	background: var(--green-2);
	box-shadow: 0 0 0 0.1875rem var(--green-3);
}

.tutor-head__title {
	font-weight: 500;
}

.tutor-head__note {
	flex-basis: 100%;
	line-height: 1.4;
}

.tutor-log {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
	margin-bottom: 1rem;
	padding-right: 0.25rem;
}

.tutor-msg {
	max-width: 92%;
	padding: 0.625rem 0.875rem;
	border-radius: 0.75rem;
	font-size: 0.875rem;
	line-height: 1.55;
	overflow-wrap: anywhere;
}

.tutor-msg p + p,
.tutor-msg p + ul,
.tutor-msg p + ol,
.tutor-msg ul + p,
.tutor-msg ol + p {
	margin-top: 0.5rem;
}

.tutor-msg ul,
.tutor-msg ol {
	padding-left: 1.25rem;
}

.tutor-msg ul li {
	list-style: disc;
}

.tutor-msg li + li {
	margin-top: 0.25rem;
}

.tutor-msg strong {
	font-weight: 500;
}

.tutor-msg code {
	font-size: 0.8125rem;
	padding: 0 0.25rem;
	border-radius: 0.25rem;
	background: var(--neutrals-5);
}

.tutor-msg--assistant {
	align-self: flex-start;
	background: var(--neutrals-white);
	border: 0.0625rem solid var(--neutrals-4);
	border-bottom-left-radius: 0.25rem;
}

.tutor-msg--user {
	align-self: flex-end;
	background: var(--blue-2);
	color: var(--neutrals-white);
	border-bottom-right-radius: 0.25rem;
}

.tutor-msg--error {
	align-self: flex-start;
	background: #fdecea;
	color: #a1281c;
}

.tutor-msg--divider {
	align-self: stretch;
	max-width: none;
	padding: 0;
	display: flex;
	align-items: center;
	gap: 0.5rem;
	font-size: 0.6875rem;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--neutrals-3);
}

.tutor-msg--divider::before,
.tutor-msg--divider::after {
	content: "";
	flex: 1 1 auto;
	height: 0.0625rem;
	background: var(--neutrals-4);
}

.dots {
	display: inline-flex;
	gap: 0.25rem;
	padding: 0.25rem 0;
}

.dots i {
	width: 0.375rem;
	height: 0.375rem;
	border-radius: 50%;
	background: var(--neutrals-3);
	animation: exam-dot 1.2s infinite ease-in-out;
}

.dots i:nth-child(2) {
	animation-delay: 0.15s;
}

.dots i:nth-child(3) {
	animation-delay: 0.3s;
}

@keyframes exam-dot {
	0%, 80%, 100% {
		opacity: 0.3;
		transform: translateY(0);
	}
	40% {
		opacity: 1;
		transform: translateY(-0.1875rem);
	}
}

.right-side__chat {
	flex: 0 0 auto;
}

.chat .chat__item {
	display: block;
	width: 100%;
	text-align: left;
	cursor: pointer;
	transition: background-color 0.3s, color 0.3s;
}

.chat .chat__item[data-toggle-chat] {
	display: none;
}

.right-side__telegram {
	border: 0;
	cursor: pointer;
}

/* ---------- hover ---------- */

@media (any-hover: hover) {
	.quiz-link:hover {
		text-decoration-color: currentColor;
	}

	.button--ghost:hover {
		background: var(--blue-4);
	}

	.board-nav__item:hover,
	.smart-link:hover,
	.rec-item:hover {
		border-color: var(--blue-2);
		box-shadow: 0 0.125rem 0.375rem rgba(0, 0, 0, 0.08);
	}

	.course-card:hover {
		border-color: var(--blue-2);
		box-shadow: 0 0.25rem 1rem rgba(46, 61, 82, 0.1);
		transform: translateY(-0.125rem);
	}

	.chat .chat__item:hover {
		background: var(--blue-2);
		color: var(--neutrals-white);
	}

	.topic-item--empty:hover {
		box-shadow: none;
	}

	.topic-item--empty:hover .topic-item__label {
		color: var(--neutrals-3);
	}
}

/* ---------- tablet and below: the tutor sits under the question ---------- */

@media (max-width: 75em) {
	.tutor-head {
		padding: 0 1.5rem;
	}

	.tutor-log {
		display: none;
		max-height: 55vh;
		padding: 0 1.5rem;
	}

	.is-chat-open .tutor-log {
		display: flex;
	}

	.chat .chat__item {
		width: auto;
		flex: 0 0 auto;
	}

	.chat .chat__item[data-toggle-chat] {
		display: block;
		color: var(--neutrals-white);
		background: var(--blue-2);
	}

	.overview-stats {
		grid-template-columns: repeat(2, 1fr);
	}
}

/* Phones: the question scrolls and the tutor bar keeps its own height at the bottom,
   growing upwards when the chat is opened. */
@media (max-width: 61.99875em) {
	.side-account__note {
		display: none;
	}

	/* The design's phone header stacks the logo row over the progress and account rows, which other pages
	   move into the topic menu. The home page has neither a topic menu nor progress, so put the logo,
	   level and Log in on one row instead of overflowing the header's fixed height. */
	.exam--home .header__container {
		grid-template-columns: minmax(0, 1fr) auto;
		align-items: center;
	}

	.exam--home .side-progress {
		display: none;
	}

	.exam--home .side-main {
		grid-template-columns: auto 1fr auto;
		gap: 0.75rem;
		padding-right: 0.75rem;
	}

	.exam--home .side-main__logo {
		justify-self: start;
	}

	.exam--home .side-account {
		padding-right: 1rem;
	}

	.quiz-tip {
		margin-top: -1.5rem;
	}

	.right-side {
		flex: 0 0 auto;
		padding-top: 0.75rem;
	}

	.right-side__body {
		height: auto;
	}

	.tutor-head {
		margin-bottom: 0.5rem;
	}

	.tutor-head__note {
		display: none;
	}

	.right-side__chat:not(:last-child) {
		margin-bottom: 0.75rem;
	}

	.is-chat-open .tutor-log {
		flex: 0 1 auto;
		max-height: 45svh;
	}
}

@media (max-width: 47.99875em) {
	.quiz-card__header:not(:last-child),
	.quiz-card__result:not(:last-child) {
		margin-bottom: 1.5rem;
	}

	.quiz-tip {
		margin-top: -0.75rem;
	}

	.box-quiz__textarea {
		height: 8rem;
	}

	.exam-home__body {
		padding: 2.5rem 1rem 3rem;
	}

	.exam-home__title {
		font-size: 2rem;
	}

	.rec-list {
		grid-template-columns: 1fr;
	}

	.unit-progress__row {
		grid-template-columns: 1fr;
		grid-template-areas: "name" "value" "bar";
	}

	.unit-progress__value {
		text-align: left;
	}

	.overview-stat__value {
		font-size: 1.5rem;
	}
}

/* Maths typeset by KaTeX (exam-app.js typeset()). The design gives every span in the question text
   inline-block and a .375rem nudge down, which piles up through KaTeX's nested spans; undo it for
   the wrapper (.math) and KaTeX's own spans. Equal specificity, so this file must load after
   index.min.css; KaTeX's own class rules are more specific and still win. */
span.math, span.katex, .katex span {
  transform: none;
}
span.math, .katex span {
  display: inline;
}
/* The design also sizes every svg in a question-text span to 1.5rem square, which squashes KaTeX's
   stretchy arrows and brackets (\overrightarrow, large brackets): give them KaTeX's own sizing back. */
.katex span svg, .quiz-card__text .katex svg {
  height: inherit;
  width: 100%;
}

/* Program code in questions, model answers and tutor replies (exam-app.js codeBlock()). */
.code-block {
  margin: 0.75rem 0;
  padding: 0.75rem 1rem;
  overflow-x: auto;
  background: #f5f6fa;
  border: 1px solid #e2e3eb;
  border-radius: 0.5rem;
  font-family: "Courier New", Consolas, monospace;
  font-size: 0.9375rem;
  line-height: 1.45;
  white-space: pre;
  tab-size: 4;
}
.code-block code {
  font: inherit;
  white-space: inherit;
}
.code-block__ln {
  display: inline-block;
  width: 2.25em;
  margin-right: 0.75em;
  color: #9aa0ad;
  text-align: right;
  user-select: none;
}
.quiz-card__text .code-block,
.tutor-msg .code-block {
  font-size: 0.875rem;
}
.tutor-msg .code-block {
  padding: 0.5rem 0.625rem;
}
textarea.is-code {
  font-family: "Courier New", Consolas, monospace;
  font-size: 0.9375rem;
  line-height: 1.45;
  tab-size: 4;
}
/* The design nudges every span in the question text down; not the line numbers. */
.code-block span {
  transform: none;
}

/* ---------- topic landing view (visitors who are not logged in) ---------- */

.quiz-card__header:has(+ .topic-landing) {
	margin-bottom: 1rem;
}

.topic-landing {
	line-height: 1.6;
	color: var(--neutrals-1);
}

.topic-landing__crumbs {
	display: flex;
	flex-wrap: wrap;
	gap: 0.25rem 0.5rem;
	margin-bottom: 1.25rem;
	font-size: 0.8125rem;
	line-height: 1.5;
	color: var(--neutrals-2);
}

.topic-landing__crumbs a {
	color: var(--blue-1);
}

.topic-landing__lead {
	font-size: 1.125rem;
	margin-bottom: 1.25rem;
}

.topic-landing__facts {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-bottom: 1.75rem;
}

.topic-landing__facts li {
	list-style: none;
	padding: 0.25rem 0.75rem;
	border-radius: 1rem;
	background: var(--blue-4);
	font-size: 0.8125rem;
	line-height: 1.5;
}

.topic-landing__start {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 0.75rem 1rem;
	margin-bottom: 3rem;
}

.topic-landing__start .button,
.topic-landing__cta .button {
	margin: 0;
	max-width: none;
	min-width: 11rem;
}

.topic-landing__note {
	font-size: 0.875rem;
	color: var(--neutrals-2);
}

.topic-landing__heading {
	font-weight: 500;
	font-size: 1.5rem;
	line-height: 1.3;
	margin-bottom: 0.5rem;
}

.topic-landing__intro {
	color: var(--neutrals-2);
	margin-bottom: 1.5rem;
}

.sample-q {
	padding: 1.75rem 0;
	border-top: 0.0625rem solid var(--neutrals-4);
}

.sample-q__head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 1rem;
	margin-bottom: 0.75rem;
}

.sample-q__title {
	font-weight: 500;
	font-size: 1.125rem;
	line-height: 1.4;
}

.sample-q__marks {
	font-size: 0.875rem;
	color: var(--neutrals-2);
	white-space: nowrap;
}

.sample-q__text {
	font-size: 1.0625rem;
	margin-bottom: 1rem;
}

.sample-q p + p {
	margin-top: 0.5rem;
}

.sample-q .quiz-figure {
	margin-bottom: 1rem;
}

.sample-q__block {
	margin-top: 0.75rem;
	padding: 0.875rem 1.125rem;
	border-radius: 0.5rem;
	background: var(--neutrals-5);
}

.sample-q__block--answer {
	background: var(--green-3);
}

/* Lines of tall maths (\displaystyle fractions) in answers would otherwise touch, so that one line's
   denominators run into the next line's numerators; the margin only adds space around tall maths. */
.sample-q .katex .base,
.feedback__model-body .katex .base {
	margin-block: 0.2em;
}

.sample-q__block h4 {
	margin-bottom: 0.25rem;
	font-size: 0.75rem;
	font-weight: 500;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--neutrals-2);
}

.sample-q__scheme {
	margin-top: 0.75rem;
	border: 0.0625rem solid var(--neutrals-4);
	border-radius: 0.5rem;
}

.sample-q__scheme summary {
	cursor: pointer;
	padding: 0.75rem 1.125rem;
	font-weight: 500;
	color: var(--blue-1);
}

.sample-q__points {
	padding: 0 1.125rem 0.5rem;
}

.sample-q__points li {
	list-style: none;
	display: flex;
	gap: 0.75rem;
	padding: 0.625rem 0;
	border-top: 0.0625rem solid var(--neutrals-5);
	font-size: 0.9375rem;
}

.sample-q__pts {
	flex: 0 0 4.25rem;
	padding-top: 0.125rem;
	font-size: 0.75rem;
	color: var(--neutrals-2);
}

.sample-q__point {
	min-width: 0;
}

.sample-q__note {
	margin-top: 0.25rem;
	font-size: 0.8125rem;
	color: var(--neutrals-2);
}

.topic-landing__cta {
	margin-top: 0.5rem;
	padding: 1.5rem;
	border-radius: 0.625rem;
	background: var(--blue-4);
	text-align: center;
}

.topic-landing__cta p {
	margin-bottom: 1rem;
}

@media (max-width: 47.99875em) {
	.topic-landing__lead {
		font-size: 1rem;
	}

	.sample-q__text {
		font-size: 1rem;
	}

	.sample-q__points li {
		flex-direction: column;
		gap: 0.125rem;
	}

	.sample-q__pts {
		flex: none;
	}
}
