/*
 * Gradespace Assess: the Tests section in Tutor's student area and portal.
 * Buttons, notes, fields and facts use Tutor's own classes (gstu-btn,
 * gstu-note, gstu-input, gstu-facts…), which every Tutor design styles
 * and contrast-checks; this file only lays out what is new, in the
 * portal's tokens (--a-*) or Core's (--gsc-*), with plain fallbacks. Text is
 * always the ink colour on the surface or a light tint, so contrast stays
 * at least 4.5:1 in every design; states are shown with borders and words,
 * never colour alone.
 */
.gsas {
	--gsas-ink: var(--a-ink, var(--gsc-ink, #111827));
	--gsas-muted: var(--a-muted, var(--gsc-muted, #4b5563));
	--gsas-line: var(--a-line, var(--gsc-line, #c9ced8));
	--gsas-tint: var(--a-tint, var(--gsc-tint, #eef2fb));
	--gsas-surface: var(--a-surface, var(--gsc-surface, #ffffff));
	--gsas-brand: var(--a-brand, var(--gsc-brand, #1d4ed8));
	--gsas-danger: var(--gsc-danger, #b42318);
	--gsas-r: var(--a-r-sm, 10px);
	color: var(--gsas-ink);
}
.gsas .gsas-group {
	margin: 1.25em 0 .5em;
	font-size: 1rem;
}
.gsas-list,
.gsas-questions,
.gsas-marked,
.gsas-qnav__list,
.gsas-filter {
	list-style: none;
	margin: 0;
	padding: 0;
}
.gsas-item {
	border: 1px solid var(--gsas-line);
	border-radius: var(--gsas-r);
	background: var(--gsas-surface);
	padding: 14px 16px;
	margin: 0 0 12px;
}
.gsas-item__head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 6px 12px;
}
.gsas .gsas-item__title {
	margin: 0;
	font-size: 1.05rem;
}
.gsas .gsas-item__facts {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
	gap: 6px 16px;
	margin: 8px 0 0;
}
.gsas .gsas-item__facts .gstu-facts__row {
	display: block;
	margin: 0;
	padding: 0;
	border: 0;
}
.gsas .gsas-item__facts dt {
	font-size: .85em;
	color: var(--gsas-muted);
}
.gsas .gsas-item__facts dd {
	margin: 0;
	font-weight: 600;
}
.gsas-item__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
	margin-top: 10px;
}
.gsas-item__hint {
	flex-basis: 100%;
	margin: 0;
}
.gsas-inline {
	display: inline;
	margin: 0;
}
.gsas-badge {
	display: inline-block;
	padding: 2px 10px;
	border: 1px solid var(--gsas-line);
	border-radius: 999px;
	background: var(--gsas-tint);
	color: var(--gsas-ink);
	font-size: .85em;
	font-weight: 600;
	white-space: nowrap;
}
.gsas-badge.is-todo,
.gsas-badge.is-warning {
	border-color: var(--gsas-ink);
}
.gsas-badge.is-good {
	border-color: var(--gsas-brand);
}
.gsas-badge.is-muted {
	background: var(--gsas-surface);
}

/* The runner. */
.gsas-runner__title {
	margin: 0 0 .5em;
	font-size: 1.15rem;
}
.gsas-bar {
	position: sticky;
	top: 0;
	z-index: 5;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 6px 16px;
	padding: 10px 14px;
	margin: 0 0 14px;
	border: 1px solid var(--gsas-line);
	border-radius: var(--gsas-r);
	background: var(--gsas-surface);
}
.gsas-bar p {
	margin: 0;
}
.gsas-bar__progress {
	font-weight: 600;
}
.gsas-bar__save:empty {
	min-height: 0;
}
.gsas-bar__save {
	flex-basis: 100%;
	font-size: .9em;
	color: var(--gsas-muted);
	min-height: 1.3em;
}
.gsas-timer {
	font-variant-numeric: tabular-nums;
	padding: 2px 10px;
	border: 2px solid transparent;
	border-radius: 8px;
}
.gsas-timer__value {
	font-size: 1.2em;
	font-weight: 700;
}
.gsas-timer__until {
	color: var(--gsas-muted);
	font-size: .9em;
}
.gsas-runner.is-low .gsas-timer {
	border-color: var(--gsas-danger);
	background: var(--gsas-surface);
}
.gsas-runner.is-time-up .gsas-questions {
	opacity: .7;
}
.gsas-qnav {
	margin: 0 0 14px;
}
.gsas-qnav__list {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}
.gsas-qnav__link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 44px;
	min-height: 44px;
	padding: 0 8px;
	border: 1px solid var(--gsas-line);
	border-radius: 8px;
	background: var(--gsas-surface);
	color: var(--gsas-ink);
	font-weight: 600;
	text-decoration: none;
}
.gsas-qnav__link.is-answered {
	background: var(--gsas-tint);
	border-style: solid;
	box-shadow: inset 0 -3px 0 var(--gsas-ink);
}
.gsas-qnav__link[aria-current] {
	border: 2px solid var(--gsas-ink);
}
.gsas-qnav__link:focus-visible,
.gsas-choice:focus-within,
.gsas-filter__link:focus-visible {
	outline: 3px solid var(--gsas-brand);
	outline-offset: 2px;
}
.gsas-q {
	border: 1px solid var(--gsas-line);
	border-radius: var(--gsas-r);
	background: var(--gsas-surface);
	padding: 16px;
	margin: 0 0 14px;
}
.gsas-q__set {
	border: 0;
	margin: 0;
	padding: 0;
	min-width: 0;
}
.gsas-q__legend {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 4px 12px;
	width: 100%;
	padding: 0;
	font-weight: 700;
}
.gsas-q__legend:focus {
	outline: none;
}
.gsas-q__legend:focus-visible {
	outline: 3px solid var(--gsas-brand);
	outline-offset: 4px;
}
.gsas-q__marks {
	font-weight: 600;
	color: var(--gsas-muted);
}
.gsas-q__text {
	margin: .5em 0 1em;
	font-size: 1.05em;
	line-height: 1.55;
}
.gsas-q__image img {
	max-width: 100%;
	height: auto;
}
.gsas-choices {
	display: grid;
	gap: 8px;
}
.gsas-choice {
	display: flex;
	align-items: center;
	gap: 10px;
	min-height: 44px;
	padding: 8px 12px;
	border: 1px solid var(--gsas-line);
	border-radius: 8px;
	background: var(--gsas-surface);
	cursor: pointer;
}
.gsas-choice:has( input:checked ) {
	border: 2px solid var(--gsas-ink);
	background: var(--gsas-tint);
	font-weight: 600;
}
.gsas-choice input {
	width: 1.15em;
	height: 1.15em;
	margin: 0;
	accent-color: var(--gsas-ink);
	flex: none;
}
.gsas .gsas-essay {
	width: 100%;
	min-height: 12em;
}
.gsas-blanks .gstu-input,
.gsas-q .gstu-input {
	width: 100%;
	max-width: 32em;
}
.gsas-q__saved {
	margin: 8px 0 0;
	min-height: 1.3em;
	font-size: .9em;
	color: var(--gsas-muted);
}
.gsas-steps {
	display: flex;
	justify-content: space-between;
	gap: 8px;
	margin: 0 0 12px;
}
.gsas-runner__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	justify-content: flex-end;
}
.gsas-dialog {
	max-width: min(440px, calc(100vw - 32px));
	border: 1px solid var(--gsas-line);
	border-radius: var(--gsas-r);
	background: var(--gsas-surface);
	color: var(--gsas-ink);
	padding: 20px;
}
.gsas-dialog::backdrop {
	background: rgba(15, 23, 42, .55);
}
.gsas-dialog__title {
	margin: 0 0 .5em;
}
.gsas-dialog .gstu-actions {
	display: flex;
	justify-content: flex-end;
	gap: 8px;
	flex-wrap: wrap;
}

/* Results and review. */
.gsas-results__title {
	margin: 0 0 .75em;
	font-size: 1.15rem;
}
.gsas-waiting {
	padding: 16px;
	border: 1px dashed var(--gsas-line);
	border-radius: var(--gsas-r);
	background: var(--gsas-tint);
	margin: 0 0 14px;
}
.gsas-waiting p {
	margin: 0 0 .25em;
}
.gsas-score {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
	gap: 10px;
	margin: 0 0 16px;
}
.gsas-score__tile {
	padding: 12px 14px;
	border: 1px solid var(--gsas-line);
	border-radius: var(--gsas-r);
	background: var(--gsas-surface);
}
.gsas-score__label {
	font-size: .85em;
	color: var(--gsas-muted);
}
.gsas-score__value {
	margin: 2px 0 0;
	font-size: 1.4em;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
}
.gsas-mq {
	border: 1px solid var(--gsas-line);
	border-left-width: 4px;
	border-radius: var(--gsas-r);
	background: var(--gsas-surface);
	padding: 14px 16px;
	margin: 0 0 12px;
}
.gsas-mq.is-right {
	border-left-color: var(--gsas-brand);
}
.gsas-mq.is-wrong {
	border-left-color: var(--gsas-ink);
	border-left-style: double;
	border-left-width: 6px;
}
.gsas-mq__head {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 12px;
	align-items: center;
}
.gsas-mq__head p {
	margin: 0;
	font-weight: 700;
}
.gsas-mq__marks {
	font-weight: 600 !important;
	color: var(--gsas-muted);
}
.gsas-mq__label {
	margin: .75em 0 .25em;
	font-size: .85em;
	font-weight: 700;
	color: var(--gsas-muted);
}
.gsas-mq__model,
.gsas-mq__why,
.gsas-mq__comment {
	padding: 8px 12px;
	border: 1px solid var(--gsas-line);
	border-radius: 8px;
	margin-top: 10px;
}
.gsas-mq__model.is-hidden {
	border-style: dashed;
}
.gsas-mq__model p,
.gsas-mq__why p,
.gsas-mq__comment p {
	margin: 0 0 .25em;
}
.gsas-filter {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0 0 12px;
}
.gsas-filter__link {
	display: inline-block;
	padding: 6px 12px;
	min-height: 32px;
	border: 1px solid var(--gsas-line);
	border-radius: 999px;
	color: var(--gsas-ink);
	text-decoration: none;
}
.gsas-filter__link[aria-current] {
	border: 2px solid var(--gsas-ink);
	background: var(--gsas-tint);
	font-weight: 700;
}
.gsas-muted {
	color: var(--gsas-muted);
}
.gsas-confirm {
	padding: 16px;
	border: 1px solid var(--gsas-line);
	border-radius: var(--gsas-r);
	background: var(--gsas-surface);
}
@media (max-width: 600px) {
	.gsas-bar {
		top: 0;
	}
	.gsas-runner__actions .gstu-btn,
	.gsas-steps .gstu-btn {
		flex: 1 1 auto;
	}
}
@media (prefers-reduced-motion: reduce) {
	.gsas * {
		transition: none !important;
		scroll-behavior: auto !important;
	}
}
.gsas-staff__list {
	list-style: none;
	margin: 0;
	padding: 0;
}
.gsas-staff__row {
	padding: 8px 0;
	border-top: 1px solid var(--gsas-line);
}
.gsas-staff__row:first-child {
	border-top: 0;
}
.gsas-staff__row p {
	margin: 0;
}
.gsas-staff__meta {
	color: var(--gsas-muted);
	font-size: .9em;
}

/* The staff portal's Tests tab: the builder, marking and analytics. */
.gsas-tb-list,
.gsas-tb-questions,
.gsas-tb-suggestions {
	list-style: none;
	margin: 0;
	padding: 0;
}
.gsas-tb-item,
.gsas-tb-q,
.gsas-tb-suggestion {
	padding: 12px 0;
	border-top: 1px solid var(--gsas-line);
}
.gsas-tb-item:first-child,
.gsas-tb-q:first-child,
.gsas-tb-suggestion:first-child {
	border-top: 0;
}
.gsas-tb-item__head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px 10px;
}
.gsas-tb-item__title {
	font-weight: 700;
	color: var(--gsas-ink);
}
.gsas-tb-item__meta,
.gsas-tb-q__head {
	margin: 4px 0 0;
	color: var(--gsas-muted);
	font-size: .92em;
}
.gsas-tb-q__head strong {
	color: var(--gsas-ink);
}
.gsas-tb-q__text {
	margin: 6px 0;
}
.gsas-tb-q__options {
	margin: 0 0 6px 1.2em;
	padding: 0;
}
.gsas-tb-q__answer {
	margin: 0 0 6px;
}
.gsas-tb-item__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 8px;
}
.gsas .gstu-btn--small {
	min-height: 36px;
	padding: 4px 12px;
	font-size: .9em;
}
.gsas-row {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
	gap: 0 16px;
}
.gsas-field .gstu-input,
.gsas-field .gstu-select,
.gsas-field .gstu-textarea {
	width: 100%;
	box-sizing: border-box;
}
.gsas-check .gstu-field__help {
	display: block;
	margin-left: 1.6em;
}
.gsas-details {
	margin: 12px 0 0;
	border: 1px solid var(--gsas-line);
	border-radius: var(--gsas-r);
	padding: 0 14px;
	background: var(--gsas-surface);
}
.gsas-details[open] {
	padding-bottom: 12px;
}
.gsas-details__summary {
	min-height: 44px;
	display: flex;
	align-items: center;
	font-weight: 700;
	cursor: pointer;
}
.gsas-details__summary:focus-visible {
	outline: 3px solid var(--gsas-brand);
	outline-offset: 2px;
}
.gsas-types {
	border: 0;
	padding: 0;
	margin: 0 0 8px;
}
.gsas-inline-check {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 36px;
	margin-right: 14px;
}
.gsas-table-wrap {
	overflow-x: auto;
}
.gsas-table {
	width: 100%;
	border-collapse: collapse;
	font-variant-numeric: tabular-nums;
}
.gsas-table caption {
	text-align: left;
	font-weight: 700;
	padding: 0 0 8px;
}
.gsas-table th,
.gsas-table td {
	text-align: left;
	padding: 6px 8px;
	border-top: 1px solid var(--gsas-line);
	vertical-align: middle;
	font-weight: 400;
}
.gsas-table thead th {
	font-size: .85em;
	color: var(--gsas-muted);
	border-top: 0;
}
.gsas-table tbody th {
	font-weight: 600;
}
.gsas-num {
	white-space: nowrap;
}
.gsas-bar-cell {
	width: 35%;
	min-width: 80px;
}
.gsas-bar-track {
	display: block;
	height: 6px;
	border-radius: 3px;
	background: var(--gsas-tint);
	border: 1px solid var(--gsas-line);
}
.gsas-bar-fill {
	display: block;
	height: 100%;
	border-radius: 3px;
	background: var(--gsas-ink);
}
.gsas-ai__form {
	margin: 0;
}
.gsas-field {
	margin: 0 0 12px;
}
.gsas-row {
	align-items: start;
}
.gsas-ai {
	margin: 0 0 12px;
}
.gsas-ai__ask {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px 12px;
	margin: 0 0 4px;
}

/* "Preview as a student": the runner read-only. */
.gsas-preview-set { border: 0; margin: 0; padding: 0; min-width: 0; }
.gsas-preview-set .gsas-choice,
.gsas-preview-set .gstu-input,
.gsas-preview-set .gstu-textarea { cursor: not-allowed; }
.gsas-preview-note { margin-block-end: 1rem; }

/* 0.5: how students sit a test, the four ways to add questions, each kind's fields. */
.gsas-sitting {
	border: 0;
	padding: 0;
	margin: 12px 0;
}
.gsas-choices--cards {
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.gsas-choice--card {
	align-items: flex-start;
	padding: 12px 14px;
}
.gsas-choice--card input {
	margin-top: .2em;
}
.gsas-choice__label strong {
	display: block;
}
.gsas-choice__help {
	display: block;
	margin-top: 2px;
	color: var(--gsas-muted);
	font-weight: 400;
	font-size: .92em;
}
.gsas-ways__title {
	margin: 20px 0 6px;
}
.gsas-ways {
	margin: 0 0 4px;
	padding: 10px 14px 10px 30px;
	border-radius: var(--gsas-r);
	background: var(--gsas-tint);
	font-size: .92em;
}
.gsas-ways li + li {
	margin-top: 4px;
}
.gsas-details--inner {
	background: var(--gsas-tint);
}
.gsas-kind[hidden] {
	display: none;
}
.gsas-paper-now {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
}

/* The runner: numbers, matching, ordering, cells, files and the paper. */
.gsas-number__row {
	display: flex;
	align-items: center;
	gap: 8px;
}
.gsas-number__row .gstu-input {
	max-width: 14em;
}
.gsas-number__unit {
	font-weight: 600;
}
.gsas-match,
.gsas-cells {
	display: grid;
	gap: 8px;
}
.gsas-match__row {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	align-items: center;
	gap: 12px;
	margin: 0;
	padding: 8px 12px;
	border: 1px solid var(--gsas-line);
	border-radius: 8px;
	background: var(--gsas-surface);
}
.gsas-match__row .gstu-field__label {
	margin: 0;
}
.gsas-order {
	display: grid;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}
.gsas-order__item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	min-height: 44px;
	padding: 6px 12px;
	border: 1px solid var(--gsas-line);
	border-radius: 8px;
	background: var(--gsas-surface);
}
.gsas-order__place {
	width: auto;
	min-width: 6.5em;
}
.gsas-file {
	margin-top: 12px;
}
.gsas-file__now {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin: 4px 0 8px;
}
.gsas-file__now[hidden] {
	display: none;
}
.gsas-file__status {
	display: block;
	margin-top: 4px;
	color: var(--gsas-muted);
}
.gsas-paper {
	margin: 12px 0 16px;
	padding: 12px 14px;
	border: 1px solid var(--gsas-line);
	border-radius: var(--gsas-r);
	background: var(--gsas-tint);
}
.gsas-paper__title {
	margin: 0 0 6px;
}
.gsas-q__several {
	margin: 0 0 6px;
}
@media (max-width: 520px) {
	.gsas-match__row {
		grid-template-columns: 1fr;
		gap: 6px;
	}
}

/* A student's tests (staff portal): rows stack on a phone. */
.gsas-st-actions {
	white-space: nowrap;
}
.gsas-st-actions .gsas-inline,
.gsas-st-actions .gstu-btn {
	display: inline-flex;
	margin: 2px 0;
}
@media (max-width: 640px) {
	.gsas-st-table thead {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip: rect(0 0 0 0);
	}
	.gsas-st-table,
	.gsas-st-table tbody,
	.gsas-st-table tr,
	.gsas-st-table td {
		display: block;
		width: 100%;
		box-sizing: border-box;
	}
	.gsas-st-table tr {
		padding: 10px 0;
		border-bottom: 1px solid var(--gsas-line);
	}
	.gsas-st-table td {
		border: 0;
		padding: 2px 0;
	}
	.gsas-st-actions {
		white-space: normal;
		display: flex;
		flex-wrap: wrap;
		gap: 6px;
		padding-top: 6px;
	}
}

/* 0.5: the question bank, copy to another group. */
.gsas-subhead {
	margin: 18px 0 6px;
	font-size: 1em;
}
.gsas-bank .gsas-check {
	margin: 0 0 4px;
}
.gsas-pages p {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
}

/* 0.5: behaviour records and the student's record. */
.gsas-bh-list {
	margin: 0;
	padding: 0;
	list-style: none;
}
.gsas-bh-item {
	padding: 8px 0;
	border-bottom: 1px solid var(--gsas-line);
}
.gsas-bh-item:last-child {
	border-bottom: 0;
}
.gsas-bh-item p {
	margin: 0;
}
.gsas-bh-item__bits,
.gsas-bh-item__notes {
	color: var(--gsas-muted);
	margin-top: 2px !important;
}
.gsas-bh-pick .gsas-row {
	align-items: end;
}
.gsas .gsas-order__item .gstu-select {
	width: auto;
	min-width: 7em;
	flex: none;
}
.gsas-record__table {
	width: 100%;
	border-collapse: collapse;
	margin: 8px 0;
}
.gsas-record__table th,
.gsas-record__table td {
	padding: 8px 10px;
	border-bottom: 1px solid var(--gsas-line);
	text-align: left;
}
.gsas-record__table thead th {
	font-size: .9em;
	color: var(--gsas-muted);
}

/* 0.5: exam mode and a paper's pages. */
.gsas-exam {
	margin: 12px 0;
	padding: 12px 14px;
	border: 2px solid var(--gsas-ink);
	border-radius: var(--gsas-r);
	background: var(--gsas-tint);
}
.gsas-exam p {
	margin: 4px 0;
}
.gsas-runner[data-exam] .gsas-runner__form,
.gsas-runner[data-exam] .gsas-qnav,
.gsas-runner[data-exam] .gsas-paper {
	display: none;
}
.gsas-runner.is-exam-on .gsas-runner__form,
.gsas-runner.is-exam-on .gsas-paper {
	display: block;
}
.gsas-runner.is-exam-on .gsas-qnav:not([hidden]) {
	display: block;
}
.gsas-runner.is-exam-on .gsas-exam [data-gsas-exam-go] {
	display: none;
}
.gsas-runner.is-exam-on .gsas-exam {
	border-width: 1px;
}
.gsas-runner.is-exam-on .gsas-exam > p:not(.gsas-exam__title):not(.gsas-exam__count) {
	display: none;
}
.gsas-pages__title {
	margin: 0 0 6px;
	font-weight: 700;
}
.gsas-pages__list {
	margin: 0 0 10px;
	padding-left: 1.4em;
}
.gsas-pages__item {
	margin: 4px 0;
}
.gsas-pages__item span {
	margin-right: 6px;
}

/* "Open TargetGrade": the page's button (phones only when the portal's sidebar has it). */
.gsas-open-tg .gstu-btn { display: inline-flex; align-items: center; gap: 8px; }
.gsas-open-tg__logo { width: 20px; height: 20px; border-radius: 5px; }
@media (min-width: 821px) { .gsas-open-tg--phone { display: none; } }
.gsas-open-tg-nav .gstu-note { display: block; margin: 4px 12px 0; font-size: .8125rem; }
