/**
 * Online Test — student-facing styles.
 *
 * Mobile first: every screen is laid out for a phone, then the paper and
 * the question palette move side by side from 900px up. Colours come from
 * the theme chosen in Settings, so a school can match its own identity
 * without editing this file.
 *
 * @package OnlineTestPlugin
 */

.ot-app {
	--ot-accent: #4338ca;
	--ot-accent-2: #6366f1;
	--ot-ink: #1e1b4b;
	--ot-paper: #ffffff;
	--ot-bg: #f4f5fb;
	--ot-line: #e2e5f0;
	--ot-text: #1f2333;
	--ot-muted: #6b7280;
	--ot-ok: #0f9d58;
	--ot-ok-bg: #e7f6ee;
	--ot-warn: #b45309;
	--ot-warn-bg: #fdf3e3;
	--ot-bad: #c62828;
	--ot-bad-bg: #fdecec;
	--ot-radius: 14px;
	--ot-shadow: 0 1px 2px rgba(0,0,0,.06), 0 8px 24px rgba(0,0,0,.06);

	box-sizing: border-box;
	max-width: 1120px;
	margin: 0 auto;
	padding: 16px;
	color: var(--ot-text);
	font-size: 16px;
	line-height: 1.55;
	-webkit-text-size-adjust: 100%;
}

.ot-app *,
.ot-app *::before,
.ot-app *::after { box-sizing: inherit; }

.ot-hidden { display: none !important; }
.ot-center { text-align: center; }
.ot-muted { color: var(--ot-muted); }

/* ------------------------------- branding ------------------------------- */

.ot-brand {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 4px 4px 16px;
}

.ot-brand-logo {
	width: 56px;
	height: 56px;
	object-fit: contain;
	border-radius: 12px;
	background: #fff;
	padding: 4px;
	box-shadow: var(--ot-shadow);
}

.ot-brand-name {
	margin: 0;
	font-size: 1.15rem;
	line-height: 1.25;
	font-weight: 700;
	color: var(--ot-ink);
}

.ot-brand-tag {
	margin: 2px 0 0;
	font-size: .85rem;
	color: var(--ot-muted);
}

/* --------------------------------- rail -------------------------------- */

.ot-steps-rail {
	display: flex;
	gap: 6px;
	margin: 0 0 16px;
	font-size: .72rem;
	text-transform: uppercase;
	letter-spacing: .06em;
}

.ot-rail-step {
	flex: 1;
	padding: 7px 4px;
	text-align: center;
	color: var(--ot-muted);
	background: #eceefa;
	border-radius: 99px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.ot-rail-step.is-on {
	background: color-mix(in srgb, var(--ot-accent) 14%, #fff);
	color: var(--ot-accent);
	font-weight: 600;
}

.ot-rail-step.is-now {
	background: var(--ot-accent);
	color: #fff;
}

/* -------------------------------- cards -------------------------------- */

.ot-card {
	background: var(--ot-paper);
	border: 1px solid var(--ot-line);
	border-radius: var(--ot-radius);
	box-shadow: var(--ot-shadow);
	padding: 20px;
	margin-bottom: 16px;
}

.ot-h2 {
	margin: 0 0 6px;
	font-size: 1.22rem;
	font-weight: 700;
	color: var(--ot-ink);
}

.ot-field { display: block; margin: 16px 0 12px; }

.ot-field-label {
	display: block;
	margin-bottom: 6px;
	font-size: .85rem;
	font-weight: 600;
	color: var(--ot-ink);
}

.ot-app input[type="text"],
.ot-app textarea {
	width: 100%;
	padding: 13px 14px;
	font: inherit;
	color: inherit;
	background: #fff;
	border: 1.5px solid var(--ot-line);
	border-radius: 10px;
	transition: border-color .15s, box-shadow .15s;
}

.ot-app input[type="text"]:focus,
.ot-app textarea:focus {
	outline: none;
	border-color: var(--ot-accent);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--ot-accent) 18%, transparent);
}

.ot-error {
	margin-top: 10px;
	color: var(--ot-bad);
	font-size: .9rem;
	min-height: 1.2em;
}

.ot-link { color: var(--ot-accent); text-decoration: none; font-size: .9rem; }
.ot-link:hover { text-decoration: underline; }

/* ------------------------------- buttons ------------------------------- */

