:root {
	--background: #f5f9fb;
	--background-accent: #e8f4fb;
	--surface: #ffffff;
	--surface-muted: #f0f8ff;
	--surface-elevated: rgba(255, 255, 255, 0.85);
	--border: rgba(10, 102, 194, 0.15);
	--border-strong: rgba(10, 102, 194, 0.3);
	--primary-50: #e8f4fb;
	--primary-100: #d1e9f7;
	--primary-400: #3b9bd9;
	--primary-500: #0A66C2;
	--primary-600: #095aa8;
	--primary-700: #084e8f;
	/* Alias: shorthand --primary maps to the main brand colour */
	--primary: #0A66C2;
	--text-900: #0f172a;
	--text-800: #1e293b;
	--text-700: #334155;
	--text-600: #475569;
	--text-500: #64748b;
	--text-400: #94a3b8;
	--text-300: #94a3b8;
	--success-500: #22c55e;
	--warning-500: #f59e0b;
	--danger-500: #ef4444;
	--radius-lg: 20px;
	--radius-md: 16px;
	--radius-sm: 12px;
	--shadow-sm: 0 10px 30px rgba(10, 102, 194, 0.08);
	--shadow-md: 0 18px 40px rgba(10, 102, 194, 0.12);
	--shadow-lg: 0 28px 60px rgba(10, 102, 194, 0.18);
	--blur-backdrop: saturate(180%) blur(18px);
	--font-sans: "Inter", "SF Pro Text", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
	--navbar-height: 72px;
	--vvh: 1vh;
	font-family: var(--font-sans);
}

* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

html,
body {
	height: 100%;
}

body {
	font-family: var(--font-sans);
	background: radial-gradient(circle at 15% 20%, #e8f4fb 0%, transparent 40%),
		radial-gradient(circle at 85% 10%, rgba(10, 102, 194, 0.12) 0%, transparent 42%),
		radial-gradient(circle at 60% 75%, rgba(59, 155, 217, 0.12) 0%, transparent 40%),
		var(--background);
	color: var(--text-900);
	-webkit-font-smoothing: antialiased;
	line-height: 1.65;
}

/* Utility: disable page scroll when applied to body */
.no-scroll {
	overflow: hidden;
}

/* Suspense / lazy-load fallback */
.suspense-fallback {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: calc(var(--vvh, 1vh) * 100);
}

/* Skip-to-content link (accessibility) */
.skip-to-content {
	position: absolute;
	left: -999px;
	top: auto;
	width: 1px;
	height: 1px;
	overflow: hidden;
	z-index: 9999;
}
.skip-to-content:focus {
	position: fixed;
	top: 0.5rem;
	left: 50%;
	transform: translateX(-50%);
	width: auto;
	height: auto;
	padding: 0.65rem 1.2rem;
	border-radius: 999px;
	background: var(--primary-600);
	color: #fff;
	font-weight: 600;
	font-size: 0.9rem;
	box-shadow: var(--shadow-md);
	text-decoration: none;
}

a {
	color: inherit;
	text-decoration: none;
}

a:hover {
	color: var(--primary-600);
}

img {
	display: block;
	max-width: 100%;
}

button {
	font: inherit;
}

main {
	position: relative;
	z-index: 1;
}

.app-shell {
	display: flex;
	flex-direction: column;
	min-height: calc(var(--vvh, 1vh) * 100);
}

.app-shell__main {
	flex: 1;
}

.shimmer {
	position: relative;
	overflow: hidden;
}

.shimmer::after {
	content: "";
	position: absolute;
	inset: 0;
	transform: translateX(-100%);
	background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.5), transparent);
	animation: shimmer 2.8s infinite;
}

@keyframes shimmer {
	100% {
		transform: translateX(100%);
	}
}

/* Layout */
.container {
	width: 100%;
	max-width: 1480px;
	margin: 0 auto;
	padding-left: clamp(1rem, 3vw, 2rem);
	padding-right: clamp(1rem, 3vw, 2rem);
}

/* Course detail: slightly tighter container padding */
.course-detail__container {
	padding-left: clamp(0.75rem, 2vw, 1.25rem);
	padding-right: clamp(0.75rem, 2vw, 1.25rem);
}

.section {
	padding: clamp(1.5rem, 3vw, 2.5rem) 0;
}

/* Pages that need tighter spacing to navbar */
.course-detail__layout,
.page-header:has(.filter-group),
.page-header:has(+ .quiz-layout),
.dashboard-grid .page-header {
	margin-top: 0;
}

.page-header:has(+ .quiz-layout),
.dashboard-grid .page-header {
	margin-bottom: clamp(1rem, 2vw, 1.5rem);
}

.page-header {
	margin-bottom: clamp(2rem, 4vw, 3rem);
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

.page-header__eyebrow {
	display: inline-flex;
	align-items: center;
	padding: 0.35rem 0.75rem;
	border-radius: 999px;
	background: rgba(10, 102, 194, 0.12);
	color: var(--primary-600);
	font-weight: 600;
	font-size: 0.85rem;
	width: -webkit-max-content;
	width: max-content;
}

.page-header__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
}

.page-header__title {
	font-size: clamp(1.5rem, 4vw, 2rem);
	font-weight: 700;
	letter-spacing: -0.02em;
	color: var(--text-900);
	line-height: 1.25;
}

.page-header__subtitle {
	font-size: 1rem;
	font-weight: 500;
	color: var(--text-600);
}

.grid {
	display: grid;
	grid-gap: clamp(1.25rem, 3.2vw, 2rem);
	gap: clamp(1.25rem, 3.2vw, 2rem);
}

.grid--courses {
	grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.grid--metrics {
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

@media (min-width: 960px) {
	.grid--hero {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		align-items: center;
	}
}

/* Navbar */
.navbar {
	position: -webkit-sticky;
	position: sticky;
	top: 0;
	z-index: 100;
	-webkit-backdrop-filter: var(--blur-backdrop);
	        backdrop-filter: var(--blur-backdrop);
	/* Fully opaque so the blue hero background never bleeds through */
	background: linear-gradient(180deg, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0.98) 100%);
	border-bottom: 1px solid rgba(10, 102, 194, 0.18);
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.navbar__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 1rem 0;
	gap: 2rem;
}

.logo {
	display: inline-flex;
	align-items: center;
	gap: 0.75rem;
	font-weight: 800;
	color: var(--text-900);
	letter-spacing: -0.02em;
	font-size: 1.125rem;
	transition: opacity 0.2s ease;
}

.logo:hover {
	opacity: 0.8;
}

.logo__image {
	height: 44px;
	width: auto;
	display: block;
	object-fit: contain;
}

.logo__text {
	color: var(--primary-700);
	font-weight: 800;
}

.logo__mark {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: 12px;
	background: linear-gradient(140deg, var(--primary-600), #22d3ee);
	color: #fff;
	font-weight: 700;
	font-size: 1.1rem;
}

.mobile-menu-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border: 1px solid rgba(10, 102, 194, 0.16);
	background: rgba(255, 255, 255, 1);
	color: var(--text-800);
	cursor: pointer;
	border-radius: 12px;
	transition: all 0.2s ease;
	box-shadow: 0 6px 18px rgba(10, 102, 194, 0.08);
}

.mobile-menu-toggle:hover {
	background: rgba(10, 102, 194, 0.06);
	border-color: rgba(10, 102, 194, 0.24);
	color: var(--primary-700);
}

.mobile-menu-toggle:active {
	transform: scale(0.95);
}

.mobile-menu-toggle:focus-visible {
	outline: none;
	box-shadow: 0 0 0 4px rgba(10, 102, 194, 0.18), 0 8px 20px rgba(10, 102, 194, 0.10);
}

.mobile-menu-backdrop {
	position: fixed;
	inset: 0;
	background: rgba(15, 23, 42, 0.35);
	-webkit-backdrop-filter: blur(10px);
	        backdrop-filter: blur(10px);
	z-index: 90;
	opacity: 0;
	transition: opacity 0.2s ease;
}

.mobile-menu-backdrop--visible {
	opacity: 1;
}

.nav-links {
	display: none;
	position: fixed;
	top: calc(var(--navbar-height) + 0.5rem);
	left: 1rem;
	right: 1rem;
	z-index: 95;
	padding: 0.85rem;
	border-radius: 16px;
	background: rgba(255, 255, 255, 1);
	border: 1px solid rgba(10, 102, 194, 0.16);
	box-shadow: var(--shadow-md);
	-webkit-backdrop-filter: var(--blur-backdrop);
	        backdrop-filter: var(--blur-backdrop);
	transform: translateY(-6px);
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.18s ease, transform 0.18s ease;
	flex-direction: column;
	gap: 0.25rem;
}

/* Mobile nav overlay header should never appear in the desktop navbar */
.nav-links__header {
	display: none;
}

/* Ensure logo/nav are readable on dark backgrounds (dark theme) */
[data-theme="dark"] .navbar {
	background: rgba(15, 23, 42, 0.92);
	border-bottom: 1px solid rgba(148, 163, 184, 0.18);
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .logo,
[data-theme="dark"] .logo__text {
	color: rgba(255, 255, 255, 0.95);
}

[data-theme="dark"] .logo__image {
	/* We only ship a blue logo asset; invert it for dark backgrounds */
	filter: brightness(0) invert(1);
}

[data-theme="dark"] .mobile-menu-toggle {
	background: rgba(15, 23, 42, 0.65);
	border-color: rgba(148, 163, 184, 0.22);
	color: rgba(255, 255, 255, 0.95);
}

[data-theme="dark"] .nav-links {
	background: rgba(15, 23, 42, 0.92);
	border-color: rgba(148, 163, 184, 0.18);
}

[data-theme="dark"] .nav-link {
	color: rgba(226, 232, 240, 0.95);
}

[data-theme="dark"] .nav-link:hover {
	color: rgba(255, 255, 255, 0.98);
	background: rgba(148, 163, 184, 0.12);
}

[data-theme="dark"] .nav-link.active {
	color: rgba(255, 255, 255, 0.98);
	background: rgba(10, 102, 194, 0.22);
}

.nav-links--mobile-open {
	display: flex;
	opacity: 1;
	transform: translateY(0);
	pointer-events: auto;
}

.nav-link {
	color: var(--text-900);
	font-weight: 600;
	font-size: 0.9375rem;
	transition: all 0.2s ease;
	display: flex;
	align-items: center;
	gap: 0.375rem;
	padding: 0.5rem 0.75rem;
	border-radius: 8px;
}

.nav-link:hover {
	color: var(--primary-700);
	background: rgba(10, 102, 194, 0.06);
}

.nav-link.active {
	color: var(--primary-700);
	background: rgba(10, 102, 194, 0.1);
	font-weight: 700;
}

.nav-link--mobile-only {
	display: flex;
}

.nav-actions {
	display: none;
}

.nav-link--button {
	width: 100%;
	justify-content: center;
	border: 1px solid rgba(10, 102, 194, 0.14);
	background: rgba(255, 255, 255, 0.65);
}

.nav-link--button.nav-link--primary {
	background: linear-gradient(135deg, var(--primary-600), #1e88e5);
	color: #fff;
	border-color: transparent;
}

@media (min-width: 768px) {
	.mobile-menu-toggle {
		display: none;
	}

	.mobile-menu-backdrop {
		display: none;
	}

	.nav-links {
		display: flex;
		position: static;
		padding: 0;
		border: 0;
		box-shadow: none;
		background: transparent;
		-webkit-backdrop-filter: none;
		        backdrop-filter: none;
		transform: none;
		opacity: 1;
		pointer-events: auto;
		flex-direction: row;
		gap: 1.25rem;
	}

	.nav-link--mobile-only {
		display: none;
	}

	.nav-actions {
		display: flex;
		align-items: center;
		gap: 0.75rem;
	}
}

/* Hero */
.hero {
	/* Reduce top gap by ~50% */
	padding: clamp(2rem, 4vw, 3rem) 0 clamp(3rem, 6vw, 4.5rem);
}

/* Make the home hero fill the viewport below the navbar and reduce inner spacing to avoid scroll */
.hero--full {
	height: calc(var(--vvh, 1vh) * 100 - var(--navbar-height));
	display: flex;
	align-items: center;
	padding: clamp(1rem, 3vw, 1.5rem) 0; /* tighter to avoid overflow */
}

.hero--full .container {
	min-height: 100%;
}

.hero--full .hero__actions {
	margin-bottom: clamp(0.75rem, 2vw, 1rem);
}

.hero--full .hero__content {
	gap: 1rem;
}

.hero--full .hero__description {
	margin-bottom: clamp(0.9rem, 2.5vw, 1.2rem);
}

.hero__badge {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.35rem 0.8rem;
	border-radius: 999px;
	background: rgba(79, 70, 229, 0.14);
	color: var(--primary-600);
	font-weight: 600;
	font-size: 0.85rem;
	margin-bottom: 1.25rem;
}

.hero__title {
	font-size: clamp(2.25rem, 5vw, 3.5rem);
	line-height: 1.08;
	letter-spacing: -0.04em;
	margin-bottom: clamp(1.2rem, 3vw, 1.8rem);
}

.hero__title span {
	color: var(--primary-600);
}

.hero__description {
	color: var(--text-500);
	font-size: clamp(1rem, 2vw, 1.1rem);
	max-width: 32rem;
	margin-bottom: clamp(1.8rem, 4vw, 2.2rem);
}

.hero__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.85rem;
	margin-bottom: clamp(2.5rem, 5vw, 3rem);
}

.hero-card {
	position: relative;
	background: linear-gradient(160deg, rgba(10, 102, 194, 0.5), rgba(14, 165, 233, 0.28));
	border-radius: var(--radius-lg);
	padding: clamp(1.6rem, 4vw, 2.2rem);
	color: #ffffff;
	overflow: hidden;
	box-shadow: var(--shadow-md);
}

/* Subtle dark overlay to boost text contrast */
.hero-card::before {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, rgba(0, 0, 0, 0.28), rgba(0, 0, 0, 0.18));
	z-index: 0;
	pointer-events: none;
}

.hero-card::after {
	content: "";
	position: absolute;
	inset: -30% 30% 10% -20%;
	background: radial-gradient(circle, rgba(255, 255, 255, 0.55) 0%, transparent 58%);
	opacity: 0.4;
	transform: rotate(12deg);
}

.hero-card__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 1.8rem;
	position: relative;
	z-index: 1;
}

.hero-card__badge {
	position: relative;
	z-index: 1;
	display: inline-flex;
	padding: 0.35rem 0.85rem;
	border-radius: 999px;
	background: rgba(15, 23, 42, 0.5);
	box-shadow: 0 1px 2px rgba(0,0,0,0.35);
	font-size: 0.9rem;
	font-weight: 700;
}

.hero-card__metric {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	grid-gap: 1.2rem;
	gap: 1.2rem;
	position: relative;
	z-index: 1;
}

.hero-card__metric-item h4 {
	font-size: 2rem;
	font-weight: 800;
	margin-bottom: 0.15rem;
	text-shadow: 0 1px 2px rgba(0,0,0,0.6);
}

.hero-card__metric-item p {
	color: rgba(255, 255, 255, 0.92);
	font-size: 1rem;
	text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.hero__content {
	display: flex;
	flex-direction: column;
	gap: 1.5rem;
}

.hero-visual {
	position: relative;
	border-radius: var(--radius-lg);
	padding: clamp(1.4rem, 3vw, 1.9rem);
	background: linear-gradient(160deg, rgba(255, 255, 255, 0.9), rgba(232, 244, 251, 0.85));
	box-shadow: var(--shadow-md);
	overflow: hidden;
}

.hero-visual::after {
	content: "";
	position: absolute;
	inset: auto -30% -40% -10%;
	height: 260px;
	background: radial-gradient(circle, rgba(10, 102, 194, 0.28) 0%, transparent 60%);
}

.hero-visual__grid {
	display: grid;
	grid-gap: 1.25rem;
	gap: 1.25rem;
}

.hero-visual__image {
	display: block;
	width: 100%;
	height: auto;
	border-radius: var(--radius-md);
	box-shadow: var(--shadow-sm);
}

.hero-visual__row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 1rem;
	border-radius: var(--radius-md);
	background: rgba(255, 255, 255, 0.6);
	-webkit-backdrop-filter: var(--blur-backdrop);
	        backdrop-filter: var(--blur-backdrop);
	box-shadow: var(--shadow-sm);
}

.hero-visual__row span {
	font-weight: 600;
	color: var(--text-700);
}

.hero-visual__row small {
	color: var(--text-300);
}

/* Buttons */
.button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.6rem;
	padding: clamp(0.58rem, 1.7vw, 0.72rem) clamp(1rem, 3.4vw, 1.25rem);
	border-radius: 999px;
	font-weight: 600;
	font-size: clamp(0.92rem, 2.6vw, 0.98rem);
	border: none;
	cursor: pointer;
	transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.button--primary {
	background: linear-gradient(135deg, var(--primary-600), #1e88e5);
	color: #ffffff;
	box-shadow: var(--shadow-sm);
}

.button--primary:hover {
	transform: translateY(-1px);
	box-shadow: var(--shadow-md);
}

.button--ghost {
	background: rgba(10, 102, 194, 0.12);
	color: var(--primary-600);
}

.button--ghost:hover {
	background: rgba(10, 102, 194, 0.18);
}

.button--secondary {
	background: var(--surface);
	color: var(--text-700);
	border: 1px solid var(--border-strong);
	box-shadow: var(--shadow-sm);
}

.button--secondary:hover {
	background: var(--surface-muted);
	border-color: rgba(10, 102, 194, 0.4);
}

.button--light {
	background: rgba(255, 255, 255, 0.85);
	color: var(--text-900);
	box-shadow: var(--shadow-sm);
}

.button--pill {
	border-radius: 999px;
}

.button--sm {
	padding: clamp(0.4rem, 1.2vw, 0.5rem) clamp(0.75rem, 2.6vw, 0.95rem);
	font-size: clamp(0.82rem, 2.4vw, 0.9rem);
}

/* Chips */
.chip {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	padding: clamp(0.26rem, 1vw, 0.34rem) clamp(0.55rem, 2vw, 0.7rem);
	border-radius: 999px;
	font-size: clamp(0.78rem, 2.2vw, 0.86rem);
	font-weight: 600;
	background: rgba(10, 102, 194, 0.12);
	color: var(--primary-600);
}

.chip--success {
	background: rgba(34, 197, 94, 0.12);
	color: var(--success-500);
}

.chip--ghost {
	background: rgba(148, 163, 184, 0.14);
	color: var(--text-500);
}

.chip--primary {
	background: rgba(10, 102, 194, 0.14);
	color: var(--primary-600);
}

.chip--warning {
	background: rgba(245, 158, 11, 0.14);
	color: #b45309;
}

.chip--danger {
	background: rgba(239, 68, 68, 0.16);
	color: var(--danger-500);
}

/* Cards */
.card {
	background: var(--surface);
	border-radius: var(--radius-lg);
	padding: clamp(1.4rem, 3vw, 1.8rem);
	border: 1px solid rgba(10, 102, 194, 0.08);
	box-shadow: var(--shadow-sm);
	transition: transform 0.25s ease, box-shadow 0.25s ease;
}

/* Only lift interactive cards (buttons / links) on hover */
button.card:hover,
a.card:hover,
.card--interactive:hover {
	transform: translateY(-4px);
	box-shadow: var(--shadow-md);
}

.card--centered {
	display: flex;
	align-items: center;
	justify-content: center;
}

.card--message {
	display: grid;
	grid-gap: 1rem;
	gap: 1rem;
	text-align: center;
}

.card--loading {
	min-height: 320px;
}

.card--compact {
	padding: 1rem;
}

.card__title {
	margin: 0 0 0.5rem;
}

.list--bulleted {
	margin: 0;
	padding-left: 1.2rem;
}

/* Modern form fields */
.field {
	display: grid;
	grid-gap: 0.35rem;
	gap: 0.35rem;
}

.label {
	font-weight: 600;
	font-size: clamp(0.9rem, 2.5vw, 0.95rem);
	color: var(--text-700);
}

.input-field {
	-webkit-appearance: none;
	        appearance: none;
	width: 100%;
	padding: clamp(0.6rem, 1.7vw, 0.75rem) clamp(0.8rem, 2.4vw, 0.95rem);
	border-radius: var(--radius-md);
	border: 1px solid var(--border);
	background: rgba(255, 255, 255, 0.9);
	color: var(--text-900);
	font-size: clamp(1rem, 2.7vw, 1.05rem);
	outline: none;
	transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.input-field::placeholder {
	color: var(--text-300);
}

.input-field:hover {
	border-color: var(--border-strong);
}

.input-field:focus {
	border-color: var(--primary-500);
	box-shadow: 0 0 0 4px rgba(10, 102, 194, 0.12);
	background: #fff;
}

textarea.input-field {
	resize: vertical;
	min-height: 140px;
	line-height: 1.5;
}

.input-field:not(:placeholder-shown):invalid {
	border-color: rgba(239, 68, 68, 0.6);
	box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.12);
}

.field__hint {
	font-size: 0.85rem;
	color: var(--text-500);
}

.metric-card {
	background: linear-gradient(160deg, rgba(255, 255, 255, 0.9), rgba(219, 239, 255, 0.68));
	border-radius: var(--radius-lg);
	padding: clamp(1.4rem, 3vw, 1.9rem);
	border: 1px solid rgba(10, 102, 194, 0.18);
	box-shadow: var(--shadow-sm);
}
.metric-card__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border-radius: var(--radius-sm);
	background: rgba(10, 102, 194, 0.1);
	color: var(--primary-600);
	margin-bottom: 0.9rem;
	flex-shrink: 0;
}

/* Green variant (quizzes) */
.metric-card--green .metric-card__icon {
	background: rgba(34, 197, 94, 0.12);
	color: #16a34a;
}

/* Purple variant (score) */
.metric-card--purple .metric-card__icon {
	background: rgba(124, 58, 237, 0.12);
	color: #7c3aed;
}

/* Ensure metric pieces stack (avoid inline run-on) */
.metric-card__eyebrow,
.metric-card__value,
.metric-card__caption {
	display: block;
}

.metric-card__eyebrow {
	font-size: 0.85rem;
	font-weight: 600;
	color: var(--primary-600);
	margin-bottom: 0.6rem;
}

.metric-card__value {
	font-size: clamp(1.8rem, 4vw, 2.4rem);
	font-weight: 700;
	letter-spacing: -0.03em;
	margin-bottom: 0.3rem;
}

.metric-card__caption {
	color: rgba(15, 23, 42, 0.65);
	font-size: 0.9rem;
	margin-top: 0.1rem;
}

.text-xs { font-size: 0.8rem; }

.activity-item__question {
	font-weight: 600;
	color: var(--text-700);
}

.activity-item__date {
	font-size: 0.85rem;
	color: var(--text-300);
}

/* Course Card */
.course-card {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 1.4rem;
	padding: clamp(1.6rem, 3vw, 1.9rem);
	border-radius: var(--radius-lg);
	background: linear-gradient(150deg, rgba(255, 255, 255, 0.9), rgba(232, 244, 251, 0.65));
	border: 1px solid rgba(10, 102, 194, 0.1);
	box-shadow: var(--shadow-sm);
	overflow: hidden;
}

.course-card::before {
	content: "";
	position: absolute;
	inset: -60% auto auto -40%;
	width: 220px;
	height: 220px;
	background: radial-gradient(circle, rgba(10, 102, 194, 0.18) 0%, transparent 63%);
	opacity: 0;
	transition: opacity 0.3s ease;
}

.course-card:hover::before {
	opacity: 1;
}

.course-card__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.8rem;
	position: relative;
}

.course-card__badge {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	padding: clamp(0.3rem, 1vw, 0.38rem) clamp(0.65rem, 2.2vw, 0.8rem);
	border-radius: 999px;
	font-size: clamp(0.78rem, 2.2vw, 0.86rem);
	font-weight: 600;
	color: var(--primary-600);
	background: rgba(10, 102, 194, 0.12);
}

.course-card__title {
	font-size: clamp(1.1rem, 3.2vw, 1.25rem);
	font-weight: 700;
	line-height: 1.35;
	letter-spacing: -0.02em;
	color: var(--text-900);
}

.course-card__description {
	color: var(--text-500);
	font-size: clamp(0.95rem, 2.7vw, 1rem);
	line-height: 1.6;
	max-width: 34ch;
}

.course-card__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 0.85rem;
}

.course-meta__item {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	padding: 0.35rem 0.65rem;
	border-radius: 10px;
	background: rgba(15, 23, 42, 0.04);
	color: var(--text-500);
	font-size: clamp(0.82rem, 2.4vw, 0.9rem);
	font-weight: 500;
}

.course-meta__item strong {
	color: var(--text-700);
}

.course-card__footer {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
	margin-top: auto;
}

.course-card__actions {
	display: flex;
	align-items: center;
	flex-direction: row;
	gap: 0.5rem;
}

.course-card__actions .button,
.course-card__actions .course-card__cta {
	flex: 1;
	justify-content: center;
}

.course-progress {
	display: grid;
	grid-gap: 0.3rem;
	gap: 0.3rem;
	font-size: clamp(0.8rem, 2.2vw, 0.88rem);
	color: var(--text-500);
}

.progress-bar {
	width: 100%;
	height: 6px;
	border-radius: 999px;
	background: rgba(10, 102, 194, 0.14);
	overflow: hidden;
}

