/*
 * The KS2 SATs and 11+ sections (newcourses/sats-11plus/platform/DESIGN.md): their answer types (js/exam-widgets.js), the section
 * page and the pages of a course made only of skills. Loaded only on those sections' pages, after exam-instant.css, so Years 1-3
 * and the exam courses look exactly as before. Every control is at least 48px each way where it stands alone, and everything fits
 * a 360px wide phone.
 */

/* ---------- text with markup: underlining, a blank, lines ---------- */

.w-u {
	text-decoration: underline;
	text-decoration-thickness: 0.125rem;
	text-underline-offset: 0.2em;
}

.w-blank {
	display: inline-block;
	width: 4.5em;
	height: 1em;
	margin: 0 0.15em;
	border-bottom: 0.125rem solid var(--neutrals-1);
	vertical-align: -0.15em;
}

.w-line {
	display: block;
}

.ti-choice.w-choice--lines {
	text-align: left;
	line-height: 1.45;
}

.ti-choice.w-choice--lines .w-line {
	padding-left: 0.25rem;
}

/* ---------- the question: the puzzle line, a passage, a figure ---------- */

.exam--section .skill-q__big.w-big {
	white-space: pre-wrap;
	overflow-wrap: anywhere;
	font-size: 1.75rem;
	line-height: 1.35;
}

.w-passage {
	margin: 0 0 1rem;
	padding: 0.75rem 1rem;
	border-radius: 0.625rem;
	background: var(--neutrals-white);
	box-shadow: inset 0 0 0 0.0625rem var(--neutrals-4);
	font-size: 1.25rem;
	line-height: 1.6;
}

.w-passage p {
	margin: 0;
}

.w-passage p + p {
	margin-top: 0.5rem;
}

.exam--section .skill-q__figure svg {
	max-width: 100%;
	height: auto;
}

.w-hint {
	margin: 0 0 0.75rem;
	font-size: 0.9375rem;
	color: var(--neutrals-2);
}

/* ---------- five options: stacked on a phone ---------- */

@media (max-width: 40em) {
	.ti-choices.w-choices--stack,
	.ti-choices--row.w-choices--stack {
		grid-template-columns: 1fr;
	}

	.ti-choices--row.w-choices--stack .ti-choice {
		min-height: 3.25rem;
		font-size: 1.375rem;
	}
}

/* ---------- lettered pictures (11+ non-verbal reasoning): each at its size, the letter under it ---------- */

.ti-choices.w-letters-choice {
	--w-opt: 64px;
	grid-template-columns: repeat(var(--w-cols, 5), var(--w-opt));
	justify-content: center;
	gap: 0.25rem;
}

/* The picture is the whole width of its button, so that five 64px options fit a 360px phone: the frame is drawn inside it. */
.w-letters-choice .ti-choice {
	min-height: 0;
	padding: 0 0 0.25rem;
	gap: 0.125rem;
	border-width: 0;
	box-shadow: inset 0 0 0 0.125rem var(--blue-3);
}

.w-letters-choice .ti-choice.is-chosen {
	box-shadow: inset 0 0 0 0.1875rem var(--blue-1);
}

.w-letters-choice .ti-choice.is-right {
	box-shadow: inset 0 0 0 0.1875rem var(--green-1);
}

.w-letters-choice .ti-choice.is-wrong {
	box-shadow: inset 0 0 0 0.1875rem #c8402f;
}

.w-letters-choice .ti-choice svg {
	width: var(--w-opt);
	max-width: none;
	height: auto;
}

.w-letters-choice .ti-choice__letter {
	font-weight: 600;
}

.w-letters-choice .ti-mark {
	top: 0.125rem;
	right: 0.1875rem;
}

/* ---------- arith: the answer box, its forms and the pad with a point ---------- */

.w-forms {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin: 0 0 0.75rem;
}

.w-form {
	min-height: 3rem;
	padding: 0.375rem 1rem;
	border: 0.125rem solid var(--blue-3);
	border-radius: 1.5rem;
	background: var(--neutrals-white);
	color: var(--neutrals-1);
	font: inherit;
	font-size: 1rem;
	font-weight: 500;
	cursor: pointer;
	touch-action: manipulation;
}

.w-form[aria-pressed="true"] {
	border-color: var(--blue-1);
	background: var(--blue-4);
}

.w-form:focus-visible,
.w-tok:focus-visible,
.w-gap:focus-visible,
.w-gapbtn:focus-visible,
.w-markbox:focus-visible,
.w-tick:focus-visible {
	outline: 0.1875rem solid var(--blue-1);
	outline-offset: 0.125rem;
}

.w-arith .w-box {
	flex: 0 0 auto;
	height: 3.75rem;
	padding: 0 0.5rem;
	font-size: 2rem;
}

.w-arith .w-box.is-active {
	box-shadow: 0 0 0 0.1875rem var(--blue-3);
}