.ot-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 48px;
	padding: 12px 20px;
	font: inherit;
	font-weight: 600;
	color: #fff;
	background: var(--ot-accent);
	border: 1.5px solid var(--ot-accent);
	border-radius: 10px;
	cursor: pointer;
	transition: filter .15s, box-shadow .15s;
	-webkit-appearance: none;
}

.ot-btn:hover:not(:disabled) { filter: brightness(1.08); }
.ot-btn:disabled { opacity: .6; cursor: default; }
.ot-btn-block { width: 100%; }
.ot-btn-sm { min-height: 36px; padding: 6px 12px; font-size: .85rem; }

.ot-btn-outline {
	color: var(--ot-accent);
	background: #fff;
}

.ot-btn-ghost {
	color: #fff;
	background: rgba(255, 255, 255, .18);
	border-color: rgba(255, 255, 255, .5);
}

/* --------------------------- student details --------------------------- */

.ot-student-card {
	margin: 4px 0 18px;
	border: 1px solid var(--ot-line);
	border-radius: 12px;
	overflow: hidden;
}

.ot-student-row {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	padding: 11px 14px;
	border-bottom: 1px solid var(--ot-line);
	background: #fbfbff;
}

.ot-student-row:last-child { border-bottom: 0; }
.ot-student-row dt { margin: 0; font-size: .85rem; color: var(--ot-muted); }
.ot-student-row dd { margin: 0; font-weight: 600; text-align: right; color: var(--ot-ink); }

/* ------------------------------ exam list ------------------------------ */

.ot-exam-list { display: grid; gap: 12px; margin: 14px 0 6px; }

.ot-exam-card {
	display: flex;
	flex-direction: column;
	gap: 12px;
	padding: 16px;
	border: 1.5px solid var(--ot-line);
	border-radius: 12px;
	background: #fbfbff;
}

