/**
 * Sample Paper Exam — the parts the Blueprint Exam stylesheet does not cover.
 *
 * The shell (header, timer, tabs, question pane, palette, action bar, modal,
 * results card) comes from myaischool-lt-blueprint-exam.css, which loads first.
 * What is here is only what a written board paper adds: the answer box and its
 * voice/camera tools, sub-question blocks, the per-section scan uploader, the
 * full-screen takeover for a paper embedded in a topic page, and the marked
 * report. Everything inherits the blueprint's palette variables.
 */

/* ── Full-screen takeover ─────────────────────────────────────────────
   A paper embedded in a topic page would otherwise run inside the site's
   chrome, with the nav one mis-click away from abandoning a three-hour
   attempt. On Start the shell takes the viewport, whether or not the browser
   grants the native Fullscreen request. */
html.slms-sp-fullscreen,
body.slms-sp-fullscreen { overflow: hidden; }

/* Header and tabs are pinned and only the body scrolls. The blueprint gets the
   same effect from a sticky header on a page that scrolls as a whole; inside a
   fixed container that would let the tab bar slide underneath the header, where
   it is still "visible" but no longer clickable. */
body.slms-sp-fullscreen .slms-sp-app .slms-exam-shell {
	position: fixed;
	inset: 0;
	z-index: 99999;
	margin: 0;
	min-height: 0;
	height: 100%;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	background: #f3f5f8;
}
body.slms-sp-fullscreen .slms-sp-app .slms-exam-header,
body.slms-sp-fullscreen .slms-sp-app .slms-exam-tabs {
	flex: 0 0 auto;
	position: static;
}
body.slms-sp-fullscreen .slms-sp-app .slms-exam-body {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
}
body.slms-sp-fullscreen #wpadminbar { display: none !important; }

/* The submit dialog is a sibling of the shell, and the blueprint gives it
   z-index 1000 — below the 99999 the shell takes in full screen. It painted
   underneath: on screen, but swallowing every click on "Submit for evaluation",
   so a paper could only end by running out of time.
   Stated unconditionally rather than only inside the full-screen block: the
   dialog must outrank the shell whenever the shell exists, and a rule that
   only applies in one state is a rule waiting to be missed. */
.slms-sp-app .slms-exam-modal { z-index: 100001; }