.w-arith .w-box--n {
	flex: 1 1 auto;
	width: 100%;
	max-width: 18rem;
}

.w-frac,
.w-rem {
	display: flex;
	align-items: center;
	gap: 0.625rem;
	margin: 0 0 0.75rem;
}

.w-frac__stack {
	display: inline-flex;
	flex-direction: column;
	align-items: stretch;
	gap: 0.25rem;
}

.w-frac__stack .ti-fraction__bar {
	display: block;
	height: 0.1875rem;
	border-radius: 0.125rem;
	background: var(--neutrals-1);
}

.w-box--w {
	width: 6.25rem;
}

.w-box--t,
.w-box--b {
	width: 5.5rem;
}

.w-box--q {
	width: 7.5rem;
}

.w-box--r {
	width: 4.75rem;
}

.w-rem__r {
	font-size: 2rem;
	font-weight: 500;
}

.w-arith.is-right .w-box {
	border-color: var(--green-1);
	background: var(--green-3);
}

.w-arith.is-wrong .w-box {
	border-color: #c8402f;
	background: #fdecea;
}

.w-pad {
	max-width: 20rem;
}

/* Two rows of keys below the desktop layout, as exam-instant.css lays out the plain pad: 1-5 and delete, then 6-9, 0 and the point. */
@media (max-width: 61.99875em) {
	.w-pad {
		max-width: 30rem;
	}

	.w-pad .ti-key--del {
		grid-column: 6;
		grid-row: 1;
	}

	.w-pad .w-key--point {
		grid-column: 6;
		grid-row: 2;
	}
}

/* ---------- word: one box of a given number of letters ---------- */

.w-word__label {
	display: block;
	margin: 0 0 0.375rem;
	font-size: 0.9375rem;
	color: var(--neutrals-2);
}

.w-word__input {
	width: calc(var(--letters, 4) * 1.6rem + 2.5rem);
	min-width: 5rem;
	max-width: 100%;
	height: 3.75rem;
	padding: 0 0.75rem;
	border: 0.125rem solid var(--blue-2);
	border-radius: 0.75rem;
	background: var(--neutrals-white);
	color: var(--neutrals-1);
	font: inherit;
	font-size: 2rem;
	font-weight: 500;
	letter-spacing: 0.15em;
	text-transform: uppercase;
	text-align: center;
}

.w-word {
	margin: 0 0 1rem;
}

.w-word.is-right .w-word__input {
	border-color: var(--green-1);
	background: var(--green-3);
}

.w-word.is-wrong .w-word__input {
	border-color: #c8402f;
	background: #fdecea;
}

.ti-slot .w-word {
	margin: 0;
}

/* ---------- cloze: a passage with gaps ---------- */

.w-cloze {
	margin: 0 0 1rem;
}

.w-cloze__text {
	margin: 0 0 0.75rem;
	padding: 0.75rem 1rem;
	border-radius: 0.625rem;
	background: var(--neutrals-white);
	box-shadow: inset 0 0 0 0.0625rem var(--neutrals-4);
	font-size: 1.1875rem;
	line-height: 2.2;
}

.w-gap {
	display: inline-flex;
	align-items: center;
	gap: 0.25rem;
	min-width: 3.5rem;
	min-height: 2.75rem;
	padding: 0 0.625rem;
	border: 0.125rem dashed var(--blue-2);
	border-radius: 0.5rem;
	background: var(--blue-4);
	color: var(--neutrals-1);
	font: inherit;
	line-height: 1.2;
	vertical-align: middle;
	cursor: pointer;
}

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

.w-gap.is-filled {
	border-style: solid;
	background: var(--neutrals-white);
	font-weight: 500;
}

.w-gap.is-open {
	border-color: var(--blue-1);
	box-shadow: 0 0 0 0.1875rem var(--blue-3);
}

.w-gap.is-right,
.w-letters.is-right .w-letters__box {
	border-color: var(--green-1);
	background: var(--green-3);
}

.w-gap.is-wrong,
.w-letters.is-wrong .w-letters__box {
	border-color: #c8402f;
	background: #fdecea;
}

.w-letters {
	display: inline-flex;
	align-items: center;
	gap: 0.0625rem;
	vertical-align: middle;
}

.w-letters__given {
	font-weight: 500;
}

.w-letters__box {
	width: 2rem;
	height: 2.75rem;
	padding: 0;
	border: 0.125rem solid var(--blue-2);
	border-radius: 0.375rem;
	background: var(--neutrals-white);
	color: var(--neutrals-1);
	font: inherit;
	font-weight: 500;
	text-align: center;
	text-transform: lowercase;
}

.w-gapchoices {
	margin: 0 0 0.75rem;
	padding: 0.75rem;
	border-radius: 0.625rem;
	background: var(--neutrals-6);
}