.progress-bar__fill {
	display: block;
	height: 100%;
	border-radius: inherit;
	background: linear-gradient(135deg, var(--primary-500), #1e88e5);
	transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.course-card__cta {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	padding: clamp(0.58rem, 1.7vw, 0.72rem) clamp(1rem, 3.4vw, 1.25rem); /* Match button size */
	border-radius: 999px;
	background: rgba(10, 102, 194, 0.14);
	color: var(--primary-600);
	font-weight: 600;
	font-size: clamp(0.92rem, 2.6vw, 0.98rem); /* Match button font size */
	transition: transform 0.2s ease, background 0.2s ease;
}

.course-card__cta:hover {
	transform: translateX(2px);
	background: rgba(10, 102, 194, 0.22);
}

/* Course Modal */
.modal-overlay {
	position: fixed;
	inset: 0;
	background: rgba(15, 23, 42, 0.32);
	-webkit-backdrop-filter: blur(12px);
	        backdrop-filter: blur(12px);
	display: grid;
	place-items: center;
	padding: calc(1.5rem + env(safe-area-inset-top)) calc(1.5rem + env(safe-area-inset-right)) calc(1.5rem + env(safe-area-inset-bottom)) calc(1.5rem + env(safe-area-inset-left));
	z-index: 30;
}

.course-modal {
	width: min(640px, 96vw);
	border-radius: 24px;
	background: linear-gradient(160deg, rgba(255, 255, 255, 0.98), rgba(238, 241, 255, 0.95));
	border: 1px solid rgba(10, 102, 194, 0.2);
	box-shadow: var(--shadow-xl);
	position: relative;
	max-height: calc(var(--vvh, 1vh) * 90);
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

.course-modal__header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 1.5rem;
	padding: clamp(1.5rem, 4vw, 2rem);
	border-bottom: 1px solid rgba(10, 102, 194, 0.12);
	flex-shrink: 0;
}

.course-modal__header-content {
	flex: 1;
	min-width: 0;
}

.course-modal__badges {
	display: flex;
	gap: 0.5rem;
	margin-bottom: 0.75rem;
	flex-wrap: wrap;
}

.course-modal__title {
	font-size: clamp(1.375rem, 3vw, 1.75rem);
	font-weight: 700;
	line-height: 1.3;
	letter-spacing: -0.02em;
	margin: 0;
	color: var(--text-900);
}

.course-modal__instructor {
	margin: 0.5rem 0 0 0;
	font-size: 0.9375rem;
	color: var(--text-600);
}

.course-modal__close {
	flex-shrink: 0;
	background: rgba(10, 102, 194, 0.1);
	color: var(--primary-600);
	border: none;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	display: grid;
	place-items: center;
	cursor: pointer;
	transition: all 0.2s ease;
	font-size: 1.5rem;
	font-weight: 300;
	line-height: 1;
}

.course-modal__close:hover {
	background: rgba(10, 102, 194, 0.18);
	transform: scale(1.05);
}

.course-modal__body {
	flex: 1;
	overflow-y: auto;
	padding: clamp(1.5rem, 4vw, 2rem);
	display: flex;
	flex-direction: column;
	gap: 2rem;
}

.course-modal__meta {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
	grid-gap: 1rem;
	gap: 1rem;
}

.course-modal__meta-item {
	padding: 1rem;
	border-radius: 12px;
	background: rgba(10, 102, 194, 0.08);
	border: 1px solid rgba(10, 102, 194, 0.12);
	display: flex;
	align-items: center;
	gap: 0.75rem;
	transition: all 0.2s ease;
}

.course-modal__meta-item:hover {
	background: rgba(10, 102, 194, 0.12);
	transform: translateY(-2px);
}

.course-modal__meta-icon {
	color: var(--primary-600);
	flex-shrink: 0;
}

.course-modal__meta-label {
	display: block;
	font-size: 0.8125rem;
	font-weight: 600;
	color: var(--primary-600);
	margin-bottom: 0.25rem;
	text-transform: uppercase;
	letter-spacing: 0.03em;
}

.course-modal__meta-value {
	display: block;
	font-size: 1.125rem;
	font-weight: 700;
	color: var(--text-800);
}

.course-modal__section-title {
	font-size: 1.125rem;
	font-weight: 700;
	color: var(--text-900);
	margin: 0 0 1rem 0;
	letter-spacing: -0.01em;
}

.course-modal__description {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
}

.course-modal__descriptor {
	color: var(--text-600);
	font-size: 0.9375rem;
	line-height: 1.6;
	margin: 0;
}

.course-modal__syllabus-wrapper {
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

.course-modal__syllabus {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
	max-height: 400px;
	overflow-y: auto;
	padding-right: 0.5rem;
}

.syllabus-item {
	padding: 1rem 1.25rem;
	border-radius: 12px;
	border: 1px solid rgba(10, 102, 194, 0.15);
	background: rgba(255, 255, 255, 0.8);
	display: flex;
	justify-content: space-between;
	align-items: center;
	color: var(--text-700);
	transition: all 0.2s ease;
}

.syllabus-item:hover {
	background: rgba(255, 255, 255, 1);
	border-color: rgba(10, 102, 194, 0.25);
	transform: translateX(4px);
}

.syllabus-item__left {
	display: flex;
	align-items: center;
	gap: 1rem;
	min-width: 0;
	flex: 1;
}

.syllabus-item__index {
	width: 40px;
	height: 40px;
	border-radius: 10px;
	display: grid;
	place-items: center;
	background: rgba(10, 102, 194, 0.12);
	color: var(--primary-600);
	font-weight: 700;
	font-size: 0.9375rem;
	flex: 0 0 auto;
}

.syllabus-item__meta {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
	min-width: 0;
}

.syllabus-item__title {
	font-weight: 600;
	font-size: 0.9375rem;
	color: var(--text-800);
	line-height: 1.4;
}

.syllabus-item__subtitle {
	color: var(--text-500);
	font-size: 0.8125rem;
}

.syllabus-item__right {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	flex-shrink: 0;
}

.syllabus-item__note {
	font-size: 0.8125rem;
}

.syllabus-item__chevron {
	color: var(--text-400);
	font-size: 1.5rem;
	font-weight: 300;
	line-height: 1;
}

.course-modal__footer {
	padding: clamp(1.5rem, 4vw, 2rem);
	border-top: 1px solid rgba(10, 102, 194, 0.12);
	display: flex;
	flex-wrap: wrap;
	gap: 1rem;
	justify-content: flex-end;
	background: rgba(255, 255, 255, 0.5);
	flex-shrink: 0;
}

/* Course Detail */
.course-detail__layout {
	display: grid;
	grid-gap: clamp(0.9rem, 2.5vw, 1.6rem);
	gap: clamp(0.9rem, 2.5vw, 1.6rem);
	/* Single column layout since sidebar is now fixed */
	grid-template-columns: 1fr;
}

.course-detail__column {
	display: grid;
	grid-gap: 1.5rem;
	gap: 1.5rem;
	/* Prevent overlap with fixed sidebar - sidebar width + gap + right margin */
	max-width: calc(100% - min(320px, 25vw) - 2rem);
}

.lesson-card {
	background: rgba(255, 255, 255, 0.85);
	border-radius: var(--radius-lg);
	border: 1px solid rgba(10, 102, 194, 0.12);
	box-shadow: var(--shadow-sm);
	padding: clamp(1.2rem, 2.5vw, 1.6rem);
	display: grid;
	grid-gap: 1rem;
	gap: 1rem;
}

.lesson-card__media {
	border-radius: var(--radius-md);
	overflow: hidden;
	background: rgba(15, 23, 42, 0.05);
	aspect-ratio: 16 / 9;
	width: 100%;
}

.lesson-card__media iframe,
.lesson-card__media video {
	width: 100%;
	height: 100%;
	border: none;
	display: block;
}

/* Ensure the video doesn't get excessively tall on large screens */
@media (min-width: 1200px) {
	.lesson-card__media {
		max-height: 480px;
	}
}

/* When showing Unit Quiz inline, allow natural height and scrolling */
.lesson-card__media--quiz {
	aspect-ratio: auto;
	max-height: none;
	overflow: visible;
	background: transparent;
}

.lesson-card__quizwrap {
	display: grid;
	grid-gap: 0.75rem;
	gap: 0.75rem;
}

.lesson-card__quizbar {
	display: flex;
	justify-content: flex-start;
	align-items: center;
}

.lesson-card__placeholder {
	display: grid;
	place-items: center;
	height: 100%;
	padding: 2rem;
	color: var(--text-500);
	font-size: 0.95rem;
}

.lesson-card__header {
	display: grid;
	grid-gap: 0.6rem;
	gap: 0.6rem;
}

.lesson-card__header-content {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.lesson-card__progress-badges {
	display: flex;
	gap: 0.5rem;
	flex-wrap: wrap;
}

.lesson-card__title {
	font-size: clamp(1.3rem, 2.6vw, 1.6rem);
	font-weight: 700;
	line-height: 1.3;
	word-wrap: break-word;
	overflow-wrap: break-word;
}

.lesson-card__description {
	margin-top: 0.25rem;
	line-height: 1.6;
	white-space: normal; /* allow wrapping to multiple lines */
}

.lesson-card__nav {
	display: flex;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 1rem;
	align-items: stretch;
	margin-top: 1.5rem;
	padding: 0;
	background: transparent;
	border-radius: 0;
	border: none;
}

.lesson-card__nav-group {
	display: flex;
	gap: 0.75rem;
	flex-wrap: wrap;
	align-items: center;
}

.lesson-card__nav-group--navigation {
	flex: 0 0 auto;
}

.lesson-card__nav-group--navigation .button {
	min-width: 120px;
	font-weight: 600;
	padding: 0.75rem 1.25rem;
	border-radius: 12px;
	transition: all 0.2s ease;
	background: white;
	border: 1.5px solid rgba(10, 102, 194, 0.15);
	color: var(--primary-600);
}

.lesson-card__nav-group--navigation .button:hover:not(:disabled) {
	background: var(--primary-600);
	color: white;
	border-color: var(--primary-600);
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(10, 102, 194, 0.2);
}

.lesson-card__nav-group--navigation .button:disabled {
	opacity: 0.35;
	cursor: not-allowed;
	background: rgba(0, 0, 0, 0.02);
}

.lesson-card__nav-group--actions {
	flex: 1 1 auto;
	justify-content: flex-end;
	gap: 0.625rem;
}

.lesson-card__nav-group--actions .button {
	padding: 0.75rem 1rem;
	border-radius: 12px;
	font-weight: 600;
	font-size: 0.9375rem;
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	transition: all 0.2s ease;
}

.lesson-card__nav-group--actions .button-icon {
	font-size: 1.125rem;
	line-height: 1;
}

.lesson-card__nav-group--actions .button:hover {
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.lesson-card__nav-group--actions .button--success {
	background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
	border: none;
}

.lesson-card__nav-group--actions .button--success:disabled {
	opacity: 0.7;
}

.lesson-card__nav-group--actions .button--primary {
	box-shadow: 0 2px 8px rgba(10, 102, 194, 0.2);
}

.lesson-card__nav-group--actions .button--ghost {
	border: 1.5px solid rgba(0, 0, 0, 0.1);
}

.lesson-card__nav-group--actions .button--ghost:hover {
	background: rgba(0, 0, 0, 0.04);
	border-color: rgba(0, 0, 0, 0.2);
}

/* Under-video nav/actions: flat (no boxed background) */
.lesson-card__nav .lesson-card__nav-flat {
	background: transparent;
	border: none;
	box-shadow: none;
}

.lesson-card__nav .lesson-card__nav-flat:hover:not(:disabled) {
	transform: none;
	box-shadow: none;
	background: transparent;
	color: var(--primary-600);
}

.lesson-card__nav .lesson-card__nav-flat.button--primary {
	background: transparent;
	border: none;
	box-shadow: none;
	color: var(--primary-600);
}

.lesson-card__lessons {
	display: grid;
	grid-gap: 1rem;
	gap: 1rem;
}

.lesson-card__lessons-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 1rem;
}

.lesson-card__lessons-title {
	font-size: 1rem;
	font-weight: 700;
}

.lesson-card__lessons-count {
	font-size: 0.9rem;
}

.lesson-card__lesson-list {
	display: grid;
	grid-gap: 0.75rem;
	gap: 0.75rem;
}

.lesson-card__lesson-item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 0.8rem 1rem;
	border-radius: 14px;
	border: 1px solid rgba(148, 163, 184, 0.25);
	background: rgba(248, 250, 255, 0.65);
}

.lesson-card__lesson-meta {
	display: flex;
	align-items: flex-start;
	gap: 0.85rem;
}

.lesson-card__lesson-index {
	width: 32px;
	height: 32px;
	border-radius: 999px;
	display: grid;
	place-items: center;
	font-weight: 600;
	background: rgba(10, 102, 194, 0.18);
	color: var(--primary-600);
}

.lesson-card__lesson-title {
	font-weight: 600;
}

.lesson-card__lesson-objective {
	font-size: 0.85rem;
	margin-top: 0.2rem;
}

.lesson-card__lesson-duration {
	font-size: 0.85rem;
	font-weight: 600;
	color: var(--primary-600);
}

.lesson-sidebar {
	background: var(--surface-elevated);
	border-radius: var(--radius-md);
	border: 1px solid var(--border);
	box-shadow: var(--shadow-sm);
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 0;
	/* Fixed positioning - completely unscrollable */
	position: fixed;
	top: var(--navbar-height); /* Fixed position below navbar */
	right: calc((100vw - min(1480px, 98vw)) / 2); /* Match container's right margin */
	width: min(320px, 25vw); /* Responsive width */
	max-height: calc(var(--vvh, 1vh) * 100 - var(--navbar-height));
	overflow: hidden;
	z-index: 10;
}

/* Backdrop for mobile off-canvas course sidebar (hidden by default) */
.lesson-sidebar__backdrop {
	display: none;
}

/* Hide mobile-only elements on desktop */
.lesson-card__sidebar-toggle,
.lesson-sidebar__close,
.lesson-card__comments-toggle {
	display: none;
}

/* Comments always visible on desktop */
.lesson-card--comments {
	padding: 1.5rem;
}

.lesson-card__comments-content {
	display: block;
}

.lesson-sidebar__header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 1rem;
	padding: 1rem 1rem 0.9rem;
	border-bottom: 1px solid rgba(10, 102, 194, 0.12);
	background: var(--surface-elevated);
	position: -webkit-sticky;
	position: sticky;
	top: 0;
	z-index: 2;
	-webkit-backdrop-filter: var(--blur-backdrop);
	        backdrop-filter: var(--blur-backdrop);
}

.lesson-sidebar__header > div {
	flex: 1 1 auto;
	min-width: 0;
}

.lesson-sidebar__heading {
	font-size: 1.05rem;
	font-weight: 750;
	letter-spacing: -0.01em;
	margin: 0;
	color: var(--text-900);
}

.lesson-sidebar__description {
	font-size: 0.9rem;
}

.lesson-sidebar__progress {
	margin: 0.65rem 0 0;
	display: flex;
	flex-direction: column;
	gap: 0.3rem;
}

.lesson-sidebar__progress-bar {
	height: 6px;
	border-radius: 999px;
	background: rgba(10, 102, 194, 0.12);
	overflow: hidden;
}

.lesson-sidebar__progress-fill {
	height: 100%;
	border-radius: 999px;
	background: var(--primary-600);
	transition: width 0.4s ease;
}

.lesson-sidebar__progress-label {
	font-size: 0.8rem;
	color: var(--text-500);
}

/* Lesson type icon inside child lesson rows */
.lesson-list__type-icon {
	font-size: 0.7rem;
	flex: 0 0 auto;
	line-height: 1;
	opacity: 0.7;
}

.lesson-list {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
	padding: 0.6rem;
	overflow-y: auto;
	overflow-x: hidden;
	flex: 1 1 auto;
	scrollbar-width: none; /* Firefox: hide scrollbar, keep scroll */
}

/* WebKit: hide scrollbar, keep scroll */
.lesson-list::-webkit-scrollbar {
	width: 0;
	height: 0;
}

.lesson-list__item {
	display: flex;
	align-items: center;
	gap: 0.65rem;
	min-height: 42px;
	padding: 0.55rem 0.65rem;
	width: 100%; /* prevent overflow causing horizontal scroll */
	border-radius: 0;
	border: none;
	background: transparent;
	cursor: pointer;
	transition: box-shadow 0.15s ease, color 0.15s ease;
}

.lesson-list__item:hover {
	background: transparent;
}

.lesson-list__item:focus-visible {
	outline: none;
	box-shadow: 0 0 0 3px rgba(10, 102, 194, 0.16);
}

.lesson-list__item--module {
	align-items: flex-start;
	min-height: 44px;
}

.lesson-list__item--lesson {
	min-height: 42px;
}

.lesson-list__item--active {
	background: transparent;
}

.lesson-list__item--completed {
	background: transparent;
}

.lesson-list__item--completed .lesson-list__index {
	color: var(--success-500);
	font-weight: 600;
}

.lesson-list__children {
	margin: 0.25rem 0 0.5rem;
	padding-left: 0.65rem;
	border-left: none;
	overflow-x: hidden;
	display: flex;
	flex-direction: column;
	gap: 0.15rem;
}

/* Active chapter/subchapter: highlight via text color only */
.lesson-list__item--active .lesson-list__index,
.lesson-list__item--active .lesson-list__title {
	color: var(--primary-600);
}

.lesson-list__children .lesson-list__item--lesson {
	min-height: 40px;
	align-items: center;
	padding-top: 0.45rem;
	padding-bottom: 0.45rem;
}

.lesson-list__index {
	width: 22px;
	height: 22px;
	border-radius: 7px;
	display: grid;
	place-items: center;
	font-size: 0.78rem;
	font-weight: 650;
	background: transparent;
	color: var(--text-500);
	flex: 0 0 22px;
}

/* Subchapter rows: use compact index badge without circle to prevent overflow and keep left alignment clean */
.lesson-list__children .lesson-list__index {
	width: 22px;
	height: 22px;
	border-radius: 7px;
	background: transparent;
	padding: 0;
	color: var(--text-500);
	display: grid;
	place-items: center;
	flex: 0 0 22px;
}

.lesson-list__meta {
	flex: 1 1 auto;
	display: flex;
	align-items: center;
	gap: 0.45rem;
	min-width: 0;
}

.lesson-list__item--module .lesson-list__meta {
	align-items: flex-start;
}

.lesson-list__title {
	font-weight: 600;
	font-size: 0.95rem;
	min-width: 0; /* allow ellipsis */
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	text-align: left;
	line-height: 1.25;
}

.lesson-list__item--lesson .lesson-list__title {
	font-weight: 500;
	font-size: 0.93rem;
}

/* Module titles can wrap to two lines to avoid feeling cramped */
.lesson-list__item--module .lesson-list__title {
	white-space: normal;
	display: -webkit-box;
	line-clamp: 2;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	line-height: 1.3;
}

/* Allow lesson titles (children) to wrap to two lines so they don't feel "cut off" */
.lesson-list__children .lesson-list__title {
	white-space: normal;
	display: -webkit-box;
	line-clamp: 2;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	line-height: 1.25;
}

.lesson-list__chevron {
	color: var(--text-500);
	transition: transform 0.2s ease;
	margin-left: auto;
	padding-left: 0.5rem;
}

.is-expanded .lesson-list__chevron {
	transform: rotate(90deg);
}


.lesson-list__empty {
	padding: 1rem;
	border-radius: 12px;
	background: rgba(148, 163, 184, 0.12);
	text-align: center;
	font-size: 0.9rem;
	color: var(--text-500);
}

@media (max-width: 960px) {
	.course-detail__layout {
		grid-template-columns: 1fr;
	}

	.course-detail__column {
		max-width: 100%;
	}

	/* Mobile: sidebar becomes an off-canvas drawer toggled by JS */
	.lesson-card__sidebar-toggle,
	.lesson-sidebar__close,
	.lesson-card__comments-toggle {
		display: inline-flex;
	}

	.lesson-sidebar {
		right: 0;
		top: var(--navbar-height);
		width: min(360px, 92vw);
		max-height: calc(var(--vvh, 1vh) * 100 - var(--navbar-height));
		transform: translateX(110%);
		opacity: 0;
		pointer-events: none;
		transition: transform 0.25s ease, opacity 0.2s ease;
		z-index: 50;
	}

	.lesson-sidebar__backdrop {
		display: block;
		position: fixed;
		inset: 0;
		background: rgba(0, 0, 0, 0.4);
		z-index: 49;
		opacity: 0;
		pointer-events: none;
		transition: opacity 0.2s ease;
	}

	.lesson-sidebar__backdrop--visible {
		opacity: 1;
		pointer-events: auto;
	}

	.lesson-list {
		padding-bottom: calc(0.6rem + env(safe-area-inset-bottom));
	}

	.lesson-sidebar.lesson-sidebar--visible {
		transform: translateX(0);
		opacity: 1;
		pointer-events: auto;
	}
}

@media (min-width: 1440px) {
	.lesson-sidebar {
		width: 360px;
	}
	.course-detail__column {
		max-width: calc(100% - 360px - 2rem);
	}
}

/* About Page */
.about-hero {
	text-align: center;
	display: grid;
	grid-gap: 1.5rem;
	gap: 1.5rem;
	margin-bottom: clamp(2.5rem, 6vw, 4.5rem);
}

.about-hero__title {
	font-size: clamp(2rem, 5vw, 2.8rem);
	font-weight: 700;
}

.about-hero__copy {
	max-width: 50rem;
	margin: 0 auto;
	font-size: clamp(1.05rem, 2.5vw, 1.25rem);
	color: var(--text-500);
}

.about-stats {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
	grid-gap: clamp(1.2rem, 4vw, 2rem);
	gap: clamp(1.2rem, 4vw, 2rem);
	margin-bottom: clamp(2.5rem, 6vw, 4.5rem);
}

.about-stats__number {
	font-size: clamp(2rem, 5vw, 2.6rem);
	font-weight: 700;
	color: var(--primary-600);
}

.about-stats__label {
	color: var(--text-500);
	font-size: 0.95rem;
}

.about-approach {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
	grid-gap: clamp(1.4rem, 4vw, 2rem);
	gap: clamp(1.4rem, 4vw, 2rem);
	margin-bottom: clamp(2.5rem, 6vw, 4rem);
}

.about-approach__item {
	display: flex;
	align-items: flex-start;
	gap: 1.1rem;
}

.about-approach__icon {
	width: 44px;
	height: 44px;
	border-radius: var(--radius-sm);
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(10, 102, 194, 0.1);
	color: var(--primary-600);
	flex-shrink: 0;
}

.about-approach__index {
	width: 3.25rem;
	height: 3.25rem;
	border-radius: 999px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(10, 102, 194, 0.12);
	color: var(--primary-600);
	font-weight: 700;
	font-size: 1.1rem;
	flex-shrink: 0;
}

.about-approach__text {
	font-size: 1.05rem;
	font-weight: 600;
}

/* Values section */
.about-values {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	grid-gap: clamp(1.2rem, 3vw, 1.8rem);
	gap: clamp(1.2rem, 3vw, 1.8rem);
}

.about-values__item {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.about-values__title {
	font-size: 1.1rem;
	font-weight: 700;
	color: var(--primary-600);
	margin: 0;
}

.about-values__desc {
	font-size: 0.95rem;
	color: var(--text-500);
	line-height: 1.6;
	margin: 0;
}

.about-team {
	display: grid;
	grid-gap: 1rem;
	gap: 1rem;
	text-align: center;
	margin-bottom: clamp(2.5rem, 6vw, 4rem);
}

.about-team__copy {
	font-size: clamp(1rem, 2.5vw, 1.125rem);
	margin: 0 auto;
	max-width: 38rem;
}

.about-cta {
	display: grid;
	grid-gap: 1.4rem;
	gap: 1.4rem;
	text-align: center;
	padding: clamp(2rem, 6vw, 3rem);
}

/* Dashboard */
.dashboard-grid {
	display: grid;
	grid-gap: clamp(1.4rem, 3vw, 2rem);
	gap: clamp(1.4rem, 3vw, 2rem);
}

.dashboard-grid__main {
	display: grid;
	grid-gap: clamp(1.4rem, 3vw, 2rem);
	gap: clamp(1.4rem, 3vw, 2rem);
}

.dashboard-section {
	padding: clamp(1.6rem, 3vw, 2.1rem);
	border-radius: var(--radius-lg);
	background: linear-gradient(150deg, rgba(255, 255, 255, 0.9), rgba(232, 244, 251, 0.72));
	border: 1px solid rgba(10, 102, 194, 0.12);
	box-shadow: var(--shadow-sm);
	display: grid;
	grid-gap: clamp(1rem, 2vw, 1.4rem);
	gap: clamp(1rem, 2vw, 1.4rem);
}

.dashboard-section__header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 1.2rem;
}

.dashboard-activity {
	display: grid;
	grid-gap: 1.2rem;
	gap: 1.2rem;
}

.activity-item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 0.9rem 1.1rem;
	border-radius: 14px;
	background: rgba(255, 255, 255, 0.7);
	border: 1px solid rgba(10, 102, 194, 0.08);
}

.activity-item__meta {
	display: grid;
	grid-gap: 0.2rem;
	gap: 0.2rem;
}

.activity-item__tag {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	padding: 0.25rem 0.55rem;
	border-radius: 999px;
	font-size: 0.75rem;
	font-weight: 600;
}

.activity-item__tag--success {
	background: rgba(34, 197, 94, 0.12);
	color: var(--success-500);
}

.activity-item__tag--error {
	background: rgba(239, 68, 68, 0.12);
	color: var(--danger-500);
}

.dashboard-section__title {
	font-size: clamp(1.2rem, 2.4vw, 1.5rem);
	font-weight: 600;
}

.section__title {
	font-size: clamp(1.4rem, 3vw, 1.9rem);
	font-weight: 700;
	margin: 0;
}

.dashboard-empty {
	padding: clamp(2rem, 5vw, 3rem) 2rem;
	border-radius: var(--radius-lg);
	border: 1.5px dashed rgba(10, 102, 194, 0.25);
	background: linear-gradient(160deg, rgba(232, 244, 251, 0.5), rgba(255, 255, 255, 0.6));
	text-align: center;
	color: var(--text-500);
	font-size: 0.95rem;
	line-height: 1.65;
}

.dashboard-course-list {
	display: grid;
	grid-gap: 0.75rem;
	gap: 0.75rem;
}

.dashboard-course-row {
	display: grid;
	grid-template-columns: 1fr auto;
	grid-gap: 1rem;
	gap: 1rem;
	align-items: center;
	padding: 0.85rem 1rem;
	border-radius: 14px;
	background: rgba(255, 255, 255, 0.7);
	border: 1px solid rgba(10, 102, 194, 0.08);
}

.dashboard-course-row__main {
	display: grid;
	grid-gap: 0.55rem;
	gap: 0.55rem;
	min-width: 0;
}

.dashboard-course-row__top {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 0.8rem;
}

.dashboard-course-row__titlewrap {
	display: grid;
	grid-gap: 0.4rem;
	gap: 0.4rem;
	min-width: 0;
}

.dashboard-course-row__title {
	margin: 0;
	font-size: 1rem;
	font-weight: 700;
	line-height: 1.25;
	color: var(--text-900);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.dashboard-course-row__badges {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.45rem;
}

.dashboard-course-row__kpis {
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-end;
	gap: 0.35rem;
	flex: 0 0 auto;
}

.dashboard-course-row__progress {
	display: grid;
	grid-gap: 0.35rem;
	gap: 0.35rem;
}

.dashboard-course-row__actions {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 0.5rem;
}

.dashboard-course-row__actions .button {
	width: 100%;
	white-space: nowrap;
}

@media (max-width: 767px) {
	.dashboard-course-row {
		grid-template-columns: 1fr;
		align-items: stretch;
	}

	.dashboard-course-row__actions {
		flex-direction: row;
		flex-wrap: wrap;
	}

	.dashboard-course-row__actions .button {
		width: auto;
	}
}

/* Footer */
.footer {
	margin-top: clamp(2.5rem, 6vw, 4rem);
	padding: clamp(0.95rem, 2.4vw, 1.8rem) 0; /* ~80% of previous padding */
	border-top: 1px solid rgba(10, 102, 194, 0.12);
	background: rgba(255, 255, 255, 0.65);
	-webkit-backdrop-filter: var(--blur-backdrop);
	        backdrop-filter: var(--blur-backdrop);
}

.footer__inner {
	display: grid;
	grid-gap: clamp(0.8rem, 2vw, 1.28rem);
	gap: clamp(0.8rem, 2vw, 1.28rem); /* ~80% gap */
}

.footer__top {
	display: grid;
	grid-gap: clamp(0.8rem, 2vw, 1.28rem);
	gap: clamp(0.8rem, 2vw, 1.28rem); /* ~80% gap */
}

@media (min-width: 960px) {
	.footer__top {
		grid-template-columns: 2fr 1fr 1fr 1fr 1.2fr;
	}
}

.footer__brand-copy {
	color: var(--text-500);
	max-width: 36ch;
	font-size: 0.9rem; /* slightly smaller */
}

.footer__logo {
	display: inline-flex;
	align-items: center;
	gap: 0.6rem;
	margin-bottom: 0.4rem; /* ~80% */
}

/* Smaller logo in footer for compact height */
.footer__logo .logo__image {
	height: 28px; /* ~80% of a typical 35px/32px scale */
}

.footer__column-title {
	font-size: 1rem;
	font-weight: 600;
	color: var(--text-700);
	margin-bottom: 0.4rem; /* ~80% */
}

.footer__link {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	color: var(--text-500);
	font-size: 0.9rem;
	padding: 0.2rem 0; /* ~80% vertical padding */
	transition: color 0.2s ease;
}

.footer__link:hover {
	color: var(--primary-600);
}

.footer__bottom {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: center;
	gap: 1rem;
	padding-top: clamp(0.72rem, 2vw, 1.12rem); /* ~80% top spacing */
	color: var(--text-300);
	font-size: 0.85rem;
}

.footer__social {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.footer__social-link {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.3rem 0.6rem;
	border-radius: 8px;
	background: rgba(10, 102, 194, 0.07);
	color: var(--text-600);
	font-weight: 500;
	font-size: 0.85rem;
	transition: background 0.2s ease, color 0.2s ease;
}

.footer__social-link:hover {
	background: rgba(10, 102, 194, 0.14);
	color: var(--primary-600);
}

/* Ensure footer link lists are evenly spaced even if utility classes aren't present */
.footer__top nav {
	display: grid;
	grid-gap: 0.2rem;
	gap: 0.2rem; /* ~80% */
}

.filter-group {
	display: flex;
	flex-wrap: wrap;
	gap: 0.6rem;
	padding: 0.35rem;
	border-radius: 999px;
	background: rgba(10, 102, 194, 0.08);
}

.filter-pill {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: clamp(0.35rem, 1.2vw, 0.48rem) clamp(0.8rem, 2.7vw, 1.05rem);
	border-radius: 999px;
	font-size: clamp(0.82rem, 2.4vw, 0.9rem);
	font-weight: 600;
	color: var(--primary-600);
	background: transparent;
	border: none;
	cursor: pointer;
	transition: background 0.2s ease, color 0.2s ease;
}

.filter-pill--active {
	background: #fff;
	color: var(--primary-600);
	box-shadow: 0 10px 25px rgba(79, 70, 229, 0.12);
}

.filter-pill:hover {
	background: rgba(255, 255, 255, 0.75);
}

.avatar {
	width: 40px;
	height: 40px;
	border-radius: 999px;
	background: linear-gradient(135deg, var(--primary-600), #22d3ee);
	color: #fff;
	font-weight: 600;
	font-size: 0.95rem;
	display: grid;
	place-items: center;
	border: none;
	cursor: pointer;
}

.dropdown {
	position: relative;
}

.dropdown__menu {
	position: absolute;
	top: calc(100% + 0.6rem);
	right: 0;
	min-width: 220px;
	padding: 0.9rem;
	border-radius: 18px;
	background: rgba(255, 255, 255, 0.95);
	-webkit-backdrop-filter: var(--blur-backdrop);
	        backdrop-filter: var(--blur-backdrop);
	box-shadow: var(--shadow-md);
	border: 1px solid rgba(10, 102, 194, 0.12);
	z-index: 40;
	display: grid;
	grid-gap: 0.45rem;
	gap: 0.45rem;
}

.dropdown__item {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 0.2rem;
	padding: 0.55rem 0.7rem;
	border-radius: 12px;
	background: transparent;
	border: none;
	color: var(--text-700);
	font-size: 0.9rem;
	cursor: pointer;
	transition: background 0.2s ease;
}

.dropdown__item--muted {
	pointer-events: none;
	color: var(--text-500);
}

.dropdown__item:hover {
	background: rgba(10, 102, 194, 0.08);
}

.dropdown__divider {
	height: 1px;
	background: rgba(10, 102, 194, 0.12);
	margin: 0.2rem 0;
}

.auth-modal {
	width: min(440px, 96vw);
	border-radius: 24px;
	background: linear-gradient(160deg, rgba(255, 255, 255, 0.98), rgba(238, 241, 255, 0.94));
	border: 1px solid rgba(10, 102, 194, 0.18);
	box-shadow: var(--shadow-lg);
	padding: clamp(1.8rem, 4vw, 2.3rem);
	position: relative;
	max-height: calc(var(--vvh, 1vh) * 92);
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
}

.auth-modal__header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 1rem;
	margin-bottom: 1.4rem;
}

.auth-modal__title {
	font-size: 1.5rem;
	font-weight: 700;
	letter-spacing: -0.02em;
}

.auth-modal__close {
	border: none;
	background: rgba(10, 102, 194, 0.12);
	color: var(--primary-600);
	width: 36px;
	height: 36px;
	border-radius: 999px;
	display: grid;
	place-items: center;
	cursor: pointer;
	transition: background 0.2s ease;
}

.auth-modal__close:hover {
	background: rgba(10, 102, 194, 0.18);
}

.auth-modal__tabs {
	display: inline-flex;
	gap: 0.5rem;
	padding: 0.35rem;
	border-radius: 999px;
	background: rgba(10, 102, 194, 0.12);
	margin-bottom: 1.8rem;
}

.auth-modal__tab {
	border: none;
	background: transparent;
	padding: 0.45rem 1.2rem;
	border-radius: 999px;
	font-weight: 600;
	font-size: 0.9rem;
	color: var(--primary-600);
	cursor: pointer;
	transition: background 0.2s ease;
}

.auth-modal__tab--active {
	background: #fff;
	box-shadow: 0 8px 18px rgba(79, 70, 229, 0.14);
}

/* OR divider between social and email sections */
.auth-divider {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	margin: 0.5rem 0 1rem;
}

.auth-divider::before,
.auth-divider::after {
	content: '';
	flex: 1;
	height: 1px;
	background: rgba(10, 102, 194, 0.15);
}

.auth-divider__label {
	font-size: 0.8rem;
	font-weight: 500;
	color: var(--text-400);
	white-space: nowrap;
}

.form-field {
	display: grid;
	grid-gap: 0.45rem;
	gap: 0.45rem;
	margin-bottom: 1.15rem;
}

.form-label {
	font-weight: 600;
	font-size: 0.9rem;
	color: var(--text-700);
}

.form-input {
	width: 100%;
	padding: 0.65rem 0.9rem;
	border-radius: 12px;
	border: 1px solid rgba(10, 102, 194, 0.2);
	background: rgba(255, 255, 255, 0.9);
	transition: border 0.2s ease, box-shadow 0.2s ease;
}

.form-input:focus {
	outline: none;
	border-color: var(--primary-500);
	box-shadow: 0 0 0 3px rgba(10, 102, 194, 0.18);
}

.form-message {
	font-size: 0.85rem;
	font-weight: 500;
}

.form-message--error {
	color: var(--danger-500);
}

.form-message--success {
	color: var(--success-500);
}

.form-footnote {
	margin-top: 1.3rem;
	text-align: center;
	font-size: 0.85rem;
	color: var(--text-500);
}

.form-footnote__link {
	background: none;
	border: none;
	color: var(--primary-600);
	font-weight: 600;
	font-size: inherit;
	cursor: pointer;
	text-decoration: underline;
	-webkit-text-decoration-style: dotted;
	        text-decoration-style: dotted;
	padding: 0;
}

.form-footnote__link:hover {
	color: var(--primary-700);
	-webkit-text-decoration-style: solid;
	        text-decoration-style: solid;
}

.hint-box {
	margin-top: 1rem;
	padding: 0.85rem 1rem;
	border-radius: 14px;
	border: 1px solid rgba(10, 102, 194, 0.14);
	background: rgba(10, 102, 194, 0.08);
	color: var(--text-700);
}

.quiz-card {
	display: grid;
	grid-gap: 1.5rem;
	gap: 1.5rem;
	max-width: 640px;
}

.quiz-card__header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 1rem;
}

.quiz-card__title {
	display: grid;
	grid-gap: 0.4rem;
	gap: 0.4rem;
}

.quiz-card__label {
	font-size: 0.9rem;
	font-weight: 600;
	color: var(--primary-600);
}

.quiz-card__heading {
	font-size: clamp(1.2rem, 3vw, 1.5rem);
	font-weight: 700;
}

.quiz-card__question {
	padding: 1.1rem 1.25rem;
	border-radius: 16px;
	background: rgba(15, 23, 42, 0.03);
	border: 1px solid rgba(148, 163, 184, 0.2);
	display: grid;
	grid-gap: 0.5rem;
	gap: 0.5rem;
}

.quiz-card__prompt {
	font-size: clamp(1.05rem, 3vw, 1.25rem);
	font-weight: 600;
}

.quiz-card__context {
	font-size: 0.95rem;
	color: var(--text-500);
}

.quiz-card__options {
	display: grid;
	grid-gap: 0.75rem;
	gap: 0.75rem;
}

/* Prevent long math/text from overflowing the card */
.quiz-card__question,
.radio-option span,
.hint-box {
	word-break: break-word;
	overflow-wrap: anywhere;
}

/* Ensure selectors stay within the card and are responsive */
.quiz-selectors {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	grid-gap: 0.5rem;
	gap: 0.5rem;
}

.quiz-selectors .input-field,
.quiz-selectors select,
.quiz-selectors input {
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
}

@media (max-width: 640px) {
	.quiz-selectors {
		grid-template-columns: 1fr;
	}
}

.quiz-card__controls {
	display: flex;
	gap: 0.75rem;
	flex-wrap: wrap;
}

.quiz-card__explanation {
	padding: 1rem 1.1rem;
	border-radius: 14px;
	background: rgba(10, 102, 194, 0.08);
	border: 1px solid rgba(10, 102, 194, 0.16);
	font-size: 0.95rem;
}

/* Practice (Quizzes) page layout */
.practice-layout {
	display: grid;
	grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
	grid-gap: 1rem;
	gap: 1rem;
	align-items: start; /* prevent sidebar from stretching to tallest column */
}

.practice-main {
	min-width: 0; /* prevent overflow */
}

.practice-aside {
	display: grid;
	grid-gap: 0.75rem;
	gap: 0.75rem;
	position: -webkit-sticky;
	position: sticky;
	top: 88px; /* beneath navbar */
	align-self: start; /* keep aside sized to its content */
}

@media (max-width: 767px) {
	.practice-layout {
		grid-template-columns: 1fr;
	}
	.practice-aside {
		position: static;
		top: auto;
	}
}

.quiz-status {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem 0.5rem;
	align-items: center;
	margin-top: 1rem;
}

/* New Quiz Layout */
.quiz-layout {
	display: grid;
	grid-template-columns: 400px 1fr;
	grid-gap: 1.5rem;
	gap: 1.5rem;
	align-items: start;
}

.quiz-filters {
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

.quiz-selectors {
	display: flex;
	flex-direction: column;
	gap: 1rem;
	margin-top: 1rem;
}

.form-group {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.quiz-panel {
	min-height: 400px;
}

.quiz-placeholder {
	min-height: 400px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.quiz-placeholder__content {
	text-align: center;
	max-width: 400px;
}

.quiz-placeholder__content h3 {
	font-size: 1.5rem;
	margin-bottom: 0.5rem;
	color: var(--text-900);
}

.quiz-placeholder__icon {
	font-size: 4rem;
	margin-top: 1rem;
	opacity: 0.3;
}

@media (max-width: 767px) {
	.quiz-layout {
		grid-template-columns: 1fr;
	}
}

/* (Removed) Unused .practice-screen* layout rules */

/* Vertical filter layout for the aside */
.quiz-selectors--vertical {
	grid-template-columns: 1fr;
}

/* Make aside info cards more compact */
.aside-mini .card--compact {
	padding: 0.75rem;
}
.aside-mini .card__title {
	font-size: 0.95rem;
	margin-bottom: 0.25rem;
}
.aside-mini .list--bulleted {
	font-size: 0.9rem;
}
.aside-mini .text-muted {
	font-size: 0.85rem;
}

/* Comments */
.comments {
	display: grid;
	grid-gap: 1rem;
	gap: 1rem;
}

.comments__form textarea {
	background: rgba(255, 255, 255, 0.9);
}

.comments__list {
	display: grid;
	grid-gap: 0.9rem;
	gap: 0.9rem;
}

.comment {
	display: grid;
	grid-template-columns: 32px 1fr;
	grid-gap: 0.8rem;
	gap: 0.8rem;
}

.comment--reply {
	margin-top: 0.6rem;
}

.comment__avatar {
	width: 32px;
	height: 32px;
	border-radius: 8px;
	display: grid;
	place-items: center;
	background: rgba(10, 102, 194, 0.12);
	color: var(--primary-600);
	font-size: 0.9rem;
}

.comment__body {
	display: grid;
	grid-gap: 0.35rem;
	gap: 0.35rem;
}

.comment__meta {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	font-size: 0.9rem;
}

.comment__text {
	white-space: pre-wrap;
}

.comment__actions {
	margin-top: 0.25rem;
}

.comment__replies {
	display: grid;
	grid-gap: 0.6rem;
	gap: 0.6rem;
	margin-top: 0.4rem;
}

.comment__reply-form {
	margin-top: 0.6rem;
	display: grid;
	grid-gap: 0.5rem;
	gap: 0.5rem;
}

.quiz-page {
	display: grid;
	grid-gap: 1.6rem;
	gap: 1.6rem;
}

.quiz-page__filters {
	display: flex;
	flex-wrap: wrap;
	gap: 0.6rem;
	margin-bottom: 0.4rem;
}

.radio-option {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	padding: 0.75rem 1rem;
	border-radius: 14px;
	border: 1px solid rgba(10, 102, 194, 0.16);
	background: rgba(255, 255, 255, 0.85);
	cursor: pointer;
	transition: border 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.radio-option:hover {
	border-color: rgba(10, 102, 194, 0.32);
	background: rgba(10, 102, 194, 0.12);
}

.radio-option input {
	accent-color: var(--primary-600);
}

.text-success {
	color: var(--success-500);
}

.text-danger {
	color: var(--danger-500);
}

/* Skeleton loading placeholders */
.skeleton {
	background: linear-gradient(90deg, rgba(10, 102, 194, 0.07) 25%, rgba(10, 102, 194, 0.12) 50%, rgba(10, 102, 194, 0.07) 75%);
	background-size: 200% 100%;
	animation: skeleton-sweep 1.6s ease-in-out infinite;
	border-radius: 8px;
}

@keyframes skeleton-sweep {
	0%   { background-position: 200% 0; }
	100% { background-position: -200% 0; }
}

.skeleton-card {
	padding: clamp(1.6rem, 3vw, 1.9rem);
	border-radius: var(--radius-lg);
	background: var(--surface);
	border: 1px solid rgba(10, 102, 194, 0.08);
	box-shadow: var(--shadow-sm);
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

.skeleton-card__badge  { height: 22px; width: 38%;  border-radius: 999px; }
.skeleton-card__title  { height: 22px; width: 80%; }
.skeleton-card__line   { height: 14px; width: 100%; }
.skeleton-card__line--short { height: 14px; width: 55%; }
.skeleton-card__bar    { height: 6px;  width: 100%; border-radius: 999px; margin-top: 0.4rem; }
.skeleton-card__btn    { height: 38px; width: 48%;  border-radius: 999px; margin-top: 0.2rem; }

.skeleton-metric {
	padding: clamp(1.4rem, 3vw, 1.9rem);
	border-radius: var(--radius-lg);
	background: linear-gradient(160deg, rgba(255,255,255,0.9), rgba(219,239,255,0.68));
	border: 1px solid rgba(10, 102, 194, 0.18);
	box-shadow: var(--shadow-sm);
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
}

.skeleton-metric__icon  { width: 44px; height: 44px; border-radius: var(--radius-sm); }
.skeleton-metric__label { height: 13px; width: 60%; }
.skeleton-metric__value { height: 32px; width: 42%; }
.skeleton-metric__cap   { height: 13px; width: 80%; }

.loading-spinner {
	width: 44px;
	height: 44px;
	border-radius: 999px;
	border: 4px solid rgba(10, 102, 194, 0.15);
	border-top-color: var(--primary-600);
	animation: spin 0.8s linear infinite;
}

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

/* Utilities */
.text-center {
	text-align: center;
}

.text-muted {
	color: var(--text-500);
}

.hidden {
	display: none !important;
}

@media (max-width: 767px) {
	.navbar__inner {
		padding: 0.85rem 0;
	}

	.hero-card__metric {
		grid-template-columns: 1fr;
	}

		/* On mobile, stack footer content vertically for clarity */
		.course-card__footer {
			flex-direction: column;
			align-items: flex-start;
		}

	.hero-visual__row {
		flex-direction: column;
		align-items: flex-start;
		gap: 0.35rem;
	}

	.course-modal__header {
		flex-direction: column;
		align-items: flex-start;
	}

	.course-modal__footer {
		justify-content: flex-start;
	}
}

/* Modal styles for admin edit forms */
.modal {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(15, 23, 42, 0.6);
	-webkit-backdrop-filter: blur(4px);
	        backdrop-filter: blur(4px);
	display: none;
	align-items: center;
	justify-content: center;
	z-index: 9999;
	padding: 1rem;
	overflow-y: auto;
}

.modal--active {
	display: flex;
}

.modal__content {
	background: var(--surface);
	border-radius: var(--radius-lg);
	box-shadow: var(--shadow-lg);
	width: 100%;
	max-width: 900px;
	max-height: calc(var(--vvh, 1vh) * 90);
	display: flex;
	flex-direction: column;
	animation: modalSlideIn 0.2s ease-out;
}

@keyframes modalSlideIn {
	from {
		opacity: 0;
		transform: translateY(-20px) scale(0.98);
	}
	to {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}

.modal__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 1.5rem;
	border-bottom: 1px solid var(--border);
}

.modal__title {
	font-size: 1.25rem;
	font-weight: 600;
	color: var(--text-900);
	margin: 0;
}

.modal__close {
	background: none;
	border: none;
	font-size: 1.75rem;
	line-height: 1;
	color: var(--text-500);
	cursor: pointer;
	padding: 0.25rem;
	width: 2rem;
	height: 2rem;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: var(--radius-sm);
	transition: all 0.2s;
}

.modal__close:hover {
	background: var(--background-accent);
	color: var(--text-900);
}

.modal__body {
	padding: 1.5rem;
	overflow-y: auto;
	flex: 1;
}

/* ========================================
   Progress Dashboard
   ======================================== */

.progress-dashboard {
	max-width: 1200px;
	margin: 0 auto;
	padding: 2rem 1rem;
}

.progress-dashboard__header {
	margin-bottom: 2rem;
}

.progress-dashboard__header h2 {
	margin: 0 0 0.5rem 0;
	color: var(--text-900);
}

.progress-dashboard__stats {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	grid-gap: 1rem;
	gap: 1rem;
	margin-bottom: 2rem;
}

.stat-card {
	background: linear-gradient(135deg, rgba(10, 102, 194, 0.05), rgba(10, 102, 194, 0.02));
	border: 1px solid rgba(10, 102, 194, 0.1);
	border-radius: 16px;
	padding: 1.5rem;
	text-align: center;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(10, 102, 194, 0.1);
}

.stat-card__icon {
	font-size: 2rem;
	margin-bottom: 0.5rem;
}

.stat-card__value {
	font-size: 2rem;
	font-weight: 700;
	color: var(--text-900);
	margin-bottom: 0.25rem;
}

.stat-card__label {
	font-size: 0.875rem;
	color: var(--text-600);
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.progress-dashboard__badges,
.progress-dashboard__courses {
	margin-bottom: 2rem;
}

.progress-dashboard__badges h3,
.progress-dashboard__courses h3 {
	margin: 0 0 1rem 0;
	color: var(--text-900);
}

.badge-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
	grid-gap: 1rem;
	gap: 1rem;
}

.achievement-badge {
	background: white;
	border: 1px solid rgba(0, 0, 0, 0.08);
	border-radius: 12px;
	padding: 1rem;
	text-align: center;
	transition: transform 0.2s ease;
}

.achievement-badge:hover {
	transform: scale(1.05);
}

.achievement-badge__icon {
	font-size: 2.5rem;
	margin-bottom: 0.5rem;
}

.achievement-badge__name {
	font-size: 0.875rem;
	font-weight: 600;
	color: var(--text-700);
}

.course-progress-list {
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

.course-progress-item {
	background: white;
	border: 1px solid rgba(0, 0, 0, 0.08);
	border-radius: 12px;
	padding: 1rem;
}

.course-progress-item__header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 0.5rem;
}

.course-progress-item__name {
	font-weight: 600;
	color: var(--text-900);
}

.course-progress-item__points {
	font-weight: 700;
	color: var(--primary);
}

.course-progress-item__stats {
	display: flex;
	justify-content: space-between;
	align-items: center;
	font-size: 0.875rem;
}

.course-progress-item__streak {
	color: #f97316;
	font-weight: 600;
}

/* ========================================
   Video Player
   ======================================== */

.video-player {
	position: relative;
	width: 100%;
	height: 100%;
	background: #000;
	border-radius: 8px;
	overflow: hidden;
}

.video-player__video {
	width: 100%;
	height: 100%;
	display: block;
	cursor: pointer;
}

.video-player__controls {
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
	padding: 1rem 0.75rem 0.5rem;
	transition: opacity 0.3s ease;
}

.video-player__progress-container {
	width: 100%;
	height: 6px;
	background: rgba(255, 255, 255, 0.3);
	border-radius: 3px;
	cursor: pointer;
	margin-bottom: 0.75rem;
}

.video-player__progress-bar {
	height: 100%;
	position: relative;
}

.video-player__progress-filled {
	height: 100%;
	background: var(--primary);
	border-radius: 3px;
	transition: width 0.1s linear;
}

.video-player__controls-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 0.5rem;
}

.video-player__controls-left,
.video-player__controls-right {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.video-player__button {
	background: transparent;
	border: none;
	color: white;
	font-size: 1.25rem;
	cursor: pointer;
	padding: 0.25rem 0.5rem;
	border-radius: 4px;
	transition: background 0.2s ease;
	display: flex;
	align-items: center;
	justify-content: center;
}

.video-player__button:hover {
	background: rgba(255, 255, 255, 0.2);
}

.video-player__volume-slider {
	width: 80px;
	cursor: pointer;
}

.video-player__time {
	color: white;
	font-size: 0.875rem;
	white-space: nowrap;
}

.video-player__speed-select {
	background: rgba(255, 255, 255, 0.2);
	border: 1px solid rgba(255, 255, 255, 0.3);
	color: white;
	padding: 0.25rem 0.5rem;
	border-radius: 4px;
	font-size: 0.875rem;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.2s ease;
}

.video-player__speed-select:hover {
	background: rgba(255, 255, 255, 0.3);
}

.video-player__speed-select option {
	background: #1a1a1a;
	color: white;
}

.video-player__youtube-note {
	position: absolute;
	bottom: 0.5rem;
	left: 0.5rem;
	right: 0.5rem;
	background: rgba(0, 0, 0, 0.7);
	color: white;
	padding: 0.5rem;
	border-radius: 4px;
	text-align: center;
}

/* ========================================
   Flashcards
   ======================================== */

.flashcard-deck {
	background: white;
	border-radius: 12px;
	padding: 1.5rem;
	max-width: 800px;
	margin: 0 auto;
}

.flashcard-deck__header {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	margin-bottom: 1.5rem;
	gap: 1rem;
}

.flashcard-deck__header h3 {
	margin: 0 0 0.25rem 0;
}

.flashcard-deck__actions {
	display: flex;
	gap: 0.5rem;
}

.flashcard-empty {
	text-align: center;
	padding: 3rem 1rem;
}

.flashcard-container {
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

.flashcard {
	perspective: 1000px;
	min-height: 400px;
	cursor: pointer;
	position: relative;
}

.flashcard__inner {
	position: relative;
	width: 100%;
	height: 100%;
	min-height: 400px;
	transition: transform 0.6s;
	transform-style: preserve-3d;
}

.flashcard--flipped .flashcard__inner {
	transform: rotateY(180deg);
}

.flashcard__front,
.flashcard__back {
	position: absolute;
	width: 100%;
	min-height: 400px;
	-webkit-backface-visibility: hidden;
	        backface-visibility: hidden;
	border-radius: 12px;
	padding: 2rem;
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	text-align: center;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.flashcard__front {
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	color: white;
}

.flashcard__back {
	background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
	color: white;
	transform: rotateY(180deg);
}

.flashcard--mastered .flashcard__front {
	background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.flashcard--difficult .flashcard__front {
	background: linear-gradient(135deg, #fc4a1a 0%, #f7b733 100%);
}

.flashcard__label {
	font-size: 0.875rem;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	opacity: 0.9;
	margin-bottom: 1rem;
	font-weight: 600;
}

.flashcard__content {
	font-size: 1.5rem;
	font-weight: 600;
	line-height: 1.4;
	margin-bottom: 1rem;
	flex: 1;
	display: flex;
	align-items: center;
	justify-content: center;
}

.flashcard__content--answer {
	font-size: 1.75rem;
	font-weight: 700;
}

.flashcard__hint-text {
	font-size: 0.875rem;
	opacity: 0.8;
	margin-top: auto;
}

.flashcard__hint,
.flashcard__explanation {
	font-size: 0.875rem;
	text-align: left;
	background: rgba(255, 255, 255, 0.2);
	padding: 0.75rem;
	border-radius: 8px;
	margin-top: 1rem;
	line-height: 1.5;
}

.flashcard-controls {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 1rem;
}

.flashcard-controls__rating {
	display: flex;
	gap: 0.5rem;
}

.flashcard-progress {
	height: 4px;
	background: rgba(0, 0, 0, 0.1);
	border-radius: 2px;
	overflow: hidden;
}

.flashcard-progress__bar {
	height: 100%;
	background: var(--primary);
	transition: width 0.3s ease;
}

/* ========================================
   Notification Center
   ======================================== */

.notification-center {
	background: white;
	border-radius: 12px;
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
	max-width: 500px;
	width: 100%;
	max-height: 600px;
	display: flex;
	flex-direction: column;
}

.notification-center__header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 1rem 1.5rem;
	border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.notification-center__header h3 {
	margin: 0;
}

.notification-center__tabs {
	display: flex;
	border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.notification-center__tab {
	flex: 1;
	padding: 0.75rem 1rem;
	background: transparent;
	border: none;
	font-weight: 500;
	color: var(--text-600);
	cursor: pointer;
	transition: all 0.2s ease;
	border-bottom: 2px solid transparent;
}

.notification-center__tab:hover {
	background: rgba(0, 0, 0, 0.02);
}

.notification-center__tab--active {
	color: var(--primary);
	border-bottom-color: var(--primary);
}

.notification-center__content {
	flex: 1;
	overflow-y: auto;
	padding: 1rem;
}

.notification-center__loading {
	display: flex;
	justify-content: center;
	align-items: center;
	padding: 3rem;
}

.notification-list,
.reminder-list {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.notification-list__header,
.reminder-list__header {
	display: flex;
	justify-content: flex-end;
	margin-bottom: 0.5rem;
}

.notification-item,
.reminder-item {
	display: flex;
	gap: 0.75rem;
	padding: 0.75rem;
	background: rgba(10, 102, 194, 0.04);
	border-radius: 8px;
	border: 1px solid rgba(10, 102, 194, 0.1);
	transition: transform 0.2s ease;
}

.notification-item:hover,
.reminder-item:hover {
	transform: translateX(2px);
}

.notification-item__icon {
	font-size: 1.5rem;
	flex-shrink: 0;
}

.notification-item__content,
.reminder-item__content {
	flex: 1;
}

.notification-item__title,
.reminder-item__title {
	font-weight: 600;
	color: var(--text-900);
	margin-bottom: 0.25rem;
}

.notification-item__message,
.reminder-item__message {
	font-size: 0.875rem;
	color: var(--text-700);
	margin-bottom: 0.25rem;
}

.notification-item__time,
.reminder-item__schedule {
	font-size: 0.75rem;
	color: var(--text-500);
}

.notification-item__dismiss,
.reminder-item__delete {
	background: transparent;
	border: none;
	cursor: pointer;
	font-size: 1.25rem;
	color: var(--text-500);
	padding: 0.25rem;
	border-radius: 4px;
	transition: all 0.2s ease;
}

.notification-item__dismiss:hover {
	background: rgba(34, 197, 94, 0.1);
	color: #22c55e;
}

.reminder-item__delete:hover {
	background: rgba(239, 68, 68, 0.1);
	color: #ef4444;
}

.notification-empty {
	text-align: center;
	padding: 3rem 1rem;
	color: var(--text-600);
}

.notification-empty p:first-child {
	font-size: 1.5rem;
	margin-bottom: 0.5rem;
}

.notification-settings {
	display: flex;
	flex-direction: column;
	gap: 1.5rem;
}

.notification-settings h4 {
	margin: 0 0 1rem 0;
}

.notification-setting {
	padding-bottom: 1rem;
	border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.notification-setting:last-child {
	border-bottom: none;
}

.notification-setting__label {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	font-weight: 500;
	margin-bottom: 0.5rem;
	cursor: pointer;
}

.notification-setting__label input[type="checkbox"] {
	width: 1.25rem;
	height: 1.25rem;
	cursor: pointer;
}

.notification-setting__time-input {
	padding: 0.5rem;
	border: 1px solid rgba(0, 0, 0, 0.2);
	border-radius: 6px;
	font-size: 0.875rem;
	margin-left: auto;
}

.notification-setting .text-muted {
	margin: 0;
	font-size: 0.875rem;
}

/* ========================================
   Hide YouTube End Screen Overlay
   ======================================== */

/* Try to hide YouTube's end screen suggestions using CSS */
.lesson-card__media iframe {
	position: relative;
	z-index: 1;
}

/* This won't completely hide YouTube suggestions as they're inside the iframe,
   but we can add an overlay when the video ends */
.lesson-card__media {
	position: relative;
}


.modal__footer {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 0.75rem;
	padding: 1.5rem;
	border-top: 1px solid var(--border);
}

/* ========================================
   Exam Browser
   ======================================== */

.exam-browser__header {
	margin-top: 0;
}

/* ─── Sticky filter strip — fully transparent ─── */
.exam-browser__filters-sticky {
	position: static;
	top: auto;
	z-index: 40;
	background: none;
	padding: 0.85rem 0;
	margin: 0 calc(-1 * clamp(1rem, 3vw, 2rem));
	padding-left: clamp(1rem, 3vw, 2rem);
	padding-right: clamp(1rem, 3vw, 2rem);
	border-bottom: none;
}

.exam-browser__filters-sticky:has(~ .grid--exams) {
	box-shadow: none;
}

/* Transparent wrapper — no visible card */
.exam-browser__filters-card {
	display: flex;
	flex-direction: column;
	gap: 0.6rem;
	background: none;
	border: none;
	padding: 0;
	box-shadow: none;
}

/* Row that holds grouped controls */
.exam-browser__filters {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	align-items: flex-end;
}

/* Field groups with labels */
.exam-browser__field {
	display: flex;
	flex-direction: column;
	gap: 0.3rem;
	flex: 1;
	min-width: 0;
}

.exam-browser__field--search {
	flex: 2;
	min-width: 200px;
}

.exam-browser__field--actions {
	flex: 0 0 auto;
	align-self: flex-end;
}

.exam-browser__label {
	font-size: 0.7rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--text-400);
	padding-left: 0.2rem;
	-webkit-user-select: none;
	        user-select: none;
}

/* Premium pill-shaped selects */
.exam-browser__select {
	-webkit-appearance: none;
	        appearance: none;
	padding: 0.6rem 2rem 0.6rem 1rem;
	border-radius: 100px;
	border: 1.5px solid var(--border);
	background:
		url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2712%27 height=%2712%27 viewBox=%270 0 24 24%27 fill=%27none%27 stroke=%27%239ca3af%27 stroke-width=%272.5%27 stroke-linecap=%27round%27 stroke-linejoin=%27round%27%3E%3Cpolyline points=%276 9 12 15 18 9%27/%3E%3C/svg%3E")
		no-repeat right 0.85rem center / 12px,
		rgba(255, 255, 255, 0.70);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
	color: var(--text-700);
	font-size: 0.85rem;
	font-family: var(--font-sans);
	cursor: pointer;
	transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
	width: 100%;
}

.exam-browser__select:hover {
	background-color: rgba(255, 255, 255, 0.95);
	border-color: var(--primary-400, #60a5fa);
}

.exam-browser__select:focus {
	outline: none;
	border-color: var(--primary-500);
	box-shadow: 0 0 0 3px rgba(10, 102, 194, 0.10), 0 1px 4px rgba(10, 102, 194, 0.08);
}

/* Premium pill search input */
.exam-browser__search-wrap {
	position: relative;
	width: 100%;
}

.exam-browser__search-icon {
	position: absolute;
	left: 1rem;
	top: 50%;
	transform: translateY(-50%);
	color: var(--text-300);
	pointer-events: none;
	transition: color 0.2s;
}

.exam-browser__search-wrap:focus-within .exam-browser__search-icon {
	color: var(--primary-500);
}

.exam-browser__search {
	width: 100%;
	padding: 0.6rem 1rem 0.6rem 2.75rem;
	border-radius: 100px;
	border: 1.5px solid var(--border);
	background: rgba(255, 255, 255, 0.70);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
	color: var(--text-700);
	font-size: 0.85rem;
	font-family: var(--font-sans);
	transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.exam-browser__search::placeholder {
	color: var(--text-300);
	transition: color 0.2s;
}

.exam-browser__search:hover {
	background: rgba(255, 255, 255, 0.95);
	border-color: var(--primary-400, #60a5fa);
}

.exam-browser__search:focus {
	outline: none;
	border-color: var(--primary-500);
	box-shadow: 0 0 0 3px rgba(10, 102, 194, 0.10), 0 1px 4px rgba(10, 102, 194, 0.08);
}

.exam-browser__search:focus::placeholder {
	color: var(--text-200, #d1d5db);
}

/* Icon-only ghost pill reset button */
.exam-browser__clear-btn {
	-webkit-appearance: none;
	        appearance: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.4rem;
	background: rgba(239, 68, 68, 0.06);
	color: #ef4444;
	border: 1.5px solid rgba(239, 68, 68, 0.15);
	padding: 0.55rem 1rem;
	border-radius: 100px;
	font-size: 0.78rem;
	font-weight: 600;
	font-family: var(--font-sans);
	cursor: pointer;
	transition: background 0.2s, border-color 0.2s, transform 0.15s, box-shadow 0.2s;
	white-space: nowrap;
	line-height: 1;
}

.exam-browser__clear-btn:hover {
	background: rgba(239, 68, 68, 0.12);
	border-color: rgba(239, 68, 68, 0.30);
	box-shadow: 0 2px 8px rgba(239, 68, 68, 0.10);
}

.exam-browser__clear-btn:active {
	transform: scale(0.96);
}

/* ─── Divider between controls and stats ─── */
.exam-browser__divider {
	height: 1px;
	background: linear-gradient(90deg, transparent, rgba(10, 102, 194, 0.10) 20%, rgba(10, 102, 194, 0.10) 80%, transparent);
	margin: 0;
	border: none;
}

/* ─── Summary stat chips ─── */
.exam-browser__summary {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	flex-wrap: wrap;
}

.exam-browser__stat-chip {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	padding: 0.3rem 0.75rem;
	border-radius: 100px;
	font-size: 0.78rem;
	font-weight: 600;
	font-family: var(--font-sans);
	background: rgba(10, 102, 194, 0.06);
	color: var(--primary-700, #1d4ed8);
	border: 1px solid rgba(10, 102, 194, 0.10);
	line-height: 1.3;
	transition: background 0.2s, transform 0.15s;
	white-space: nowrap;
}

.exam-browser__stat-chip--accent {
	background: rgba(16, 185, 129, 0.07);
	color: #047857;
	border-color: rgba(16, 185, 129, 0.14);
}

.exam-browser__stat-chip:hover {
	background: rgba(10, 102, 194, 0.10);
}

.exam-browser__stat-chip--accent:hover {
	background: rgba(16, 185, 129, 0.12);
}

.exam-browser__stat-icon {
	font-size: 0.85rem;
	line-height: 1;
}

.grid--exams {
	grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
}

.exam-browser__grid {
	margin-top: 1.25rem;
}

.exam-browser__empty {
	margin-top: 1.5rem;
}

/* Exam Card */
.exam-card {
	display: flex;
	flex-direction: column;
	gap: 0.6rem;
	text-align: left;
	cursor: pointer;
	width: 100%;
	font-family: var(--font-sans);
	transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease, background 0.25s ease;
	border: 1px solid rgba(10, 102, 194, 0.09);
	position: relative;
	overflow: hidden;
}

.exam-card::before {
	content: '';
	position: absolute;
	left: 0;
	top: 0;
	bottom: 0;
	width: 4px;
	background: var(--exam-accent, var(--primary-500));
	opacity: 0.45;
	transition: opacity 0.25s ease, width 0.25s ease;
}

.exam-card:hover,
.exam-card:focus-visible {
	border-color: rgba(10, 102, 194, 0.22);
	background: rgba(255, 255, 255, 0.95);
	backdrop-filter: saturate(140%) blur(8px);
	-webkit-backdrop-filter: saturate(140%) blur(8px);
}

.exam-card:hover::before,
.exam-card:focus-visible::before {
	opacity: 0.55;
}

.exam-card:focus-visible {
	outline: 2px solid var(--primary-500);
	outline-offset: 2px;
}

.exam-card:active {
	transform: none;
}

.exam-card__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem;
}

.exam-card__subject-badge {
	display: inline-flex;
	align-items: center;
	padding: 0.2rem 0.6rem;
	border-radius: 999px;
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.01em;
}

.exam-card__year {
	font-size: 0.82rem;
	font-weight: 700;
	color: var(--text-400);
	background: var(--surface-muted);
	padding: 0.15rem 0.5rem;
	border-radius: var(--radius-sm);
}

.exam-card__title {
	font-size: 0.97rem;
	font-weight: 700;
	color: var(--text-900);
	line-height: 1.42;
	letter-spacing: -0.01em;
	margin: 0;
	/* Truncate at 2 lines */
	display: -webkit-box;
	line-clamp: 2;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	text-overflow: ellipsis;
}

.exam-card__meta {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	font-size: 0.8rem;
	color: var(--text-500);
	flex-wrap: wrap;
}

.exam-card__meta > span {
	display: inline-flex;
	align-items: center;
	gap: 0.2rem;
}

/* Subtle separator dots between meta items */
.exam-card__meta > span + span::before {
	content: '·';
	margin-right: 0.35rem;
	color: var(--text-300);
	font-weight: 700;
}

.exam-card__level {
	font-weight: 600;
	color: var(--text-600);
}

.exam-card__stats {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	font-size: 0.8rem;
	color: var(--text-500);
	flex-wrap: wrap;
}

.exam-card__gradable {
	color: var(--success-500);
	font-weight: 600;
}

.exam-card__types {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem;
	margin-top: auto;
}

.exam-card__type-chip {
	display: inline-flex;
	align-items: center;
	gap: 0.2rem;
	padding: 0.2rem 0.5rem;
	border-radius: 999px;
	font-size: 0.7rem;
	font-weight: 600;
	background: rgba(10, 102, 194, 0.06);
	color: var(--text-500);
	white-space: nowrap;
	border: 1px solid rgba(10, 102, 194, 0.08);
}

.exam-card__cta {
	margin-top: auto;
	padding-top: 0.7rem;
}

.exam-card__cta-text {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.4rem;
	width: 100%;
	padding: 0.55rem 1rem;
	border-radius: var(--radius-sm);
	background: color-mix(in srgb, var(--exam-accent, var(--primary-500)) 8%, transparent);
	border: 1px solid color-mix(in srgb, var(--exam-accent, var(--primary-500)) 20%, transparent);
	font-weight: 700;
	font-size: 0.88rem;
	color: var(--exam-accent, var(--primary-600));
	transition: background 0.2s ease, border-color 0.2s ease;
}

.exam-card:hover .exam-card__cta-text,
.exam-card:focus-visible .exam-card__cta-text {
	background: color-mix(in srgb, var(--exam-accent, var(--primary-500)) 14%, transparent);
	border-color: color-mix(in srgb, var(--exam-accent, var(--primary-500)) 35%, transparent);
}

/* Load more / Pagination */
.exam-browser__load-more {
	display: flex;
	justify-content: center;
	padding: 1.5rem 0 0.5rem;
}

.exam-browser__load-btn {
	-webkit-appearance: none;
	        appearance: none;
	background: var(--surface);
	color: var(--primary-600);
	border: 1.5px solid rgba(10, 102, 194, 0.2);
	padding: 0.7rem 2rem;
	border-radius: 999px;
	font-size: 0.92rem;
	font-weight: 600;
	font-family: var(--font-sans);
	cursor: pointer;
	transition: all 0.2s;
}

.exam-browser__load-btn:hover {
	background: rgba(10, 102, 194, 0.06);
	border-color: rgba(10, 102, 194, 0.35);
	transform: translateY(-1px);
	box-shadow: var(--shadow-sm);
}

.exam-browser__showing {
	text-align: center;
	font-size: 0.82rem;
	color: var(--text-400);
	padding-top: 0.75rem;
}

/* Responsive adjustments */
@media (max-width: 640px) {
	.exam-browser__filters {
		flex-direction: column;
	}

	.exam-browser__select,
	.exam-browser__search-wrap {
		width: 100%;
		min-width: 0;
	}

	.grid--exams {
		grid-template-columns: 1fr;
	}

	.exam-take__body {
		grid-template-columns: 1fr;
	}

	.exam-take__nav {
		position: static;
		order: 2;
		backdrop-filter: none;
		-webkit-backdrop-filter: none;
	}

	.exam-take__nav-sections {
		max-height: none;
	}

	.exam-take__nav-section {
		border-left: none;
		padding-left: 0;
	}

	.exam-take__nav-section-grid {
		grid-template-columns: repeat(auto-fill, minmax(38px, 1fr));
	}

	.exam-take__content {
		order: 1;
	}

	.exam-take__topbar {
		flex-wrap: wrap;
	}

	.exam-take__title-short {
		max-width: 120px;
	}

	.exam-take__passage-btn {
		bottom: calc(1rem + env(safe-area-inset-bottom));
		right: calc(1rem + env(safe-area-inset-right));
		padding: 0.55rem 0.9rem;
		font-size: 0.8rem;
	}

	.exam-take__passage-panel {
		width: 100vw;
	}

	.exam-take__inline-blank {
		min-width: 4em;
		font-size: 0.9rem;
		padding: 0.1em 0.3em;
	}

	.exam-take__fill-blank-text {
		font-size: 0.95rem;
		line-height: 2;
	}

	.exam-results__overview {
		grid-template-columns: 1fr;
	}

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

	.exam-results__actions {
		flex-direction: column;
		align-items: stretch;
	}
}

/* ========================================
   Exam Cover  (pre-exam splash – Phase 10)
   ======================================== */

/* ── Full-bleed wrapper ── */
.exam-cover {
	position: relative;
	min-height: calc(var(--vvh, 1vh) * 100);
	overflow: hidden;
	display: flex;
	flex-direction: column;
	background:
		linear-gradient(160deg, color-mix(in srgb, var(--cover-accent, var(--primary-500)) 6%, transparent) 0%,
			transparent 50%),
		linear-gradient(320deg, color-mix(in srgb, var(--cover-accent, var(--primary-500)) 4%, transparent) 0%,
			transparent 40%),
		var(--background);
}

/* ── Decorative background ── */
.exam-cover__bg {
	position: absolute;
	inset: 0;
	pointer-events: none;
	z-index: 0;
	overflow: hidden;
}

.exam-cover__orb {
	position: absolute;
	border-radius: 50%;
	filter: blur(80px);
	opacity: 0.35;
}
.exam-cover__orb--1 {
	width: 420px; height: 420px;
	top: -80px; right: -60px;
	background: var(--cover-accent, var(--primary-500));
	animation: coverFloat 14s ease-in-out infinite;
}
.exam-cover__orb--2 {
	width: 280px; height: 280px;
	bottom: 10%; left: -40px;
	background: #22d3ee;
	animation: coverFloat 18s ease-in-out infinite reverse;
}
.exam-cover__orb--3 {
	width: 200px; height: 200px;
	top: 45%; right: 20%;
	background: #a78bfa;
	opacity: 0.18;
	animation: coverFloat 22s ease-in-out infinite 3s;
}
.exam-cover__grid {
	position: absolute;
	inset: 0;
	background-image:
		linear-gradient(rgba(10,102,194,0.035) 1px, transparent 1px),
		linear-gradient(90deg, rgba(10,102,194,0.035) 1px, transparent 1px);
	background-size: 48px 48px;
	mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, black 0%, transparent 100%);
	-webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, black 0%, transparent 100%);
}

@keyframes coverFloat {
	0%, 100% { transform: translateY(0) scale(1); }
	50%      { transform: translateY(-30px) scale(1.08); }
}

/* ── Inner content column ── */
.exam-cover__inner {
	position: relative;
	z-index: 1;
	width: 100%;
	max-width: 820px;
	margin: 0 auto;
	padding: 1.5rem 1.25rem 3rem;
	display: flex;
	flex-direction: column;
	gap: 1.5rem;
	animation: coverReveal 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes coverReveal {
	from { opacity: 0; transform: translateY(24px); }
	to   { opacity: 1; transform: translateY(0); }
}

/* ── Top navigation row ── */
.exam-cover__nav {
	display: flex;
	align-items: center;
	justify-content: space-between;
}
.exam-cover__back {
	display: inline-flex;
	align-items: center;
	gap: 0.3rem;
	background: rgba(255,255,255,0.65);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	border: 1px solid var(--border);
	border-radius: 999px;
	padding: 0.45rem 1rem 0.45rem 0.7rem;
	font-size: 0.85rem;
	font-weight: 600;
	color: var(--text-700);
	cursor: pointer;
	transition: background 0.2s, box-shadow 0.2s;
}
.exam-cover__back:hover {
	background: rgba(255,255,255,0.9);
	box-shadow: var(--shadow-sm);
}
.exam-cover__brand {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	font-size: 0.82rem;
	font-weight: 700;
	color: var(--text-400);
	letter-spacing: 0.02em;
}
.exam-cover__brand-icon { font-size: 1rem; }

/* ── Hero card ── */
.exam-cover__hero {
	background: rgba(255,255,255,0.72);
	backdrop-filter: saturate(160%) blur(20px);
	-webkit-backdrop-filter: saturate(160%) blur(20px);
	border: 1px solid rgba(255,255,255,0.5);
	border-radius: var(--radius-lg);
	padding: 2rem 2.25rem 1.75rem;
	box-shadow:
		0 1px 2px rgba(0,0,0,0.04),
		0 8px 32px rgba(10,102,194,0.08);
	display: flex;
	flex-direction: column;
	gap: 0.85rem;
	animation: coverReveal 0.5s cubic-bezier(0.16,1,0.3,1) 0.08s both;
}
.exam-cover__badge {
	align-self: flex-start;
	padding: 0.35rem 1rem;
	border-radius: 999px;
	font-size: 0.78rem;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.06em;
}
.exam-cover__title {
	font-size: clamp(1.4rem, 4vw, 2rem);
	font-weight: 900;
	line-height: 1.2;
	letter-spacing: -0.025em;
	color: var(--text-900);
}
.exam-cover__year {
	font-size: 0.9rem;
	font-weight: 600;
	color: var(--text-400);
	margin-top: -0.3rem;
}

/* ── Stats row ── */
.exam-cover__stats {
	display: flex;
	gap: 0.5rem;
	margin-top: 0.5rem;
	flex-wrap: wrap;
}
.exam-cover__stat {
	flex: 1;
	min-width: 90px;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.15rem;
	padding: 0.75rem 0.5rem;
	border-radius: var(--radius-sm);
	background: var(--background);
	border: 1px solid var(--border);
}
.exam-cover__stat-value {
	font-size: 1.35rem;
	font-weight: 900;
	color: var(--cover-accent, var(--primary-500));
	line-height: 1;
}
.exam-cover__stat-label {
	font-size: 0.72rem;
	font-weight: 600;
	color: var(--text-400);
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

/* ── Two-column body ── */
.exam-cover__body {
	display: grid;
	grid-template-columns: 1fr 1fr;
	grid-gap: 1rem;
	gap: 1rem;
	animation: coverReveal 0.5s cubic-bezier(0.16,1,0.3,1) 0.16s both;
}

/* ── Glass panels ── */
.exam-cover__panel {
	background: rgba(255,255,255,0.68);
	backdrop-filter: saturate(160%) blur(20px);
	-webkit-backdrop-filter: saturate(160%) blur(20px);
	border: 1px solid rgba(255,255,255,0.45);
	border-radius: var(--radius-lg);
	padding: 1.35rem 1.5rem;
	box-shadow:
		0 1px 2px rgba(0,0,0,0.03),
		0 6px 24px rgba(10,102,194,0.06);
}
.exam-cover__panel--sections:only-child,
.exam-cover__body > .exam-cover__panel--sections:last-child {
	grid-column: 1 / -1;
}
.exam-cover__panel-heading {
	display: flex;
	align-items: center;
	gap: 0.45rem;
	font-size: 0.85rem;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--text-500);
	margin-bottom: 1rem;
}
.exam-cover__panel-heading svg {
	color: var(--cover-accent, var(--primary-500));
	flex-shrink: 0;
}

/* ── Section list ── */
.exam-cover__section-list {
	list-style: none;
	padding: 0;
	margin: 0;
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	counter-reset: section-counter;
}
.exam-cover__section-row {
	display: flex;
	align-items: center;
	gap: 0.65rem;
	padding: 0.55rem 0.7rem;
	border-radius: var(--radius-sm);
	background: var(--background);
	transition: background 0.15s, transform 0.15s;
}
.exam-cover__section-row:hover {
	background: var(--primary-50);
	transform: translateX(3px);
}
.exam-cover__section-dot {
	width: 10px;
	height: 10px;
	border-radius: 50%;
	flex-shrink: 0;
}
.exam-cover__section-name {
	flex: 1;
	font-size: 0.88rem;
	font-weight: 600;
	color: var(--text-800);
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.exam-cover__section-qty {
	font-size: 0.75rem;
	font-weight: 700;
	color: var(--text-400);
	background: var(--surface);
	border: 1px solid var(--border);
	padding: 0.15rem 0.55rem;
	border-radius: 999px;
	flex-shrink: 0;
}

/* ── Rules list ── */
.exam-cover__rules-list {
	list-style: none;
	padding: 0;
	margin: 0;
	display: flex;
	flex-direction: column;
	gap: 0.65rem;
}
.exam-cover__rule-item {
	display: flex;
	align-items: flex-start;
	gap: 0.55rem;
	font-size: 0.85rem;
	line-height: 1.55;
	color: var(--text-700);
}
.exam-cover__rule-icon {
	flex-shrink: 0;
	font-size: 1rem;
	margin-top: 2px;
}

/* ── Feedback mode selector ── */
.exam-cover__feedback-mode {
	grid-column: 1 / -1;
	animation: coverReveal 0.5s cubic-bezier(0.16,1,0.3,1) 0.2s both;
}
.exam-cover__feedback-options {
	display: grid;
	grid-template-columns: 1fr 1fr;
	grid-gap: 0.75rem;
	gap: 0.75rem;
	margin-top: 0.65rem;
}
.exam-cover__feedback-option {
	display: flex;
	align-items: flex-start;
	gap: 0.5rem;
	padding: 0.85rem 1rem;
	border: 2px solid var(--border-200, #e2e8f0);
	border-radius: 12px;
	cursor: pointer;
	transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
	background: var(--bg-50, #fff);
}
.exam-cover__feedback-option:hover {
	border-color: var(--border-300, #cbd5e1);
	box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.exam-cover__feedback-option--selected {
	box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
.exam-cover__feedback-radio {
	margin-top: 3px;
	accent-color: var(--cover-accent, var(--primary-500));
}
.exam-cover__feedback-content {
	display: flex;
	align-items: flex-start;
	gap: 0.5rem;
}
.exam-cover__feedback-icon {
	font-size: 1.35rem;
	flex-shrink: 0;
	margin-top: -1px;
}
.exam-cover__feedback-content strong {
	display: block;
	font-size: 0.92rem;
	font-weight: 700;
	color: var(--text-900, #1e293b);
	margin-bottom: 2px;
}
.exam-cover__feedback-content p {
	font-size: 0.78rem;
	color: var(--text-500, #64748b);
	margin: 0;
	line-height: 1.35;
}
@media (max-width: 500px) {
	.exam-cover__feedback-options {
		grid-template-columns: 1fr;
	}
}

/* ── CTA ── */
.exam-cover__cta {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.65rem;
	margin-top: 0.25rem;
	animation: coverReveal 0.5s cubic-bezier(0.16,1,0.3,1) 0.24s both;
}
.exam-cover__start-btn {
	display: inline-flex;
	align-items: center;
	gap: 0.65rem;
	padding: 0.9rem 2.5rem;
	border-radius: 999px;
	border: none;
	color: #fff;
	font-size: 1.05rem;
	font-weight: 800;
	letter-spacing: 0.01em;
	cursor: pointer;
	box-shadow:
		0 4px 14px color-mix(in srgb, var(--cover-accent, var(--primary-500)) 35%, transparent),
		0 1px 3px rgba(0,0,0,0.08);
	transition: transform 0.2s, box-shadow 0.2s;
}
.exam-cover__start-btn:hover {
	transform: translateY(-2px) scale(1.02);
	box-shadow:
		0 8px 24px color-mix(in srgb, var(--cover-accent, var(--primary-500)) 40%, transparent),
		0 2px 6px rgba(0,0,0,0.1);
}
.exam-cover__start-btn:active {
	transform: translateY(0) scale(0.98);
}
.exam-cover__cta-hint {
	font-size: 0.82rem;
	font-weight: 600;
	color: var(--text-400);
}

/* ── Mobile: stack to single column ── */
@media (max-width: 700px) {
	.exam-cover__inner {
		padding: 1.25rem 1rem 2.5rem;
	}
	.exam-cover__hero {
		padding: 1.5rem 1.25rem 1.35rem;
	}
	.exam-cover__body {
		grid-template-columns: 1fr;
	}
	.exam-cover__stats {
		gap: 0.4rem;
	}
	.exam-cover__stat {
		min-width: 70px;
		padding: 0.6rem 0.35rem;
	}
	.exam-cover__stat-value {
		font-size: 1.15rem;
	}
	.exam-cover__panel {
		padding: 1.1rem 1.15rem;
	}
	.exam-cover__title {
		font-size: 1.25rem;
	}
	.exam-cover__orb--1 { width: 250px; height: 250px; }
	.exam-cover__orb--2 { width: 160px; height: 160px; }
	.exam-cover__orb--3 { display: none; }
}

/* ========================================
   Exam Take
   ======================================== */

.exam-take {
	padding-top: 0 !important;
}

.exam-take__topbar {
	position: -webkit-sticky;
	position: sticky;
	top: var(--navbar-height);
	z-index: 50;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 0.75rem 0;
	background: rgba(255, 255, 255, 0.92);
	-webkit-backdrop-filter: var(--blur-backdrop);
	        backdrop-filter: var(--blur-backdrop);
	border-bottom: 1px solid var(--border);
	margin: 0 calc(-1 * clamp(1rem, 3vw, 2rem));
	padding-left: clamp(1rem, 3vw, 2rem);
	padding-right: clamp(1rem, 3vw, 2rem);
}

.exam-take__topbar-left {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	min-width: 0;
}

.exam-take__exam-info {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.exam-take__subject {
	font-size: 0.78rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.03em;
}

.exam-take__title-short {
	font-size: 0.82rem;
	color: var(--text-500);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	max-width: 200px;
}

.exam-take__topbar-right {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	flex-shrink: 0;
}

.exam-take__progress {
	font-size: 0.82rem;
	font-weight: 600;
	color: var(--text-500);
}

/* ── Progress bar ── */

.exam-take__progress-bar {
	width: 100%;
	height: 4px;
	background: var(--border);
	border-radius: 999px;
	overflow: hidden;
	margin-top: 0.75rem;
}

.exam-take__progress-fill {
	height: 100%;
	background: var(--primary-500);
	border-radius: 999px;
	transition: width 0.35s ease;
	min-width: 2px;
}

.exam-take__timer {
	font-size: 0.9rem;
	font-weight: 700;
	font-feature-settings: "tnum";
	font-variant-numeric: tabular-nums;
	color: var(--text-700);
	padding: 0.3rem 0.75rem;
	border-radius: var(--radius-sm);
	background: rgba(10, 102, 194, 0.08);
}

.exam-take__timer--warning {
	background: rgba(239, 68, 68, 0.12);
	color: var(--danger-500);
	animation: pulse-timer 1s ease infinite;
}

@keyframes pulse-timer {
	0%, 100% { opacity: 1; }
	50% { opacity: 0.6; }
}

.exam-take__body {
	display: grid;
	grid-template-columns: 210px 1fr;
	grid-gap: 1.5rem;
	gap: 1.5rem;
	margin-top: 1.5rem;
	align-items: flex-start;
}

/* ── Premium sidebar ───────────────────────────────────────────────── */
.exam-take__nav {
	position: -webkit-sticky;
	position: sticky;
	top: calc(var(--navbar-height) + 64px);
	background: linear-gradient(165deg, rgba(255,255,255,0.92) 0%, rgba(248,250,255,0.96) 100%);
	backdrop-filter: saturate(140%) blur(12px);
	-webkit-backdrop-filter: saturate(140%) blur(12px);
	border-radius: var(--radius-md);
	border: 1px solid rgba(10,102,194,0.10);
	padding: 1rem 0.85rem;
	box-shadow:
		0 1px 2px rgba(10,102,194,0.04),
		0 8px 24px rgba(10,102,194,0.07);
	transition: box-shadow 0.3s ease;
	min-width: 0;
	width: 210px;
	box-sizing: border-box;
}

.exam-take__nav:hover {
	box-shadow:
		0 1px 2px rgba(10,102,194,0.05),
		0 12px 32px rgba(10,102,194,0.10);
}

/* ── Progress ring header ──────────────────────────────────────── */
.exam-take__nav-progress {
	display: flex;
	align-items: center;
	gap: 0.65rem;
	width: 100%;
	min-width: 0;
}

.exam-take__nav-ring-wrap {
	position: relative;
	width: 46px;
	height: 46px;
	flex-shrink: 0;
}

.exam-take__nav-ring {
	width: 100%;
	height: 100%;
	transform: rotate(-90deg);
}

.exam-take__nav-ring-bg {
	fill: none;
	stroke: rgba(10,102,194,0.08);
	stroke-width: 3.5;
}

.exam-take__nav-ring-fill {
	fill: none;
	stroke: var(--nav-accent, var(--primary-500));
	stroke-width: 3.5;
	stroke-linecap: round;
	transition: stroke-dashoffset 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.exam-take__nav-ring-pct {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 0.72rem;
	font-weight: 800;
	color: var(--text-800);
	line-height: 1;
}

.exam-take__nav-ring-pct small {
	font-size: 0.48rem;
	font-weight: 700;
	opacity: 0.6;
}

.exam-take__nav-progress-meta {
	display: flex;
	flex-direction: column;
	gap: 0.1rem;
	min-width: 0;
}

.exam-take__nav-progress-title {
	font-size: 0.72rem;
	font-weight: 700;
	color: var(--text-700);
	letter-spacing: 0.01em;
}

.exam-take__nav-progress-detail {
	font-size: 0.65rem;
	font-weight: 600;
	color: var(--text-400);
	font-feature-settings: "tnum";
	font-variant-numeric: tabular-nums;
}

/* ── Divider ───────────────────────────────────────────────────── */
.exam-take__nav-divider {
	height: 1px;
	margin: 0.75rem 0;
	background: linear-gradient(90deg, transparent, var(--border), transparent);
}

/* ── Sections list ─────────────────────────────────────────────── */
.exam-take__nav-sections {
	display: grid;
	grid-gap: 0.6rem;
	gap: 0.6rem;
	max-height: calc(var(--vvh, 1vh) * 100 - var(--navbar-height) - 200px);
	overflow-y: auto;
	overflow-x: hidden;
	padding-right: 0.2rem;
	scrollbar-width: thin;
	scrollbar-color: rgba(10,102,194,0.12) transparent;
	min-width: 0;
	width: 100%;
}

.exam-take__nav-sections::-webkit-scrollbar {
	width: 4px;
}

.exam-take__nav-sections::-webkit-scrollbar-thumb {
	background: rgba(10, 102, 194, 0.12);
	border-radius: 4px;
}

/* ── Section block ─────────────────────────────────────────────── */
.exam-take__nav-section {
	display: grid;
	grid-gap: 0.35rem;
	gap: 0.35rem;
	padding-left: 0.55rem;
	border-left: 2px solid transparent;
	transition: border-color 0.25s ease;
	min-width: 0;
	width: 100%;
	overflow: hidden;
}

.exam-take__nav-section--active {
	border-left-color: var(--nav-accent, var(--primary-500));
}

.exam-take__nav-section-title {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.4rem;
	font-size: 0.7rem;
	font-weight: 700;
	color: var(--text-500);
	padding-top: 0.15rem;
	transition: color 0.2s;
	min-width: 0;
	width: 100%;
}

.exam-take__nav-section-title--current {
	color: var(--text-900);
}

.exam-take__nav-section-name {
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.exam-take__nav-section-badge {
	flex-shrink: 0;
	font-size: 0.58rem;
	font-weight: 700;
	font-feature-settings: "tnum";
	font-variant-numeric: tabular-nums;
	padding: 0.1rem 0.4rem;
	border-radius: 999px;
	background: rgba(10, 102, 194, 0.06);
	color: var(--text-400);
	transition: all 0.25s;
}

.exam-take__nav-section-badge--done {
	background: rgba(34, 197, 94, 0.14);
	color: var(--success-500);
}

/* ── Question grid ─────────────────────────────────────────────── */
.exam-take__nav-section-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(32px, 1fr));
	grid-gap: 3px;
	gap: 3px;
	min-width: 0;
	width: 100%;
	overflow: hidden;
}

.exam-take__nav-btn {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-width: 0;
	min-height: 30px;
	padding: 3px 2px;
	border: 1px solid var(--border);
	border-radius: 8px;
	background: var(--surface);
	font-size: 0.64rem;
	font-weight: 600;
	color: var(--text-500);
	cursor: pointer;
	transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
	line-height: 1.1;
	text-align: center;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.exam-take__nav-btn:hover {
	background: rgba(10, 102, 194, 0.05);
	border-color: var(--nav-accent, var(--primary-400));
	transform: translateY(-1px);
	box-shadow: 0 2px 6px rgba(10, 102, 194, 0.10);
}

.exam-take__nav-btn--current {
	background: var(--nav-accent, var(--primary-500));
	color: #fff;
	border-color: var(--nav-accent, var(--primary-500));
	box-shadow: 0 2px 8px color-mix(in srgb, var(--nav-accent, var(--primary-500)) 40%, transparent);
	font-weight: 700;
}

.exam-take__nav-btn--current:hover {
	transform: translateY(-1px);
	box-shadow: 0 4px 12px color-mix(in srgb, var(--nav-accent, var(--primary-500)) 50%, transparent);
}

.exam-take__nav-btn--answered {
	background: rgba(34, 197, 94, 0.08);
	color: var(--success-500);
	border-color: rgba(34, 197, 94, 0.25);
}

/* Immediate mode: graded nav button variants */
.exam-take__nav-btn--correct {
	background: rgba(34, 197, 94, 0.12);
	color: #16a34a;
	border-color: rgba(34, 197, 94, 0.35);
	font-weight: 600;
}
.exam-take__nav-btn--incorrect {
	background: rgba(239, 68, 68, 0.10);
	color: #dc2626;
	border-color: rgba(239, 68, 68, 0.30);
	font-weight: 600;
}
.exam-take__nav-btn--partial {
	background: rgba(245, 158, 11, 0.10);
	color: #d97706;
	border-color: rgba(245, 158, 11, 0.30);
	font-weight: 600;
}

/* Small green check dot on answered buttons */
.exam-take__nav-btn-check {
	position: absolute;
	top: 2px;
	right: 2px;
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--success-500);
	box-shadow: 0 0 0 1.5px var(--surface);
}

.exam-take__content {
	min-width: 0;
}

.exam-take__section-header {
	margin-bottom: 1rem;
	padding: 1rem;
	background: rgba(10, 102, 194, 0.04);
	border-radius: var(--radius-md);
	border-left: 4px solid var(--primary-500);
}

.exam-take__section-header-top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem;
	cursor: pointer;
	-webkit-user-select: none;
	        user-select: none;
}

.exam-take__section-header h3 {
	font-size: 1.05rem;
	font-weight: 700;
	color: var(--text-900);
	margin: 0;
}

.exam-take__section-toggle {
	background: none;
	border: none;
	font-size: 0.75rem;
	color: var(--text-400);
	cursor: pointer;
	padding: 0.25rem;
	border-radius: var(--radius-sm);
	transition: color 0.15s;
	line-height: 1;
}

.exam-take__section-toggle:hover {
	color: var(--primary-500);
}

.exam-take__section-instructions {
	font-size: 0.88rem;
	color: var(--text-500);
	margin-top: 0.35rem;
}

/* ── Reading Passage (always-visible panel for comprehension text) ── */

.exam-take__reading-passage {
	margin-bottom: 1.25rem;
	border-radius: var(--radius-md);
	background: var(--surface);
	border: 1.5px solid rgba(10, 102, 194, 0.12);
	box-shadow: var(--shadow-sm);
	overflow: hidden;
	transition: box-shadow 0.2s;
}

.exam-take__reading-passage:hover {
	box-shadow: var(--shadow-md);
}

.exam-take__reading-passage-bar {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.75rem 1.15rem;
	background: linear-gradient(135deg, rgba(10, 102, 194, 0.06), rgba(59, 155, 217, 0.04));
	border-bottom: 1px solid rgba(10, 102, 194, 0.08);
	cursor: pointer;
	-webkit-user-select: none;
	        user-select: none;
	transition: background 0.15s;
}

.exam-take__reading-passage-bar:hover {
	background: linear-gradient(135deg, rgba(10, 102, 194, 0.09), rgba(59, 155, 217, 0.06));
}

.exam-take__reading-passage-icon {
	font-size: 1.15rem;
	flex-shrink: 0;
}

.exam-take__reading-passage-label {
	font-size: 0.88rem;
	font-weight: 700;
	color: var(--primary-600);
	flex: 1;
}

.exam-take__reading-passage-toggle {
	background: none;
	border: none;
	font-size: 0.78rem;
	font-weight: 600;
	color: var(--text-400);
	cursor: pointer;
	padding: 0.2rem 0.5rem;
	border-radius: 999px;
	transition: color 0.15s, background 0.15s;
}

.exam-take__reading-passage-toggle:hover {
	color: var(--primary-500);
	background: rgba(10, 102, 194, 0.06);
}

.exam-take__reading-passage-body {
	padding: 1.25rem 1.5rem 1.5rem;
}

.exam-take__reading-passage-body .instruction-renderer {
	max-height: none;
	overflow: visible;
	background: none;
	border: none;
	padding: 0;
	font-size: 0.95rem;
	line-height: 1.8;
	color: var(--text-700);
}

/* Collapsed state: hide body */
.exam-take__reading-passage--collapsed .exam-take__reading-passage-bar {
	border-bottom: none;
}

@media (max-width: 767px) {
	.exam-take__reading-passage-body {
		padding: 1rem 1.1rem 1.15rem;
	}

	.exam-take__reading-passage-body .instruction-renderer {
		font-size: 0.9rem;
		line-height: 1.75;
	}
}

/* ── Sub-exercise directive header ── */

.exam-take__subex-header {
	display: flex;
	align-items: baseline;
	gap: 0.5rem;
	margin-bottom: 0.75rem;
	padding: 0.65rem 0.85rem;
	background: rgba(139, 92, 246, 0.05);
	border-bottom: 1px solid rgba(139, 92, 246, 0.15);
}

.exam-take__subex-label {
	font-size: 0.9rem;
	font-weight: 800;
	color: #7c3aed;
	flex-shrink: 0;
}

.exam-take__subex-directive {
	font-size: 0.88rem;
	line-height: 1.5;
	color: var(--text-600);
	font-style: italic;
}

/* ── Word pool callout ── */

.exam-take__word-pool {
	margin-bottom: 0.75rem;
	padding: 0.55rem 0.85rem;
	background: rgba(245, 158, 11, 0.06);
	border: 1px dashed rgba(245, 158, 11, 0.3);
	border-radius: var(--radius-sm);
	font-size: 0.88rem;
	line-height: 1.5;
}

.exam-take__word-pool--compact {
	padding: 0.4rem 0.75rem;
	margin-bottom: 0.5rem;
}

.exam-take__word-pool-label {
	font-weight: 700;
	color: #b45309;
	margin-right: 0.25rem;
}

.exam-take__word-pool-words {
	color: var(--text-700);
	font-style: italic;
}

/* ── Instruction Renderer (reading passages, long instructions) ── */

.instruction-renderer {
	margin-top: 0.5rem;
	padding: 1rem 1.25rem;
	background: rgba(10, 102, 194, 0.03);
	border: 1px solid rgba(10, 102, 194, 0.08);
	border-radius: var(--radius-md);
	font-size: 0.92rem;
	line-height: 1.75;
	color: var(--text-700);
	max-height: 340px;
	overflow-y: auto;
	scrollbar-width: thin;
}

.instruction-renderer__p {
	margin: 0 0 0.75em;
}

.instruction-renderer__p:last-child {
	margin-bottom: 0;
}

.instruction-renderer__heading {
	display: block;
	font-size: 0.95rem;
	font-weight: 700;
	color: var(--text-900);
	margin-bottom: 0.35em;
}

.instruction-renderer__ul,
.instruction-renderer__ol {
	padding-left: 1.4em;
	margin: 0.5em 0;
}

.instruction-renderer__ul li,
.instruction-renderer__ol li {
	margin-bottom: 0.3em;
}

/* Source / attribution line at end of passages */
.instruction-renderer__p:last-child:has(em),
.instruction-renderer p:last-child em {
	font-size: 0.82rem;
	color: var(--text-400);
}

/* Scrollbar styling */
.instruction-renderer::-webkit-scrollbar {
	width: 5px;
}

.instruction-renderer::-webkit-scrollbar-thumb {
	background: rgba(10, 102, 194, 0.15);
	border-radius: 999px;
}

@media (max-width: 767px) {
	.instruction-renderer {
		max-height: 240px;
		padding: 0.85rem 1rem;
		font-size: 0.88rem;
	}
}

.exam-take__question-card {
	display: flex;
	flex-direction: column;
	gap: 1rem;
	animation: fadeInUp 0.2s ease;
}

/* Stacked cards in grouped questions get spacing between them */
.exam-take__question-card + .exam-take__question-card {
	margin-top: 0.75rem;
}

@keyframes fadeInUp {
	from {
		opacity: 0;
		transform: translateY(8px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.exam-take__question-card:hover {
	transform: none;
}

/* Locked card (immediate mode — already graded) */
.exam-take__question-card--locked {
	opacity: 0.85;
	pointer-events: none; /* read-only, except feedback area */
}
.exam-take__question-card--locked .exam-take__feedback,
.exam-take__question-card--locked .exam-take__feedback-explain-btn {
	pointer-events: auto;
	opacity: 1;
}

/* ── Action row: hints + check on same line ── */
.exam-take__action-row {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	padding-top: 0.35rem;
	flex-wrap: wrap;
}

.exam-take__check-answer {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	margin-left: auto;
}

.exam-take__check-btn {
	display: inline-flex;
	align-items: center;
	gap: 0.3rem;
	padding: 0.3rem 0.75rem;
	border: 1.5px solid var(--primary-500);
	border-radius: 999px;
	background: none;
	color: var(--primary-600);
	font-size: 0.8rem;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.15s;
	white-space: nowrap;
}
.exam-take__check-btn:hover:not(:disabled) {
	background: var(--primary-500);
	color: #fff;
}
.exam-take__check-btn:disabled {
	opacity: 0.35;
	cursor: not-allowed;
}

.exam-take__check-hint {
	font-size: 0.75rem;
	color: var(--text-400, #94a3b8);
	font-style: italic;
}
.loading-spinner--inline {
	display: inline-block;
	width: 14px;
	height: 14px;
	border: 2px solid rgba(255,255,255,0.3);
	border-top-color: #fff;
	border-radius: 50%;
	animation: spin 0.6s linear infinite;
	vertical-align: middle;
	margin-right: 4px;
}

/* ── Inline feedback card (immediate mode) ── */
.exam-take__feedback {
	border-radius: 10px;
	padding: 0.85rem 1rem;
	margin-top: 0.25rem;
	animation: fadeInUp 0.25s ease;
}
.exam-take__feedback--correct {
	background: rgba(34, 197, 94, 0.08);
	border: 1px solid rgba(34, 197, 94, 0.25);
}
.exam-take__feedback--partial {
	background: rgba(245, 158, 11, 0.08);
	border: 1px solid rgba(245, 158, 11, 0.25);
}
.exam-take__feedback--incorrect {
	background: rgba(239, 68, 68, 0.07);
	border: 1px solid rgba(239, 68, 68, 0.20);
}
.exam-take__feedback--manual {
	background: rgba(99, 102, 241, 0.06);
	border: 1px solid rgba(99, 102, 241, 0.18);
}
.exam-take__feedback--unanswered {
	background: rgba(100, 116, 139, 0.06);
	border: 1px solid rgba(100, 116, 139, 0.15);
}

.exam-take__feedback-banner {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	font-weight: 700;
	font-size: 0.95rem;
	margin-bottom: 0.5rem;
}
.exam-take__feedback-icon {
	font-size: 1.15rem;
}
.exam-take__feedback-score {
	margin-left: auto;
	font-size: 0.82rem;
	font-weight: 600;
	opacity: 0.75;
}
.exam-take__feedback--correct .exam-take__feedback-banner { color: #16a34a; }
.exam-take__feedback--partial .exam-take__feedback-banner { color: #d97706; }
.exam-take__feedback--incorrect .exam-take__feedback-banner { color: #dc2626; }
.exam-take__feedback--manual .exam-take__feedback-banner { color: #6366f1; }

/* Essay AI feedback */
.exam-take__feedback-essay {
	background: rgba(99, 102, 241, 0.05);
	border-radius: 8px;
	padding: 0.65rem 0.85rem;
	margin-bottom: 0.5rem;
}
.exam-take__feedback-essay-score {
	font-size: 0.88rem;
	margin-bottom: 0.35rem;
}
.exam-take__feedback-essay-score strong {
	color: var(--primary-600, #4f46e5);
}
.exam-take__feedback-essay-text {
	font-size: 0.84rem;
	color: var(--text-700, #334155);
	line-height: 1.55;
	margin: 0;
}

/* Correct answer reveal */
.exam-take__feedback-correct {
	font-size: 0.88rem;
	padding: 0.45rem 0;
	color: var(--text-700, #334155);
}
.exam-take__feedback-correct-label {
	color: var(--text-400, #94a3b8);
	font-size: 0.8rem;
}

/* Scaffold blank results */
.exam-take__feedback-blanks {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
	font-size: 0.84rem;
	margin: 0.35rem 0;
}
.exam-take__feedback-blank {
	display: flex;
	align-items: center;
	gap: 0.35rem;
	padding: 0.2rem 0;
}
.exam-take__feedback-blank--ok { color: #16a34a; }
.exam-take__feedback-blank--wrong { color: #dc2626; }
.exam-take__feedback-blank-user {
	text-decoration: line-through;
	opacity: 0.6;
}

/* Explanation toggle */
.exam-take__feedback-explain {
	margin-top: 0.35rem;
	border-top: 1px solid rgba(0,0,0,0.06);
	padding-top: 0.45rem;
}
.exam-take__feedback-explain-btn {
	font-size: 0.82rem;
	color: var(--primary-600, #4f46e5);
	background: none;
	border: none;
	cursor: pointer;
	padding: 0.25rem 0;
	font-weight: 600;
}
.exam-take__feedback-explain-btn:hover {
	text-decoration: underline;
}
.exam-take__feedback-explain-body {
	margin-top: 0.5rem;
	font-size: 0.85rem;
	color: var(--text-700, #334155);
	line-height: 1.6;
}
.exam-take__feedback-explain-model {
	margin-top: 0.65rem;
	padding: 0.6rem 0.85rem;
	background: rgba(0,0,0,0.025);
	border-radius: 8px;
}

/* Essay word count */
.exam-take__essay-wrap {
	position: relative;
}
.exam-take__essay-wordcount {
	position: absolute;
	bottom: 8px;
	right: 12px;
	font-size: 0.72rem;
	color: var(--text-300, #a1a1aa);
	pointer-events: none;
	font-feature-settings: "tnum";
	font-variant-numeric: tabular-nums;
}

/* Short-answer (long-text with LLM grading) */
.exam-take__short-answer-wrap {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}
.exam-take__short-answer-guide {
	background: var(--surface-100, #f4f4f5);
	border: 1px solid var(--border-200, #e4e4e7);
	border-radius: 8px;
	padding: 0.65rem 0.85rem;
	font-size: 0.82rem;
}
.exam-take__short-answer-guide-title {
	font-weight: 700;
	color: var(--text-600, #52525b);
	display: block;
	margin-bottom: 0.25rem;
}
.exam-take__short-answer-guide-list {
	margin: 0;
	padding-left: 1.2rem;
	color: var(--text-500, #71717a);
	display: flex;
	flex-direction: column;
	gap: 0.15rem;
}
.exam-take__short-answer-guide-list li {
	line-height: 1.45;
}
.exam-take__short-answer-input {
	width: 100%;
	min-height: 120px;
	padding: 0.75rem 1rem;
	border: 1.5px solid var(--border-200, #e4e4e7);
	border-radius: 10px;
	font-size: 0.92rem;
	line-height: 1.6;
	resize: vertical;
	transition: border-color 0.15s;
	font-family: inherit;
	background: var(--surface-50, #fafafa);
}
.exam-take__short-answer-input:focus {
	outline: none;
	border-color: var(--primary, #6366f1);
	box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}
.exam-take__short-answer-input:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}
.exam-take__short-answer-wordcount {
	position: absolute;
	bottom: 8px;
	right: 12px;
	font-size: 0.72rem;
	color: var(--text-300, #a1a1aa);
	pointer-events: none;
	font-feature-settings: "tnum";
	font-variant-numeric: tabular-nums;
}

/* Disabled MCQ options */
.exam-take__mcq-options--disabled {
	pointer-events: none;
	opacity: 0.7;
}

.exam-take__question-header {
	display: flex;
	align-items: center;
	gap: 0.65rem;
	flex-wrap: wrap;
}

.exam-take__question-number {
	display: inline-flex;
	align-items: baseline;
	gap: 0.15rem;
	font-size: 0.82rem;
	color: var(--text-500);
}

.exam-take__question-num-label {
	font-weight: 800;
	font-size: 0.88rem;
	color: var(--text-700);
}

.exam-take__question-num-total {
	font-weight: 500;
	font-size: 0.78rem;
	color: var(--text-400);
}

.exam-take__question-type {
	display: inline-flex;
	align-items: center;
	gap: 0.25rem;
	padding: 0.2rem 0.55rem;
	border-radius: 999px;
	font-size: 0.75rem;
	font-weight: 600;
}

.exam-take__question-points {
	font-size: 0.78rem;
	font-weight: 600;
	color: var(--text-500);
	margin-left: auto;
}

/* Temporal context note */
.exam-take__temporal-note {
	display: flex;
	align-items: flex-start;
	gap: 0.5rem;
	padding: 0.6rem 0.85rem;
	margin: 0.5rem 0;
	border-radius: 8px;
	background: linear-gradient(135deg, rgba(245, 158, 11, 0.08), rgba(245, 158, 11, 0.03));
	border: 1px solid rgba(245, 158, 11, 0.2);
	font-size: 0.82rem;
	line-height: 1.5;
	color: var(--text-700);
}

.exam-take__temporal-note-icon {
	flex-shrink: 0;
	font-size: 1rem;
	margin-top: 0.05rem;
}

.exam-take__temporal-note-text {
	flex: 1;
	min-width: 0;
}

.exam-take__question-text {
	font-size: 1rem;
	line-height: 1.65;
	color: var(--text-900);
}

/* Question text uses InstructionRenderer — override its container styles when inside a question */
.exam-take__question-text .instruction-renderer {
	margin-top: 0;
	padding: 0;
	background: none;
	border: none;
	border-radius: 0;
	max-height: none;
	overflow: visible;
	font-size: 1rem;
	line-height: 1.65;
	color: var(--text-900);
}

.exam-take__question-text .instruction-renderer__p {
	margin: 0 0 0.5em;
}

.exam-take__question-text .instruction-renderer__p:last-child {
	margin-bottom: 0;
}

/* KaTeX math integration */
.exam-take__question-text .katex-display {
	margin: 0.75em 0;
	overflow-x: auto;
	overflow-y: hidden;
	padding: 0.25em 0;
}

.exam-take__question-text .katex {
	font-size: 1.05em;
}

.exam-take__mcq-text .katex {
	font-size: 1em;
}

.exam-take__fill-blank-text .katex {
	font-size: 1em;
}

.exam-take__subex-directive .katex {
	font-size: 1em;
}

.exam-take__answer-area {
	margin-top: 0.5rem;
}

/* ══════════════════════════════════════════════════════════════════════════
   TIGHTER SPACING FOR EXAM VIEWS
   ══════════════════════════════════════════════════════════════════════════ */

/* Reduce card padding inside exam questions */
.exam-take__question-card.card {
	padding: clamp(0.9rem, 2vw, 1.2rem);
}

/* Tighter internal gaps */
.exam-take__question-card {
	gap: 0.6rem;
}

/* Reduce section header margin */
.exam-take__section-header {
	margin-bottom: 0.6rem;
	padding: 0.75rem;
}

/* Reduce reading passage margin */
.exam-take__reading-passage {
	margin-bottom: 0.75rem;
}

/* Tighter question navigation */
.exam-take__question-nav {
	margin-top: 1rem;
}

/* Reduce answer area spacing */
.exam-take__answer-area {
	margin-top: 0.35rem;
}

/* Strip instruction renderer boxiness inside section headers */
.exam-take__section-header .instruction-renderer {
	margin-top: 0;
	padding: 0.5rem 0 0;
	background: none;
	border: none;
	max-height: none;
	overflow: visible;
	font-size: 0.88rem;
}

@media (max-width: 767px) {
	.exam-take__question-card.card {
		padding: 0.85rem;
	}
	.exam-take__question-card {
		gap: 0.5rem;
	}
	.exam-take__section-header {
		margin-bottom: 0.5rem;
		padding: 0.65rem;
	}
}

/* ══════════════════════════════════════════════════════════════════════════
   PREVIEW MODE STYLES
   ══════════════════════════════════════════════════════════════════════════ */

.exam-take--preview .exam-take__topbar {
	position: -webkit-sticky;
	position: sticky;
	top: var(--navbar-height);
	z-index: 99;
	background: var(--surface);
	border-bottom: 1px solid var(--border);
	padding: 0.65rem 1.25rem;
	margin: -1.5rem -1.5rem 1.5rem;
}

/* Preview topbar — mobile-first single-row layout */
.exam-take__topbar--preview {
	display: flex;
	align-items: center;
	gap: 0.65rem;
}

.exam-take__back-btn {
	display: inline-flex;
	align-items: center;
	padding: 0.3rem 0.6rem;
	border: none;
	background: none;
	color: var(--text-600);
	font-size: 0.88rem;
	font-weight: 600;
	cursor: pointer;
	border-radius: var(--radius-sm);
	transition: color 0.15s, background 0.15s;
	flex-shrink: 0;
}
.exam-take__back-btn:hover {
	color: var(--text-900);
	background: rgba(0,0,0,0.05);
}

.exam-take__topbar-center {
	display: flex;
	align-items: baseline;
	gap: 0.4rem;
	min-width: 0;
	flex: 1;
	overflow: hidden;
}

.exam-take__topbar-sep {
	color: var(--text-400);
	flex-shrink: 0;
	font-weight: 700;
}

.exam-take__topbar--preview .exam-take__subject {
	font-size: 0.92rem;
	font-weight: 800;
	text-transform: none;
	letter-spacing: 0;
}

.exam-take__topbar--preview .exam-take__title-short {
	max-width: none;
	font-size: 0.92rem;
	color: var(--text-700);
	font-weight: 500;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.exam-take__timer-badge {
	display: inline-flex;
	align-items: center;
	padding: 0.25rem 0.6rem;
	border-radius: 999px;
	background: rgba(10, 102, 194, 0.1);
	color: var(--primary-600);
	font-size: 0.82rem;
	font-weight: 600;
	font-feature-settings: "tnum";
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
	flex-shrink: 0;
}

.exam-take__preview-scroll {
	max-width: 820px;
	margin: 0 auto;
}

.exam-take__preview-hint {
	font-size: 0.88rem;
	color: var(--text-500);
	margin-bottom: 1.5rem;
	line-height: 1.5;
}
.exam-take__preview-hint strong {
	color: var(--text-700);
}

.exam-take__preview-section {
	margin-bottom: 2rem;
	page-break-inside: avoid;
}

.exam-take__preview-section-header {
	margin-bottom: 1rem;
	padding-bottom: 0.5rem;
	border-bottom: 1px solid var(--border);
}

.exam-take__preview-section-header h2 {
	font-size: 1.15rem;
	font-weight: 700;
	color: var(--text-900);
	margin: 0 0 0.35rem;
	letter-spacing: -0.01em;
}

.exam-take__preview-section-instructions {
	font-size: 0.92rem;
	color: var(--text-600);
	line-height: 1.6;
}

/* Keep the semi-transparent box ONLY for section instructions */
.exam-take__preview-section-instructions .instruction-renderer {
	padding: 0.65rem 0.85rem;
	font-size: 0.88rem;
	max-height: none;
	overflow: visible;
}

/* Strip the box from all other preview instruction-renderer usages */
.exam-take__preview-passage .instruction-renderer,
.exam-take__preview-subex-directive .instruction-renderer,
.exam-take__preview-question-inline-text .instruction-renderer,
.exam-take__preview-word-pool .instruction-renderer {
	margin: 0;
	padding: 0;
	background: none;
	border: none;
	border-radius: 0;
	max-height: none;
	overflow: visible;
	font-size: inherit;
	line-height: inherit;
	color: inherit;
}

.exam-take__preview-passage {
	padding: 0.75rem 1rem 0.75rem 1.25rem;
	margin-bottom: 1rem;
	background: none;
	border: none;
	border-left: 3px solid var(--primary-200, rgba(10, 102, 194, 0.2));
	border-radius: 0;
}

.exam-take__preview-passage-label {
	display: block;
	font-size: 0.78rem;
	font-weight: 600;
	color: var(--text-400);
	margin-bottom: 0.4rem;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.exam-take__preview-question {
	margin-bottom: 0.15rem;
	padding: 0.3rem 0;
	border-bottom: none;
	page-break-inside: avoid;
}

.exam-take__preview-question:last-child {
	margin-bottom: 0;
}

.exam-take__preview-type-group {
	margin-bottom: 2rem;
}

.exam-take__preview-type-header {
	margin-bottom: 1.25rem;
	padding-bottom: 0.5rem;
	border-bottom: 1.5px solid rgba(10, 102, 194, 0.12);
}

.exam-take__preview-type-label {
	display: inline-block;
	font-size: 0.85rem;
	font-weight: 600;
	padding: 0.35rem 0.85rem;
	border-radius: 999px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.exam-take__preview-question-line {
	display: flex;
	align-items: baseline;
	gap: 0.35rem;
	margin-bottom: 0.25rem;
	flex-wrap: wrap;
	font-size: 0.95rem;
	line-height: 1.55;
}

.exam-take__preview-question-number {
	font-size: 1rem;
	font-weight: 700;
	color: var(--primary-600);
	flex-shrink: 0;
	min-width: auto;
}

.exam-take__preview-question-points {
	font-size: 0.85rem;
	color: var(--text-500);
	flex-shrink: 0;
}

.exam-take__preview-question-inline-text {
	color: var(--text-900);
	flex: 1;
	min-width: 0;
}

.exam-take__preview-question-inline-text p {
	margin: 0;
	display: inline;
}

.exam-take__preview-mcq-options {
	display: flex;
	flex-direction: column;
	gap: 0.2rem;
	margin-top: 0.25rem;
	margin-left: 1.8rem;
}

.exam-take__preview-mcq-option {
	display: flex;
	gap: 0.5rem;
	align-items: baseline;
	padding: 0.25rem 0;
	background: none;
	border: none;
	border-radius: 0;
	font-size: 0.9rem;
	line-height: 1.5;
}

.exam-take__preview-mcq-letter {
	font-weight: 700;
	color: var(--primary-600);
	flex-shrink: 0;
	min-width: 1.5rem;
}

.exam-take__preview-cta {
	text-align: center;
	padding: 2rem 1rem;
	margin-top: 1.5rem;
	border-top: 1px solid var(--border);
}

.exam-take__preview-cta button {
	font-size: 1rem;
	padding: 0.75rem 2rem;
	transition: transform 0.15s, box-shadow 0.15s;
}

.exam-take__preview-cta button:hover {
	transform: translateY(-1px);
	box-shadow: var(--shadow-md);
}

.exam-take__preview-cta-hint {
	margin-top: 0.75rem;
	font-size: 0.85rem;
	color: var(--text-400);
}

/* Sub-exercise groups (A., B., C. etc.) */
.exam-take__preview-subex-group {
	margin-bottom: 1rem;
	page-break-inside: avoid;
}

.exam-take__preview-subex-directive {
	padding: 0.25rem 0;
	margin-bottom: 0.5rem;
	background: none;
	border: none;
	font-size: 0.93rem;
	font-style: normal;
	font-weight: 700;
	line-height: 1.5;
	color: var(--text-800);
}

.exam-take__preview-word-pool {
	padding: 0.5rem 0 0.5rem 1rem;
	margin-bottom: 0.75rem;
	background: none;
	border: none;
	border-left: 3px solid rgba(245, 158, 11, 0.35);
	border-radius: 0;
}

.exam-take__preview-word-pool-label {
	display: block;
	font-size: 0.75rem;
	font-weight: 600;
	color: var(--text-400);
	margin-bottom: 0.3rem;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

@media (max-width: 767px) {
	.exam-take__preview-scroll:not(.card) {
		padding: 0 0.25rem;
	}
	
	.exam-take__preview-section-header h2 {
		font-size: 1.05rem;
	}
	
	.exam-take__preview-question {
		padding: 0.4rem 0;
	}

	.exam-take__preview-subex-directive {
		font-size: 0.88rem;
	}

	.exam-take__preview-word-pool {
		padding-left: 0.75rem;
	}

	.exam-take--preview .exam-take__topbar {
		padding: 0.4rem 0.65rem;
		margin: -1rem -1rem 1rem;
	}
}

/* Print styles for preview */
@media print {
	.exam-take--preview .exam-take__topbar,
	.exam-take__preview-hint,
	.exam-take__preview-cta {
		display: none;
	}
	
	.exam-take__preview-section {
		page-break-after: always;
	}
	
	.exam-take__preview-question {
		page-break-inside: avoid;
	}
}

/* ── Question Hints (progressive reveal) ───────────────────────────────── */

.qa-hints {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	flex-wrap: wrap;
}

.qa-hints__item {
	display: inline-flex;
	align-items: baseline;
	gap: 0.35rem;
	padding: 0.3rem 0.65rem;
	background: #fffbe6;
	border-radius: 999px;
	animation: qa-hint-in 0.3s ease both;
	font-size: 0.82rem;
	line-height: 1.4;
	color: #5d4e00;
}

@keyframes qa-hint-in {
	0% {
		opacity: 0;
		transform: translateY(-6px) scale(0.97);
	}
	100% {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}

.qa-hints__text {
	flex: 1;
}

.qa-hints__btn {
	display: inline-flex;
	align-items: center;
	gap: 0.3rem;
	padding: 0.3rem 0.65rem;
	border: 1.5px solid #e8d44d;
	border-radius: 999px;
	background: #fffdf0;
	color: #92750a;
	font-size: 0.8rem;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.15s;
	white-space: nowrap;
	flex-shrink: 0;
}

.qa-hints__btn:hover {
	background: #fef9c3;
	border-color: #d4a72c;
}

.qa-hints__btn:active {
	transform: scale(0.97);
}

.qa-hints__counter {
	font-weight: 500;
	opacity: 0.7;
	font-size: 0.75em;
}

/* Dark mode */
[data-theme="dark"] .qa-hints__item {
	background: #3d340033;
	color: #fef08a;
}

[data-theme="dark"] .qa-hints__btn {
	background: #2a2400;
	border-color: #5c4a00;
	color: #fef08a;
}

[data-theme="dark"] .qa-hints__btn:hover {
	background: #3d3400;
	border-color: #7c6a10;
}

/* ── Khan Academy-style Scaffolded Answer ──────────────────────────────
   Faithful to KA's exercise card: clean white, flat layout, inline
   label + input, bottom bar with dots + Check, banner feedback.
   ─────────────────────────────────────────────────────────────────── */

.ka-scaffold {
	margin-top: 0.35rem;
	border: none;
	border-radius: 0;
	background: transparent;
	overflow: visible;
}
.ka-scaffold--complete {
	border-color: #0d923f;
}

/* ── Feedback banner (top, like KA's "Correct!" / "Incorrect") ───── */
.ka-scaffold__banner {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.4rem 0.75rem;
	font-size: 0.88rem;
	font-weight: 700;
	border-radius: 0.375rem;
	animation: ka-banner-in 0.3s ease-out;
}
.ka-scaffold__banner--correct {
	background: #e4f7e8;
	color: #0d6b2f;
}
.ka-scaffold__banner--incorrect {
	background: #fce4e4;
	color: #c42020;
}
@keyframes ka-banner-in {
	from { opacity: 0; transform: translateY(-100%); }
	to { opacity: 1; transform: translateY(0); }
}

/* ── Field rows — flat KA-style label + input ────────────────────── */
.ka-scaffold__fields {
	padding: 0.25rem 0 0.35rem;
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.ka-scaffold__field {
	position: relative;
}
.ka-scaffold__field--correct .ka-scaffold__input-wrap .math-kb__input-row {
	border-color: #0d923f;
	background: #f6fef8;
}
.ka-scaffold__field--correct .math-kb__input {
	color: #0d6b2f;
}
.ka-scaffold__field--wrong .ka-scaffold__input-wrap .math-kb__input-row {
	border-color: #d92828;
	background: #fef6f6;
}

/* Label — small gray text, inline with "=" when multi-blank */
.ka-scaffold__label {
	display: block;
	font-size: 0.82rem;
	font-weight: 600;
	color: #3b3f44;
	margin-bottom: 0.2rem;
	line-height: 1.3;
}
.ka-scaffold__label .katex {
	font-size: 1em;
}

/* Input wrapper */
.ka-scaffold__input-wrap {
	max-width: 400px;
}

/* Plain text input (non-math subjects) */
.ka-scaffold__text-input {
	width: 100%;
	padding: 0.35rem 0.55rem;
	font-size: 0.9rem;
	font-family: inherit;
	border: 1.5px solid #d1d5db;
	border-radius: 0.375rem;
	background: #fff;
	color: #1e293b;
	outline: none;
	transition: border-color 0.15s, box-shadow 0.15s;
}
.ka-scaffold__text-input:focus {
	border-color: #6366f1;
	box-shadow: 0 0 0 3px rgba(99,102,241,0.13);
}
.ka-scaffold__text-input:disabled {
	background: #f3f4f6;
	color: #9ca3af;
}
.ka-scaffold__field--correct .ka-scaffold__text-input {
	border-color: #0d923f;
	background: #f6fef8;
	color: #0d6b2f;
}
.ka-scaffold__field--wrong .ka-scaffold__text-input {
	border-color: #d92828;
	background: #fef6f6;
}

/* Correction hint (shown below input on wrong answer) */
.ka-scaffold__correction {
	margin-top: 0.3rem;
	font-size: 0.82rem;
	font-weight: 600;
	color: #0d923f;
}

/* AI grading feedback */
.ka-scaffold__ai-loading {
	margin-top: 0.3rem;
	font-size: 0.82rem;
	color: #6366f1;
	display: flex;
	align-items: center;
	gap: 0.4rem;
}
.ka-scaffold__spinner {
	display: inline-block;
	width: 14px;
	height: 14px;
	border: 2px solid #c7d2fe;
	border-top-color: #6366f1;
	border-radius: 50%;
	animation: ka-spin 0.6s linear infinite;
}
@keyframes ka-spin { to { transform: rotate(360deg); } }

.ka-scaffold__ai-feedback {
	margin-top: 0.3rem;
	font-size: 0.82rem;
	padding: 0.3rem 0.5rem;
	border-radius: 0.35rem;
	line-height: 1.4;
}
.ka-scaffold__ai-feedback--correct {
	color: #0d6b2f;
	background: #f0fdf4;
}
.ka-scaffold__ai-feedback--wrong {
	color: #92400e;
	background: #fffbeb;
}

.ka-scaffold__field--pending .ka-scaffold__text-input,
.ka-scaffold__field--pending .math-kb__input-row {
	border-color: #a5b4fc;
	background: #eef2ff;
}

/* ── Hint area — KA-style "Related content" / hint toggle ────────── */
.ka-scaffold__hint-area {
	padding: 0 0 0.35rem;
}
.ka-scaffold__hint-btn {
	display: inline-flex;
	align-items: center;
	gap: 0.3rem;
	padding: 0;
	border: none;
	background: none;
	color: #1865f2;
	font-size: 0.82rem;
	font-weight: 600;
	cursor: pointer;
	transition: color 0.15s;
}
.ka-scaffold__hint-btn:hover {
	color: #1240ab;
	text-decoration: underline;
}
.ka-scaffold__hint-body {
	margin-top: 0.5rem;
	padding: 0.85rem 1rem;
	font-size: 0.85rem;
	line-height: 1.7;
	color: #4b5563;
	background: #f7f8fa;
	border: 1px solid #e2e4e8;
	border-radius: 6px;
	max-height: 20rem;
	overflow-y: auto;
}

/* ── Bottom bar: dots + Check (KA layout) ────────────────────────── */
.ka-scaffold__bottom {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0.4rem 0;
	border-top: none;
	background: transparent;
}

/* Progress dots */
.ka-scaffold__dots {
	display: flex;
	align-items: center;
	gap: 0.4rem;
}
.ka-scaffold__dot {
	width: 10px;
	height: 10px;
	border-radius: 50%;
	border: 2px solid #babec3;
	background: #fff;
	padding: 0;
	cursor: pointer;
	transition: all 0.2s;
}
.ka-scaffold__dot:hover {
	border-color: #1865f2;
	transform: scale(1.15);
}
.ka-scaffold__dot--filled {
	background: #a8c7fa;
	border-color: #1865f2;
}
.ka-scaffold__dot--active {
	border-color: #1865f2;
	box-shadow: 0 0 0 3px rgba(24, 101, 242, 0.18);
	transform: scale(1.2);
}
.ka-scaffold__dot--correct {
	background: #0d923f;
	border-color: #0d923f;
}
.ka-scaffold__dot--wrong {
	background: #d92828;
	border-color: #d92828;
}

/* Check button — KA blue pill */
.ka-scaffold__check {
	padding: 0.5rem 1.6rem;
	border: none;
	border-radius: 999px;
	background: #1865f2;
	color: #fff;
	font-size: 0.88rem;
	font-weight: 700;
	cursor: pointer;
	transition: background 0.15s;
	white-space: nowrap;
}
.ka-scaffold__check:hover:not(:disabled) {
	background: #1240ab;
}
.ka-scaffold__check:disabled {
	opacity: 0.4;
	cursor: not-allowed;
}
.ka-scaffold__check--done {
	background: #0d923f;
}
.ka-scaffold__check--done:hover {
	background: #0d923f;
	cursor: default;
}

/* ── Dark mode ────────────────────────────────────────────────────── */
[data-theme="dark"] .ka-scaffold {
	background: #21242c;
	border-color: #3a3e47;
}
[data-theme="dark"] .ka-scaffold--complete {
	border-color: #1fa34e;
}
[data-theme="dark"] .ka-scaffold__banner--correct {
	background: #0b2e1a;
	color: #6dd898;
}
[data-theme="dark"] .ka-scaffold__banner--incorrect {
	background: #2e0b0b;
	color: #f59090;
}
[data-theme="dark"] .ka-scaffold__label {
	color: #c9cdd4;
}
[data-theme="dark"] .ka-scaffold__correction {
	color: #6dd898;
}
[data-theme="dark"] .ka-scaffold__hint-btn {
	color: #5c9cf5;
}
[data-theme="dark"] .ka-scaffold__hint-btn:hover {
	color: #8ab8ff;
}
[data-theme="dark"] .ka-scaffold__hint-body {
	background: #181a20;
	color: #bfc4cc;
	border-color: #3a3e47;
}
[data-theme="dark"] .ka-scaffold__bottom {
	background: #181a20;
	border-top-color: #3a3e47;
}
[data-theme="dark"] .ka-scaffold__dot {
	border-color: #4b5060;
	background: #21242c;
}
[data-theme="dark"] .ka-scaffold__check {
	background: #4285f4;
}
[data-theme="dark"] .ka-scaffold__check:hover:not(:disabled) {
	background: #5c9cf5;
}
[data-theme="dark"] .ka-scaffold__field--correct .ka-scaffold__input-wrap .math-kb__input-row {
	border-color: #1fa34e;
	background: #0b2e1a;
}
[data-theme="dark"] .ka-scaffold__field--wrong .ka-scaffold__input-wrap .math-kb__input-row {
	border-color: #e54545;
	background: #2e0b0b;
}
[data-theme="dark"] .ka-scaffold__text-input {
	background: #21242c;
	border-color: #4b5060;
	color: #e2e8f0;
}
[data-theme="dark"] .ka-scaffold__text-input:focus {
	border-color: #818cf8;
	box-shadow: 0 0 0 3px rgba(129,140,248,0.18);
}
[data-theme="dark"] .ka-scaffold__text-input:disabled {
	background: #181a20;
	color: #6b7280;
}
[data-theme="dark"] .ka-scaffold__field--correct .ka-scaffold__text-input {
	border-color: #1fa34e;
	background: #0b2e1a;
	color: #6ee7a0;
}
[data-theme="dark"] .ka-scaffold__field--wrong .ka-scaffold__text-input {
	border-color: #e54545;
	background: #2e0b0b;
}
[data-theme="dark"] .ka-scaffold__ai-loading {
	color: #a5b4fc;
}
[data-theme="dark"] .ka-scaffold__spinner {
	border-color: #3730a3;
	border-top-color: #a5b4fc;
}
[data-theme="dark"] .ka-scaffold__ai-feedback--correct {
	color: #6ee7a0;
	background: #0b2e1a;
}
[data-theme="dark"] .ka-scaffold__ai-feedback--wrong {
	color: #fcd34d;
	background: #2e1f0b;
}
[data-theme="dark"] .ka-scaffold__field--pending .ka-scaffold__text-input,
[data-theme="dark"] .ka-scaffold__field--pending .math-kb__input-row {
	border-color: #6366f1;
	background: #1e1b4b;
}

/* ── Responsive ───────────────────────────────────────────────────── */
@media (max-width: 640px) {
	.ka-scaffold__fields {
		padding: 1rem 1rem 0.5rem;
	}
	.ka-scaffold__input-wrap {
		max-width: none;
	}
	.ka-scaffold__bottom {
		padding: 0.5rem 1rem;
	}
	.ka-scaffold__check {
		padding: 0.45rem 1.2rem;
		font-size: 0.82rem;
	}
	.ka-scaffold__hint-area {
		padding: 0 1rem 0.5rem;
	}
}

/* ── MathKeyboard — math symbol toolbar + input + KaTeX preview ────────── */

.math-kb {
	flex: 1;
	min-width: 0;
	position: relative;
}

/* Input row: text field + toolbar toggle button */
.math-kb__input-row {
	display: flex;
	align-items: center;
	gap: 0;
	border: 1.5px solid #d1d5db;
	border-radius: 0.375rem;
	background: #fff;
	transition: all 0.15s;
	overflow: hidden;
}
.math-kb--focused .math-kb__input-row {
	border-color: #1865f2;
	box-shadow: 0 0 0 3px rgba(24, 101, 242, 0.12);
}
.ka-scaffold__field--correct .math-kb__input-row {
	border-color: #0d923f;
	background: #f6fef8;
}
.ka-scaffold__field--wrong .math-kb__input-row {
	border-color: #d92828;
	background: #fef6f6;
}

.math-kb__input {
	flex: 1;
	padding: 0.45rem 0.65rem;
	border: none;
	background: transparent;
	font-size: 0.9rem;
	font-family: 'KaTeX_Main', 'Times New Roman', serif;
	color: #1f2937;
	outline: none;
	min-width: 0;
}
.math-kb__input::placeholder {
	color: #9ca3af;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	font-style: normal;
	font-size: 0.85rem;
}
.ka-scaffold__field--correct .math-kb__input {
	color: #0d6b2f;
}

/* Toggle button for symbol toolbar */
.math-kb__toggle {
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 2.2rem;
	height: 100%;
	min-height: 2.2rem;
	border: none;
	border-left: 1px solid #e5e7eb;
	background: #f9fafb;
	color: #6b7280;
	cursor: pointer;
	transition: all 0.15s;
}
.math-kb__toggle:hover {
	background: #eef2ff;
	color: #4338ca;
}
.math-kb__toggle--active {
	background: #eef2ff;
	color: #4338ca;
}

/* Live KaTeX preview */
.math-kb__preview {
	padding: 0.3rem 0.65rem;
	font-size: 0.88rem;
	color: #4b5563;
	background: #fafbff;
	border-top: 1px dashed #e5e7eb;
	border-radius: 0 0 0.375rem 0.375rem;
	overflow-x: auto;
}
.math-kb__preview .katex {
	font-size: 1em;
}

/* Toolbar panel — symbol palette */
.math-kb__toolbar {
	position: absolute;
	left: 0;
	right: 0;
	top: 100%;
	z-index: 20;
	margin-top: 0.25rem;
	background: #fff;
	border: 1px solid #d1d5db;
	border-radius: 0.5rem;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1), 0 1px 4px rgba(0, 0, 0, 0.06);
	overflow: hidden;
	animation: math-kb-slide 0.15s ease-out;
}

@keyframes math-kb-slide {
	from { opacity: 0; transform: translateY(-4px); }
	to { opacity: 1; transform: translateY(0); }
}

/* Group tabs */
.math-kb__tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 0;
	padding: 0.25rem 0.35rem;
	background: #f9fafb;
	border-bottom: 1px solid #e5e7eb;
}
.math-kb__tab {
	padding: 0.25rem 0.5rem;
	border: none;
	border-radius: 0.25rem;
	background: transparent;
	color: #6b7280;
	font-size: 0.72rem;
	font-weight: 500;
	cursor: pointer;
	white-space: nowrap;
	transition: all 0.1s;
}
.math-kb__tab:hover {
	background: #eef2ff;
	color: #4338ca;
}
.math-kb__tab--active {
	background: #4f46e5;
	color: #fff;
}
.math-kb__tab--active:hover {
	background: #4338ca;
	color: #fff;
}

/* Symbol buttons grid */
.math-kb__symbols {
	display: flex;
	flex-wrap: wrap;
	gap: 0.25rem;
	padding: 0.4rem;
}
.math-kb__sym-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: 2.2rem;
	height: 2.2rem;
	padding: 0 0.35rem;
	border: 1px solid #e5e7eb;
	border-radius: 0.3rem;
	background: #fff;
	color: #1f2937;
	font-size: 0.92rem;
	font-family: 'KaTeX_Main', 'Times New Roman', serif;
	cursor: pointer;
	transition: all 0.1s;
	-webkit-user-select: none;
	        user-select: none;
}
.math-kb__sym-btn:hover {
	background: #eef2ff;
	border-color: #818cf8;
	color: #4338ca;
	transform: scale(1.08);
}
.math-kb__sym-btn:active {
	transform: scale(0.95);
	background: #c7d2fe;
}

/* ── MathKeyboard Dark Mode ────────────────────────────────────────────── */
[data-theme="dark"] .math-kb__input-row {
	background: #111827;
	border-color: #4b5563;
}
[data-theme="dark"] .math-kb--focused .math-kb__input-row {
	border-color: #818cf8;
	box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.15);
}
[data-theme="dark"] .math-kb__input {
	color: #f3f4f6;
}
[data-theme="dark"] .math-kb__input::placeholder {
	color: #6b7280;
}
[data-theme="dark"] .math-kb__toggle {
	background: #1a1a2e;
	border-left-color: #374151;
	color: #9ca3af;
}
[data-theme="dark"] .math-kb__toggle:hover,
[data-theme="dark"] .math-kb__toggle--active {
	background: #1e1b4b;
	color: #a5b4fc;
}
[data-theme="dark"] .math-kb__preview {
	background: #16162a;
	color: #d1d5db;
	border-top-color: #374151;
}
[data-theme="dark"] .math-kb__toolbar {
	background: #1e1e2e;
	border-color: #374151;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}
[data-theme="dark"] .math-kb__tabs {
	background: #1a1a2e;
	border-bottom-color: #374151;
}
[data-theme="dark"] .math-kb__tab {
	color: #9ca3af;
}
[data-theme="dark"] .math-kb__tab:hover {
	background: #252540;
	color: #c7d2fe;
}
[data-theme="dark"] .math-kb__tab--active {
	background: #6366f1;
	color: #fff;
}
[data-theme="dark"] .math-kb__sym-btn {
	background: #252540;
	border-color: #374151;
	color: #e5e7eb;
}
[data-theme="dark"] .math-kb__sym-btn:hover {
	background: #312e81;
	border-color: #6366f1;
	color: #c7d2fe;
}

/* ── MathKeyboard Responsive ───────────────────────────────────────────── */
@media (max-width: 640px) {
	.math-kb__toolbar {
		position: fixed;
		left: 0.5rem;
		right: 0.5rem;
		top: auto;
		bottom: 0.5rem;
		margin-top: 0;
		max-height: 40vh;
		overflow-y: auto;
	}
	.math-kb__sym-btn {
		min-width: 2.5rem;
		height: 2.5rem;
		font-size: 1rem;
	}
	.math-kb__tab {
		font-size: 0.68rem;
		padding: 0.2rem 0.4rem;
	}
}

/* Scaffold in results view */
.scaffold-result {
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
	margin-top: 0.25rem;
}

.scaffold-result__item {
	display: flex;
	gap: 0.5rem;
	align-items: baseline;
	font-size: 0.9rem;
}

.scaffold-result__label {
	font-weight: 600;
	color: #5b21b6;
	font-size: 0.82rem;
	white-space: nowrap;
}

.scaffold-result__value {
	color: #1f2937;
}

.scaffold-result__item--correct {
	background: #f0fdf4;
	border-radius: 0.25rem;
	padding: 0.15rem 0.5rem;
}

.scaffold-result__item--incorrect {
	background: #fef2f2;
	border-radius: 0.25rem;
	padding: 0.15rem 0.5rem;
}

.scaffold-result__value--correct {
	color: #16a34a;
	font-weight: 600;
}

.scaffold-result__value--incorrect {
	color: #dc2626;
	text-decoration: line-through;
}

.scaffold-result__expected {
	color: #16a34a;
	font-weight: 600;
	font-size: 0.85rem;
}

.scaffold-result__solution {
	margin-top: 0.75rem;
	border: 1px solid #e5e7eb;
	border-radius: 0.5rem;
	overflow: hidden;
}

.scaffold-result__solution-toggle {
	padding: 0.5rem 0.75rem;
	cursor: pointer;
	font-weight: 600;
	font-size: 0.88rem;
	background: #f9fafb;
	color: #4b5563;
}

.scaffold-result__solution-body {
	padding: 0.75rem;
	font-size: 0.9rem;
	line-height: 1.6;
	white-space: pre-wrap;
}

.exam-results__badge--partial {
	background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
	color: #92400e;
}

.exam-results__item--partial {
	border-left: 3px solid #f59e0b;
}

.exam-results__item-solution,
.exam-results__item-approaches {
	margin-top: 0.5rem;
	border: 1px solid #e5e7eb;
	border-radius: 0.5rem;
	overflow: hidden;
}

.exam-results__item-solution > summary,
.exam-results__item-approaches > summary {
	padding: 0.5rem 0.75rem;
	cursor: pointer;
	font-weight: 600;
	font-size: 0.85rem;
	background: #f9fafb;
	color: #4b5563;
}

.exam-results__item-solution-body,
.exam-results__item-approaches-body {
	padding: 0.75rem;
	font-size: 0.9rem;
	line-height: 1.6;
}

.exam-results__approach {
	margin-bottom: 0.75rem;
}

.exam-results__approach ol {
	margin: 0.25rem 0 0 1.25rem;
	padding: 0;
}

.exam-results__approach li {
	margin-bottom: 0.25rem;
}

/* Dark mode for new result elements */
[data-theme="dark"] .scaffold-result__item--correct {
	background: #064e3b;
}

[data-theme="dark"] .scaffold-result__item--incorrect {
	background: #450a0a;
}

[data-theme="dark"] .scaffold-result__value--correct {
	color: #34d399;
}

[data-theme="dark"] .scaffold-result__value--incorrect {
	color: #f87171;
}

[data-theme="dark"] .scaffold-result__expected {
	color: #34d399;
}

[data-theme="dark"] .scaffold-result__solution {
	border-color: #374151;
}

[data-theme="dark"] .scaffold-result__solution-toggle,
[data-theme="dark"] .exam-results__item-solution > summary,
[data-theme="dark"] .exam-results__item-approaches > summary {
	background: #1f2937;
	color: #d1d5db;
}

[data-theme="dark"] .exam-results__badge--partial {
	background: linear-gradient(135deg, #78350f 0%, #92400e 100%);
	color: #fde68a;
}

[data-theme="dark"] .exam-results__item-solution,
[data-theme="dark"] .exam-results__item-approaches {
	border-color: #374151;
}

/* Dark mode */
[data-theme="dark"] .scaffold {
	background: linear-gradient(135deg, #1e1333 0%, #2a1f4e 100%);
	border-color: #5b21b6;
}

[data-theme="dark"] .scaffold__header {
	background: linear-gradient(135deg, #2a1f4e 0%, #3b2d7a 100%);
	border-color: #5b21b6;
}

[data-theme="dark"] .scaffold__badge {
	color: #c4b5fd;
}

[data-theme="dark"] .scaffold__progress {
	color: #a78bfa;
}

[data-theme="dark"] .scaffold__body {
	color: #e5e7eb;
}

[data-theme="dark"] .scaffold__blank {
	background: #1f2937;
	border-color: #7c3aed;
	color: #f3f4f6;
}

[data-theme="dark"] .scaffold__blank:focus {
	box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.3);
}

[data-theme="dark"] .scaffold__blank--filled {
	border-color: #34d399;
	background: #064e3b;
}

[data-theme="dark"] .scaffold__blank--correct {
	border-color: #22c55e;
	background: #052e16;
	color: #bbf7d0;
}

[data-theme="dark"] .scaffold__blank--incorrect {
	border-color: #f87171;
	background: #450a0a;
	color: #fecaca;
}

[data-theme="dark"] .scaffold__blank-check {
	color: #4ade80;
}

[data-theme="dark"] .scaffold__blank-cross {
	color: #f87171;
}

[data-theme="dark"] .scaffold__blank::placeholder {
	color: #6d28d9;
}

[data-theme="dark"] .scaffold__blank-label {
	color: #a78bfa;
}

[data-theme="dark"] .scaffold-result__label {
	color: #c4b5fd;
}

[data-theme="dark"] .scaffold-result__value {
	color: #e5e7eb;
}

/* MCQ options */
.exam-take__mcq-options {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.exam-take__mcq-option {
	display: flex;
	align-items: flex-start;
	gap: 0.75rem;
	padding: 0.85rem 1rem;
	border: 1.5px solid var(--border);
	border-radius: var(--radius-sm);
	cursor: pointer;
	transition: all 0.15s;
	background: var(--surface);
}

.exam-take__mcq-option:hover {
	border-color: var(--primary-400);
	background: rgba(10, 102, 194, 0.03);
}

.exam-take__mcq-option--selected {
	border-color: var(--primary-500);
	background: rgba(10, 102, 194, 0.06);
	box-shadow: 0 0 0 3px rgba(10, 102, 194, 0.1);
}

.exam-take__mcq-radio {
	margin-top: 2px;
	accent-color: var(--primary-500);
}

.exam-take__mcq-checkbox {
	margin-top: 2px;
	accent-color: var(--primary-500);
	width: 16px;
	height: 16px;
}

.exam-take__multi-hint {
	font-size: 0.82rem;
	color: var(--text-secondary, #666);
	margin-bottom: 4px;
	font-style: italic;
}

.exam-take__mcq-options--multi .exam-take__mcq-key {
	border-radius: 4px;
}

.exam-take__mcq-key {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 26px;
	height: 26px;
	border-radius: 50%;
	background: rgba(10, 102, 194, 0.08);
	color: var(--primary-600);
	font-size: 0.8rem;
	font-weight: 700;
	flex-shrink: 0;
}

.exam-take__mcq-text {
	font-size: 0.92rem;
	line-height: 1.5;
	color: var(--text-700);
}

/* True/False options */
.exam-take__tf-options {
	display: flex;
	gap: 0.75rem;
}

.exam-take__tf-option {
	flex: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	padding: 0.85rem 1rem;
	border: 1.5px solid var(--border);
	border-radius: var(--radius-sm);
	cursor: pointer;
	transition: all 0.15s;
	font-weight: 600;
	font-size: 0.95rem;
	background: var(--surface);
}

.exam-take__tf-option:hover {
	border-color: var(--primary-400);
}

.exam-take__tf-option--selected {
	border-color: var(--primary-500);
	background: rgba(10, 102, 194, 0.06);
	box-shadow: 0 0 0 3px rgba(10, 102, 194, 0.1);
}

.exam-take__tf-radio {
	accent-color: var(--primary-500);
}

/* Text & essay inputs */
.exam-take__text-input {
	width: 100%;
	padding: 0.7rem 1rem;
	border: 1.5px solid var(--border);
	border-radius: var(--radius-sm);
	font-size: 0.95rem;
	font-family: var(--font-sans);
	color: var(--text-700);
	background: var(--surface);
	transition: border-color 0.2s;
}

.exam-take__text-input:focus {
	outline: none;
	border-color: var(--primary-500);
	box-shadow: 0 0 0 3px rgba(10, 102, 194, 0.18);
}

.exam-take__essay-input {
	width: 100%;
	padding: 0.85rem 1rem;
	border: 1.5px solid var(--border);
	border-radius: var(--radius-sm);
	font-size: 0.95rem;
	font-family: var(--font-sans);
	color: var(--text-700);
	background: var(--surface);
	resize: vertical;
	min-height: 160px;
	transition: border-color 0.2s;
}

.exam-take__essay-input:focus {
	outline: none;
	border-color: var(--primary-500);
	box-shadow: 0 0 0 3px rgba(10, 102, 194, 0.18);
}

/* ══════════════════════════════════════════════════════════════════════════
   Proof / Step-by-Step Input — Khan Academy Style
   Clean cards, progress timeline, progressive hints, micro-encouragement
   ══════════════════════════════════════════════════════════════════════════ */

/* ── Main container ── */
.ka-proof {
	border: 1px solid var(--border);
	border-radius: 12px;
	background: var(--surface);
	overflow: hidden;
	box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

/* ── Header ── */
.ka-proof__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	padding: 0.75rem 1rem;
	background: var(--surface);
	border-bottom: 1px solid var(--border);
}

.ka-proof__header-left {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.ka-proof__type-badge {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	font-size: 0.78rem;
	font-weight: 700;
	color: var(--primary-700);
	background: rgba(99,102,241,0.08);
	padding: 0.3rem 0.7rem;
	border-radius: 999px;
	letter-spacing: 0.01em;
}

.ka-proof__header-right {
	display: flex;
	align-items: center;
}

/* ── Progress bar ── */
.ka-proof__progress {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.ka-proof__progress-bar {
	width: 80px;
	height: 4px;
	border-radius: 2px;
	background: rgba(0,0,0,0.06);
	overflow: hidden;
}

.ka-proof__progress-fill {
	height: 100%;
	border-radius: 2px;
	background: var(--success-500);
	transition: width 0.4s ease;
}

.ka-proof__progress-text {
	font-size: 0.7rem;
	font-weight: 700;
	color: var(--text-400);
	min-width: 2rem;
}

/* ── Encouragement toast ── */
.ka-proof__encouragement {
	text-align: center;
	padding: 0.5rem;
	font-size: 0.82rem;
	font-weight: 600;
	color: var(--success-600);
	background: rgba(34,197,94,0.06);
	animation: ka-fade-in-out 2s ease forwards;
}

@keyframes ka-fade-in-out {
	0%   { opacity: 0; transform: translateY(-4px); }
	15%  { opacity: 1; transform: translateY(0); }
	80%  { opacity: 1; }
	100% { opacity: 0; }
}

/* ── Steps timeline ── */
.ka-proof__timeline {
	padding: 1rem 1rem 0.25rem;
}

/* ── Individual step ── */
.ka-step {
	display: flex;
	gap: 0.75rem;
	position: relative;
	padding-bottom: 0.5rem;
	min-height: 3.5rem;
	opacity: 0.55;
	transition: opacity 0.25s ease;
}

.ka-step--active,
.ka-step--done {
	opacity: 1;
}

/* ── Rail (dot + connector) ── */
.ka-step__rail {
	display: flex;
	flex-direction: column;
	align-items: center;
	width: 1.75rem;
	flex-shrink: 0;
}

.ka-step__dot {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 1.5rem;
	height: 1.5rem;
	border-radius: 50%;
	border: 2px solid var(--border);
	background: var(--surface);
	color: var(--text-400);
	font-size: 0.65rem;
	font-weight: 700;
	flex-shrink: 0;
	transition: all 0.25s ease;
}

.ka-step__dot-number {
	line-height: 1;
}

.ka-step--active .ka-step__dot {
	border-color: var(--primary-500);
	color: var(--primary-600);
	box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
}

.ka-step--done .ka-step__dot {
	border-color: var(--success-500);
	background: var(--success-500);
	color: #fff;
}

.ka-step__connector {
	flex: 1;
	width: 2px;
	background: var(--border);
	margin: 4px 0;
	border-radius: 1px;
	transition: background 0.25s;
}

.ka-step--done .ka-step__connector {
	background: var(--success-400);
}

/* ── Step content ── */
.ka-step__content {
	flex: 1;
	min-width: 0;
	padding-bottom: 0.75rem;
}

.ka-step__label {
	font-size: 0.7rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--text-400);
	margin-bottom: 0.35rem;
}

.ka-step--active .ka-step__label {
	color: var(--primary-600);
}

.ka-step--done .ka-step__label {
	color: var(--success-600);
}

/* ── Progressive hint pill ── */
.ka-step__hint {
	display: flex;
	align-items: flex-start;
	gap: 0.35rem;
	font-size: 0.78rem;
	color: var(--primary-600);
	background: rgba(99,102,241,0.05);
	border: 1px solid rgba(99,102,241,0.12);
	border-radius: 8px;
	padding: 0.4rem 0.65rem;
	margin-bottom: 0.5rem;
	line-height: 1.45;
	animation: ka-hint-in 0.3s ease;
}

.ka-step__hint-icon {
	flex-shrink: 0;
	font-size: 0.82rem;
}

@keyframes ka-hint-in {
	from { opacity: 0; transform: translateY(-6px); }
	to   { opacity: 1; transform: translateY(0); }
}

/* ── Step input ── */
.ka-step__input {
	display: block;
	width: 100%;
	padding: 0.55rem 0.75rem;
	border: 1.5px solid var(--border);
	border-radius: 8px;
	font-size: 0.9rem;
	font-family: 'Fira Code', 'Cascadia Code', 'JetBrains Mono', monospace;
	color: var(--text-800);
	background: var(--surface);
	resize: none;
	overflow: hidden;
	min-height: 2.6rem;
	line-height: 1.5;
	transition: border-color 0.2s, box-shadow 0.2s;
	field-sizing: content;
}

.ka-step__input:focus {
	outline: none;
	border-color: var(--primary-500);
	box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}

.ka-step__input::placeholder {
	font-family: var(--font-sans);
	font-size: 0.82rem;
	color: var(--text-300);
	font-style: italic;
}

.ka-step--done .ka-step__input {
	border-color: rgba(34,197,94,0.25);
	background: rgba(34,197,94,0.02);
}

/* ── KaTeX preview ── */
.ka-step__preview {
	margin-top: 0.35rem;
	padding: 0.4rem 0.65rem;
	background: rgba(99,102,241,0.03);
	border-radius: 6px;
	overflow-x: auto;
}

.ka-step__preview .katex {
	font-size: 1.05em;
}

/* ── Remove step button ── */
.ka-step__remove {
	position: absolute;
	top: 0;
	right: 0;
	width: 1.25rem;
	height: 1.25rem;
	display: flex;
	align-items: center;
	justify-content: center;
	border: none;
	background: none;
	color: var(--text-300);
	border-radius: 50%;
	font-size: 0.65rem;
	cursor: pointer;
	opacity: 0;
	transition: opacity 0.15s, color 0.15s, background 0.15s;
}

.ka-step:hover .ka-step__remove {
	opacity: 1;
}

.ka-step__remove:hover {
	color: var(--danger-500);
	background: rgba(239,68,68,0.08);
}

/* ── Bottom actions ── */
.ka-proof__actions {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	padding: 0.5rem 1rem 0.75rem;
}

.ka-proof__add-btn {
	background: none;
	border: 1px dashed var(--border);
	border-radius: 8px;
	padding: 0.45rem 1rem;
	font-size: 0.8rem;
	font-weight: 600;
	color: var(--text-500);
	cursor: pointer;
	transition: all 0.15s;
}

.ka-proof__add-btn:hover {
	border-color: var(--primary-400);
	color: var(--primary-600);
	background: rgba(99,102,241,0.04);
}

.ka-proof__hint-btn {
	background: rgba(245,158,11,0.08);
	border: 1px solid rgba(245,158,11,0.2);
	border-radius: 8px;
	padding: 0.45rem 1rem;
	font-size: 0.8rem;
	font-weight: 600;
	color: var(--warning-600);
	cursor: pointer;
	transition: all 0.15s;
}

.ka-proof__hint-btn:hover {
	background: rgba(245,158,11,0.14);
	border-color: rgba(245,158,11,0.35);
}

/* ── Final answer box ── */
.ka-proof__answer {
	border-top: 1px solid var(--border);
	padding: 0.85rem 1rem;
	background: linear-gradient(to bottom, rgba(34,197,94,0.02), transparent);
}

.ka-proof__answer-header {
	display: flex;
	align-items: center;
	gap: 0.4rem;
	margin-bottom: 0.5rem;
	flex-wrap: wrap;
}

.ka-proof__answer-icon {
	font-size: 0.95rem;
}

.ka-proof__answer-label {
	font-size: 0.82rem;
	font-weight: 700;
	color: var(--text-800);
}

.ka-proof__answer-badge {
	margin-left: auto;
	font-size: 0.65rem;
	font-weight: 600;
	color: var(--success-500);
	background: rgba(34,197,94,0.08);
	padding: 0.15rem 0.5rem;
	border-radius: 999px;
	letter-spacing: 0.02em;
}

.ka-proof__answer-input {
	display: block;
	width: 100%;
	padding: 0.6rem 0.75rem;
	border: 2px solid var(--success-300);
	border-radius: 8px;
	font-size: 0.92rem;
	font-family: 'Fira Code', 'Cascadia Code', 'JetBrains Mono', monospace;
	color: var(--text-800);
	background: var(--surface);
	transition: border-color 0.2s, box-shadow 0.2s;
}

.ka-proof__answer-input:focus {
	outline: none;
	border-color: var(--success-500);
	box-shadow: 0 0 0 3px rgba(34,197,94,0.12);
}

.ka-proof__answer-input::placeholder {
	font-family: var(--font-sans);
	color: var(--text-300);
	font-size: 0.85rem;
}

.ka-proof__answer-preview {
	margin-top: 0.35rem;
	padding: 0.4rem 0.65rem;
	background: rgba(34,197,94,0.03);
	border-radius: 6px;
	overflow-x: auto;
}

.ka-proof__answer-preview .katex {
	font-size: 1.1em;
}

/* ── Collapsible justification ── */
.ka-justify__toggle {
	display: inline-block;
	background: none;
	border: none;
	padding: 0.2rem 0;
	margin-top: 0.3rem;
	font-size: 0.72rem;
	font-weight: 600;
	color: var(--text-300);
	cursor: pointer;
	transition: color 0.15s;
}

.ka-justify__toggle:hover {
	color: var(--text-500);
}

.ka-justify {
	display: flex;
	gap: 0.4rem;
	align-items: center;
	margin-top: 0.35rem;
	animation: ka-hint-in 0.2s ease;
}

.ka-justify__select {
	flex: 0 1 auto;
	min-width: 10em;
	padding: 0.3rem 0.5rem;
	border: 1px solid var(--border);
	border-radius: 6px;
	font-size: 0.78rem;
	color: var(--text-600);
	background: var(--surface);
	cursor: pointer;
	transition: border-color 0.15s;
}

.ka-justify__select:focus {
	outline: none;
	border-color: var(--primary-400);
}

.ka-justify__custom {
	flex: 1;
	min-width: 8em;
	padding: 0.3rem 0.5rem;
	border: 1px solid var(--border);
	border-radius: 6px;
	font-size: 0.78rem;
	color: var(--text-700);
	background: var(--surface);
	transition: border-color 0.15s;
}

.ka-justify__custom:focus {
	outline: none;
	border-color: var(--primary-400);
}

.ka-justify__close {
	background: none;
	border: none;
	padding: 0.15rem 0.35rem;
	font-size: 0.65rem;
	color: var(--text-300);
	cursor: pointer;
	border-radius: 50%;
	transition: color 0.15s;
}

.ka-justify__close:hover {
	color: var(--text-500);
}

/* ══════════════════════════════════════════════════════════════════════════
   Proof Results — Khan Academy Style
   ══════════════════════════════════════════════════════════════════════════ */

.ka-results {
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
}

.ka-results__steps {
	display: flex;
	flex-direction: column;
	gap: 0.15rem;
}

.ka-results__step {
	display: flex;
	gap: 0.6rem;
	align-items: flex-start;
	padding: 0.35rem 0;
}

.ka-results__step-dot {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 1.3rem;
	height: 1.3rem;
	border-radius: 50%;
	flex-shrink: 0;
	font-size: 0.6rem;
	font-weight: 700;
	border: 1.5px solid var(--border);
	color: var(--text-400);
	background: var(--surface);
	margin-top: 0.1rem;
}

.ka-results__step--done .ka-results__step-dot {
	border-color: var(--success-500);
	background: var(--success-500);
	color: #fff;
}

.ka-results__step--empty .ka-results__step-dot {
	border-color: var(--text-200);
	color: var(--text-300);
}

.ka-results__step-body {
	flex: 1;
	min-width: 0;
}

.ka-results__step-math {
	font-size: 0.88rem;
	color: var(--text-800);
	line-height: 1.5;
	overflow-x: auto;
}

.ka-results__step-math .katex {
	font-size: 1em;
}

.ka-results__empty {
	color: var(--text-300);
	font-style: italic;
}

.ka-results__step-reason {
	font-size: 0.72rem;
	color: var(--text-400);
	font-style: italic;
	margin-top: 0.1rem;
}

/* ── Results final answer ── */
.ka-results__answer {
	margin-top: 0.4rem;
	padding: 0.55rem 0.7rem;
	border-radius: 8px;
	border: 1px solid var(--border);
	background: rgba(0,0,0,0.01);
}

.ka-results__answer--correct {
	border-color: rgba(34,197,94,0.3);
	background: rgba(34,197,94,0.03);
}

.ka-results__answer--incorrect {
	border-color: rgba(239,68,68,0.25);
	background: rgba(239,68,68,0.02);
}

.ka-results__answer-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem;
	margin-bottom: 0.3rem;
}

.ka-results__answer-label {
	font-size: 0.78rem;
	font-weight: 700;
	color: var(--text-700);
}

.ka-results__cas {
	font-size: 0.7rem;
	font-weight: 700;
	padding: 0.15rem 0.55rem;
	border-radius: 999px;
}

.ka-results__cas--correct {
	background: rgba(34,197,94,0.1);
	color: var(--success-600);
}

.ka-results__cas--incorrect {
	background: rgba(239,68,68,0.08);
	color: var(--danger-600);
}

.ka-results__answer-value {
	font-size: 0.9rem;
	color: var(--text-800);
	overflow-x: auto;
}

.ka-results__answer-value .katex {
	font-size: 1.05em;
}

.ka-results__cas-detail {
	font-size: 0.7rem;
	color: var(--text-400);
	margin-top: 0.2rem;
}

.ka-results__summary {
	font-size: 0.7rem;
	font-weight: 600;
	color: var(--text-300);
	text-align: right;
	padding-top: 0.25rem;
}

/* ── Responsive ── */
@media (max-width: 480px) {
	.ka-proof__header {
		flex-direction: column;
		align-items: flex-start;
		gap: 0.4rem;
	}
	.ka-proof__progress-bar {
		width: 60px;
	}
	.ka-proof__actions {
		flex-direction: column;
	}
	.ka-justify {
		flex-direction: column;
		align-items: stretch;
	}
	.ka-justify__select,
	.ka-justify__custom {
		width: 100%;
	}
}

/* Matching / no-options */
.exam-take__matching-hint {
	font-size: 0.85rem;
	color: var(--text-500);
	margin-bottom: 0.5rem;
}

/* Structured matching (select-based) */
.exam-take__matching-structured {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.exam-take__matching-progress {
	font-size: 0.78rem;
	font-weight: 600;
	color: var(--text-400);
	text-align: right;
}

.exam-take__matching-pairs {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.exam-take__matching-pair {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	padding: 0.5rem 0.75rem;
	border-radius: 8px;
	background: var(--bg-100, #f8f9fa);
	border: 1px solid var(--border);
	transition: background 0.15s;
}

.exam-take__matching-pair:hover {
	background: var(--bg-200, #f0f1f3);
}

.exam-take__matching-item {
	font-size: 0.88rem;
	font-weight: 600;
	color: var(--text-800);
	min-width: 0;
	flex: 1;
}

.exam-take__matching-arrow {
	color: var(--text-300);
	font-size: 0.9rem;
	flex-shrink: 0;
}

.exam-take__matching-select {
	flex: 1;
	min-width: 0;
	padding: 0.4rem 0.6rem;
	border-radius: 6px;
	border: 1px solid var(--border);
	font-size: 0.85rem;
	background: white;
	color: var(--text-800);
	cursor: pointer;
}

.exam-take__matching-select:focus {
	outline: none;
	border-color: var(--primary);
	box-shadow: 0 0 0 2px rgba(10, 102, 194, 0.15);
}

.exam-take__no-options p {
	font-size: 0.85rem;
	color: var(--text-500);
	margin-bottom: 0.5rem;
}

/* Question nav buttons */
.exam-take__question-nav {
	display: flex;
	justify-content: space-between;
	gap: 0.75rem;
	margin-top: 1.5rem;
}

/* Group counter (between grouped cards and nav) */
.exam-take__group-counter {
	text-align: center;
	font-size: 0.78rem;
	font-weight: 600;
	color: var(--text-400);
	padding: 0.35rem 0;
	letter-spacing: 0.02em;
}

/* Confirmation modal */
.exam-take__overlay {
	position: fixed;
	inset: 0;
	z-index: 200;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, 0.4);
	-webkit-backdrop-filter: blur(4px);
	        backdrop-filter: blur(4px);
}

.exam-take__modal {
	max-width: 420px;
	width: 90%;
}

.exam-take__modal h3 {
	font-size: 1.15rem;
	font-weight: 700;
	margin-bottom: 0.75rem;
}

.exam-take__modal p {
	font-size: 0.92rem;
	color: var(--text-700);
	line-height: 1.55;
}

.exam-take__modal-warning {
	color: var(--warning-500);
	font-weight: 600;
}

.exam-take__modal-actions {
	display: flex;
	justify-content: flex-end;
	gap: 0.65rem;
	margin-top: 1.25rem;
}

.exam-take__modal-jump {
	margin-top: 0.9rem;
	display: grid;
	grid-gap: 0.55rem;
	gap: 0.55rem;
}

.exam-take__modal-jump-title {
	font-size: 0.78rem;
	font-weight: 700;
	color: var(--text-500);
}

.exam-take__modal-jump-buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	align-items: center;
}

.exam-take__modal-jump-more {
	font-size: 0.8rem;
	font-weight: 700;
	color: var(--text-400);
}

/* ── Floating passage button ── */

.exam-take__passage-btn {
	position: fixed;
	bottom: calc(1.5rem + env(safe-area-inset-bottom));
	right: calc(1.5rem + env(safe-area-inset-right));
	z-index: 100;
	display: flex;
	align-items: center;
	gap: 0.4rem;
	padding: 0.65rem 1.1rem;
	border: none;
	border-radius: 999px;
	background: var(--primary-500);
	color: #fff;
	font-size: 0.85rem;
	font-weight: 700;
	cursor: pointer;
	box-shadow: 0 4px 16px rgba(10, 102, 194, 0.3);
	transition: transform 0.15s, box-shadow 0.15s;
}

.exam-take__passage-btn:hover {
	transform: translateY(-2px);
	box-shadow: 0 6px 20px rgba(10, 102, 194, 0.4);
}

/* ── Passage slide-over panel ── */

.exam-take__passage-panel {
	position: fixed;
	top: env(safe-area-inset-top);
	right: 0;
	bottom: env(safe-area-inset-bottom);
	width: min(520px, 90vw);
	background: var(--surface);
	box-shadow: -4px 0 32px rgba(0, 0, 0, 0.15);
	display: flex;
	flex-direction: column;
	z-index: 201;
	animation: slide-in-right 0.25s ease;
}

@keyframes slide-in-right {
	from { transform: translateX(100%); }
	to { transform: translateX(0); }
}

.exam-take__passage-panel-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 1rem 1.25rem;
	border-bottom: 1px solid var(--border);
	flex-shrink: 0;
}

.exam-take__passage-panel-header h3 {
	font-size: 1rem;
	font-weight: 700;
	color: var(--text-900);
	margin: 0;
}

.exam-take__passage-panel-close {
	background: none;
	border: none;
	font-size: 1.2rem;
	color: var(--text-400);
	cursor: pointer;
	padding: 0.25rem 0.5rem;
	border-radius: var(--radius-sm);
	transition: color 0.15s;
}

.exam-take__passage-panel-close:hover {
	color: var(--text-700);
}

.exam-take__passage-panel-body {
	flex: 1;
	overflow-y: auto;
	padding: 1.25rem;
}

.exam-take__passage-panel-body .instruction-renderer {
	max-height: none;
	overflow: visible;
	background: none;
	border: none;
	padding: 0;
	font-size: 0.95rem;
	line-height: 1.8;
}

/* ── Styled fill-in-the-blank inline inputs ── */

.exam-take__fill-blank-text {
	font-size: 1.05rem;
	line-height: 1.9;
	color: var(--text-800);
	word-wrap: break-word;
}

.exam-take__inline-blank {
	display: inline-block;
	-webkit-appearance: none;
	        appearance: none;
	border: none;
	border-bottom: 2px solid var(--primary-400);
	background: rgba(10, 102, 194, 0.04);
	border-radius: 4px 4px 0 0;
	padding: 0.1em 0.35em;
	margin: 0 0.15em;
	min-width: 5em;
	max-width: 16em;
	font: inherit;
	font-size: 0.95rem;
	color: var(--primary-700);
	font-weight: 600;
	text-align: center;
	outline: none;
	vertical-align: baseline;
	transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.exam-take__inline-blank::placeholder {
	color: var(--text-400);
	font-weight: 400;
	font-style: italic;
}

.exam-take__inline-blank:hover {
	background: rgba(10, 102, 194, 0.08);
}

.exam-take__inline-blank:focus {
	border-bottom-color: var(--primary-600);
	background: rgba(10, 102, 194, 0.06);
	box-shadow: 0 2px 0 0 var(--primary-500);
}

/* When filled, show a subtle checkmark feel */
.exam-take__inline-blank:not(:placeholder-shown) {
	border-bottom-color: var(--success-500);
	background: rgba(34, 197, 94, 0.05);
}

/* ========================================
   Exam Results
   ======================================== */

.exam-results__header {
	margin-top: 0;
}

.exam-results__overview {
	display: grid;
	grid-template-columns: 200px 1fr;
	grid-gap: 2rem;
	gap: 2rem;
	align-items: center;
	margin-bottom: 2.5rem;
	padding: 2rem;
	background: rgba(255, 255, 255, 0.78);
	backdrop-filter: saturate(160%) blur(16px);
	-webkit-backdrop-filter: saturate(160%) blur(16px);
	border: 1px solid rgba(255, 255, 255, 0.55);
	border-radius: var(--radius-lg);
	box-shadow:
		0 1px 2px rgba(10, 102, 194, 0.04),
		0 8px 28px rgba(10, 102, 194, 0.08);
}

.exam-results__score-ring {
	position: relative;
	width: 160px;
	height: 160px;
	margin: 0 auto;
}

.exam-results__ring-svg {
	width: 100%;
	height: 100%;
}

.exam-results__score-text {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
}

.exam-results__score-pct {
	font-size: 2rem;
	font-weight: 800;
	color: var(--text-900);
}

.exam-results__score-label {
	font-size: 0.82rem;
	font-weight: 600;
	color: var(--text-500);
}

.exam-results__stats-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
	grid-gap: 0.75rem;
	gap: 0.75rem;
}

.exam-results__stat-card {
	background: var(--background);
	border: 1px solid var(--border);
	border-radius: var(--radius-md);
	padding: 1rem 0.85rem;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.2rem;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.exam-results__stat-card:hover {
	transform: translateY(-2px);
	box-shadow: var(--shadow-sm);
}

.exam-results__stat-number {
	font-size: 1.6rem;
	font-weight: 800;
	letter-spacing: -0.03em;
	color: var(--text-900);
	line-height: 1;
}

.exam-results__stat-label {
	font-size: 0.72rem;
	font-weight: 600;
	color: var(--text-400);
	text-align: center;
	letter-spacing: 0.01em;
}

.exam-results__stat-card--correct {
	border-color: rgba(34, 197, 94, 0.25);
	background: rgba(34, 197, 94, 0.04);
}

.exam-results__stat-card--correct .exam-results__stat-number {
	color: var(--success-500);
}

.exam-results__stat-card--incorrect {
	border-color: rgba(239, 68, 68, 0.25);
	background: rgba(239, 68, 68, 0.04);
}

.exam-results__stat-card--incorrect .exam-results__stat-number {
	color: var(--danger-500);
}

.exam-results__stat-card--manual {
	border-color: rgba(245, 158, 11, 0.25);
	background: rgba(245, 158, 11, 0.04);
}

.exam-results__stat-card--manual .exam-results__stat-number {
	color: var(--warning-500);
}

/* Detailed results */
.exam-results__details {
	margin-top: 2rem;
}

.exam-results__details-title {
	font-size: 1.15rem;
	font-weight: 700;
	margin-bottom: 1rem;
	color: var(--text-900);
}

.exam-results__item {
	margin-bottom: 0.85rem;
	border-left: 3px solid var(--border);
	transition: border-left-color 0.2s ease;
}

.exam-results__item:hover {
	transform: none;
}

.exam-results__item--correct {
	border-left-color: var(--success-500);
}

.exam-results__item--incorrect {
	border-left-color: var(--danger-500);
}

.exam-results__item--manual {
	border-left-color: var(--warning-500);
}

.exam-results__item--unanswered {
	border-left-color: var(--text-300);
}

.exam-results__item-header {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	flex-wrap: wrap;
	margin-bottom: 0.5rem;
}

.exam-results__item-number {
	font-weight: 700;
	font-size: 0.85rem;
	color: var(--text-500);
}

.exam-results__item-type {
	font-size: 0.78rem;
	color: var(--text-500);
}

.exam-results__item-points {
	font-size: 0.78rem;
	font-weight: 600;
	color: var(--text-500);
	margin-left: auto;
}

.exam-results__badge {
	display: inline-flex;
	align-items: center;
	padding: 0.2rem 0.55rem;
	border-radius: 999px;
	font-size: 0.72rem;
	font-weight: 700;
}

.exam-results__badge--correct {
	background: rgba(34, 197, 94, 0.12);
	color: var(--success-500);
}

.exam-results__badge--incorrect {
	background: rgba(239, 68, 68, 0.12);
	color: var(--danger-500);
}

.exam-results__badge--manual {
	background: rgba(245, 158, 11, 0.12);
	color: var(--warning-500);
}

.exam-results__badge--unanswered {
	background: rgba(148, 163, 184, 0.14);
	color: var(--text-500);
}

.exam-results__item-question {
	font-size: 0.95rem;
	line-height: 1.55;
	color: var(--text-900);
	margin-bottom: 0.5rem;
}

/* Override InstructionRenderer container styles inside results */
.exam-results__item-question .instruction-renderer {
	margin-top: 0;
	padding: 0;
	background: none;
	border: none;
	border-radius: 0;
	max-height: none;
	overflow: visible;
	font-size: 0.95rem;
	line-height: 1.55;
	color: var(--text-900);
}

.exam-results__item-question .instruction-renderer__p {
	margin: 0 0 0.4em;
}

.exam-results__item-question .instruction-renderer__p:last-child {
	margin-bottom: 0;
}

.exam-results__item-answer {
	font-size: 0.88rem;
	color: var(--text-700);
	padding: 0.4rem 0.65rem;
	background: rgba(10, 102, 194, 0.04);
	border-radius: var(--radius-sm);
	margin-bottom: 0.35rem;
}

.exam-results__item-correct {
	font-size: 0.88rem;
	color: var(--success-500);
	padding: 0.4rem 0.65rem;
	background: rgba(34, 197, 94, 0.06);
	border-radius: var(--radius-sm);
	margin-bottom: 0.35rem;
}

.exam-results__item-explanation {
	font-size: 0.85rem;
	color: var(--text-500);
	padding: 0.4rem 0.65rem;
	background: rgba(245, 158, 11, 0.06);
	border-radius: var(--radius-sm);
	font-style: italic;
}

.exam-results__actions {
	display: flex;
	justify-content: center;
	gap: 0.75rem;
	margin-top: 2.5rem;
	padding-top: 1.5rem;
	border-top: 1px solid var(--border);
}

/* ========================================
   Figure Renderer
   ======================================== */

.figure-renderer {
	margin: 0.75rem 0;
	border: 1px solid rgba(10, 102, 194, 0.1);
	border-radius: var(--radius-md);
	overflow: hidden;
	background: rgba(10, 102, 194, 0.02);
}

.figure-renderer--compact {
	margin: 0.5rem 0;
}

.figure-renderer--compact .figure-render__graph-desc,
.figure-renderer--compact .figure-render__circuit-desc,
.figure-renderer--compact .figure-render__geo-desc,
.figure-renderer--compact .figure-render__chem-desc,
.figure-renderer--compact .figure-render__image-desc,
.figure-renderer--compact .figure-render__card-body {
	font-size: 0.78rem;
}

/* Table figures */
.figure-render--table {
	padding: 0.75rem;
}

.figure-render__table-wrap {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

.figure-render__table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.85rem;
}

.figure-render__table th {
	background: rgba(10, 102, 194, 0.08);
	color: var(--text-900);
	font-weight: 700;
	padding: 0.55rem 0.75rem;
	text-align: left;
	border: 1px solid var(--border);
	white-space: nowrap;
}

.figure-render__table td {
	padding: 0.45rem 0.75rem;
	border: 1px solid var(--border);
	color: var(--text-700);
}

.figure-render__table tr:nth-child(even) {
	background: rgba(10, 102, 194, 0.02);
}

/* Graph figures */
.figure-render--graph {
	padding: 0.75rem;
	display: flex;
	flex-direction: column;
	align-items: center;
}

.figure-render__graph-title {
	font-size: 0.9rem;
	font-weight: 700;
	color: var(--text-900);
	text-align: center;
	margin-bottom: 0.35rem;
}

.figure-render__graph-svg {
	width: 100%;
	max-width: 400px;
	height: auto;
}

.figure-render__graph-desc {
	font-size: 0.82rem;
	color: var(--text-500);
	line-height: 1.5;
	padding: 0.5rem 0 0;
	text-align: center;
}

/* Circuit figures */
.figure-render--circuit {
	padding: 0.75rem;
	display: flex;
	flex-direction: column;
	align-items: center;
}

.figure-render__circuit-svg {
	width: 100%;
	max-width: 380px;
	height: auto;
}

.figure-render__circuit-desc {
	font-size: 0.82rem;
	color: var(--text-500);
	line-height: 1.5;
	padding: 0.5rem 0 0;
	text-align: center;
}

/* Geometry figures */
.figure-render--geometry {
	padding: 0.75rem;
	display: flex;
	flex-direction: column;
	align-items: center;
}

.figure-render__geo-svg {
	width: 100%;
	max-width: 280px;
	height: auto;
}

.figure-render__geo-desc {
	font-size: 0.82rem;
	color: var(--text-500);
	line-height: 1.5;
	padding: 0.5rem 0 0;
	text-align: center;
}

/* Chemistry figures */
.figure-render--chemistry {
	padding: 0.75rem;
	display: flex;
	flex-direction: column;
	align-items: center;
}

.figure-render__chem-svg {
	width: 100%;
	max-width: 340px;
	height: auto;
}

.figure-render__chem-desc {
	font-size: 0.82rem;
	color: var(--text-500);
	line-height: 1.5;
	padding: 0.5rem 0 0;
	text-align: center;
}

/* Equation figures */
.figure-render--equation {
	padding: 1rem;
	display: flex;
	justify-content: center;
}

.figure-render__equation-display {
	font-size: 1.2rem;
}

/* Description card (fallback) */
.figure-render--card {
	padding: 0.75rem;
}

.figure-render__card-header {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	margin-bottom: 0.5rem;
	padding-bottom: 0.5rem;
	border-bottom: 1px solid var(--border);
}

.figure-render__card-icon {
	font-size: 1.15rem;
}

.figure-render__card-label {
	font-size: 0.78rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--text-500);
}

.figure-render__card-body {
	font-size: 0.88rem;
	line-height: 1.6;
	color: var(--text-700);
}

/* Image placeholder */
.figure-render--image {
	padding: 0.75rem;
}

/* Music notation figure */
.figure-render--music {
	padding: 0.75rem;
	border-left: 3px solid #8b5cf6;
	background: linear-gradient(135deg, rgba(139, 92, 246, 0.04), rgba(139, 92, 246, 0.01));
}

.figure-render__music-header {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	margin-bottom: 0.5rem;
	padding-bottom: 0.5rem;
	border-bottom: 1px solid var(--border);
	flex-wrap: wrap;
}

.figure-render__music-icon {
	font-size: 1.2rem;
}

.figure-render__music-label {
	font-size: 0.78rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: #8b5cf6;
}

.figure-render__music-clef {
	font-size: 1.5rem;
	line-height: 1;
	opacity: 0.6;
}

.figure-render__music-badge {
	font-size: 0.7rem;
	font-weight: 600;
	padding: 0.15rem 0.45rem;
	border-radius: 100px;
	background: rgba(139, 92, 246, 0.12);
	color: #7c3aed;
}

.figure-render__music-staff {
	margin: 0.5rem 0;
}

.figure-render__music-lines {
	width: 100%;
	height: 48px;
	color: #8b5cf6;
}

.figure-render__music-desc {
	font-size: 0.88rem;
	line-height: 1.6;
	color: var(--text-700);
	padding: 0.5rem 0;
}

.figure-render__music-hint {
	display: flex;
	align-items: flex-start;
	gap: 0.4rem;
	font-size: 0.78rem;
	color: var(--text-400);
	font-style: italic;
	margin-top: 0.25rem;
	padding-top: 0.5rem;
	border-top: 1px solid var(--border);
}

.figure-render__image-placeholder {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.5rem;
	padding: 1.5rem;
	color: var(--text-300);
}

.figure-render__image-placeholder span {
	font-size: 0.82rem;
	font-weight: 600;
}

.figure-render__image-desc {
	font-size: 0.85rem;
	line-height: 1.55;
	color: var(--text-700);
	padding-top: 0.5rem;
	border-top: 1px solid var(--border);
}

/* ========================================
   Exam Responsive
   ======================================== */

@media (max-width: 767px) {
	.exam-browser__filters {
		flex-direction: column;
	}

	.exam-browser__select,
	.exam-browser__search-wrap {
		width: 100%;
		min-width: 0;
	}

	.grid--exams {
		grid-template-columns: 1fr;
	}

	.exam-take__body {
		grid-template-columns: 1fr;
	}

	.exam-take__nav {
		position: static;
		order: 2;
		backdrop-filter: none;
		-webkit-backdrop-filter: none;
	}

	.exam-take__nav-sections {
		max-height: none;
	}

	.exam-take__nav-section {
		border-left: none;
		padding-left: 0;
	}

	.exam-take__nav-section-grid {
		grid-template-columns: repeat(auto-fill, minmax(38px, 1fr));
	}

	.exam-take__content {
		order: 1;
	}

	.exam-take__topbar {
		flex-wrap: wrap;
	}

	.exam-take__title-short {
		max-width: 120px;
	}

	.exam-take__passage-btn {
		bottom: 1rem;
		right: 1rem;
		padding: 0.55rem 0.9rem;
		font-size: 0.8rem;
	}

	.exam-take__passage-panel {
		width: 100vw;
	}

	.exam-take__inline-blank {
		min-width: 4em;
		font-size: 0.9rem;
		padding: 0.1em 0.3em;
	}

	.exam-take__fill-blank-text {
		font-size: 0.95rem;
		line-height: 2;
	}

	.exam-results__overview {
		grid-template-columns: 1fr;
	}

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

	.exam-results__actions {
		flex-direction: column;
		align-items: stretch;
	}
}


/* ═══════════════════════════════════════════════════════════════════════════
   Answer Verification — Admin page for reviewing AI answers
   ═══════════════════════════════════════════════════════════════════════════ */

.av-page {
	padding: 2rem 1rem 4rem;
	max-width: 900px;
	margin: 0 auto;
}

/* Header */
.av-header {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 1rem;
	margin-bottom: 1.5rem;
	flex-wrap: wrap;
}

.av-header h1 {
	margin: 0.25rem 0 0.25rem;
}

.av-header__actions {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	flex-wrap: wrap;
}

/* Progress bar */
.av-progress-bar {
	position: relative;
	height: 28px;
	background: var(--color-bg-secondary, #f1f5f9);
	border-radius: 14px;
	overflow: hidden;
	margin-bottom: 1.25rem;
	border: 1px solid var(--color-border, #e2e8f0);
}

.av-progress-bar__fill {
	position: absolute;
	left: 0;
	top: 0;
	bottom: 0;
	background: linear-gradient(90deg, #22c55e 0%, #16a34a 100%);
	border-radius: 14px;
	transition: width 0.4s ease;
	min-width: 2px;
}

.av-progress-bar__label {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 0.8rem;
	font-weight: 600;
	color: var(--color-text, #1e293b);
	text-shadow: 0 0 4px rgba(255,255,255,0.8);
	pointer-events: none;
}

/* Filter bar */
.av-filter-bar {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 1rem;
	padding: 0.75rem 1rem;
	background: var(--color-bg-secondary, #f8fafc);
	border: 1px solid var(--color-border, #e2e8f0);
	border-radius: 12px;
	margin-bottom: 1rem;
	flex-wrap: wrap;
}

.av-filter-bar__stats {
	display: flex;
	gap: 0.75rem;
	flex-wrap: wrap;
}

.av-stat {
	font-size: 0.8rem;
	font-weight: 600;
	padding: 0.2rem 0.6rem;
	border-radius: 999px;
}

.av-stat--verified { background: #dcfce7; color: #16a34a; }
.av-stat--pending { background: #fef9c3; color: #ca8a04; }
.av-stat--rejected { background: #fecaca; color: #dc2626; }
.av-stat--total { background: var(--color-bg-tertiary, #e2e8f0); color: var(--color-text-muted, #64748b); }

.av-filter-bar__controls {
	display: flex;
	gap: 0.5rem;
	flex-wrap: wrap;
}

.av-select {
	padding: 0.35rem 0.6rem;
	border-radius: 8px;
	border: 1px solid var(--color-border, #e2e8f0);
	background: var(--color-bg, #fff);
	color: var(--color-text, #1e293b);
	font-size: 0.85rem;
	cursor: pointer;
}

.av-select:focus {
	outline: 2px solid var(--color-primary, #3b82f6);
	outline-offset: 1px;
}

/* Navigation bar */
.av-nav {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0.5rem 0;
	margin-bottom: 1rem;
}

.av-nav__position {
	font-size: 0.9rem;
	font-weight: 500;
	color: var(--color-text-muted, #64748b);
}

/* Buttons */
.av-btn {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	padding: 0.5rem 1rem;
	border-radius: 8px;
	border: 1px solid transparent;
	font-size: 0.9rem;
	font-weight: 500;
	cursor: pointer;
	transition: all 0.15s ease;
	white-space: nowrap;
	font-family: inherit;
}

.av-btn:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.av-btn--sm {
	padding: 0.3rem 0.6rem;
	font-size: 0.8rem;
	border-radius: 6px;
}

.av-btn--lg {
	padding: 0.65rem 1.5rem;
	font-size: 1rem;
	font-weight: 600;
}

.av-btn--primary {
	background: var(--color-primary, #3b82f6);
	color: #fff;
	border-color: var(--color-primary, #3b82f6);
}
.av-btn--primary:hover:not(:disabled) { background: #2563eb; }

.av-btn--ghost {
	background: transparent;
	color: var(--color-text, #1e293b);
	border-color: var(--color-border, #e2e8f0);
}
.av-btn--ghost:hover:not(:disabled) { background: var(--color-bg-secondary, #f1f5f9); }

.av-btn--success {
	background: #22c55e;
	color: #fff;
	border-color: #22c55e;
}
.av-btn--success:hover:not(:disabled) { background: #16a34a; }

.av-btn--danger {
	background: #ef4444;
	color: #fff;
	border-color: #ef4444;
}
.av-btn--danger:hover:not(:disabled) { background: #dc2626; }

.av-btn--loading {
	opacity: 0.7;
	pointer-events: none;
}

/* Save status */
.av-save-status {
	font-size: 0.8rem;
	font-weight: 500;
}
.av-save-status--success { color: #16a34a; }
.av-save-status--error { color: #dc2626; }

/* Review card */
.av-card {
	background: var(--color-bg, #fff);
	border: 1px solid var(--color-border, #e2e8f0);
	border-radius: 16px;
	padding: 1.5rem;
	margin-bottom: 1rem;
	box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.av-card__header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 1rem;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.av-card__meta {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	flex-wrap: wrap;
}

.av-card__badge {
	font-size: 0.75rem;
	font-weight: 600;
	padding: 0.2rem 0.6rem;
	border-radius: 999px;
	border: 1px solid;
}

.av-card__type {
	font-size: 0.8rem;
	color: var(--color-text-muted, #64748b);
}

.av-card__exam-title {
	font-size: 0.8rem;
	color: var(--color-text-muted, #64748b);
	max-width: 300px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.av-card__nav-info {
	font-size: 0.85rem;
	font-weight: 600;
	color: var(--color-text-muted, #64748b);
}

/* Context / parent */
.av-card__context {
	font-size: 0.85rem;
	padding: 0.75rem;
	background: var(--color-bg-secondary, #f8fafc);
	border-radius: 8px;
	margin-bottom: 1rem;
	color: var(--color-text-muted, #64748b);
}

.av-card__instructions {
	margin-top: 0.5rem;
}
.av-card__instructions summary {
	cursor: pointer;
	font-size: 0.8rem;
	color: var(--color-primary, #3b82f6);
}

.av-card__parent {
	font-size: 0.85rem;
	padding: 0.75rem;
	background: #eff6ff;
	border-left: 3px solid #3b82f6;
	border-radius: 4px;
	margin-bottom: 1rem;
}

.av-card__parent-label {
	font-weight: 600;
	margin-right: 0.5rem;
}

/* Question text */
.av-card__question {
	margin-bottom: 1.25rem;
}

.av-card__question-text {
	font-size: 1.05rem;
	line-height: 1.6;
	margin: 0;
	white-space: pre-wrap;
}

.av-card__figure {
	margin-top: 0.5rem;
	font-size: 0.85rem;
	padding: 0.5rem 0.75rem;
	background: #fefce8;
	border-radius: 6px;
}

.av-card__figure-label {
	font-weight: 600;
	margin-right: 0.4rem;
}

.av-card__figure-text {
	color: var(--color-text-muted, #64748b);
}

/* Model answer */
.av-card__model-answer {
	margin-bottom: 1rem;
}

.av-card__model-answer-text {
	margin-top: 0.5rem;
	padding: 1rem;
	background: var(--color-bg-secondary, #f8fafc);
	border: 1px solid var(--color-border, #e2e8f0);
	border-radius: 8px;
	font-size: 0.9rem;
	line-height: 1.7;
	white-space: pre-wrap;
	max-height: 400px;
	overflow-y: auto;
}

/* Answer parts */
.av-card__parts {
	margin-bottom: 1.25rem;
}

.av-card__parts-title {
	font-size: 0.95rem;
	margin: 0 0 0.75rem;
	color: var(--color-text, #1e293b);
}

.av-part {
	padding: 0.75rem;
	border: 1px solid var(--color-border, #e2e8f0);
	border-radius: 8px;
	margin-bottom: 0.5rem;
	transition: border-color 0.2s;
}

.av-part:hover {
	border-color: var(--color-primary, #3b82f6);
}

.av-part--editing {
	border-color: var(--color-primary, #3b82f6);
	background: #eff6ff08;
}

.av-part__header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 0.4rem;
}

.av-part__label {
	font-size: 0.8rem;
	font-weight: 600;
	color: var(--color-primary, #3b82f6);
	text-transform: uppercase;
	letter-spacing: 0.03em;
}

/* Part display (read-only view) */
.av-part__display {
	font-size: 0.9rem;
}

.av-part__answer strong {
	margin-right: 0.35rem;
	font-weight: 600;
}

.av-part__alts {
	margin-top: 0.4rem;
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem;
	align-items: center;
}

.av-part__alts-label {
	font-size: 0.78rem;
	color: var(--color-text-muted, #64748b);
	margin-right: 0.25rem;
}

.av-part__alt-chip {
	font-size: 0.78rem;
	padding: 0.15rem 0.45rem;
	background: var(--color-bg-secondary, #f1f5f9);
	border-radius: 4px;
	color: var(--color-text-muted, #64748b);
}

/* Part edit form */
.av-part__edit-form {
	display: flex;
	flex-direction: column;
}

.av-part__edit-actions {
	display: flex;
	gap: 0.5rem;
	margin-top: 0.5rem;
}

/* Approaches */
.av-approaches {
	margin-bottom: 1.25rem;
}

.av-approaches__title {
	font-size: 0.95rem;
	margin: 0 0 0.5rem;
}

.av-approach {
	border: 1px solid var(--color-border, #e2e8f0);
	border-radius: 8px;
	margin-bottom: 0.4rem;
	overflow: hidden;
}

.av-approach__toggle {
	width: 100%;
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 0.6rem 0.75rem;
	background: var(--color-bg-secondary, #f8fafc);
	border: none;
	cursor: pointer;
	font-size: 0.85rem;
	font-family: inherit;
	color: var(--color-text, #1e293b);
}

.av-approach__toggle:hover {
	background: var(--color-bg-tertiary, #e2e8f0);
}

.av-approach__name {
	font-weight: 600;
}

.av-approach__step-count {
	font-size: 0.78rem;
	color: var(--color-text-muted, #64748b);
}

.av-approach__steps {
	padding: 0.75rem 1rem 0.75rem 2rem;
	margin: 0;
	font-size: 0.85rem;
	line-height: 1.7;
}

.av-approach__step {
	margin-bottom: 0.35rem;
}

/* Final answer */
.av-card__final-answer {
	margin-bottom: 1.25rem;
}

.av-card__final-answer-row {
	display: flex;
	gap: 0.5rem;
	align-items: center;
}

/* Scaffold preview */
.av-card__scaffold-preview {
	margin-bottom: 1.25rem;
}
.av-card__scaffold-preview summary {
	cursor: pointer;
	font-size: 0.85rem;
	color: var(--color-primary, #3b82f6);
	font-weight: 500;
}
.av-card__scaffold-text {
	margin-top: 0.5rem;
	padding: 1rem;
	background: #fefce8;
	border: 1px dashed #eab308;
	border-radius: 8px;
	font-size: 0.9rem;
	line-height: 1.7;
	white-space: pre-wrap;
}

/* Actions */
.av-card__actions {
	display: flex;
	gap: 0.75rem;
	margin-top: 1.5rem;
	padding-top: 1.25rem;
	border-top: 1px solid var(--color-border, #e2e8f0);
}

.av-card__edit-notice {
	margin-top: 0.75rem;
	font-size: 0.8rem;
	color: #ca8a04;
	font-weight: 500;
}

/* Form elements */
.av-label {
	display: block;
	font-size: 0.8rem;
	font-weight: 600;
	color: var(--color-text-muted, #64748b);
	margin-bottom: 0.3rem;
}

.av-input {
	width: 100%;
	padding: 0.45rem 0.65rem;
	border: 1px solid var(--color-border, #e2e8f0);
	border-radius: 6px;
	font-size: 0.9rem;
	font-family: inherit;
	background: var(--color-bg, #fff);
	color: var(--color-text, #1e293b);
}

.av-input:focus {
	outline: 2px solid var(--color-primary, #3b82f6);
	outline-offset: 1px;
	border-color: var(--color-primary, #3b82f6);
}

.av-textarea {
	width: 100%;
	padding: 0.45rem 0.65rem;
	border: 1px solid var(--color-border, #e2e8f0);
	border-radius: 6px;
	font-size: 0.85rem;
	font-family: 'Fira Code', 'SF Mono', monospace;
	background: var(--color-bg, #fff);
	color: var(--color-text, #1e293b);
	resize: vertical;
	min-height: 60px;
}

.av-textarea:focus {
	outline: 2px solid var(--color-primary, #3b82f6);
	outline-offset: 1px;
	border-color: var(--color-primary, #3b82f6);
}

/* Empty state */
.av-empty {
	text-align: center;
	padding: 3rem 1rem;
}

.av-empty__icon {
	font-size: 3rem;
	margin-bottom: 0.75rem;
}

.av-empty h3 {
	margin: 0 0 0.5rem;
}

/* Keyboard shortcuts */
.av-shortcuts {
	text-align: center;
	padding: 1rem;
	font-size: 0.78rem;
	color: var(--color-text-muted, #64748b);
}

.av-shortcuts kbd {
	display: inline-block;
	padding: 0.1rem 0.4rem;
	background: var(--color-bg-secondary, #f1f5f9);
	border: 1px solid var(--color-border, #e2e8f0);
	border-radius: 4px;
	font-size: 0.75rem;
	font-family: inherit;
	margin: 0 0.15rem;
}

/* ─── Dark mode ─────────────────────────────────────────────────────────── */

[data-theme="dark"] .av-filter-bar {
	background: var(--color-bg-secondary);
	border-color: var(--color-border);
}

[data-theme="dark"] .av-stat--verified { background: #166534; color: #86efac; }
[data-theme="dark"] .av-stat--pending { background: #713f12; color: #fde047; }
[data-theme="dark"] .av-stat--rejected { background: #7f1d1d; color: #fca5a5; }

[data-theme="dark"] .av-progress-bar {
	background: var(--color-bg-secondary);
	border-color: var(--color-border);
}

[data-theme="dark"] .av-progress-bar__label {
	color: var(--color-text);
	text-shadow: 0 0 4px rgba(0,0,0,0.6);
}

[data-theme="dark"] .av-card {
	background: var(--color-bg);
	border-color: var(--color-border);
}

[data-theme="dark"] .av-card__parent {
	background: #1e3a5f;
	border-color: #3b82f6;
}

[data-theme="dark"] .av-card__figure {
	background: #422006;
}

[data-theme="dark"] .av-card__model-answer-text {
	background: var(--color-bg-secondary);
	border-color: var(--color-border);
}

[data-theme="dark"] .av-approach__toggle {
	background: var(--color-bg-secondary);
	color: var(--color-text);
}
[data-theme="dark"] .av-approach__toggle:hover {
	background: var(--color-bg-tertiary);
}

[data-theme="dark"] .av-card__scaffold-text {
	background: #422006;
	border-color: #92400e;
}

[data-theme="dark"] .av-select {
	background: var(--color-bg-secondary);
	color: var(--color-text);
	border-color: var(--color-border);
}

[data-theme="dark"] .av-input,
[data-theme="dark"] .av-textarea {
	background: var(--color-bg-secondary);
	color: var(--color-text);
	border-color: var(--color-border);
}

[data-theme="dark"] .av-part__alt-chip {
	background: var(--color-bg-tertiary);
}

/* ========================================
   Exam pages — mobile-first override layer
   ======================================== */

/* Mobile defaults */
.exam-browser__filters {
	flex-direction: column;
	align-items: stretch;
}

.exam-browser__field {
	width: 100%;
	min-width: 0;
	flex: none;
}

.exam-browser__field--search {
	flex: none;
	min-width: 0;
}

.exam-browser__field--actions {
	align-self: stretch;
}

.exam-browser__clear-btn {
	width: 100%;
	justify-content: center;
}

.exam-browser__stat-chip {
	font-size: 0.75rem;
	padding: 0.25rem 0.6rem;
}

.grid--exams {
	grid-template-columns: 1fr;
}

.exam-take__body {
	grid-template-columns: 1fr;
}

.exam-take__nav {
	position: static;
	order: 2;
	width: 100%;
	max-width: 100%;
	backdrop-filter: none;
	-webkit-backdrop-filter: none;
}

.exam-take__nav-sections {
	max-height: none;
}

.exam-take__nav-section {
	border-left: none;
	padding-left: 0;
}

.exam-take__nav-section-grid {
	grid-template-columns: repeat(auto-fill, minmax(38px, 1fr));
}

.exam-take__content {
	order: 1;
}

.exam-take__topbar {
	flex-wrap: wrap;
}

.exam-take__title-short {
	max-width: 120px;
}

.exam-take__passage-btn {
	bottom: 1rem;
	right: 1rem;
	padding: 0.55rem 0.9rem;
	font-size: 0.8rem;
}

.exam-take__passage-panel {
	width: 100vw;
}

.exam-take__inline-blank {
	min-width: 4em;
	font-size: 0.9rem;
	padding: 0.1em 0.3em;
}

.exam-take__fill-blank-text {
	font-size: 0.95rem;
	line-height: 2;
}

.exam-results__overview {
	grid-template-columns: 1fr;
	padding: 1.5rem 1.25rem;
}

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

.exam-results__actions {
	flex-direction: column;
	align-items: stretch;
}

/* Tablet/desktop enhancements */
@media (min-width: 641px) {
	.exam-browser__filters {
		flex-direction: row;
		flex-wrap: wrap;
		align-items: flex-end;
	}

	.exam-browser__field {
		width: auto;
		flex: 1;
		max-width: 200px;
	}

	.exam-browser__field--search {
		flex: 2;
		max-width: none;
		min-width: 200px;
	}

	.exam-browser__field--actions {
		flex: 0 0 auto;
		max-width: none;
	}

	.exam-browser__clear-btn {
		width: auto;
	}

	.grid--exams {
		grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
	}

	.exam-take__body {
		grid-template-columns: 210px 1fr;
	}

	.exam-take__nav {
		position: -webkit-sticky;
		position: sticky;
		top: calc(var(--navbar-height) + 64px);
		order: 0;
		width: 210px;
		backdrop-filter: saturate(140%) blur(12px);
		-webkit-backdrop-filter: saturate(140%) blur(12px);
	}

	.exam-take__nav-sections {
		max-height: calc(var(--vvh, 1vh) * 100 - var(--navbar-height) - 200px);
	}

	.exam-take__nav-section {
		border-left: 2px solid transparent;
		padding-left: 0.55rem;
	}

	.exam-take__nav-section-grid {
		grid-template-columns: repeat(auto-fill, minmax(32px, 1fr));
	}

	.exam-take__content {
		order: 0;
	}

	.exam-take__topbar {
		flex-wrap: nowrap;
	}

	.exam-take__title-short {
		max-width: 200px;
	}

	.exam-results__overview {
		grid-template-columns: 200px 1fr;
		padding: 2rem;
	}

	.exam-results__stats-grid {
		grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
	}

	.exam-results__actions {
		flex-direction: row;
		align-items: center;
	}
}

/* Small-screen touch-target refinements */
@media (max-width: 640px) {
	.exam-browser__select,
	.exam-browser__search,
	.exam-browser__clear-btn,
	.exam-browser__load-btn {
		min-height: 44px;
		font-size: 0.95rem;
	}

	.exam-browser__stat-chip {
		font-size: 0.82rem;
		padding: 0.3rem 0.65rem;
	}

	.exam-browser__load-btn,
	.exam-browser__clear-btn {
		width: 100%;
	}

	.exam-take__nav-btn {
		min-height: 40px;
		font-size: 0.75rem;
	}

	.exam-take__question-nav .button,
	.exam-take__modal-actions .button,
	.exam-results__actions .button {
		min-height: 44px;
		width: 100%;
	}

	.exam-take__passage-panel-close {
		min-width: 44px;
		min-height: 44px;
	}

	.exam-results__item {
		padding: 1rem;
	}
}

/* ════════════════════════════════════════════════════════════════════════════
   TRACK SELECTOR (onboarding + settings)
   ════════════════════════════════════════════════════════════════════════════ */

.track-selector__overlay {
	z-index: 1000;
}

.track-selector__modal {
	background: var(--surface);
	border-radius: 1.25rem;
	max-width: 620px;
	width: 95%;
	max-height: calc(var(--vvh, 1vh) * 90);
	overflow-y: auto;
	box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
	animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
	from { opacity: 0; transform: translateY(20px); }
	to   { opacity: 1; transform: translateY(0); }
}

.track-selector {
	padding: 1.75rem;
}

.track-selector__header {
	text-align: center;
	margin-bottom: 1.5rem;
}

.track-selector__icon {
	font-size: 2.5rem;
	display: block;
	margin-bottom: 0.5rem;
}

.track-selector__title {
	font-size: 1.35rem;
	font-weight: 700;
	margin: 0 0 0.4rem;
	color: var(--text);
}

.track-selector__subtitle {
	font-size: 0.92rem;
	color: var(--text-muted);
	margin: 0;
	line-height: 1.5;
}

.track-selector__grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
	grid-gap: 0.75rem;
	gap: 0.75rem;
	margin-bottom: 1.25rem;
}

.track-selector__card {
	all: unset;
	box-sizing: border-box;
	cursor: pointer;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.3rem;
	padding: 1rem 0.75rem;
	border: 2px solid var(--border, #e2e8f0);
	border-radius: 0.875rem;
	background: var(--surface);
	transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s;
	position: relative;
	text-align: center;
}

.track-selector__card:hover {
	border-color: var(--track-color);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--track-color) 15%, transparent);
	transform: translateY(-1px);
}

.track-selector__card--selected {
	border-color: var(--track-color);
	background: color-mix(in srgb, var(--track-color) 6%, var(--surface));
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--track-color) 20%, transparent);
}

.track-selector__card-icon {
	font-size: 1.75rem;
}

.track-selector__card-code {
	font-size: 1.05rem;
	font-weight: 700;
	color: var(--track-color);
}

.track-selector__card-name {
	font-size: 0.72rem;
	color: var(--text-muted);
	line-height: 1.3;
}

.track-selector__card-desc {
	font-size: 0.68rem;
	color: var(--text-muted);
	opacity: 0.7;
	line-height: 1.3;
}

.track-selector__check {
	position: absolute;
	top: 0.5rem;
	right: 0.5rem;
}

.track-selector__error {
	color: var(--danger-500, #ef4444);
	font-size: 0.88rem;
	text-align: center;
	margin: 0.75rem 0;
}

.track-selector__actions {
	display: flex;
	gap: 0.75rem;
	justify-content: center;
	margin-top: 1rem;
}

.track-selector__confirm {
	min-width: 160px;
}

.track-selector__hint {
	text-align: center;
	font-size: 0.78rem;
	color: var(--text-muted);
	margin: 1rem 0 0;
}

/* Track filter chip bar (ExamBrowser) */
.exam-browser__track-bar {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	align-items: center;
}

.exam-browser__track-label {
	font-size: 0.82rem;
	font-weight: 600;
	color: var(--text-muted);
	margin-right: 0.25rem;
}

.exam-browser__track-chip {
	all: unset;
	box-sizing: border-box;
	cursor: pointer;
	font-size: 0.78rem;
	font-weight: 600;
	padding: 0.3rem 0.7rem;
	border-radius: 999px;
	border: 1.5px solid var(--border, #e2e8f0);
	background: var(--surface);
	color: var(--text-muted);
	transition: all 0.15s;
	white-space: nowrap;
}

.exam-browser__track-chip:hover {
	border-color: var(--track-color, var(--primary));
	color: var(--track-color, var(--primary));
}

.exam-browser__track-chip--active {
	border-color: var(--track-color, var(--primary));
	background: color-mix(in srgb, var(--track-color, var(--primary)) 12%, var(--surface));
	color: var(--track-color, var(--primary));
}

/* Track banner in ExamTake */
.exam-take__track-banner {
	display: flex;
	align-items: flex-start;
	gap: 0.6rem;
	padding: 0.75rem 1rem;
	border-radius: 0.625rem;
	background: color-mix(in srgb, var(--track-color, #3b82f6) 8%, var(--surface));
	border: 1px solid color-mix(in srgb, var(--track-color, #3b82f6) 25%, transparent);
	margin-bottom: 1rem;
	font-size: 0.88rem;
	line-height: 1.5;
}

.exam-take__track-banner-icon {
	font-size: 1.1rem;
	flex-shrink: 0;
	margin-top: 0.1rem;
}

.exam-take__track-banner-text {
	color: var(--text);
}

.exam-take__track-banner-text strong {
	color: var(--track-color, #3b82f6);
}

/* Track badge on exam cards */
.exam-card__tracks {
	display: flex;
	flex-wrap: wrap;
	gap: 0.25rem;
	margin-top: 0.25rem;
}

.exam-card__track-chip {
	font-size: 0.65rem;
	font-weight: 600;
	padding: 0.1rem 0.4rem;
	border-radius: 4px;
	background: var(--bg-muted, #f1f5f9);
	color: var(--text-muted);
}

/* Coefficient badge in ExamResults */
.exam-results__coeff-badge {
	display: inline-flex;
	align-items: center;
	gap: 0.3rem;
	font-size: 0.8rem;
	font-weight: 600;
	padding: 0.2rem 0.6rem;
	border-radius: 999px;
	background: color-mix(in srgb, var(--primary) 10%, var(--surface));
	color: var(--primary);
	margin-left: 0.5rem;
}

.exam-results__weighted {
	margin-top: 1rem;
	padding: 1rem;
	background: color-mix(in srgb, var(--primary) 5%, var(--surface));
	border-radius: 0.75rem;
	border: 1px solid color-mix(in srgb, var(--primary) 15%, transparent);
}

.exam-results__weighted-title {
	font-size: 0.88rem;
	font-weight: 600;
	color: var(--text);
	margin: 0 0 0.5rem;
}

.exam-results__weighted-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	font-size: 0.85rem;
	padding: 0.25rem 0;
}

.exam-results__weighted-value {
	font-weight: 700;
	color: var(--primary);
}

/* Change track button in dropdown */
.dropdown__track {
	display: flex;
	align-items: center;
	gap: 0.4rem;
	font-size: 0.85rem;
}

.dropdown__track-badge {
	font-size: 0.72rem;
	font-weight: 700;
	padding: 0.1rem 0.4rem;
	border-radius: 4px;
	background: var(--bg-muted, #f1f5f9);
}

@media (max-width: 480px) {
	.track-selector__grid {
		grid-template-columns: 1fr 1fr;
	}

	.track-selector__card {
		padding: 0.75rem 0.5rem;
	}

	.track-selector__card-icon {
		font-size: 1.4rem;
	}

	.track-selector__actions {
		flex-direction: column;
	}
}
/* Mobile-First Responsive Fixes */

/* Ensure proper viewport behavior on mobile */
html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  scroll-behavior: smooth;
}

/* Prevent horizontal scroll on mobile */
body {
  overflow-x: hidden;
  width: 100%;
}

*, *::before, *::after {
  box-sizing: border-box;
}

/* Container padding for mobile */
@media (max-width: 767px) {
  /* Remove negative margins on mobile */
  .course-detail__layout,
  .page-header:has(.filter-group),
  .page-header:has(+ .quiz-layout),
  .dashboard-grid .page-header {
    margin-top: 0 !important;
  }
  
  /* Section spacing */
  .section {
    padding: 1.5rem 0;
  }
  
  /* Navbar improvements - Minimal and Seamless */
  .navbar {
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    z-index: 100;
    background: white;
    border-bottom: 1px solid #f3f4f6;
    box-shadow: none;
  }
  
  .navbar__inner {
    padding: 1rem 1rem;
    gap: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  
  .logo {
    font-size: 1rem;
    gap: 0.45rem;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: static;
    transform: none;
  }
  
  .logo__image {
    display: block;
    height: 28px;
    width: auto;
    flex-shrink: 0;
  }
  
  .logo__text {
    font-size: 0.9375rem;
    color: var(--text-800);
    font-weight: 700;
    letter-spacing: -0.02em;
  }
  
  /* Mobile Menu Toggle - Minimal */
  .mobile-menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    color: #111827;
    cursor: pointer;
    padding: 0;
    margin: 0;
    flex-shrink: 0;
    transition: opacity 0.2s ease;
  }
  
  .mobile-menu-toggle:active {
    opacity: 0.6;
  }
  
  /* Mobile Navigation Menu - Seamless Slide-in */
  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100vw;
    height: calc(var(--vvh, 1vh) * 100);
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    background: white;
    box-shadow: none;
    padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom) 0;
    display: flex;
    flex-direction: column;
    gap: 0;
    transition: right 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1001;
    overflow-y: auto;
  }

  /* Replace pseudo header spacer with a real header (includes a close button) */
  .nav-links::before {
    content: none;
    display: none;
  }

  .nav-links__header {
    height: var(--navbar-height);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f3f4f6;
    flex-shrink: 0;
    background: white;
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    z-index: 1;
  }

  .nav-links__close {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: #111827;
    cursor: pointer;
    padding: 0;
    border-radius: 10px;
  }

  .nav-links__close:active {
    background: #fafafa;
  }
  
  .nav-links--mobile-open {
    right: 0;
  }
  
  .nav-link {
    width: 100%;
    padding: clamp(1rem, 3.5vw, 1.125rem) clamp(1.15rem, 4.6vw, 1.5rem);
    font-size: clamp(0.98rem, 3.2vw, 1.05rem);
    font-weight: 500;
    color: #6b7280;
    border-radius: 0;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0;
    transition: all 0.15s ease;
    border: none;
    border-bottom: 1px solid #f3f4f6;
    background: white;
  }
  
  .nav-link:active {
    background: #fafafa;
  }
  
  .nav-link.active {
    background: rgba(10, 102, 194, 0.07);
    color: var(--primary-600);
    font-weight: 700;
    border-left: 3px solid var(--primary-500);
    padding-left: calc(1.5rem - 3px);
  }
  
  .nav-link--mobile-only {
    display: flex;
    margin-top: 0;
    padding-top: 1.125rem;
    border-top: 1px solid #f3f4f6;
  }
  
  .nav-link--mobile-only:first-of-type {
    margin-top: 1rem;
    border-top: 4px solid #f3f4f6;
  }
  
  .nav-link--button {
    background: white;
    border: none;
    border-bottom: 1px solid #f3f4f6;
    color: #6b7280;
    text-align: left;
    justify-content: flex-start;
    cursor: pointer;
    font-weight: 500;
  }
  
  .nav-link--button:active {
    background: #fafafa;
  }
  
  .nav-link--primary {
    font-weight: 700;
    color: var(--primary-600);
    background: rgba(10, 102, 194, 0.06);
  }
  
  .nav-link--primary:active {
    background: rgba(10, 102, 194, 0.12);
  }
  
  /* Backdrop overlay for mobile menu */
  .mobile-menu-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
  }
  
  .mobile-menu-backdrop--visible {
    opacity: 1;
    pointer-events: auto;
  }
  
  /* Hide desktop nav actions on mobile, only show avatar if logged in */
  .nav-actions {
    gap: 0.625rem;
    order: 2;
  }
  
  .nav-actions__dashboard,
  .nav-actions__signin,
  .nav-actions__signup {
    display: none;
  }
  
  .nav-actions .avatar {
    width: 40px;
    height: 40px;
    font-size: 0.875rem;
    border: 2px solid rgba(10, 102, 194, 0.2);
    box-shadow: 0 2px 6px rgba(10, 102, 194, 0.15);
  }
  
  .nav-actions .button {
    font-size: 0.875rem;
    padding: 0.625rem 1rem;
    white-space: nowrap;
  }

  /* Prevent iOS Safari auto-zoom on focus (needs >= 16px font-size) */
  .input-field,
  input,
  select,
  textarea,
  .exam-browser__select,
  .exam-browser__search,
  .exam-take__short-answer-input {
    font-size: clamp(16px, 4.2vw, 18px) !important;
  }
  
  /* Hero section */
  .hero {
    padding: 1.5rem 0 2rem;
  }
  
  .hero--full {
    min-height: auto;
    height: auto;
    padding: 1.5rem 0 2rem;
    margin-top: 0;
  }
  
  .section .hero--full {
    margin-top: 0;
  }
  
  .grid--hero {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding-top: 0;
  }
  
  .hero-visual {
    /* order: -1 removed – show headline/CTA first on mobile */
    margin-top: 0;
    padding-top: 0;
  }
  
  .hero-visual__image {
    max-height: 220px;
    object-fit: cover;
    border-radius: var(--radius-md);
    display: block;
  }
  
  .hero-visual__grid {
    display: none;
  }
  
  .hero-card {
    margin-top: 1.5rem;
  }
  
  .hero-card__metric {
    gap: 1rem;
  }
  
  .hero__badge {
    font-size: 0.75rem;
    padding: 0.375rem 0.75rem;
  }
  
  .hero__title {
    font-size: clamp(1.875rem, 7vw, 2.5rem);
    line-height: 1.15;
    margin-bottom: 1rem;
  }
  
  .hero__description {
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
  }
  
  .hero__actions {
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
    margin-bottom: 2rem;
  }
  
  .hero__actions .button {
    width: 100%;
    justify-content: center;
  }
  
  .hero-card {
    margin-bottom: 2rem;
  }
  
  .hero-card__header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  
  .hero-card__metric {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
  
  .hero-card__metric-item h4 {
    font-size: 1.5rem;
  }
  
  .hero-visual {
    margin-top: 2rem;
  }
  
  .hero-visual__image {
    max-height: 220px;
    border-radius: var(--radius-md);
  }
  
  .hero-visual__grid {
    display: none;
  }
  
  .hero-visual__row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
    padding: 1rem;
  }
  
  .hero-visual__row span {
    font-size: 0.9375rem;
  }
  
  .hero-visual__row small {
    font-size: 0.8125rem;
  }
  
  .grid--hero {
    grid-template-columns: 1fr;
    gap: 0;
  }
  
  /* Cards */
  .card {
    padding: 1.25rem;
  }
  
  .card__title {
    font-size: 1.125rem;
  }
  
  .course-card {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
  }
  
  .course-card__head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  
  .course-card__badge {
    font-size: 0.75rem;
  }
  
  .course-card__title {
    font-size: 1.25rem;
    line-height: 1.3;
    margin: 0;
  }
  
  .course-card__description {
    font-size: 0.9375rem;
    line-height: 1.6;
    margin: 0;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
  }
  
  .course-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    font-size: 0.875rem;
  }
  
  .course-meta__item {
    white-space: nowrap;
  }
  
  .course-card__footer {
    gap: 0.6rem;
    margin-top: 0.5rem;
  }
  
  .course-progress {
    width: 100%;
  }
  
  .course-card__actions {
    gap: 0.5rem;
  }
  
  .course-card__cta {
    padding: 0.7rem 0.9rem;
    font-size: 0.9375rem;
  }
  
  /* Grid layouts */
  .grid--courses {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .grid {
    gap: 1.5rem;
  }
  
  .grid--metrics {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .grid {
    gap: 1.5rem;
  }
  
  /* Quiz layout */
  .quiz-layout {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
  }
  
  .quiz-filters {
    width: 100%;
  }
  
  .quiz-panel {
    width: 100%;
  }
  
  .quiz-selectors {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
  }
  
  .quiz-selectors .form-group {
    width: 100%;
  }
  
  .quiz-selectors select,
  .quiz-selectors .input-field {
    width: 100%;
    font-size: 1rem;
  }
  
  .quiz-status {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  
  .quiz-placeholder {
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .quiz-placeholder__content {
    text-align: center;
    padding: 2rem 1rem;
  }
  
  .quiz-placeholder__icon {
    font-size: 3rem;
    margin-top: 1rem;
  }
  
  /* Modal fixes */
  .modal-overlay {
    padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom) 0;
    align-items: flex-end;
  }
  
  .modal {
    padding: 0.5rem;
  }
  
  .modal__content {
    max-width: 100%;
    max-height: calc(var(--vvh, 1vh) * 90);
    margin: 0;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }
  
  .auth-modal,
  .course-modal {
    width: 100vw !important;
    max-width: 100% !important;
    max-height: calc(var(--vvh, 1vh) * 92) !important;
    margin: 0 !important;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0 !important;
  }
  
  .course-modal__header {
    padding: 1.25rem 1rem !important;
    gap: 1rem !important;
  }
  
  .course-modal__badges {
    gap: 0.5rem;
  }
  
  .course-modal__title {
    font-size: 1.25rem !important;
    line-height: 1.3 !important;
  }
  
  .course-modal__instructor {
    font-size: 0.875rem !important;
  }
  
  .course-modal__close {
    width: 36px !important;
    height: 36px !important;
    font-size: 1.25rem !important;
  }
  
  .course-modal__body {
    padding: 1.25rem 1rem !important;
    gap: 1.5rem !important;
  }
  
  .course-modal__meta {
    grid-template-columns: 1fr !important;
    gap: 0.75rem !important;
  }
  
  .course-modal__meta-item {
    padding: 0.875rem 1rem !important;
  }
  
  .course-modal__meta-icon {
    width: 14px !important;
    height: 14px !important;
  }
  
  .course-modal__meta-label {
    font-size: 0.75rem !important;
  }
  
  .course-modal__meta-value {
    font-size: 1rem !important;
  }
  
  .course-modal__section-title {
    font-size: 1rem !important;
    margin-bottom: 0.75rem !important;
  }
  
  .course-modal__descriptor {
    font-size: 0.875rem !important;
    line-height: 1.5 !important;
  }
  
  .course-modal__syllabus {
    max-height: 300px !important;
    gap: 0.625rem !important;
  }
  
  .syllabus-item {
    padding: 0.875rem 1rem !important;
    flex-wrap: wrap;
  }
  
  .syllabus-item__left {
    gap: 0.75rem !important;
    flex: 1 !important;
    min-width: 0 !important;
  }
  
  .syllabus-item__index {
    width: 36px !important;
    height: 36px !important;
    font-size: 0.875rem !important;
  }
  
  .syllabus-item__title {
    font-size: 0.875rem !important;
  }
  
  .syllabus-item__subtitle {
    font-size: 0.75rem !important;
  }
  
  .syllabus-item__note {
    display: none;
  }
  
  .syllabus-item__chevron {
    font-size: 1.25rem !important;
  }
  
  .course-modal__footer {
    padding: 1rem !important;
    gap: 0.75rem !important;
    flex-direction: column !important;
  }
  
  .course-modal__footer .button {
    width: 100% !important;
    flex: none !important;
    min-width: 0 !important;
    justify-content: center;
  }
  
  .auth-modal__tabs {
    gap: 0.5rem;
    padding: 0 0.5rem;
  }
  
  .auth-modal__tab {
    font-size: 0.9375rem;
    padding: 0.75rem 1rem;
    flex: 1;
    text-align: center;
  }
  
  .course-modal__header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  
  .course-modal__body {
    padding: 1.25rem;
  }
  
  .course-modal__footer {
    flex-direction: column;
    gap: 0.75rem;
    padding: 1.25rem;
  }
  
  .course-modal__footer .button {
    width: 100%;
  }
  
  /* Form inputs */
  .form-input,
  .form-select,
  .form-textarea {
    font-size: 16px; /* Prevents iOS zoom on focus */
  }
  
  /* Buttons */
  .button--pill {
    padding: 0.625rem 1.25rem;
    font-size: 0.9375rem;
  }
  
  /* Page headers */
  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    padding-top: 0;
  }
  
  .page-header > div {
    width: 100%;
  }
  
  .page-header__eyebrow {
    font-size: 0.75rem;
    padding: 0.3rem 0.65rem;
  }
  
  .page-header h1,
  .page-header h2 {
    font-size: 1.5rem;
    line-height: 1.25;
    margin: 0.5rem 0;
  }
  
  .page-header p {
    font-size: 0.875rem;
    line-height: 1.5;
    margin-top: 0.25rem;
  }
  
  .page-header__actions {
    width: 100%;
    flex-direction: column;
    gap: 1rem;
    margin-top: 0.5rem;
  }
  
  .page-header__actions .button {
    width: 100%;
    justify-content: center;
    font-size: 0.9375rem;
  }
  
  .filter-group {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 0.5rem;
    width: 100%;
    padding: 0.3rem;
  }
  
  .filter-group::-webkit-scrollbar {
    display: none;
  }
  
  .filter-pill {
    padding: 0.5rem 0.85rem;
    font-size: 0.8125rem;
    white-space: nowrap;
    flex-shrink: 0;
    border: 1.5px solid rgba(10, 102, 194, 0.2);
  }
  
  .filter-pill--active {
    border-color: var(--primary);
    font-weight: 600;
  }
  
  /* Course detail */
  .course-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
  }
  
  .course-detail__layout {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 0 !important;
  }
  
  .course-detail__column {
    width: 100%;
    max-width: 100%;
    order: 1;
  }
  
  .course-detail__sidebar {
    width: 100%;
    order: 2;
    position: static !important;
    max-height: none;
    top: auto !important;
    right: auto !important;
  }
  
  .lesson-sidebar,
  .sidebar {
    position: static !important;
    width: 100%;
    height: auto;
    max-height: none;
    border-radius: var(--radius-md);
    padding: 1rem;
  }
  
  .lesson-sidebar__heading {
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
  }

  /* Keep sidebar header compact on mobile — hide progress bar and description */
  .lesson-sidebar__progress {
    display: none;
  }
  
  .lesson-sidebar__description {
    font-size: 0.875rem;
    margin-bottom: 1rem;
  }
  
  .lesson-sidebar__close {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    background: rgba(10, 102, 194, 0.1);
    color: var(--primary-600);
    font-size: 1.125rem;
    font-weight: 400;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1;
  }
  
  .lesson-sidebar__close:active {
    background: rgba(10, 102, 194, 0.2);
    transform: scale(0.95);
  }
  
  /* Empty state styling */
  .lesson-list__empty {
    padding: 2rem 1rem;
    text-align: center;
    color: var(--text-500);
    font-size: 0.875rem;
    line-height: 1.5;
  }
  
  .lesson-card {
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: var(--radius-md);
  }
  
  .lesson-card__header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1rem;
  }
  
  .lesson-card__header-content {
    width: 100%;
  }
  
  .lesson-card__title {
    font-size: 1.25rem;
    line-height: 1.3;
    margin: 0;
    cursor: pointer;
  }

  /* Tap-to-open hint: show a subtle chevron after the title on mobile */
  .lesson-card__title::after {
    content: ' ›';
    color: var(--text-500);
    font-size: 1rem;
    font-weight: 400;
    vertical-align: middle;
    margin-left: 0.15rem;
  }
  
  /* Hide progress badges on mobile for cleaner header */
  .lesson-card__progress-badges--desktop {
    display: none !important;
  }
  
  /* Show sidebar toggle button only on mobile */
  .lesson-card__sidebar-toggle {
    width: 100%;
    justify-content: center;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    border: 1.5px solid rgba(10, 102, 194, 0.3);
    margin-top: 0.5rem;
  }
  
  .lesson-card__media {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    border-radius: var(--radius-md);
    overflow: hidden;
    margin: 0 0 1rem 0;
    background: #000;
  }
  
  .lesson-card__media iframe,
  .lesson-card__media > div {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    border: none;
  }
  
  .lesson-card__media--quiz {
    position: static;
    padding-bottom: 0;
    min-height: 350px;
    background: transparent;
  }
  
  .lesson-card__quizwrap {
    width: 100%;
  }
  
  .lesson-card__description {
    font-size: 0.9375rem;
    line-height: 1.6;
    margin: 0 0 1rem 0;
  }
  
  .lesson-card__nav {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1.25rem;
    padding: 0;
    background: transparent;
    border-radius: 0;
    border: none;
    box-shadow: none;
  }
  
  .lesson-card__nav-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.625rem;
  }
  
  /* Navigation buttons (Prev/Next) - Top section */
  .lesson-card__nav-group--navigation {
    order: 1;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #f1f5f9;
  }
  
  .lesson-card__nav-group--navigation .button {
    flex: 1;
    min-width: 0;
    justify-content: center;
    font-size: 0.9375rem;
    font-weight: 700;
    padding: 0.875rem 1rem;
    min-height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(10, 102, 194, 0.08) 0%, rgba(10, 102, 194, 0.04) 100%);
    border: 1.5px solid rgba(10, 102, 194, 0.2);
    color: var(--primary-600);
    transition: all 0.2s ease;
  }

  /* Under-video nav/actions: flat (no boxed background) */
  .lesson-card__nav .lesson-card__nav-flat {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
  }

  .lesson-card__nav .lesson-card__nav-flat:active:not(:disabled) {
    background: transparent !important;
    transform: none;
    box-shadow: none !important;
  }

  .lesson-card__nav .lesson-card__nav-flat.button--primary {
    color: var(--primary-600);
  }
  
  .lesson-card__nav-group--navigation .button:active:not(:disabled) {
    background: var(--primary-600);
    color: white;
    transform: scale(0.98);
  }
  
  .lesson-card__nav-group--navigation .button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    background: #f8fafc;
    border-color: #e2e8f0;
    color: #94a3b8;
  }
  
  /* Action buttons - Bottom section */
  .lesson-card__nav-group--actions {
    order: 2;
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    padding-top: 0.75rem;
  }
  
  .lesson-card__nav-group--actions .button {
    width: 100%;
    justify-content: center;
    font-size: 0.9375rem;
    font-weight: 700;
    padding: 0.875rem 1rem;
    min-height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 0.625rem;
    transition: all 0.2s ease;
  }
  
  .lesson-card__nav-group--actions .button-icon {
    font-size: 1.25rem;
    line-height: 1;
  }
  
  .lesson-card__nav-group--actions .button-text {
    font-size: 0.9375rem;
    font-weight: 700;
  }
  
  .lesson-card__nav-group--actions .button--success {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: white;
    border: none;
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.2);
  }
  
  .lesson-card__nav-group--actions .button--success:disabled {
    opacity: 0.7;
    background: #94a3b8;
    box-shadow: none;
  }
  
  .lesson-card__nav-group--actions .button--primary {
    box-shadow: 0 2px 8px rgba(10, 102, 194, 0.25);
  }
  
  .lesson-card__nav-group--actions .button--primary:active {
    transform: scale(0.98);
    box-shadow: 0 1px 4px rgba(10, 102, 194, 0.3);
  }
  
  .lesson-card__nav-group--actions .button--ghost {
    background: white;
    border: 1.5px solid #e2e8f0;
    color: #334155;
  }
  
  .lesson-card__nav-group--actions .button--ghost:active {
    background: #f8fafc;
    transform: scale(0.98);
  }
  
  /* Show only icons on very small screens */
  @media (max-width: 360px) {
    /* Keep text visible for the under-video controls (icons removed) */
    .lesson-card__nav .lesson-card__nav-flat .button-text {
      display: inline;
    }
  }
  
  .lesson-card__actions {
    flex-direction: column;
    gap: 0.75rem;
  }
  
  .lesson-card__actions .button {
    width: 100%;
    justify-content: center;
  }
  
  /* Collapsible Comments Section */
  .lesson-card--comments {
    padding: 0;
    margin-bottom: 1rem;
    overflow: hidden;
  }
  
  .lesson-card__comments-toggle {
    width: 100%;
    padding: 1rem;
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: background 0.2s ease;
    font-family: inherit;
  }
  
  .lesson-card__comments-toggle:active {
    background: rgba(10, 102, 194, 0.05);
  }
  
  .lesson-card__comments-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-800);
  }
  
  .lesson-card__comments-chevron {
    font-size: 0.75rem;
    color: var(--text-500);
  }
  
  .lesson-card__comments-content {
    display: none;
    padding: 0 1rem 1rem;
  }

  .lesson-card--comments-open .lesson-card__comments-content {
    display: block;
    animation: slideDown 0.3s ease;
  }
  
  @keyframes slideDown {
    from {
      opacity: 0;
      transform: translateY(-10px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
  
  /* Mobile Sidebar Styles - Minimal and Seamless */
  .lesson-sidebar {
    position: fixed !important;
    top: 0;
    left: -100%;
    width: 100vw !important;
    max-width: 100vw !important;
    height: calc(var(--vvh, 1vh) * 100) !important;
    max-height: calc(var(--vvh, 1vh) * 100) !important;
    z-index: 1000;
    background: #ffffff;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0 !important;
    -webkit-overflow-scrolling: touch;
  }
  
  .lesson-sidebar--visible {
    left: 0 !important;
  }
  
  /* Sidebar overlay backdrop */
  .lesson-sidebar--visible::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: -1;
    animation: fadeIn 0.3s ease;
  }
  
  @keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
  }
  
  .lesson-sidebar__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1rem 0.875rem;
    padding-top: calc(1rem + var(--navbar-height) + env(safe-area-inset-top)); /* Account for navbar height */
    border-bottom: 1px solid rgba(10, 102, 194, 0.12);
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    background: var(--surface);
    z-index: 10;
  }
  
  .lesson-sidebar__header > div {
    flex: 1;
    min-width: 0;
  }
  
  .lesson-sidebar__heading {
    font-size: 1.125rem !important;
    margin: 0 !important;
    font-weight: 700;
    line-height: 1.4;
    color: var(--text-900);
  }
  
  .lesson-sidebar__description {
    display: none !important;
  }
  
  .lesson-sidebar__close {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: 1px solid rgba(10, 102, 194, 0.18);
    background: var(--surface);
    color: var(--text-600);
    font-size: 1.25rem;
    font-weight: 400;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1;
  }
  
  .lesson-sidebar__close:active {
    background: rgba(10, 102, 194, 0.06);
    border-color: rgba(10, 102, 194, 0.28);
  }
  
  .lesson-list {
    padding: 0;
    margin: 0;
    background: var(--surface);
  }
  
  .lesson-list__group {
    margin-bottom: 0;
    background: var(--surface);
    border-bottom: 1px solid rgba(10, 102, 194, 0.08);
  }
  
  /* Chapter/Module - Simple List Item */
  .lesson-list__item {
    padding: 0.875rem 1rem;
    font-size: 0.9375rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    width: 100%;
    border: none;
    background: transparent;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s ease;
    min-height: 52px;
  }
  
  .lesson-list__item:active {
    background: rgba(10, 102, 194, 0.06);
  }
  
  .lesson-list__item--active {
    background: transparent;
  }
  
  .lesson-list__index {
    font-size: 0.75rem;
    font-weight: 600;
    min-width: 22px;
    width: 22px;
    height: 22px;
    border-radius: 6px;
    background: transparent;
    color: var(--text-500);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 0.125rem;
  }
  
  .lesson-list__item--active .lesson-list__index {
    background: transparent;
    color: var(--primary-600);
  }
  
  .lesson-list__item--completed .lesson-list__index {
    color: var(--success-500);
  }
  
  .lesson-list__meta {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    min-width: 0;
    overflow: hidden;
  }

  .lesson-list__subtitle {
    font-size: 12px;
    line-height: 1.2;
    color: var(--text-500);
  }
  
  .lesson-list__title {
    font-size: 0.9375rem;
    line-height: 1.4;
    font-weight: 600;
    color: var(--text-900);
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    line-clamp: 2;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }
  
  .lesson-list__item--active .lesson-list__title {
    color: var(--primary-600);
    font-weight: 600;
  }

  .lesson-list__item--module.lesson-list__item--active .lesson-list__title {
    font-weight: 700;
  }
  
  .lesson-list__duration {
    display: none;
  }

  .lesson-list__type-icon {
    display: none;
  }
  
  .lesson-list__chevron {
    font-size: 1rem;
    color: var(--text-400);
    flex-shrink: 0;
    transition: transform 0.2s ease;
    margin-top: 0.375rem;
  }

  /* Chevron is removed from markup, but keep hidden as a safeguard */
  .lesson-list__chevron {
    display: none;
  }
  
  .is-expanded .lesson-list__chevron {
    transform: rotate(90deg);
  }
  
  /* Subchapter/Lesson - Nested Items */
  .lesson-list__children {
    padding: 0;
    margin: 0;
    background: transparent;
    animation: expandChildren 0.2s ease-out;
    overflow: hidden;
  }
  
  @keyframes expandChildren {
    from {
      opacity: 0;
      max-height: 0;
    }
    to {
      opacity: 1;
      max-height: 2000px;
    }
  }
  
  .lesson-list__children .lesson-list__item--lesson {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    min-height: 48px;
    background: transparent;
    border-bottom: none;
    align-items: flex-start;
  }
  
  .lesson-list__children .lesson-list__item--lesson:last-child {
    border-bottom: none;
  }
  
  .lesson-list__children .lesson-list__item--lesson:active {
    background: rgba(10, 102, 194, 0.06);
  }
  
  .lesson-list__children .lesson-list__item--active {
    background: transparent;
  }
  
  .lesson-list__children .lesson-list__index {
    width: 20px;
    height: 20px;
    font-size: 0.75rem;
    margin-top: 0.125rem;
  }
  
  .lesson-list__children .lesson-list__meta {
    overflow: hidden;
  }
  
  .lesson-list__children .lesson-list__title {
    font-size: 0.8125rem;
    font-weight: 500;
    line-height: 1.35;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    line-clamp: 2;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }
  
  .lesson-list__children .lesson-list__duration {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  /* Hide chip completely on mobile for cleaner look */
  .lesson-list__item .chip {
    display: none;
  }
  
  /* Empty state styling */
  .lesson-list__empty {
    padding: 3rem 1.5rem;
    text-align: center;
    color: var(--text-500);
    font-size: 0.875rem;
    line-height: 1.6;
  }
  
  /* Dashboard */
  .dashboard-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .grid--metrics {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .metric-card {
    padding: 1.25rem;
    text-align: center;
  }
  
  .metric-card__value {
    font-size: 2rem;
  }
  
  .metric-card__caption {
    font-size: 0.875rem;
    margin-top: 0.5rem;
  }
  
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }
  
  .stat-card {
    padding: 1rem;
  }
  
  .stat-card__value {
    font-size: 1.75rem;
  }
  
  .stat-card__label {
    font-size: 0.8125rem;
  }
  
  .dashboard-section {
    width: 100%;
  }
  
  .dashboard-section__header {
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
  }
  
  .dashboard-section__header .button {
    width: 100%;
  }
  
  .progress-dashboard {
    padding: 1.25rem;
  }
  
  .progress-dashboard__section {
    margin-bottom: 1.5rem;
  }
  
  .progress-dashboard__section h3 {
    font-size: 1.125rem;
    margin-bottom: 1rem;
  }
  
  .badge-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }
  
  .badge-item {
    padding: 0.875rem;
    text-align: center;
  }
  
  .badge-item__icon {
    font-size: 1.5rem;
  }
  
  .badge-item__name {
    font-size: 0.8125rem;
  }
  
  .course-progress-list {
    gap: 0.75rem;
  }
  
  .course-progress-item {
    padding: 1rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
  
  .course-progress-item__stats {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  
  /* Flashcards */
  .flashcard-deck {
    padding: 1rem;
  }
  
  .flashcard-deck__header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
  }
  
  .flashcard-deck__header h3 {
    font-size: 1.25rem;
  }
  
  .flashcard-deck__actions {
    width: 100%;
    display: flex;
    gap: 0.5rem;
  }
  
  .flashcard-deck__actions .button {
    flex: 1;
  }
  
  .flashcard {
    min-height: 320px;
  }
  
  .flashcard__content {
    font-size: 1rem;
    line-height: 1.6;
  }
  
  .flashcard-controls {
    flex-direction: column;
    gap: 1rem;
  }
  
  .flashcard-controls__rating {
    width: 100%;
    display: flex;
    gap: 0.75rem;
  }
  
  .flashcard-controls__rating .button {
    flex: 1;
  }
  
  .flashcard-deck__actions {
    width: 100%;
    justify-content: space-between;
  }
  
  .flashcard {
    min-height: 300px;
    height: auto;
    max-height: 400px;
  }
  
  .flashcard__content {
    font-size: 1.125rem;
    padding: 1rem;
    line-height: 1.6;
  }
  
  .flashcard__hint,
  .flashcard__explanation {
    font-size: 0.875rem;
    padding: 0.75rem;
  }
  
  .flashcard-controls {
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.5rem;
  }
  
  .flashcard-controls > .button {
    flex: 1;
    min-width: 100px;
  }
  
  .flashcard-controls__rating {
    width: 100%;
    order: -1;
    justify-content: center;
    gap: 0.75rem;
  }
  
  .flashcard-controls__rating .button {
    flex: 1;
  }
  
  /* Notification Center */
  .notification-center {
    padding: 1rem;
  }
  
  .notification-center__tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 0.5rem;
    padding-bottom: 0.5rem;
  }
  
  .notification-center__tab {
    white-space: nowrap;
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
  }
  
  .notification-item,
  .reminder-item {
    padding: 1rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
  
  .notification-item__content,
  .reminder-item__content {
    width: 100%;
  }
  
  .notification-item__actions,
  .reminder-item__actions {
    width: 100%;
    justify-content: flex-end;
  }
  
  /* Tables */
  .table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -1rem;
    padding: 0 1rem;
  }
  
  .table {
    min-width: 600px;
  }
  
  .table th,
  .table td {
    padding: 0.75rem;
    font-size: 0.875rem;
  }
  
  /* Footer */
  .footer {
    padding: 2rem 0 1.5rem;
  }
  
  .footer__top {
    gap: 1.5rem;
  }
  
  .footer__social {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  
  .footer__bottom {
    flex-direction: column;
    gap: 0.75rem;
    text-align: center;
  }
  
  .footer__grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .footer__section h4 {
    font-size: 0.9375rem;
    margin-bottom: 0.75rem;
  }
  
  .footer__links {
    gap: 0.5rem;
  }
  
  .footer__link {
    font-size: 0.875rem;
  }
  
  .course-header {
    padding: 1.5rem 0;
  }
  
  .course-header__title {
    font-size: 1.75rem;
  }
  
  .course-header__meta {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  
  .course-header__actions {
    width: 100%;
    margin-top: 1rem;
  }
  
  .course-header__actions .button {
    width: 100%;
    justify-content: center;
  }
  
  /* Video player container */
  .video-container {
    aspect-ratio: 16/9;
    width: 100%;
  }
  
  /* Comments section */
  .comments-section {
    padding: 1rem;
  }
  
  /* Dashboard stats */
  .stats-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .metric-card {
    padding: 1.25rem;
  }
  
  .metric-card h3 {
    font-size: 1.875rem;
  }
  
  /* Progress bars */
  .progress-list {
    gap: 1rem;
  }
  
  /* Admin page table */
  .table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -1rem;
    padding: 0 1rem;
  }
  
  table {
    min-width: 800px;
    font-size: 0.875rem;
  }
  
  table th,
  table td {
    padding: 0.75rem 0.5rem;
  }
  
  /* Dropdown menu positioning */
  .dropdown__menu {
    right: 0;
    left: auto;
    min-width: 200px;
    max-width: 280px;
  }
  
  .dropdown__item {
    padding: 0.75rem 1rem;
    font-size: 0.9375rem;
  }
  
  /* Badge sizing */
  .badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.625rem;
  }
  
  /* Chips */
  .chip {
    font-size: 0.8125rem;
    padding: 0.4375rem 0.875rem;
  }
  
  /* Sections */
  .section {
    padding: 2rem 0;
  }
  
  /* Video player container */
  .video-container {
    aspect-ratio: 16/9;
    width: 100%;
    border-radius: var(--radius-md);
    overflow: hidden;
  }
  
  .video-container iframe {
    width: 100%;
    height: 100%;
  }
  
  /* Comments section */
  .comments-section {
    padding: 1.25rem;
  }
  
  /* Course modules accordion */
  .module {
    margin-bottom: 0.75rem;
  }
  
  .module__header {
    padding: 1rem;
  }
  
  .module__title {
    font-size: 1rem;
  }
  
  .lesson {
    padding: 1rem;
  }
  
  .lesson__title {
    font-size: 0.9375rem;
  }
  
  /* Form improvements */
  .form-group {
    margin-bottom: 1.25rem;
  }
  
  .form-label {
    font-size: 0.9375rem;
    margin-bottom: 0.5rem;
  }
  
  .form-input,
  .form-select,
  .form-textarea,
  .input-field {
    font-size: 1rem; /* Prevents iOS zoom on focus */
    padding: 0.75rem 1rem;
  }
  
  .form-message {
    font-size: 0.875rem;
  }
}

/* Tablet landscape (768px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
  .container {
    padding-left: 2rem;
    padding-right: 2rem;
  }
  
  .grid--courses {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .grid--metrics {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .course-detail__layout {
    grid-template-columns: 1fr;
  }
  
  .course-detail__column {
    max-width: 100%;
  }
  
  .course-detail__sidebar {
    position: static;
    width: 100%;
    max-width: 100%;
  }
  
  .filter-group {
    flex-wrap: nowrap;
  }
}

/* Touch device improvements */
@media (hover: none) and (pointer: coarse) {
  .button,
  .filter-pill,
  .lesson-list__item,
  .module__header {
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  .lesson-list__item {
    height: auto;
  }
  
  /* Larger tap targets */
  a, button, input, select, textarea {
    min-height: 44px;
  }
}

/* Small phones (< 375px) */
@media (max-width: 374px) {
  .container {
    padding-left: 0.875rem;
    padding-right: 0.875rem;
  }
  
  .hero__title {
    font-size: 1.625rem;
  }
  
  .hero__description {
    font-size: 0.9375rem;
  }
  
  .nav-actions .button {
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
  }
  
  .filter-pill {
    font-size: 0.8125rem;
    padding: 0.5rem 0.75rem;
  }
  
  .metric-card__value {
    font-size: 1.75rem;
  }
  
  .card,
  .course-card {
    padding: 1rem;
  }
  
  .page-header h1,
  .page-header h2 {
    font-size: 1.5rem;
  }
}

/* Medium phones and phablets (375px - 480px) */
@media (min-width: 375px) and (max-width: 480px) {
  .hero-card__metric {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Tablets portrait (481px - 768px) */
@media (min-width: 481px) and (max-width: 767px) {
  .grid--courses {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  }
  
  .hero-card__metric {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .quiz-selectors {
    flex-direction: row;
    flex-wrap: wrap;
  }
  
  .quiz-selectors .form-group {
    flex: 1 1 45%;
    min-width: 200px;
  }
}

/* Landscape orientation on mobile */
@media (max-height: 500px) and (orientation: landscape) {
  .hero {
    padding: 1.5rem 0;
  }
  
  .hero--full {
    min-height: auto;
    padding: 1.5rem 0;
  }
  
  .modal-overlay {
    align-items: flex-start;
    padding: 0.5rem;
  }
  
  .modal,
  .auth-modal,
  .course-modal {
    max-height: calc(var(--vvh, 1vh) * 95);
  }
  
  .modal__content {
    max-height: calc(var(--vvh, 1vh) * 95);
  }
  
  .navbar {
    position: -webkit-sticky;
    position: sticky;
  }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
  /* Increase touch targets */
  .button,
  .nav-link,
  .course-card__cta,
  .dropdown__item,
  .lesson,
  .module__header {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }

  /* Icon / close buttons need width too */
  .course-modal__close,
  .auth-modal__close,
  .modal__close,
  .ka-justify__close,
  .exam-take__passage-panel-close {
    min-width: 44px;
    min-height: 44px;
  }

  /* Exam take question nav buttons aren't .button */
  .exam-take__nav-btn {
    min-height: 44px;
    padding: 6px 4px;
  }
  
  /* Better tap feedback */
  .button,
  .card,
  .course-card,
  .chip,
  .badge {
    -webkit-tap-highlight-color: rgba(10, 102, 194, 0.1);
  }
  
  /* Improve scroll performance */
  .modal-overlay,
  .table-wrapper {
    -webkit-overflow-scrolling: touch;
  }
  
  /* Prevent text selection on interactive elements */
  .button,
  .nav-link,
  .dropdown__item {
    -webkit-user-select: none;
    user-select: none;
  }
}

@media (max-width: 767px) {
  /* Admin edit modal */
  .modal__content {
    max-width: 100% !important;
    width: 100vw !important;
    max-height: calc(var(--vvh, 1vh) * 95) !important;
    margin: 0 !important;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0 !important;
  }
  
  .modal__header {
    padding: 1rem !important;
  }
  
  .modal__title {
    font-size: 1.125rem !important;
  }
  
  .modal__body {
    padding: 1rem !important;
  }
  
  .modal__body > div {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }
  
  .modal__footer {
    padding: 1rem !important;
    flex-direction: column-reverse !important;
  }
  
  .modal__footer .button {
    width: 100%;
    justify-content: center;
  }
  
  .form-field {
    grid-column: 1 / -1 !important;
  }
  
  .form-input,
  .form-field textarea {
    font-size: 16px !important; /* Prevents iOS zoom */
  }
}

/* Dark mode adjustments for mobile */
@media (max-width: 767px) and (prefers-color-scheme: dark) {
  .navbar {
    background: rgba(15, 23, 42, 0.95);
    -webkit-backdrop-filter: blur(8px);
            backdrop-filter: blur(8px);
  }

  .logo,
  .logo__text {
    color: rgba(255, 255, 255, 0.95);
  }

  .logo__image {
    /* Use the existing blue logo asset, but render it white on dark */
    filter: brightness(0) invert(1);
  }

  .mobile-menu-toggle {
    color: rgba(255, 255, 255, 0.95);
  }
  
  .modal,
  .modal__content {
    background: var(--surface);
  }
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  html {
    scroll-behavior: auto;
  }
}