/* ── Start screen extras ──────────────────────────────────────────────── */
.slms-sp-start-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.slms-sp-chip {
	padding: 4px 12px; border-radius: 999px; background: #eef5fd;
	color: var(--slms-blue-dark); font-size: 12px; font-weight: 700;
	letter-spacing: .04em; text-transform: uppercase;
}
.slms-sp-start-note { margin: 10px 0 0; font-size: 13px; color: #666; }
.slms-exam-start-instructions ol { margin: 8px 0 0; padding-left: 20px; }
.slms-exam-start-instructions ol li { margin: 4px 0; }

.slms-sp-save-state { font-size: 12px; opacity: .85; min-width: 46px; }
.slms-sp-save-state.is-error { color: #ffd86b; }

/* ── Question pane additions ──────────────────────────────────────────── */
.slms-sp-stimulus {
	padding: 14px 18px; margin: 0 0 14px; background: #f7f9fc;
	border-left: 3px solid var(--slms-gray); border-radius: 0 4px 4px 0;
	font-size: 15px; line-height: 1.7;
}
.slms-sp-stimulus table,
.slms-exam-question-body table {
	width: 100%; border-collapse: collapse; margin: 10px 0;
}
.slms-sp-stimulus td, .slms-sp-stimulus th,
.slms-exam-question-body td, .slms-exam-question-body th {
	border: 1px solid #dfe4ea; padding: 6px 10px; text-align: left;
}
.slms-exam-question-image figcaption {
	margin-top: 6px; font-size: 12px; color: #777; font-style: italic;
}

.slms-sp-choicebar {
	display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
	margin: 0 0 14px; font-size: 13px; color: #666;
}
.slms-btn.slms-sp-pill {
	padding: 5px 14px; border-radius: 999px; background: #fff;
	color: #444; border-color: #d0d7e0; font-size: 13px;
}
.slms-btn.slms-sp-pill.is-active {
	background: var(--slms-blue); border-color: var(--slms-blue); color: #fff;
}

.slms-sp-vi details { font-size: 13px; margin: 0 0 14px; }
.slms-sp-vi summary { cursor: pointer; color: #666; }
.slms-sp-vi div { margin-top: 8px; padding-left: 14px; border-left: 2px solid #e3e8ef; }

/* ── Sub-questions ────────────────────────────────────────────────────── */
.slms-sp-part {
	padding: 14px 0 4px 16px; margin: 14px 0 0; border-left: 3px solid #eef1f5;
}
.slms-sp-part__head { display: flex; align-items: baseline; gap: 10px; }
.slms-sp-part__num { font-weight: 700; }
.slms-sp-part__marks { margin-left: auto; font-size: 13px; color: var(--slms-blue-dark); font-weight: 600; }
.slms-sp-part__body { margin: 6px 0 0; line-height: 1.7; }
.slms-sp-part__or { margin: 8px 0; font-size: 14px; }
.slms-sp-part__or span {
	display: inline-block; margin-bottom: 4px; font-weight: 700;
	font-size: 12px; letter-spacing: .08em; color: #666;
}

/* ── Answer area ──────────────────────────────────────────────────────── */
.slms-sp-answer { display: block; margin-top: 12px; }
.slms-sp-answer__input {
	width: 100%; padding: 12px 14px; border: 1px solid #d0d7e0; border-radius: 4px;
	line-height: 1.7; resize: vertical; background: #fcfdfe;
}
.slms-sp-answer__input:focus {
	outline: none; border-color: var(--slms-blue);
	box-shadow: 0 0 0 3px rgba(233, 120, 39, .15); background: #fff;
}
.slms-sp-answer__tools { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.slms-btn.slms-sp-tool { padding: 6px 12px; font-size: 13px; border-radius: 999px; }
.slms-btn.slms-sp-tool.is-listening {
	background: #fdeaea; border-color: var(--slms-red); color: var(--slms-red);
}
.slms-sp-diagramhint {
	margin: 8px 0 0; padding: 8px 12px; background: #fff8e6;
	border-radius: 4px; font-size: 13px; color: #8a5a00;
}
.slms-sp-answer__status { margin: 8px 0 0; font-size: 13px; color: #666; }
.slms-sp-answer__status.is-error { color: var(--slms-red); }

.slms-sp-answer__images {
	display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 12px; margin-top: 12px;
}
.slms-sp-answerimg {
	position: relative; margin: 0; padding: 8px;
	border: 1px solid #e0e0e0; border-radius: 6px; background: #fff;
}
.slms-sp-answerimg img { display: block; max-width: 100%; border-radius: 3px; }
.slms-sp-answerimg__remove {
	position: absolute; top: 4px; right: 4px; width: 24px; height: 24px;
	border: 0; border-radius: 50%; background: rgba(255,255,255,.92);
	color: var(--slms-red); cursor: pointer; line-height: 1;
}
.slms-sp-answerimg figcaption {
	margin-top: 8px; font-size: 12px; line-height: 1.5; color: #666;
	max-height: 120px; overflow-y: auto; white-space: pre-wrap;
}
.slms-sp-answerimg figcaption strong { display: block; margin-bottom: 4px; color: #333; }

/* ── Per-section scan upload (sidebar) ────────────────────────────────── */
.slms-sp-sectionupload {
	padding: 10px 12px; background: #f7f9fc;
	border: 1px dashed var(--slms-blue); border-radius: 4px;
}
.slms-sp-sectionupload__hint { margin: 0 0 10px; font-size: 11.5px; line-height: 1.5; color: #666; }
.slms-btn.slms-sp-sectionupload__btn { width: 100%; font-size: 13px; padding: 8px 10px; }
.slms-sp-sectionupload__files { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 5px; }
.slms-sp-sheetfile {
	display: flex; align-items: center; gap: 7px;
	padding: 5px 8px; background: #fff; border: 1px solid #e5e9ef;
	border-radius: 3px; font-size: 12px;
}
.slms-sp-sheetfile__name { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slms-sp-sheetfile__remove {
	border: 0; background: transparent; color: var(--slms-red);
	cursor: pointer; font-size: 13px; line-height: 1; padding: 2px 3px;
}
.slms-sp-sectionupload__status { margin: 8px 0 0; font-size: 12px; color: #666; }
.slms-sp-sectionupload__status.is-error { color: var(--slms-red); }

/* ── Submit modal ─────────────────────────────────────────────────────── */
.slms-sp-modal-note { font-size: 13px; color: #666; }
.slms-sp-modal-warn { color: #a86200; font-weight: 600; }

/* ── Report ───────────────────────────────────────────────────────────── */
.slms-sp-band--high .slms-exam-score strong { color: #2e9e5b; }
.slms-sp-band--mid  .slms-exam-score strong { color: #e8912a; }
.slms-sp-band--low  .slms-exam-score strong { color: var(--slms-red); }

.slms-sp-report-h {
	margin: 28px 0 12px; font-size: 13px; text-transform: uppercase;
	letter-spacing: .06em; color: #666;
}
.slms-sp-report-notes {
	margin: 0 0 18px; padding: 12px 16px; background: #fff8e6;
	border-radius: 6px; font-size: 14px; color: #8a5a00;
}
.slms-sp-report-notes p { margin: 0 0 6px; }
.slms-sp-report-notes p:last-child { margin: 0; }
.slms-sp-report-overall {
	padding: 18px 22px; margin: 0 0 18px; background: #fff;
	border: 1px solid #e0e0e0; border-left: 4px solid var(--slms-blue); border-radius: 6px;
}
.slms-sp-report-overall h3 { margin: 0 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: #666; }
.slms-sp-report-overall p { margin: 0; }

.slms-sp-secgrid { display: grid; gap: 10px; }
.slms-sp-secgrid__item {
	display: grid; grid-template-columns: 1fr auto; gap: 4px 14px;
	padding: 12px 16px; background: #fff; border: 1px solid #e0e0e0; border-radius: 6px;
}
.slms-sp-secgrid__name { font-weight: 600; }
.slms-sp-secgrid__name em { font-weight: 400; font-style: normal; color: #777; }
.slms-sp-secgrid__score { font-weight: 700; font-variant-numeric: tabular-nums; }
.slms-sp-secgrid__bar {
	grid-column: 1 / -1; height: 6px; border-radius: 999px; background: #eef1f5; overflow: hidden;
}
.slms-sp-secgrid__bar i { display: block; height: 100%; background: var(--slms-blue); }

.slms-sp-result {
	padding: 18px 20px; margin: 0 0 14px; background: #fff;
	border: 1px solid #e0e0e0; border-left: 4px solid #e0e0e0; border-radius: 6px; text-align: left;
}
.slms-sp-result--correct   { border-left-color: var(--slms-green); }
.slms-sp-result--partial   { border-left-color: var(--slms-orange); }
.slms-sp-result--incorrect { border-left-color: var(--slms-red); }
.slms-sp-result header { display: flex; flex-wrap: wrap; align-items: baseline; gap: 12px; margin-bottom: 10px; }
.slms-sp-result__num { font-weight: 700; }
.slms-sp-result__marks { margin-left: auto; font-weight: 700; font-variant-numeric: tabular-nums; }
.slms-sp-result__src { width: 100%; font-size: 11px; color: #888; font-style: italic; }
.slms-sp-result__q { margin-bottom: 12px; line-height: 1.7; }
.slms-sp-result__yours,
.slms-sp-result__feedback { padding: 10px 14px; border-radius: 4px; margin-bottom: 10px; font-size: 14px; }
.slms-sp-result__yours { background: #f6f8fb; }
.slms-sp-result__yours p { margin: 4px 0 0; white-space: pre-wrap; }
.slms-sp-result__yours--blank { color: #888; font-style: italic; }
.slms-sp-result__feedback { background: #eef5fd; }
.slms-sp-result__feedback p { margin: 4px 0 0; }
.slms-sp-result__img { display: block; margin: 10px 0; border: 1px solid #e0e0e0; border-radius: 4px; max-width: 320px; }
.slms-sp-result__model summary { cursor: pointer; font-weight: 600; font-size: 14px; color: var(--slms-accent); }
.slms-sp-result__model div { margin-top: 8px; padding: 10px 14px; background: #fbfcfd; border-radius: 4px; font-size: 14px; }
.slms-sp-result__model-inline { margin: 0; font-size: 14px; }
.slms-sp-report-actions { text-align: center; margin-top: 26px; display: flex; flex-wrap: wrap;
                          gap: 10px; align-items: center; justify-content: center; }
/* Sits between the score card and the marked questions, so it reads as part
   of the result rather than as a footer to it. */
.slms-sp-report-actions--top { margin: 18px 0 22px; padding-bottom: 20px;
                               border-bottom: 1px solid #e7ebef; }
/* The hint takes the whole row under the two buttons, so it reads as a note
   about them rather than as a third thing to click. */
.slms-sp-report-hint { flex: 1 0 100%; margin: 2px 0 0; font-size: 13px; color: var(--slms-muted, #667); }

@media (max-width: 640px) {
	.slms-sp-answer__tools { flex-direction: column; }
	.slms-btn.slms-sp-tool { width: 100%; }
	.slms-sp-answer__images { grid-template-columns: 1fr; }
}

/* ── Sat on paper ─────────────────────────────────────────────────────
   The second route through the same exam: print, write, scan back in. */
.slms-sp-onpaper {
	margin-top: 24px; padding: 18px 20px;
	border: 1px solid #e0e0e0; border-radius: 8px; background: #fafbfc;
}
.slms-sp-onpaper h3 { margin: 0 0 6px; font-size: 15px; }
.slms-sp-onpaper p  { margin: 0 0 12px; font-size: 13px; color: #555; line-height: 1.5; }
.slms-sp-onpaper__actions { display: flex; gap: 10px; flex-wrap: wrap; }

.slms-sp-printed__actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.slms-sp-printed .slms-sp-sectionupload { margin-top: 16px; }
.slms-sp-file-remove {
	border: none; background: none; cursor: pointer; color: #999;
	font-size: 13px; padding: 0 4px;
}
.slms-sp-file-remove:hover { color: #c0392b; }
.slms-sp-report-mode {
	margin: 0 0 14px; padding: 8px 12px; border-radius: 6px;
	background: #eef5fd; color: #1a4a7a; font-size: 13px; font-weight: 600;
}