.w-gapchoices__head {
	margin: 0 0 0.5rem;
	font-weight: 500;
}

.w-gapchoices .w-gapchoice {
	margin: 0 0.5rem 0.5rem 0;
	min-height: 3rem;
	font-size: 1.125rem;
}

/* ---------- a sentence of tokens: tap words (tapword), gaps (gapplace) or boxes (gapmark) ---------- */

.w-sentence {
	margin: 0 0 0.75rem;
	padding: 0.75rem 1rem;
	border-radius: 0.625rem;
	background: var(--neutrals-white);
	box-shadow: inset 0 0 0 0.0625rem var(--neutrals-4);
	font-size: 1.375rem;
	line-height: 2.6;
}

.w-tok {
	font: inherit;
}

button.w-tok {
	position: relative;
	display: inline;
	margin: 0;
	padding: 0.375rem 0.25rem;
	border: 0.125rem solid transparent;
	border-radius: 999rem;
	background: none;
	color: var(--neutrals-1);
	line-height: 1.6;
	cursor: pointer;
	touch-action: manipulation;
	-webkit-box-decoration-break: clone;
	box-decoration-break: clone;
}

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

.w-tap--circle button.w-tok.is-chosen {
	border-color: var(--blue-1);
	background: var(--blue-4);
}

.w-tap--underline button.w-tok {
	border-radius: 0.25rem;
}

.w-tap--underline button.w-tok.is-chosen,
.w-tap--underline .w-sp.is-joined {
	text-decoration: underline;
	text-decoration-color: var(--blue-1);
	text-decoration-thickness: 0.1875rem;
	text-underline-offset: 0.25em;
}

.w-tap--underline .w-sp.is-joined {
	text-decoration-skip-ink: none;
	white-space: pre;
}

button.w-tok.is-right {
	border-color: var(--green-1);
	background: var(--green-3);
}

button.w-tok.is-wrong {
	border-color: #c8402f;
	background: #fdecea;
}

button.w-tok.is-missed {
	border-color: var(--green-1);
	border-style: dashed;
}

.w-tap--underline button.w-tok.is-right,
.w-tap--underline button.w-tok.is-wrong,
.w-tap--underline button.w-tok.is-missed {
	border-radius: 0.25rem;
}

.w-gapbtn,
.w-markbox {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	vertical-align: middle;
	min-width: 1.25rem;
	height: 2.5rem;
	margin: 0 0.0625rem;
	padding: 0 0.125rem;
	border: 0.125rem dashed var(--blue-3);
	border-radius: 0.375rem;
	background: var(--blue-4);
	color: var(--neutrals-1);
	font: inherit;
	font-weight: 600;
	line-height: 1;
	cursor: pointer;
	touch-action: manipulation;
}

/* a gap is a narrow target between words that are not themselves tapped: its touch area reaches over them, to 48px */
.w-gapbtn::after {
	content: "";
	position: absolute;
	inset: -0.25rem -0.875rem;
}

.w-gapbtn.is-chosen {
	min-width: 1.5rem;
	border-style: solid;
	border-color: var(--blue-1);
	background: var(--neutrals-white);
}

.w-gapbtn.is-right,
.w-markbox.is-right {
	border-style: solid;
	border-color: var(--green-1);
	background: var(--green-3);
}

.w-gapbtn.is-wrong,
.w-markbox.is-wrong {
	border-style: solid;
	border-color: #c8402f;
	background: #fdecea;
}

.w-gapbtn.is-missed {
	border-color: var(--green-1);
}

.w-markbox {
	min-width: 2.25rem;
	height: 2.75rem;
	border-style: solid;
	border-color: var(--blue-2);
	background: var(--neutrals-white);
	font-size: 1.5rem;
}

.w-markbox.is-active {
	border-color: var(--blue-1);
	box-shadow: 0 0 0 0.1875rem var(--blue-3);
}

.w-markopts {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin: 0 0 1rem;
}

.w-markopts .ti-choice {
	min-height: 3rem;
	font-size: 1.125rem;
}

/* ---------- typeword and dictation: a box in a sentence ---------- */

.w-type {
	margin: 0 0 1rem;
	font-size: 1.375rem;
	line-height: 2.4;
}

.w-type__input {
	width: 10em;
	max-width: 100%;
	height: 3rem;
	padding: 0 0.5rem;
	border: 0.125rem solid var(--blue-2);
	border-radius: 0.5rem;
	background: var(--neutrals-white);
	color: var(--neutrals-1);
	font: inherit;
	font-weight: 500;
	vertical-align: middle;
}

.is-right .w-type__input {
	border-color: var(--green-1);
	background: var(--green-3);
}

.is-wrong .w-type__input {
	border-color: #c8402f;
	background: #fdecea;
}

.w-dict__controls {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin: 0 0 0.75rem;
}