.ot-exam-card.is-resume {
	border-color: color-mix(in srgb, var(--ot-warn) 45%, #fff);
	background: var(--ot-warn-bg);
}

.ot-exam-name { margin: 0; font-size: 1.02rem; color: var(--ot-ink); }
.ot-exam-meta { margin: 4px 0 0; font-size: .86rem; color: var(--ot-muted); }

.ot-badge {
	display: inline-block;
	padding: 2px 8px;
	font-size: .7rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .04em;
	border-radius: 99px;
	background: #eceefa;
	color: var(--ot-accent);
	vertical-align: middle;
}

.ot-badge.is-warn { background: #fde9c8; color: var(--ot-warn); }

.ot-exam-instructions { margin-top: 8px; font-size: .88rem; }
.ot-exam-instructions summary { cursor: pointer; color: var(--ot-accent); font-weight: 600; }
.ot-exam-instructions div { margin-top: 6px; color: var(--ot-muted); }

.ot-empty { padding: 22px 0; text-align: center; color: var(--ot-muted); }

/* ----------------------------- test screen ----------------------------- */

.ot-proctor-banner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 12px 16px;
	margin-bottom: 12px;
	border-radius: 12px;
	font-size: .92rem;
	font-weight: 600;
	color: #fff;
	background: var(--ot-warn);
}

.ot-proctor-banner.is-info { background: var(--ot-accent); }

.ot-test-bar {
	position: sticky;
	top: 0;
	z-index: 5;
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 14px 16px;
	margin-bottom: 14px;
	border-radius: var(--ot-radius);
	color: #fff;
	background: linear-gradient(135deg, var(--ot-ink), var(--ot-accent));
	box-shadow: var(--ot-shadow);
}

.ot-test-bar-main { flex: 1; min-width: 0; }

.ot-app .ot-exam-title {
	margin: 0;
	color: inherit; /* the theme's own heading colour is unreadable on the dark bar */
	font-family: inherit;
	font-size: 1.05rem;
	font-weight: 700;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.ot-test-meta {
	margin-top: 2px;
	font-size: .8rem;
	opacity: .85;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.ot-timer { position: relative; width: 62px; height: 62px; flex: none; }
.ot-timer-svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ot-timer-track { fill: none; stroke: rgba(255, 255, 255, .25); stroke-width: 4; }

.ot-timer-arc {
	fill: none;
	stroke: #fff;
	stroke-width: 4;
	stroke-linecap: round;
	transition: stroke-dashoffset 1s linear, stroke .3s;
}

.ot-timer-text {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: .82rem;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
}

.ot-timer.is-warning .ot-timer-arc { stroke: #ffd166; }
.ot-timer.is-warning .ot-timer-text { color: #ffd166; animation: ot-pulse 1s ease-in-out infinite; }

@keyframes ot-pulse {
	50% { opacity: .45; }
}

@media (prefers-reduced-motion: reduce) {
	.ot-timer.is-warning .ot-timer-text { animation: none; }
	.ot-app * { scroll-behavior: auto !important; }
}

.ot-test-body { display: grid; gap: 14px; }

/* ------------------------------- palette ------------------------------- */

.ot-palette-wrap {
	order: 2;
	padding: 16px;
	background: var(--ot-paper);
	border: 1px solid var(--ot-line);
	border-radius: var(--ot-radius);
	box-shadow: var(--ot-shadow);
}

.ot-palette-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 8px;
	margin-bottom: 10px;
	color: var(--ot-ink);
}

.ot-save-state { font-size: .76rem; color: var(--ot-muted); }
.ot-save-state[data-state="saved"] { color: var(--ot-ok); }
.ot-save-state[data-state="failed"] { color: var(--ot-bad); }

.ot-palette {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(42px, 1fr));
	gap: 7px;
}

.ot-pal {
	min-height: 42px;
	font: inherit;
	font-weight: 700;
	font-size: .9rem;
	color: var(--ot-muted);
	background: #f1f2f9;
	border: 1.5px solid transparent;
	border-radius: 9px;
	cursor: pointer;
}

.ot-pal.is-answered { background: var(--ot-ok-bg); color: var(--ot-ok); }
.ot-pal.is-marked { background: var(--ot-warn-bg); color: var(--ot-warn); }
.ot-pal.is-page { border-color: var(--ot-accent); }

.ot-legend {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin: 12px 0;
	padding: 0;
	list-style: none;
	font-size: .76rem;
	color: var(--ot-muted);
}

.ot-legend li { display: flex; align-items: center; gap: 5px; }

.ot-dot {
	width: 11px;
	height: 11px;
	border-radius: 3px;
	background: #e6e7ef;
}

.ot-dot.is-answered { background: var(--ot-ok); }
.ot-dot.is-marked { background: var(--ot-warn); }
.ot-dot.is-empty { background: #d6d8e4; }

/* -------------------------------- paper -------------------------------- */

.ot-paper { order: 1; min-width: 0; }

.ot-instructions {
	padding: 14px 16px;
	margin-bottom: 12px;
	font-size: .9rem;
	background: #eef0fb;
	border-left: 4px solid var(--ot-accent);
	border-radius: 10px;
}

.ot-instructions strong { display: block; margin-bottom: 4px; color: var(--ot-ink); }

.ot-q {
	padding: 18px;
	margin-bottom: 14px;
	background: var(--ot-paper);
	border: 1px solid var(--ot-line);
	border-radius: var(--ot-radius);
	box-shadow: var(--ot-shadow);
	transition: box-shadow .2s, border-color .2s;
}

.ot-q.is-focus {
	border-color: var(--ot-accent);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--ot-accent) 20%, transparent);
}

.ot-q-head { display: flex; align-items: flex-start; gap: 10px; }

.ot-q-num {
	flex: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	font-size: .82rem;
	font-weight: 700;
	color: #fff;
	background: var(--ot-accent);
	border-radius: 8px;
}

.ot-q-text { flex: 1; font-weight: 600; color: var(--ot-ink); }

.ot-q-marks {
	flex: none;
	font-size: .74rem;
	font-weight: 700;
	color: var(--ot-accent);
	background: #eceefa;
	padding: 3px 9px;
	border-radius: 99px;
	white-space: nowrap;
}

.ot-q-image { margin: 12px 0; text-align: center; }

.ot-q-image img {
	max-width: 100%;
	height: auto;
	border-radius: 10px;
	border: 1px solid var(--ot-line);
}

/* ------------------------------- options ------------------------------- */

.ot-options { display: grid; gap: 9px; margin-top: 14px; }

.ot-option {
	display: flex;
	align-items: center;
	gap: 12px;
	width: 100%;
	min-height: 52px;
	padding: 10px 14px;
	font: inherit;
	text-align: left;
	color: var(--ot-text);
	background: #fbfbff;
	border: 1.5px solid var(--ot-line);
	border-radius: 11px;
	cursor: pointer;
	transition: border-color .15s, background .15s;
}

.ot-option:hover { border-color: color-mix(in srgb, var(--ot-accent) 45%, #fff); }

.ot-option-letter {
	flex: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	font-size: .84rem;
	font-weight: 700;
	color: var(--ot-accent);
	background: #eceefa;
	border-radius: 50%;
}

.ot-option-text { flex: 1; }

.ot-option.is-on {
	border-color: var(--ot-accent);
	background: color-mix(in srgb, var(--ot-accent) 8%, #fff);
}

.ot-option.is-on .ot-option-letter { color: #fff; background: var(--ot-accent); }

.ot-options.is-junior { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }

.ot-options.is-junior .ot-option {
	flex-direction: column;
	min-height: 92px;
	justify-content: center;
	text-align: center;
	font-size: 1.3rem;
	font-weight: 700;
}

.ot-colors {
	display: flex;
	flex-wrap: wrap;
	gap: 14px;
	margin-top: 14px;
}

.ot-color {
	width: 74px;
	height: 74px;
	border: 4px solid #fff;
	border-radius: 18px;
	box-shadow: 0 0 0 1.5px var(--ot-line);
	cursor: pointer;
}

.ot-color.is-on { box-shadow: 0 0 0 4px var(--ot-accent); }

.ot-q-foot {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 14px;
	padding-top: 12px;
	border-top: 1px dashed var(--ot-line);
}

.ot-chip {
	padding: 6px 12px;
	font: inherit;
	font-size: .8rem;
	font-weight: 600;
	color: var(--ot-muted);
	background: #f3f4fa;
	border: 1.5px solid transparent;
	border-radius: 99px;
	cursor: pointer;
}

.ot-chip:hover { color: var(--ot-ink); }
.ot-chip.is-on { color: var(--ot-warn); background: var(--ot-warn-bg); border-color: color-mix(in srgb, var(--ot-warn) 40%, #fff); }

.ot-nav {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 4px 0 20px;
}

.ot-nav-count { font-size: .84rem; color: var(--ot-muted); text-align: center; }

/* ---------------------------- review sheet ----------------------------- */

.ot-sheet {
	position: fixed;
	inset: 0;
	z-index: 100;
	display: flex;
	align-items: flex-end;
	justify-content: center;
	padding: 0;
	background: rgba(0,0,0,.55);
}

.ot-sheet-inner {
	width: 100%;
	max-width: 560px;
	max-height: 88vh;
	overflow: auto;
	margin: 0;
	border-radius: 18px 18px 0 0;
}

.ot-review-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 14px 0; }

.ot-stat {
	padding: 12px 8px;
	text-align: center;
	border-radius: 12px;
	background: #f4f5fb;
}

.ot-stat b { display: block; font-size: 1.5rem; line-height: 1.1; color: var(--ot-ink); }
.ot-stat span { font-size: .74rem; color: var(--ot-muted); }
.ot-stat.is-ok { background: var(--ot-ok-bg); }
.ot-stat.is-ok b { color: var(--ot-ok); }
.ot-stat.is-warn { background: var(--ot-warn-bg); }
.ot-stat.is-warn b { color: var(--ot-warn); }
.ot-stat.is-bad { background: var(--ot-bad-bg); }
.ot-stat.is-bad b { color: var(--ot-bad); }

.ot-review-note { font-size: .9rem; color: var(--ot-muted); }
.ot-review-jump { margin: 10px 0; font-size: .85rem; }

.ot-jump {
	min-width: 34px;
	min-height: 34px;
	margin: 3px;
	font: inherit;
	font-weight: 700;
	font-size: .82rem;
	color: var(--ot-bad);
	background: var(--ot-bad-bg);
	border: 0;
	border-radius: 8px;
	cursor: pointer;
}

.ot-jump.is-marked { color: var(--ot-warn); background: var(--ot-warn-bg); }

.ot-sheet-actions { display: flex; gap: 10px; margin-top: 18px; }
.ot-sheet-actions .ot-btn { flex: 1; }

/* ------------------------------- result -------------------------------- */

.ot-result-card { text-align: center; padding: 28px 20px; }
.ot-result-head { margin-bottom: 8px; }

.ot-result-tick {
	width: 62px;
	height: 62px;
	margin: 0 auto 14px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 1.9rem;
	color: #fff;
	background: var(--ot-ok);
	border-radius: 50%;
}

.ot-result-sub { color: var(--ot-muted); margin: 6px 0 0; }

.ot-result-ring {
	--pct: 0;
	width: 148px;
	height: 148px;
	margin: 20px auto;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	background: conic-gradient(var(--ot-accent) calc(var(--pct) * 1%), #e9eaf4 0);
}

.ot-result-ring span {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 112px;
	height: 112px;
	font-size: 1.5rem;
	font-weight: 700;
	color: var(--ot-ink);
	background: #fff;
	border-radius: 50%;
}

.ot-score-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
	gap: 10px;
	margin: 18px 0;
}

.ot-score { padding: 12px 8px; background: #f4f5fb; border-radius: 12px; }
.ot-score b { display: block; font-size: 1.15rem; color: var(--ot-ink); }
.ot-score span { font-size: .74rem; color: var(--ot-muted); }
.ot-score.is-ok b { color: var(--ot-ok); }
.ot-score.is-bad b { color: var(--ot-bad); }

.ot-verdict {
	display: inline-block;
	padding: 8px 26px;
	font-size: 1.05rem;
	font-weight: 700;
	letter-spacing: .04em;
	text-transform: uppercase;
	border-radius: 99px;
}

.ot-verdict.is-pass { color: #fff; background: var(--ot-ok); }
.ot-verdict.is-fail { color: #fff; background: var(--ot-bad); }

.ot-note {
	margin-top: 14px;
	padding: 10px 14px;
	font-size: .88rem;
	color: var(--ot-warn);
	background: var(--ot-warn-bg);
	border-radius: 10px;
}

/* ------------------------------ wider screens -------------------------- */

@media (min-width: 900px) {
	.ot-app { padding: 24px; }

	.ot-test-body {
		grid-template-columns: 1fr 260px;
		align-items: start;
	}

	.ot-paper { order: 1; }

	.ot-palette-wrap {
		order: 2;
		position: sticky;
		top: 108px;
	}

	.ot-exam-card {
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
	}

	.ot-exam-card .ot-btn { flex: none; min-width: 150px; }

	.ot-sheet { align-items: center; padding: 20px; }
	.ot-sheet-inner { border-radius: 18px; }
}

/* Browsers without color-mix() still get a usable, if flatter, palette. */
@supports not (color: color-mix(in srgb, red 50%, blue)) {
	.ot-option.is-on { background: #eef0fb; }
	.ot-rail-step.is-on { background: #eceefa; }
	.ot-q.is-focus { box-shadow: var(--ot-shadow); }
}

/* The review box, moved onto <body> by ot-frontend.js so nothing on the page can cover it. */
.ot-app.ot-portal { max-width: none; margin: 0; padding: 0; position: static; }
.ot-portal .ot-sheet { z-index: 2147483000; }
.ot-portal .ot-sheet-inner { padding-bottom: max(16px, env(safe-area-inset-bottom)); }

/* =====================================================================
 * 3.57 — Urdu papers, sections, passages, access code, messages, rewards
 * ===================================================================== */

/* Urdu letters in Nastaliq (or Naskh); English letters keep their own
   font, because these faces only cover the Arabic script. */
@font-face { font-family: "OT Urdu"; font-weight: 400; font-display: swap; src: url(../../../../assets/vendor/fonts/noto-nastaliq-urdu-arabic-400-normal.woff2) format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F; }
@font-face { font-family: "OT Urdu"; font-weight: 700; font-display: swap; src: url(../../../../assets/vendor/fonts/noto-nastaliq-urdu-arabic-700-normal.woff2) format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F; }
@font-face { font-family: "OT Naskh"; font-weight: 400; font-display: swap; src: url(../../../../assets/vendor/fonts/noto-naskh-arabic-arabic-400-normal.woff2) format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F; }
@font-face { font-family: "OT Naskh"; font-weight: 700; font-display: swap; src: url(../../../../assets/vendor/fonts/noto-naskh-arabic-arabic-700-normal.woff2) format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F; }

.ot-app.ot-has-urdu { font-family: "OT Urdu", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; }
.ot-app.ot-has-urdu.ot-font-naskh { font-family: "OT Naskh", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; }
.ot-app.ot-has-urdu input, .ot-app.ot-has-urdu textarea, .ot-app.ot-has-urdu button { font-family: inherit; }
.ot-has-urdu .ot-q-text, .ot-has-urdu .ot-option-text, .ot-has-urdu .ot-passage-body, .ot-has-urdu .ot-msg-text { line-height: 2.1; }
.ot-has-urdu.ot-font-naskh .ot-q-text, .ot-has-urdu.ot-font-naskh .ot-option-text, .ot-has-urdu.ot-font-naskh .ot-passage-body { line-height: 1.85; }
.ot-rtl .ot-option-letter { min-width: 2.4em; font-size: .92em; }
.ot-rtl .ot-q-text, .ot-rtl .ot-option-text { font-size: 1.08em; }
[dir="rtl"] .ot-nav #ot-page-next, [dir="rtl"] .ot-nav #ot-finish-section { direction: rtl; }
.ot-q-text[dir="auto"], .ot-option-text[dir="auto"] { unicode-bidi: plaintext; text-align: start; }

/* Exam list tags */
.ot-exam-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 2px; }
.ot-tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; font-size: .74rem; font-weight: 700; border-radius: 99px; background: #eef0fb; color: var(--ot-ink); }
.ot-tag.is-hw { background: #e7f6ee; color: #0b7a43; }
.ot-tag.is-ur { background: #fdf3e3; color: #8a4b06; }
.ot-tag.is-code { background: #fdecec; color: #a12020; }
.ot-tag.is-late { background: #fff4d6; color: #8a6100; }
.ot-exam-secs { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 0; }
.ot-exam-secs span { font-size: .78rem; padding: 3px 10px; border: 1px dashed var(--ot-line); border-radius: 8px; color: var(--ot-muted); }
.ot-exam-card.is-wanted { outline: 3px solid var(--ot-accent); outline-offset: 2px; }

/* Section strip with each section's own clock */
.ot-sec-strip { display: flex; gap: 8px; overflow-x: auto; margin: 0 0 12px; padding-bottom: 2px; }
.ot-sec { flex: 1 0 auto; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 130px; padding: 9px 14px; font: inherit; text-align: start; background: var(--ot-paper); border: 1px solid var(--ot-line); border-radius: 12px; cursor: pointer; color: var(--ot-text); }
.ot-sec:disabled { cursor: default; }
.ot-sec-name { font-weight: 700; font-size: .9rem; }
.ot-sec-time { font-size: .78rem; color: var(--ot-muted); font-variant-numeric: tabular-nums; }
.ot-sec.is-on { border-color: var(--ot-accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--ot-accent) 25%, transparent); }
.ot-sec.is-on .ot-sec-time { color: var(--ot-accent); font-weight: 700; }
.ot-sec.is-done { opacity: .6; background: #f4f5fb; }
.ot-sec.is-done .ot-sec-time { color: var(--ot-ok); }

/* Reading passage beside its questions */
.ot-pgroup { display: grid; gap: 14px; }
.ot-passage { padding: 18px 20px; background: #fffdf6; border: 1px solid #f0e2b6; border-radius: var(--ot-radius); }
.ot-passage-head { display: flex; flex-direction: column; gap: 4px; }
.ot-passage-head h3 { margin: 0; font-size: 1.1rem; color: var(--ot-ink); }
.ot-passage-tag { align-self: flex-start; padding: 2px 10px; font-size: .72rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: #8a6100; background: #fff1c7; border-radius: 99px; }
.ot-rtl .ot-passage-tag { text-transform: none; letter-spacing: 0; }
.ot-passage-hint { margin: 6px 0 10px; font-size: .82rem; color: var(--ot-muted); }
.ot-passage-body { font-size: 1.02rem; line-height: 1.8; white-space: normal; }
.ot-pal.is-passage { border-style: dashed; }
/* Side by side only when the paper itself is wide enough (themes give it very different widths). */
.ot-paper { container-type: inline-size; }
@container (min-width: 760px) {
	.ot-pgroup { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
	.ot-passage { position: sticky; top: 100px; max-height: calc(100vh - 130px); overflow: auto; }
}

/* Access code */
.ot-code-card, .ot-break-card, .ot-msg-card { text-align: center; }
.ot-code-lock, .ot-break-icon, .ot-msg-icon { font-size: 2.2rem; line-height: 1; margin: 4px 0 8px; }
.ot-code-input { display: block; width: 100%; max-width: 260px; margin: 14px auto 6px; padding: 12px; font: 700 2rem/1.1 ui-monospace, SFMono-Regular, Menlo, monospace !important; letter-spacing: .5em; text-align: center; border: 2px solid var(--ot-line); border-radius: 14px; }
.ot-code-input:focus { outline: none; border-color: var(--ot-accent); }
.ot-code-card.is-shake { animation: ot-shake .4s; }
@keyframes ot-shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }

/* Break and messages */
.ot-break-clock { margin: 10px 0 4px; font-size: 2.4rem; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--ot-accent); }
.ot-msg-text { font-size: 1.12rem; color: var(--ot-ink); margin: 6px 0; }
.ot-msg-at { font-size: .78rem; color: var(--ot-muted); margin: 0; }
.ot-result-tick.is-ended { background: var(--ot-warn); }

/* Marks by section on the result */
.ot-sec-scores { max-width: 460px; margin: 6px auto 16px; text-align: start; }
.ot-sec-scores h3 { margin: 0 0 8px; font-size: .9rem; color: var(--ot-muted); }
.ot-sec-score { display: grid; grid-template-columns: 1fr 1.4fr auto; align-items: center; gap: 10px; padding: 6px 0; font-size: .9rem; }
.ot-sec-score i { height: 8px; background: #e9eaf4; border-radius: 99px; overflow: hidden; }
.ot-sec-score i b { display: block; height: 100%; background: var(--ot-accent); border-radius: 99px; }

/* Stars and badges for the youngest */
.ot-rewards { margin: 10px auto 18px; max-width: 520px; }
.ot-rewards-title { margin: 6px 0 0; font-weight: 700; color: var(--ot-muted); }
.ot-stars { display: flex; justify-content: center; gap: 10px; margin: 6px 0; }
.ot-star { font-size: 3.4rem; line-height: 1; color: #e3e4ee; }
.ot-star.is-on { color: #f5b301; text-shadow: 0 3px 10px rgba(245,179,1,.35); animation: ot-pop .6s both; }
@keyframes ot-pop { 0% { transform: scale(0) rotate(-40deg); opacity: 0; } 70% { transform: scale(1.25) rotate(8deg); opacity: 1; } 100% { transform: scale(1) rotate(0); } }
.ot-rewards-try { color: var(--ot-muted); }
.ot-new-badge { display: flex; align-items: center; gap: 12px; margin: 10px auto; padding: 12px 16px; text-align: start; background: linear-gradient(135deg, #fff8e1, #ffe9b3); border: 1px solid #f3d27a; border-radius: 16px; animation: ot-pop .7s .8s both; }
.ot-badge-icon { font-size: 2.2rem; }
.ot-new-badge b { display: block; color: #6b4a00; }
.ot-new-badge small { color: #8a6a1e; }
.ot-board { margin-top: 16px; padding: 14px; background: #f7f8fd; border-radius: 16px; }
.ot-board h3 { margin: 0 0 10px; font-size: 1rem; color: var(--ot-ink); }
.ot-board h3 small { font-weight: 600; color: #b98500; margin-inline-start: 6px; }
.ot-board-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 8px; }
.ot-sticker { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px; background: #fff; border: 1px dashed #d8dbea; border-radius: 14px; filter: grayscale(1); opacity: .45; }
.ot-sticker span { font-size: 1.8rem; }
.ot-sticker small { font-size: .7rem; font-weight: 700; color: var(--ot-muted); text-align: center; }
.ot-sticker.is-on { filter: none; opacity: 1; border-style: solid; border-color: #f3d27a; box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.ot-junior .ot-option { min-height: 58px; font-size: 1.08rem; }
.ot-exam-card.is-timeup { opacity: .85; border-style: dashed; }
.ot-exam-card.is-timeup .ot-exam-meta { color: var(--ot-warn); }
.ot-kept-note { margin: 0 0 10px; }
.ot-is-offline .ot-save-state::before { content: "\26A0  "; }