.w-dict__play {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	width: auto;
	min-height: 3.25rem;
	max-width: none;
	margin: 0;
	padding-inline: 1.25rem;
	white-space: nowrap;
}

.w-dict__play svg {
	width: 1.5rem;
	height: 1.5rem;
}

.w-dict__voice {
	margin: 0 0 0.75rem;
	font-size: 0.9375rem;
	color: var(--neutrals-2);
}

.w-dict__voice--none {
	padding: 0.75rem 1rem;
	border-radius: 0.625rem;
	background: #fff4e5;
	color: #6b3d00;
	font-size: 1rem;
}

/* ---------- sort as a table: one tick in each row ---------- */

.w-sort-wrap {
	margin: 0 0 1rem;
	overflow-x: auto;
}

.w-sort {
	width: 100%;
	border-collapse: collapse;
	font-size: 1.0625rem;
}

.w-sort th,
.w-sort td {
	padding: 0.375rem;
	border-bottom: 0.0625rem solid var(--neutrals-4);
	text-align: center;
	vertical-align: middle;
}

.w-sort thead th {
	font-size: 0.875rem;
	font-weight: 500;
	color: var(--neutrals-2);
}

.w-sort .w-sort__item {
	text-align: left;
	font-weight: 400;
	line-height: 1.45;
}

.w-tick {
	width: 3rem;
	height: 3rem;
	border: 0.125rem solid var(--blue-3);
	border-radius: 0.5rem;
	background: var(--neutrals-white);
	color: transparent;
	font-size: 1.5rem;
	cursor: pointer;
	touch-action: manipulation;
}

.w-tick.is-chosen {
	border-color: var(--blue-1);
	background: var(--blue-4);
	color: var(--blue-1);
}

.w-sort tr.is-right .w-tick.is-chosen {
	border-color: var(--green-1);
	background: var(--green-3);
	color: #4c6a00;
}

.w-sort tr.is-wrong .w-tick.is-chosen {
	border-color: #c8402f;
	background: #fdecea;
	color: #a1281c;
}

.w-sort tr.is-wrong .w-tick.is-answer {
	border-color: var(--green-1);
	border-style: dashed;
}

/* ---------- order with up to 10 one-word tiles (make a question) ---------- */

.exam--section .ti-order__places,
.exam--section .ti-order__tray {
	grid-template-columns: repeat(auto-fill, minmax(4.75rem, 1fr));
}

.exam--section .ti-order__place {
	min-height: 3.5rem;
}

/* ---------- the worked method, after marking ---------- */

.w-method {
	margin: 1rem 0 0;
	padding: 0.75rem;
	border-radius: 0.625rem;
	background: var(--neutrals-white);
	box-shadow: inset 0 0 0 0.0625rem var(--neutrals-4);
	overflow-x: auto;
}

.w-method__title {
	margin: 0 0 0.5rem;
	font-weight: 500;
}

.w-method svg {
	display: block;
	max-width: 100%;
	height: auto;
}

/* ---------- the section page and a skills-only course's pages ---------- */

.section-course__about,
.section-course__lead {
	margin: 0 0 1.25rem;
	line-height: 1.55;
	color: var(--neutrals-2);
}

.section-course__topics {
	max-width: 48rem;
}

.section-course__topics .year-unit__skill a {
	color: var(--neutrals-2);
}

.section-course__topics .year-unit__skill a:hover,
.section-course__topics .year-unit__skill a:focus-visible {
	color: var(--blue-1);
	text-decoration: underline;
}

.section-course__topiclink {
	margin: 0.25rem 0.75rem 0.75rem;
	font-size: 0.9375rem;
}

.section-course__topiclink a {
	color: var(--blue-1);
	font-weight: 500;
}

.section-skill {
	padding: 1.5rem 0;
	border-top: 0.0625rem solid var(--neutrals-4);
}

.section-skill__head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 1rem;
	margin-bottom: 0.5rem;
}

.section-skill__title {
	font-weight: 500;
	font-size: 1.25rem;
	line-height: 1.35;
}

.section-skill__title a {
	color: var(--neutrals-1);
}

.section-skill__score {
	display: inline-flex;
	flex: none;
	align-items: center;
	gap: 0.375rem;
	font-size: 0.875rem;
	font-weight: 500;
	white-space: nowrap;
}

.section-skill__blurb {
	margin: 0 0 0.75rem;
	color: var(--neutrals-2);
}

.section-skill__example .sample-q {
	padding: 0.75rem 1rem;
	border: 0.0625rem solid var(--neutrals-4);
	border-radius: 0.625rem;
	background: var(--neutrals-white);
}

.section-skill__example svg {
	max-width: 100%;
	height: auto;
}

.section-skill__go {
	margin: 0.75rem 0 0;
}

.section-skill__go .button {
	margin: 0;
}
