/* WP Exam Engine — public/frontend styles.
   Everything namespaced under .wpee- so it never fights the active
   theme (Section 62/63). Mobile-first: base rules are single-column,
   the sidebar layouts only kick in at wider viewports.

   Appearance is driven by CSS custom properties written from the
   plugin's Settings screen (see WPEE_Plugin::get_appearance_css). The
   fallbacks below mean the stylesheet still renders correctly if those
   properties are ever absent. */

:root {
	--wpee-container-width: 1200px;
	--wpee-radius: 8px;
	--wpee-font-scale: 1;
	--wpee-primary: #2952e3;
	--wpee-secondary: #0f172a;
}

.wpee-wrap-public {
	max-width: var(--wpee-container-width, 1200px);
	margin: 0 auto;
	padding: 24px 16px 48px;
	font-size: calc(1rem * var(--wpee-font-scale, 1));
}

.wpee-page-title {
	font-size: 1.75rem;
	margin: 0 0 8px;
}

.wpee-page-description {
	color: #555;
	margin-bottom: 20px;
}

.wpee-empty-state {
	color: #666;
	padding: 24px 0;
}

/* Breadcrumb */

.wpee-breadcrumb {
	font-size: 0.85rem;
	color: #666;
	margin-bottom: 12px;
}

.wpee-breadcrumb a {
	color: var(--wpee-primary, #2952e3);
	text-decoration: none;
}

.wpee-breadcrumb a:hover {
	text-decoration: underline;
}

.wpee-breadcrumb-sep {
	margin: 0 4px;
	color: #999;
}

/* Card grid (exam index, archive listings) */

.wpee-group-heading {
	font-size: 0.8rem;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: #888;
	margin: 28px 0 10px;
}

.wpee-card-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 12px;
	margin-bottom: 8px;
}

@media (min-width: 640px) {
	.wpee-card-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 960px) {
	.wpee-card-grid { grid-template-columns: repeat(4, 1fr); }
}

.wpee-card {
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding: 16px 18px;
	border: 1px solid #e2e2e2;
	border-radius: var(--wpee-radius, 8px);
	background: #fff;
	text-decoration: none;
	color: inherit;
	transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.wpee-card:hover {
	border-color: var(--wpee-primary, #2952e3);
	box-shadow: 0 2px 10px rgba(41, 82, 227, 0.12);
}

.wpee-card-title {
	font-weight: 600;
	font-size: 1rem;
	color: #1a1a1a;
}

.wpee-card-meta {
	font-size: 0.8rem;
	color: #777;
}

/* Two/three column layouts (chapter summary, question feed) */

.wpee-with-sidebar {
	display: flex;
	flex-direction: column;
	gap: 24px;
}

@media (min-width: 900px) {
	.wpee-with-sidebar {
		flex-direction: row;
		align-items: flex-start;
	}
	.wpee-with-sidebar .wpee-sibling-sidebar {
		flex: 0 0 220px;
		position: sticky;
		top: 24px;
	}
	.wpee-with-sidebar .wpee-main-content {
		flex: 1 1 auto;
		min-width: 0;
	}
	.wpee-with-right-sidebar .wpee-papers-sidebar {
		flex: 0 0 200px;
		position: sticky;
		top: 24px;
	}
}

.wpee-sidebar-title {
	font-size: 0.9rem;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: #888;
	margin: 0 0 10px;
}

.wpee-sibling-list,
.wpee-year-filter-list,
.wpee-year-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.wpee-sibling-list li,
.wpee-year-filter-list li {
	border-bottom: 1px solid #f0f0f0;
}

.wpee-sibling-list a,
.wpee-year-filter-list a {
	display: flex;
	justify-content: space-between;
	padding: 8px 4px;
	text-decoration: none;
	color: #333;
	font-size: 0.9rem;
}

.wpee-sibling-current > a,
.wpee-year-active > a {
	color: var(--wpee-primary, #2952e3);
	font-weight: 600;
}

.wpee-year-count {
	color: #999;
	font-size: 0.8rem;
}

/* Stat bar (chapter/topic summary page) */

.wpee-stat-bar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 16px;
	margin: 16px 0 24px;
	padding: 16px;
	border: 1px solid #e2e2e2;
	border-radius: var(--wpee-radius, 8px);
	background: #fafafa;
}

.wpee-stat-pill {
	display: flex;
	flex-direction: column;
}

.wpee-stat-pill strong {
	font-size: 1.2rem;
}

.wpee-stat-pill span {
	font-size: 0.75rem;
	color: #777;
	text-transform: uppercase;
}

.wpee-start-practice {
	margin-left: auto;
}

.wpee-pyq-stats {
	border: 1px solid #e2e2e2;
	border-radius: var(--wpee-radius, 8px);
	padding: 12px 16px;
}

.wpee-pyq-stats summary {
	cursor: pointer;
	font-weight: 600;
}

.wpee-year-list li a {
	padding: 6px 0;
}

/* Question cards (feed + single) */

.wpee-question-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 20px;
}

.wpee-question-card {
	border: 1px solid #e2e2e2;
	border-radius: var(--wpee-radius, 8px);
	padding: 18px 20px;
	background: #fff;
}

.wpee-question-meta {
	display: flex;
	gap: 8px;
	align-items: center;
	margin-bottom: 8px;
	font-size: 0.8rem;
}

.wpee-question-year {
	background: var(--wpee-primary, #2952e3);
	color: #fff;
	padding: 2px 8px;
	border-radius: 3px;
	font-weight: 600;
}

.wpee-question-difficulty {
	background: #f0f0f0;
	color: #555;
	padding: 2px 8px;
	border-radius: 3px;
}

.wpee-question-permalink {
	margin-left: auto;
	color: #aaa;
	text-decoration: none;
}

.wpee-question-text {
	margin-bottom: 14px;
	line-height: 1.6;
}

.wpee-question-image img {
	max-width: 100%;
	height: auto;
	margin-bottom: 14px;
}

.wpee-option-list {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin-bottom: 14px;
}

.wpee-option {
	display: flex;
	gap: 10px;
	padding: 8px 12px;
	border: 1px solid #e8e8e8;
	border-radius: 6px;
}

.wpee-option-label {
	font-weight: 700;
	color: #555;
}

.wpee-question-card.wpee-revealed .wpee-option-correct {
	border-color: #16a765;
	background: #f0fbf4;
}

.wpee-button {
	display: inline-block;
	padding: 8px 16px;
	border-radius: 6px;
	border: 1px solid var(--wpee-primary, #2952e3);
	color: var(--wpee-primary, #2952e3);
	background: #fff;
	text-decoration: none;
	font-size: 0.9rem;
	cursor: pointer;
}

.wpee-button:hover {
	background: #eef1fd;
}

.wpee-button-primary {
	background: var(--wpee-primary, #2952e3);
	color: #fff;
}

.wpee-button-primary:hover {
	background: #1e3fb8;
}

.wpee-answer-panel {
	margin-top: 14px;
	padding-top: 14px;
	border-top: 1px dashed #ddd;
}

.wpee-answer-panel h2 {
	font-size: 0.9rem;
	text-transform: uppercase;
	color: #777;
	margin: 12px 0 4px;
}

.wpee-question-pager {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	justify-content: space-between;
	margin-top: 24px;
}

/* ===============================================================
   PRACTICE ENGINE
   =============================================================== */

/* --- Setup screen --- */

.wpee-setup-form {
	max-width: 560px;
	background: #fff;
	border: 1px solid #e2e2e2;
	border-radius: var(--wpee-radius, 8px);
	padding: 24px;
}

.wpee-setup-field {
	margin-bottom: 20px;
}

.wpee-setup-field > label {
	display: block;
	font-weight: 600;
	margin-bottom: 8px;
}

.wpee-setup-field select {
	width: 100%;
	padding: 9px 12px;
	border: 1px solid #ccc;
	border-radius: 6px;
	background: #fff;
	font-size: 0.95rem;
}

.wpee-choice-row {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.wpee-choice input {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
}

.wpee-choice span {
	display: inline-block;
	padding: 9px 18px;
	border: 1px solid #ccc;
	border-radius: 6px;
	cursor: pointer;
	background: #fff;
	min-width: 44px;      /* comfortable touch target (Section 35) */
	text-align: center;
}

.wpee-choice input:checked + span {
	background: var(--wpee-primary, #2952e3);
	border-color: var(--wpee-primary, #2952e3);
	color: #fff;
	font-weight: 600;
}

/* Visible keyboard focus (Section 49). */
.wpee-choice input:focus-visible + span,
.wpee-palette-btn:focus-visible,
.wpee-button:focus-visible {
	outline: 3px solid #94a9f0;
	outline-offset: 2px;
}

.wpee-button-lg {
	padding: 12px 28px;
	font-size: 1rem;
}

.wpee-inline-error {
	color: #b32d2e;
	background: #fdf0f0;
	border-left: 4px solid #b32d2e;
	padding: 10px 14px;
	margin-top: 12px;
}

/* --- Runtime --- */

.wpee-runtime-header {
	display: flex;
	align-items: center;
	gap: 16px;
	flex-wrap: wrap;
	padding: 12px 16px;
	background: #fff;
	border: 1px solid #e2e2e2;
	border-radius: var(--wpee-radius, 8px);
	margin-bottom: 16px;
	position: sticky;
	top: 0;
	z-index: 20;
}

.wpee-runtime-progress {
	font-size: 0.95rem;
}

.wpee-timer {
	font-variant-numeric: tabular-nums;
	font-weight: 700;
	font-size: 1.1rem;
	padding: 4px 12px;
	border-radius: 6px;
	background: #f0f0f1;
}

.wpee-timer-warning {
	background: #fdecea;
	color: #b32d2e;
}

.wpee-runtime-header #wpee-submit-btn {
	margin-left: auto;
}

.wpee-button-danger {
	border-color: #b32d2e;
	color: #b32d2e;
}

.wpee-button-danger:hover {
	background: #b32d2e;
	color: #fff;
}

.wpee-runtime-body {
	display: flex;
	flex-direction: column;
	gap: 20px;
}

@media (min-width: 900px) {
	.wpee-runtime-body {
		flex-direction: row;
		align-items: flex-start;
	}
	.wpee-runtime-main { flex: 1 1 auto; min-width: 0; }
	.wpee-runtime-palette {
		flex: 0 0 220px;
		position: sticky;
		top: 80px;
	}
}

.wpee-option-selectable {
	cursor: pointer;
	align-items: center;
}

.wpee-option-selectable input[type="radio"] {
	margin-right: 4px;
}

.wpee-option-selected {
	border-color: var(--wpee-primary, #2952e3);
	background: #eef1fd;
}

.wpee-runtime-controls {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 16px;
}

.wpee-runtime-controls #wpee-next-btn {
	margin-left: auto;
}

.wpee-loading {
	padding: 32px 0;
	color: #777;
}

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

.wpee-palette-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
	gap: 6px;
	margin-bottom: 16px;
}

.wpee-palette-btn {
	min-width: 44px;
	min-height: 44px;      /* touch-friendly (Section 35) */
	border-radius: 6px;
	border: 1px solid #ccc;
	background: #fff;
	cursor: pointer;
	font-weight: 600;
}

.wpee-palette-btn.wpee-status-answered          { background: #16a765; border-color: #16a765; color: #fff; }
.wpee-palette-btn.wpee-status-not_answered      { background: #fff; border-color: #bbb; color: #555; }
.wpee-palette-btn.wpee-status-marked_for_review { background: #7c3aed; border-color: #7c3aed; color: #fff; }
.wpee-palette-btn.wpee-status-answered_marked   { background: #7c3aed; border-color: #16a765; color: #fff; }
.wpee-palette-btn.wpee-status-not_visited       { background: #f4f4f5; border-color: #ddd; color: #999; }

.wpee-palette-current {
	box-shadow: 0 0 0 3px #94a9f0;
}

.wpee-palette-key {
	list-style: none;
	margin: 0;
	padding: 0;
	font-size: 0.8rem;
	color: #666;
}

.wpee-palette-key li {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 6px;
}

.wpee-key-swatch {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 22px;
	height: 22px;
	border-radius: 4px;
	border: 1px solid #ccc;
	font-size: 0.75rem;
}

.wpee-key-swatch.wpee-status-answered          { background: #16a765; border-color: #16a765; color: #fff; }
.wpee-key-swatch.wpee-status-marked_for_review { background: #7c3aed; border-color: #7c3aed; color: #fff; }
.wpee-key-swatch.wpee-status-not_visited       { background: #f4f4f5; color: #999; }

.wpee-correct-answer {
	color: #0f7a45;
	font-weight: 600;
}

/* --- Results --- */

.wpee-score-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 12px;
	margin: 20px 0 28px;
}

@media (min-width: 700px) {
	.wpee-score-grid { grid-template-columns: repeat(6, 1fr); }
}

.wpee-score-card {
	background: #fff;
	border: 1px solid #e2e2e2;
	border-radius: var(--wpee-radius, 8px);
	padding: 16px;
	text-align: center;
}

.wpee-score-primary {
	background: var(--wpee-primary, #2952e3);
	border-color: var(--wpee-primary, #2952e3);
	color: #fff;
}

.wpee-score-value {
	display: block;
	font-size: 1.6rem;
	font-weight: 700;
	line-height: 1.2;
}

.wpee-score-label {
	display: block;
	font-size: 0.7rem;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	opacity: 0.8;
	margin-top: 4px;
}

.wpee-text-correct   { color: #16a765; }
.wpee-text-incorrect { color: #b32d2e; }
.wpee-score-primary .wpee-score-value { color: #fff; }

.wpee-breakdown-table {
	width: 100%;
	border-collapse: collapse;
	margin-bottom: 28px;
	background: #fff;
}

.wpee-breakdown-table th,
.wpee-breakdown-table td {
	border: 1px solid #e2e2e2;
	padding: 10px 12px;
	text-align: left;
	font-size: 0.9rem;
}

.wpee-breakdown-table th {
	background: #fafafa;
	font-weight: 600;
}

.wpee-review-badge {
	font-weight: 700;
	font-size: 0.75rem;
	text-transform: uppercase;
	padding: 2px 8px;
	border-radius: 3px;
}

.wpee-review-correct   .wpee-review-badge { background: #16a765; color: #fff; }
.wpee-review-incorrect .wpee-review-badge { background: #b32d2e; color: #fff; }
.wpee-review-skipped   .wpee-review-badge { background: #8a8d91; color: #fff; }

.wpee-review-correct   { border-left: 4px solid #16a765; }
.wpee-review-incorrect { border-left: 4px solid #b32d2e; }
.wpee-review-skipped   { border-left: 4px solid #8a8d91; }

.wpee-option-tag {
	margin-left: auto;
	font-size: 0.7rem;
	text-transform: uppercase;
	color: #555;
	white-space: nowrap;
}

.wpee-option-selected .wpee-option-tag { color: var(--wpee-primary, #2952e3); font-weight: 600; }

.wpee-question-node {
	background: #f0f0f1;
	color: #555;
	padding: 2px 8px;
	border-radius: 3px;
}

.wpee-notice {
	background: #fff;
	border: 1px solid #e2e2e2;
	border-left: 4px solid #2952e3;
	border-radius: 6px;
	padding: 16px 20px;
	margin: 20px 0;
}

.wpee-notice-warning { border-left-color: #dba617; }

.wpee-results-actions { margin-top: 28px; }
.wpee-feed-actions { margin: 0 0 20px; }

/* --- Question title index (chapter / topic summary page) --- */

.wpee-section-heading {
	font-size: 1.15rem;
	margin: 28px 0 12px;
	padding-bottom: 8px;
	border-bottom: 2px solid #eee;
}

.wpee-next-topic-heading {
	margin-top: 40px;
	color: #1a1a1a;
}

.wpee-year-group { margin-bottom: 22px; }

.wpee-year-heading {
	display: flex;
	align-items: center;
	gap: 10px;
	font-size: 0.95rem;
	margin: 0 0 8px;
}

.wpee-year-badge {
	background: var(--wpee-primary, #2952e3);
	color: #fff;
	padding: 2px 10px;
	border-radius: 3px;
	font-size: 0.85rem;
	font-weight: 700;
}

.wpee-year-group-count {
	font-size: 0.8rem;
	color: #888;
	font-weight: 400;
}

.wpee-title-list {
	margin: 0;
	padding-left: 22px;
}

.wpee-title-list li {
	margin-bottom: 8px;
	line-height: 1.5;
}

.wpee-title-list a {
	color: #1a1a1a;
	text-decoration: none;
}

.wpee-title-list a:hover {
	color: var(--wpee-primary, #2952e3);
	text-decoration: underline;
}

/* Anchor offset so a linked question isn't hidden under a sticky header. */
.wpee-question-card[id] { scroll-margin-top: 90px; }

/* --- Tests --- */

.wpee-test-card .wpee-card-title { font-size: 1.05rem; }

.wpee-instructions {
	margin: 8px 0 0 18px;
	line-height: 1.7;
}

.wpee-notice h2 {
	margin-top: 0;
	font-size: 1rem;
}

/* ===============================================================
   STEP 7 — accessibility, mobile and polish
   =============================================================== */

/* Skip repeated sidebars when tabbing (Section 49). */
.wpee-skip-link {
	position: absolute;
	left: -9999px;
	top: 0;
	background: var(--wpee-primary, #2952e3);
	color: #fff;
	padding: 10px 16px;
	z-index: 999;
	border-radius: 0 0 var(--wpee-radius, 8px) 0;
}

.wpee-skip-link:focus {
	left: 0;
}

/* A single, consistent focus ring everywhere (Section 49). */
.wpee-public a:focus-visible,
.wpee-public button:focus-visible,
.wpee-public input:focus-visible,
.wpee-public select:focus-visible,
.wpee-public summary:focus-visible {
	outline: 3px solid #94a9f0;
	outline-offset: 2px;
	border-radius: 3px;
}

/* Option images */
.wpee-option-image { display: block; margin-top: 8px; }
.wpee-option-image img { max-width: 100%; height: auto; border-radius: 4px; }

/* KaTeX: let long display equations scroll rather than overflow the
   card on narrow screens. */
.wpee-question-text .katex-display,
.wpee-detailed-solution .katex-display,
.wpee-explanation .katex-display {
	overflow-x: auto;
	overflow-y: hidden;
	padding: 4px 0;
	max-width: 100%;
}

.katex { font-size: 1.05em; }

/* Long unbroken strings (formulae, URLs) must not force a page-wide
   horizontal scrollbar on mobile. */
.wpee-question-text,
.wpee-option-text,
.wpee-explanation,
.wpee-detailed-solution {
	overflow-wrap: break-word;
	word-wrap: break-word;
}

/* ---------------- Mobile ---------------- */

@media (max-width: 899px) {
	.wpee-wrap-public { padding: 16px 12px 40px; }

	.wpee-page-title { font-size: 1.4rem; }

	/* On phones the palette matters less than the question, so move it
	   below and let it wrap compactly. */
	.wpee-runtime-palette { order: 2; }

	.wpee-runtime-header {
		gap: 10px;
		padding: 10px 12px;
	}

	.wpee-runtime-header #wpee-submit-btn {
		order: 3;
		width: 100%;
		margin-left: 0;
	}

	/* Controls become a 2-up grid so every target stays finger-sized
	   instead of shrinking to fit one row (Section 35). */
	.wpee-runtime-controls {
		display: grid;
		grid-template-columns: 1fr 1fr;
		gap: 8px;
	}

	.wpee-runtime-controls .wpee-button {
		width: 100%;
		padding: 12px 10px;
		text-align: center;
	}

	.wpee-runtime-controls #wpee-next-btn {
		grid-column: 1 / -1;
		margin-left: 0;
	}

	.wpee-option {
		padding: 12px;      /* larger tap target */
	}

	.wpee-stat-bar { gap: 12px; }
	.wpee-start-practice { margin-left: 0; width: 100%; text-align: center; }

	.wpee-breakdown-table { display: block; overflow-x: auto; }
}

/* Respect a reader's reduced-motion preference (Section 49). */
@media (prefers-reduced-motion: reduce) {
	.wpee-public *,
	.wpee-public *::before,
	.wpee-public *::after {
		transition-duration: 0.01ms !important;
		animation-duration: 0.01ms !important;
	}
}

/* Print: a chapter's questions should print cleanly as a worksheet. */
@media print {
	.wpee-sidebar,
	.wpee-feed-actions,
	.wpee-check-answer-btn,
	.wpee-runtime-controls,
	.wpee-breadcrumb { display: none !important; }

	.wpee-question-card {
		break-inside: avoid;
		border-color: #999;
	}
}

/* --- Cards with an optional featured image --- */

.wpee-card-has-image {
	padding: 0;
	overflow: hidden;
}

.wpee-card-image {
	display: block;
	width: 100%;
	height: 180px;          /* fixed band height as specified */
	overflow: hidden;
	background: #f0f0f1;
	line-height: 0;
}

.wpee-card-image img {
	width: 100%;
	height: 100%;
	/* Fill the band and crop rather than distort, so any aspect ratio
	   an institute uploads still looks deliberate. */
	object-fit: cover;
	display: block;
	transition: transform 0.25s ease;
}

.wpee-card-has-image:hover .wpee-card-image img {
	transform: scale(1.04);
}

.wpee-card-has-image .wpee-card-title,
.wpee-card-has-image .wpee-card-meta {
	padding-left: 16px;
	padding-right: 16px;
}

.wpee-card-has-image .wpee-card-title { padding-top: 14px; }
.wpee-card-has-image .wpee-card-meta  { padding-bottom: 16px; }

@media (prefers-reduced-motion: reduce) {
	.wpee-card-has-image:hover .wpee-card-image img { transform: none; }
}

/* --- Step 9: richer results --- */

.wpee-percentile-panel {
	background: #fff;
	border: 1px solid #e2e2e2;
	border-radius: var(--wpee-radius, 8px);
	padding: 18px 20px;
	margin-bottom: 28px;
}

.wpee-percentile-panel h2 { margin-top: 0; font-size: 1rem; }

.wpee-compare-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 14px;
}

@media (min-width: 700px) {
	.wpee-compare-grid { grid-template-columns: repeat(4, 1fr); }
}

.wpee-compare-grid strong {
	display: block;
	font-size: 1.3rem;
}

.wpee-compare-grid span {
	font-size: 0.72rem;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: #777;
}

.wpee-question-time {
	background: #f0f0f1;
	color: #555;
	padding: 2px 8px;
	border-radius: 3px;
	font-size: 0.75rem;
}

/* Test cover image on the landing page */
.wpee-test-cover {
	width: 100%;
	height: 180px;
	overflow: hidden;
	border-radius: var(--wpee-radius, 8px);
	margin-bottom: 18px;
	background: #f0f0f1;
	line-height: 0;
}

.wpee-test-cover img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

/* Student identity fields */

.wpee-identity-block {
	background: #fafafa;
	border: 1px solid #e2e2e2;
	border-radius: var(--wpee-radius, 8px);
	padding: 16px 18px;
	margin-bottom: 18px;
}

.wpee-identity-block h2 {
	margin: 0 0 12px;
	font-size: 1rem;
}

.wpee-identity-block .wpee-setup-field:last-child { margin-bottom: 0; }

.wpee-identity-block input[type="text"],
.wpee-identity-block input[type="email"] {
	width: 100%;
	padding: 9px 12px;
	border: 1px solid #ccc;
	border-radius: 6px;
	font-size: 0.95rem;
}

.wpee-required { color: #b32d2e; margin-left: 2px; }

.wpee-optional {
	color: #888;
	font-weight: 400;
	font-size: 0.85em;
	margin-left: 4px;
}

/* Question numbers */

.wpee-question-number {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 26px;
	height: 26px;
	padding: 0 7px;
	border-radius: 13px;
	background: #eef1fd;
	color: var(--wpee-primary, #2952e3);
	font-weight: 700;
	font-size: 0.8rem;
}

.wpee-section-anchor {
	display: block;
	height: 0;
	scroll-margin-top: 90px;
}

/* Scroll-spy highlighting. The current item gets a weight and a left
   marker as well as colour, so it isn't signalled by colour alone. */

.wpee-sibling-current > a,
.wpee-year-active > a {
	color: var(--wpee-primary, #2952e3);
	font-weight: 700;
}

.wpee-sibling-list li,
.wpee-year-filter-list li {
	border-left: 3px solid transparent;
	transition: border-color 0.15s ease, background 0.15s ease;
}

.wpee-sibling-current,
.wpee-year-active {
	border-left-color: var(--wpee-primary, #2952e3);
	background: #f5f7ff;
}

.wpee-sibling-current > a,
.wpee-year-active > a {
	padding-left: 8px;
}

@media (prefers-reduced-motion: reduce) {
	.wpee-sibling-list li,
	.wpee-year-filter-list li { transition: none; }
}

/* --- Extended question types --- */

/* The reason is half of the question, not a quotation. It used to
   carry a tinted background and a left rule, which read as a
   pull-quote and set it apart from the assertion it belongs with. */
.wpee-reason-text {
	margin: 0 0 14px;
}

.wpee-reason-label {
	font-weight: 600;
}

/* A Column II item already used by another row. Greyed and
   unselectable, but never the row's own current choice. */
.wpee-match-select option:disabled {
	color: #9aa1ad;
}

.wpee-multi-hint {
	font-size: 0.85rem;
	color: #666;
	margin: 0 0 10px;
}

.wpee-numerical-input {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
	margin: 14px 0;
}

.wpee-numerical-input input {
	padding: 10px 14px;
	border: 2px solid #ddd;
	border-radius: var(--wpee-radius, 8px);
	font-size: 1.05rem;
	width: 180px;
}

.wpee-numerical-input input:focus {
	border-color: var(--wpee-primary, #2952e3);
	outline: none;
}

.wpee-numerical-unit {
	color: #666;
	font-weight: 600;
}

.wpee-match-columns {
	display: flex;
	gap: 20px;
	flex-wrap: wrap;
	margin-bottom: 16px;
}

.wpee-match-list { flex: 1 1 220px; }

.wpee-match-list h4 {
	margin: 0 0 8px;
	font-size: 0.85rem;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: #666;
}

.wpee-match-list ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

.wpee-match-list li {
	padding: 6px 10px;
	border: 1px solid #eee;
	border-radius: 5px;
	margin-bottom: 5px;
	background: #fafafa;
}

.wpee-match-answers {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
}

.wpee-match-answers .wpee-match-answer-row {
	display: flex;
	align-items: center;
	gap: 6px;
}

.wpee-match-answers select {
	padding: 8px 10px;
	border: 2px solid #ddd;
	border-radius: 6px;
	min-width: 70px;
}

/* Multi-select options need a visibly different affordance from radios. */
.wpee-option input[type="checkbox"] { accent-color: var(--wpee-primary, #2952e3); }

.wpee-correct-answer-line {
	margin: 10px 0 0;
	font-weight: 600;
}

/* ---------------------------------------------------------------
   Student dashboard
   --------------------------------------------------------------- */

.wpee-dashboard { margin-top: 16px; }

.wpee-dash-loading,
.wpee-dash-empty,
.wpee-dash-note {
	color: var(--wpee-muted, #64748b);
	font-size: 0.95em;
}

.wpee-dash-section {
	margin-bottom: 28px;
	padding-bottom: 20px;
	border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.wpee-dash-section:last-child { border-bottom: 0; }

.wpee-dash-stats {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
	gap: 12px;
	margin: 12px 0 18px;
}

.wpee-dash-stat {
	background: rgba(0, 0, 0, 0.03);
	border-radius: var(--wpee-radius, 8px);
	padding: 12px 14px;
	text-align: center;
}

.wpee-dash-stat strong { display: block; font-size: 1.5em; line-height: 1.2; }
.wpee-dash-stat span { font-size: 0.85em; color: var(--wpee-muted, #64748b); }

.wpee-dash-list { list-style: none; margin: 0; padding: 0; }

.wpee-dash-attempt {
	padding: 10px 0;
	border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.wpee-dash-attempt-title { font-weight: 600; }

.wpee-dash-attempt-meta {
	display: block;
	font-size: 0.85em;
	color: var(--wpee-muted, #64748b);
}

.wpee-dash-areas { list-style: none; margin: 8px 0 16px; padding: 0; }

.wpee-dash-areas li {
	display: flex;
	justify-content: space-between;
	padding: 6px 0;
	border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.wpee-dash-weak em { color: #b42318; font-style: normal; font-weight: 600; }
.wpee-dash-strong em { color: #067647; font-style: normal; font-weight: 600; }

.wpee-dash-claim {
	background: rgba(41, 82, 227, 0.05);
	border: 1px solid rgba(41, 82, 227, 0.25);
	border-radius: var(--wpee-radius, 8px);
	padding: 16px 18px;
}

.wpee-dash-claim-actions { margin-bottom: 0; }
.wpee-dash-login-cta { margin-top: 20px; font-size: 0.95em; }


/* ---------------------------------------------------------------
   Archive, taxonomy and chapter pages — visual pass
   Definition comes from a real border and a white surface, not from
   shadow alone: these pages sit on whatever background the theme
   provides, and a card that relies on a tint disappears against a
   light grey one.
   No prefers-color-scheme rules here — the plugin cannot know whether
   the active theme follows the OS, and assuming it does turns every
   card transparent for anyone browsing in dark mode.
   --------------------------------------------------------------- */

.wpee-page-title {
	font-size: clamp(1.7rem, 1.2rem + 1.8vw, 2.4rem);
	line-height: 1.15;
	letter-spacing: -0.022em;
	margin: 0 0 0.3em;
}

.wpee-page-description {
	max-width: 62ch;
	color: #64748b;
	line-height: 1.6;
	margin-bottom: 1.6em;
}

/* Section labels stay quiet so the chapter names lead the page. */
.wpee-group-heading {
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: #94a3b8;
	margin: 2.4em 0 1em;
	padding-bottom: 0.6em;
	border-bottom: 1px solid #e2e8f0;
}

.wpee-card-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
	gap: 16px;
	margin-bottom: 8px;
}

.wpee-card {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding: 18px 20px;
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: var(--wpee-radius, 10px);
	box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
	text-decoration: none;
	color: inherit;
	overflow: hidden;
	transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

/* An accent rail that grows in on hover — confirms the target without
   repainting the card. */
.wpee-card::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0;
	bottom: 0;
	width: 3px;
	background: var(--wpee-primary, #2952e3);
	transform: scaleY(0);
	transform-origin: top;
	transition: transform 0.18s ease;
}

.wpee-card:hover,
.wpee-card:focus-visible {
	border-color: var(--wpee-primary, #2952e3);
	box-shadow: 0 8px 20px rgba(15, 23, 42, 0.10);
	transform: translateY(-2px);
}

.wpee-card:hover::before,
.wpee-card:focus-visible::before { transform: scaleY(1); }

.wpee-card:focus-visible {
	outline: 2px solid var(--wpee-primary, #2952e3);
	outline-offset: 2px;
}

.wpee-card-title {
	font-weight: 650;
	font-size: 1.02rem;
	line-height: 1.35;
	letter-spacing: -0.01em;
	color: #0f172a;
}

.wpee-card:hover .wpee-card-title { color: var(--wpee-primary, #2952e3); }

.wpee-card-meta {
	font-size: 0.84rem;
	color: #64748b;
}

.wpee-card-has-image { padding: 0; }
.wpee-card-has-image .wpee-card-image { aspect-ratio: 16 / 9; overflow: hidden; background: #f1f5f9; }
.wpee-card-has-image .wpee-card-image img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.wpee-card-has-image:hover .wpee-card-image img { transform: scale(1.05); }
.wpee-card-has-image .wpee-card-title { padding: 16px 18px 0; }
.wpee-card-has-image .wpee-card-meta { padding: 0 18px 18px; }

.wpee-feed-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 1.8em; }

.wpee-empty-state {
	padding: 36px 24px;
	text-align: center;
	color: #64748b;
	background: #fff;
	border: 1px dashed #cbd5e1;
	border-radius: var(--wpee-radius, 10px);
}

/* --- Chapter page: the stat bar --- */

.wpee-stat-bar {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin: 0 0 1.6em;
	padding: 0;
	list-style: none;
}

.wpee-stat-pill {
	flex: 0 1 auto;
	min-width: 132px;
	padding: 14px 18px;
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: var(--wpee-radius, 10px);
}

.wpee-stat-pill strong {
	display: block;
	font-size: 1.55rem;
	line-height: 1.1;
	color: #0f172a;
	letter-spacing: -0.02em;
}

.wpee-stat-pill span {
	display: block;
	margin-top: 4px;
	font-size: 0.7rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #94a3b8;
}

/* --- Chapter page: sibling sidebar --- */

.wpee-with-sidebar {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 26px;
}

@media (min-width: 900px) {
	.wpee-with-sidebar { grid-template-columns: 264px minmax(0, 1fr); align-items: start; }
	.wpee-sidebar { position: sticky; top: 24px; max-height: calc(100vh - 48px); overflow-y: auto; }
}

.wpee-sidebar {
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: var(--wpee-radius, 10px);
	padding: 14px;
}

.wpee-sidebar-title {
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: #94a3b8;
	margin: 4px 6px 10px;
}

.wpee-sibling-list { list-style: none; margin: 0; padding: 0; }

.wpee-sibling-list a {
	display: block;
	padding: 8px 12px;
	border-radius: 7px;
	font-size: 0.92rem;
	color: #334155;
	text-decoration: none;
	transition: background 0.12s ease, color 0.12s ease;
}

.wpee-sibling-list a:hover { background: #f1f5f9; color: #0f172a; }

.wpee-sibling-current a,
.wpee-sibling-list .wpee-sibling-current a {
	background: var(--wpee-primary, #2952e3);
	color: #fff;
	font-weight: 600;
}

/* --- Chapter page: the question index --- */

.wpee-section-heading {
	font-size: 1.1rem;
	font-weight: 700;
	letter-spacing: -0.01em;
	margin: 1.8em 0 0.8em;
}

.wpee-year-group {
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: var(--wpee-radius, 10px);
	margin-bottom: 14px;
	overflow: hidden;
}

.wpee-year-heading {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	margin: 0;
	padding: 12px 18px;
	background: #f8fafc;
	border-bottom: 1px solid #e2e8f0;
	font-size: 0.9rem;
	font-weight: 700;
	color: #0f172a;
}

.wpee-year-group-count { font-weight: 500; font-size: 0.8rem; color: #64748b; }

.wpee-title-list { list-style: none; margin: 0; padding: 0; counter-reset: wpee-q; }

.wpee-title-list li {
	display: flex;
	gap: 12px;
	padding: 12px 18px;
	border-bottom: 1px solid #f1f5f9;
	line-height: 1.5;
}

.wpee-title-list li:last-child { border-bottom: 0; }
.wpee-title-list li:hover { background: #f8fafc; }

/* Numbering comes from CSS so the markup stays a plain list. */
.wpee-title-list li::before {
	counter-increment: wpee-q;
	content: counter(wpee-q);
	flex: 0 0 26px;
	height: 26px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: #eef2ff;
	color: var(--wpee-primary, #2952e3);
	border-radius: 6px;
	font-size: 0.75rem;
	font-weight: 700;
}

.wpee-title-list a { color: #1e293b; text-decoration: none; }
.wpee-title-list a:hover { color: var(--wpee-primary, #2952e3); text-decoration: underline; }

.wpee-year-badge {
	display: inline-block;
	margin-top: 4px;
	padding: 2px 8px;
	background: #eef2ff;
	color: var(--wpee-primary, #2952e3);
	border-radius: 999px;
	font-size: 0.68rem;
	font-weight: 700;
	letter-spacing: 0.03em;
}

@media (prefers-reduced-motion: reduce) {
	.wpee-card,
	.wpee-card::before,
	.wpee-card-has-image .wpee-card-image img { transition: none; }
	.wpee-card:hover { transform: none; }
}

/* ---------------------------------------------------------------
   Question feed: three-column layout
   The earlier flex layout was overridden when .wpee-with-sidebar
   became a grid, which silently dropped the papers column off the
   feed. Restated here as a grid so both sidebars survive.
   --------------------------------------------------------------- */

@media (min-width: 900px) {
	.wpee-with-sidebar.wpee-with-right-sidebar {
		grid-template-columns: 244px minmax(0, 1fr);
	}
	/* Not enough width for three columns yet: papers move under the
	   feed rather than squeezing the questions. */
	.wpee-with-right-sidebar .wpee-papers-sidebar {
		grid-column: 1 / -1;
		position: static;
		max-height: none;
	}
}

@media (min-width: 1180px) {
	.wpee-with-sidebar.wpee-with-right-sidebar {
		grid-template-columns: 244px minmax(0, 1fr) 216px;
	}
	.wpee-with-right-sidebar .wpee-papers-sidebar {
		grid-column: auto;
		position: sticky;
		top: 24px;
		max-height: calc(100vh - 48px);
		overflow-y: auto;
	}
}

.wpee-year-filter-list { list-style: none; margin: 0; padding: 0; }

.wpee-year-filter-list li + li { margin-top: 2px; }

.wpee-year-filter-list a {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	padding: 7px 11px;
	border-radius: 7px;
	font-size: 0.87rem;
	color: #334155;
	text-decoration: none;
	transition: background 0.12s ease, color 0.12s ease;
}

.wpee-year-filter-list a:hover { background: #f1f5f9; color: #0f172a; }

.wpee-year-count {
	flex: 0 0 auto;
	min-width: 22px;
	padding: 1px 7px;
	background: #f1f5f9;
	border-radius: 999px;
	font-size: 0.72rem;
	font-weight: 700;
	color: #64748b;
	text-align: center;
}

/* Set by scrollspy.js as the reader moves through the papers, and by
   PHP when a year filter is applied. */
.wpee-year-filter-list .wpee-year-active > a {
	background: var(--wpee-primary, #2952e3);
	color: #fff;
	font-weight: 600;
}

.wpee-year-filter-list .wpee-year-active .wpee-year-count {
	background: rgba(255, 255, 255, 0.22);
	color: #fff;
}

/* The permalink marker stays out of the way until the card is hovered
   or it receives keyboard focus. */
.wpee-question-permalink {
	opacity: 0;
	color: #94a3b8;
	text-decoration: none;
	transition: opacity 0.12s ease, color 0.12s ease;
}

.wpee-question-card:hover .wpee-question-permalink,
.wpee-question-permalink:focus-visible { opacity: 1; }
.wpee-question-permalink:hover { color: var(--wpee-primary, #2952e3); }

/* An exam-level feed has no sibling chapters to list, so it renders no
   left sidebar. Reclaim that column for the questions instead of
   leaving an empty 244px gutter and a squashed question list. */
@media (min-width: 900px) {
	.wpee-with-sidebar.wpee-no-left-sidebar {
		grid-template-columns: minmax(0, 1fr);
	}
}

@media (min-width: 1180px) {
	.wpee-with-sidebar.wpee-with-right-sidebar.wpee-no-left-sidebar {
		grid-template-columns: minmax(0, 1fr) 216px;
	}
}

/* ---------------------------------------------------------------
   Dashboard and join page
   --------------------------------------------------------------- */

.wpee-dash-header {
	display: flex;
	align-items: center;
	gap: 18px;
	padding: 20px 22px;
	margin-bottom: 26px;
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: var(--wpee-radius, 10px);
	box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

.wpee-dash-avatar {
	width: 68px;
	height: 68px;
	border-radius: 50%;
	flex: 0 0 auto;
	border: 2px solid #fff;
	box-shadow: 0 0 0 2px #e2e8f0;
	object-fit: cover;
}

.wpee-dash-identity { min-width: 0; }
.wpee-dash-identity .wpee-page-title { margin: 0 0 2px; font-size: clamp(1.3rem, 1rem + 1.1vw, 1.8rem); }
.wpee-dash-email { margin: 0; font-size: 0.86rem; color: #64748b; word-break: break-word; }

.wpee-dash-batches { margin: 8px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }

.wpee-batch-chip {
	display: inline-block;
	padding: 3px 10px;
	background: #eef2ff;
	color: var(--wpee-primary, #2952e3);
	border-radius: 999px;
	font-size: 0.74rem;
	font-weight: 700;
	letter-spacing: 0.02em;
}

/* Sections become cards so the dashboard reads as panels rather than
   one long run of headings. */
.wpee-dash-section {
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: var(--wpee-radius, 10px);
	padding: 20px 22px;
	margin-bottom: 18px;
	box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

.wpee-dash-section h2 { margin: 0 0 14px; font-size: 1.15rem; letter-spacing: -0.01em; }
.wpee-dash-section h3 { margin: 20px 0 8px; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; color: #94a3b8; }

.wpee-dash-stat {
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	border-radius: var(--wpee-radius, 10px);
	padding: 14px 12px;
}

.wpee-dash-stat strong { font-size: 1.6rem; letter-spacing: -0.02em; color: #0f172a; }

.wpee-dash-stat span {
	font-size: 0.7rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #94a3b8;
}

.wpee-dash-attempt { padding: 12px 0; }
.wpee-dash-attempt-title { color: var(--wpee-primary, #2952e3); }

.wpee-dash-claim {
	border-color: var(--wpee-primary, #2952e3);
	background: #f8faff;
}

.wpee-dash-login-cta {
	padding: 16px 20px;
	background: #f8fafc;
	border: 1px dashed #cbd5e1;
	border-radius: var(--wpee-radius, 10px);
}

/* --- Join page --- */

.wpee-join-card {
	max-width: 520px;
	padding: 26px 28px;
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: var(--wpee-radius, 10px);
	box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

.wpee-join-form label {
	display: block;
	margin-bottom: 6px;
	font-size: 0.78rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #94a3b8;
}

.wpee-join-form input[type="text"] {
	width: 100%;
	padding: 13px 16px;
	font-size: 1.35rem;
	font-weight: 700;
	letter-spacing: 0.22em;
	text-align: center;
	color: #0f172a;
	background: #f8fafc;
	border: 2px solid #e2e8f0;
	border-radius: var(--wpee-radius, 10px);
	transition: border-color 0.15s ease, background 0.15s ease;
}

.wpee-join-form input[type="text"]:focus {
	outline: none;
	background: #fff;
	border-color: var(--wpee-primary, #2952e3);
}

.wpee-join-card .wpee-notice { border-radius: var(--wpee-radius, 10px); }

.wpee-join-card h2 {
	margin: 26px 0 10px;
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.09em;
	text-transform: uppercase;
	color: #94a3b8;
}

.wpee-join-card ul { list-style: none; margin: 0; padding: 0; }

.wpee-join-card ul li {
	padding: 10px 14px;
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	border-radius: 8px;
	font-weight: 600;
}

.wpee-join-card ul li + li { margin-top: 8px; }

@media (max-width: 600px) {
	.wpee-dash-header { flex-direction: column; align-items: flex-start; text-align: left; }
}

/* ---------------------------------------------------------------
   Icons, comparison block and leaderboard
   --------------------------------------------------------------- */

.wpee-icon {
	vertical-align: -0.18em;
	flex: 0 0 auto;
	color: var(--wpee-primary, #2952e3);
}

.wpee-compare-title,
.wpee-leaderboard-title {
	display: flex;
	align-items: center;
	gap: 9px;
	margin: 0 0 4px;
	font-size: 1.05rem;
	letter-spacing: -0.01em;
}

/* The comparison strip reads as one panel of related numbers rather
   than four loose figures. */
.wpee-compare-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
	gap: 1px;
	margin-top: 14px;
	background: #e2e8f0;
	border: 1px solid #e2e8f0;
	border-radius: var(--wpee-radius, 10px);
	overflow: hidden;
}

.wpee-compare-grid > div {
	background: #fff;
	padding: 14px 16px;
}

.wpee-compare-grid strong {
	display: block;
	font-size: 1.45rem;
	line-height: 1.15;
	letter-spacing: -0.02em;
	color: #0f172a;
}

.wpee-compare-grid span {
	display: block;
	margin-top: 3px;
	font-size: 0.68rem;
	font-weight: 700;
	letter-spacing: 0.09em;
	text-transform: uppercase;
	color: #94a3b8;
}

/* --- Leaderboard --- */

.wpee-leaderboard {
	margin: 24px 0;
	padding: 20px 22px;
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: var(--wpee-radius, 10px);
	box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

.wpee-leaderboard-note { margin: 0 0 14px; font-size: 0.84rem; color: #64748b; }

.wpee-leaderboard-list { list-style: none; margin: 0; padding: 0; }

.wpee-lb-row {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 12px;
	border-radius: 8px;
	border-bottom: 1px solid #f1f5f9;
}

.wpee-lb-row:last-child { border-bottom: 0; }

.wpee-lb-rank {
	flex: 0 0 28px;
	height: 28px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: #f1f5f9;
	color: #64748b;
	border-radius: 8px;
	font-size: 0.8rem;
	font-weight: 700;
}

/* Only the top three get colour; beyond that it is just a list. */
.wpee-lb-row:nth-child(1) .wpee-lb-rank { background: #fef3c7; color: #92400e; }
.wpee-lb-row:nth-child(2) .wpee-lb-rank { background: #e2e8f0; color: #475569; }
.wpee-lb-row:nth-child(3) .wpee-lb-rank { background: #fde8d7; color: #9a3412; }

.wpee-lb-avatar {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	flex: 0 0 auto;
	object-fit: cover;
}

.wpee-lb-avatar-blank {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: #eef2ff;
	color: var(--wpee-primary, #2952e3);
	font-weight: 700;
	text-transform: uppercase;
}

.wpee-lb-name {
	flex: 1 1 auto;
	min-width: 0;
	font-weight: 600;
	color: #0f172a;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.wpee-lb-name em {
	margin-left: 6px;
	padding: 1px 7px;
	background: var(--wpee-primary, #2952e3);
	color: #fff;
	border-radius: 999px;
	font-size: 0.66rem;
	font-style: normal;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.wpee-lb-accuracy { flex: 0 0 auto; font-size: 0.82rem; color: #64748b; }

.wpee-lb-score {
	flex: 0 0 auto;
	min-width: 46px;
	text-align: right;
	font-weight: 700;
	color: #0f172a;
}

.wpee-lb-you { background: #f8faff; box-shadow: inset 0 0 0 1px rgba(41, 82, 227, 0.35); }

@media (max-width: 520px) {
	.wpee-lb-accuracy { display: none; }
}

/* ---------------------------------------------------------------
   Stat bar: the pills are the cards, so the strip holding them needs
   no box of its own. The outer fill and border made every detail page
   look like a card inside a card.
   --------------------------------------------------------------- */

.wpee-stat-bar {
	padding: 0;
	border: 0;
	background: none;
}

/* --- Leaderboard: five rows tall until asked to open --- */

.wpee-lb-toggle { position: absolute; opacity: 0; pointer-events: none; }

.wpee-leaderboard-list {
	max-height: 296px; /* about five rows */
	overflow-y: auto;
	transition: max-height 0.2s ease;
}

.wpee-lb-toggle:checked ~ .wpee-leaderboard-list {
	max-height: 60vh;
}

.wpee-lb-more {
	display: inline-block;
	margin-top: 12px;
	padding: 8px 16px;
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	border-radius: 999px;
	font-size: 0.85rem;
	font-weight: 600;
	color: var(--wpee-primary, #2952e3);
	cursor: pointer;
	user-select: none;
	transition: background 0.15s ease, border-color 0.15s ease;
}

.wpee-lb-more:hover { background: #eef2ff; border-color: var(--wpee-primary, #2952e3); }

.wpee-lb-more-close { display: none; }
.wpee-lb-toggle:checked ~ .wpee-lb-more .wpee-lb-more-open { display: none; }
.wpee-lb-toggle:checked ~ .wpee-lb-more .wpee-lb-more-close { display: inline; }

/* Keyboard users need to see the control focused, since the checkbox
   itself is off-screen. */
.wpee-lb-toggle:focus-visible ~ .wpee-lb-more {
	outline: 2px solid var(--wpee-primary, #2952e3);
	outline-offset: 2px;
}

/* Explains an absent comparison instead of leaving a gap. */
.wpee-compare-pending {
	display: flex;
	align-items: center;
	gap: 9px;
	margin: 16px 0 24px;
	padding: 12px 16px;
	background: #f8fafc;
	border: 1px dashed #cbd5e1;
	border-radius: var(--wpee-radius, 10px);
	font-size: 0.88rem;
	color: #64748b;
}

/* --- Standalone leaderboard page --- */

.wpee-leaderboard-page .wpee-page-title {
	display: flex;
	align-items: center;
	gap: 10px;
}

.wpee-lb-filter {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
	margin: 0 0 20px;
	padding: 14px 16px;
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: var(--wpee-radius, 10px);
}

.wpee-lb-filter label {
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.09em;
	text-transform: uppercase;
	color: #94a3b8;
}

.wpee-lb-filter select {
	flex: 1 1 260px;
	max-width: 100%;
	padding: 9px 12px;
	font-size: 0.95rem;
	color: #0f172a;
	background: #fff;
	border: 1px solid #cbd5e1;
	border-radius: 8px;
}

.wpee-lb-filter select:focus {
	outline: none;
	border-color: var(--wpee-primary, #2952e3);
	box-shadow: 0 0 0 3px rgba(41, 82, 227, 0.14);
}

.wpee-leaderboard-title a { color: inherit; text-decoration: none; }
.wpee-leaderboard-title a:hover { color: var(--wpee-primary, #2952e3); }

/* The dedicated page is the place to see everyone, so it does not clip
   the list the way an inline panel would. */
.wpee-leaderboard-full {
	max-height: none;
	overflow: visible;
}

/* ===============================================================
   Join page, dashboard join panel, leaderboard polish (3.8.1)
   =============================================================== */

/* --- Join card ------------------------------------------------ */
.wpee-join-page { max-width: 560px; margin-inline: auto; }

.wpee-join-card {
	background: #fff;
	border: 1px solid #e6e9f0;
	border-radius: var(--wpee-radius, 12px);
	box-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px rgba(16, 24, 40, .06);
	padding: 32px 28px;
}

.wpee-join-head { text-align: center; margin-bottom: 24px; }

.wpee-join-icon {
	display: inline-flex; align-items: center; justify-content: center;
	width: 52px; height: 52px; margin-bottom: 14px;
	border-radius: 50%;
	background: color-mix(in srgb, var(--wpee-primary, #2952e3) 10%, #fff);
	color: var(--wpee-primary, #2952e3);
}
.wpee-join-icon svg { width: 26px; height: 26px; }

.wpee-join-page .wpee-page-title { margin: 0 0 6px; font-size: clamp(1.45rem, 1.2rem + 1vw, 1.9rem); }
.wpee-join-sub { margin: 0; color: #64748b; font-size: .92rem; line-height: 1.55; }

.wpee-join-label {
	display: block; margin-bottom: 8px;
	font-size: .72rem; font-weight: 700; letter-spacing: .09em;
	text-transform: uppercase; color: #94a3b8;
}

/* Input and button share one row on desktop, stack on narrow screens. */
.wpee-join-field { display: flex; gap: 10px; align-items: stretch; }

.wpee-join-field input[type="text"] {
	flex: 1 1 auto; min-width: 0;
	padding: 12px 14px;
	font-size: 1.05rem; font-weight: 600;
	letter-spacing: .12em; text-transform: uppercase;
	border: 1px solid #d5dae5; border-radius: 8px;
	background: #f8fafc; color: #0f172a;
	transition: border-color .15s, box-shadow .15s, background .15s;
}
.wpee-join-field input[type="text"]::placeholder {
	letter-spacing: .02em; text-transform: none; font-weight: 400; color: #a3aec0;
}
.wpee-join-field input[type="text"]:focus {
	outline: none; background: #fff;
	border-color: var(--wpee-primary, #2952e3);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--wpee-primary, #2952e3) 18%, transparent);
}

.wpee-join-submit { flex: 0 0 auto; padding-inline: 24px; font-weight: 600; }

.wpee-join-hint { margin: 10px 0 0; font-size: .8rem; color: #94a3b8; }
.wpee-join-notice { margin-bottom: 20px; }
.wpee-join-notice-action { margin-bottom: 0; }
.wpee-join-locked { text-align: center; }
.wpee-join-locked p { color: #475569; margin-bottom: 18px; }

.wpee-join-mine { margin-top: 28px; padding-top: 22px; border-top: 1px solid #eef1f6; }
.wpee-join-mine-title {
	margin: 0 0 12px; font-size: .72rem; font-weight: 700;
	letter-spacing: .09em; text-transform: uppercase; color: #94a3b8;
}
.wpee-join-batch-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.wpee-join-batch {
	display: flex; align-items: center; gap: 10px;
	padding: 12px 14px;
	background: #f6f9f7;
	border: 1px solid #d9ece0;
	border-radius: 8px;
}
.wpee-join-batch-tick {
	display: inline-flex; align-items: center; justify-content: center;
	width: 20px; height: 20px; flex: 0 0 auto;
	border-radius: 50%; background: #16a34a; color: #fff;
}
.wpee-join-batch-tick svg { width: 13px; height: 13px; stroke-width: 3; }
.wpee-join-batch-name { font-weight: 600; color: #14532d; }
.wpee-join-mine-foot { margin: 14px 0 0; font-size: .86rem; color: #94a3b8; }
.wpee-join-mine-foot a { color: var(--wpee-primary, #2952e3); }
.wpee-join-mine-foot span { margin: 0 6px; }
.wpee-join-empty { margin: 24px 0 0; font-size: .88rem; color: #94a3b8; text-align: center; }

@media (max-width: 480px) {
	.wpee-join-card { padding: 24px 18px; }
	.wpee-join-field { flex-direction: column; }
	.wpee-join-submit { width: 100%; }
}

/* --- Dashboard inline join ------------------------------------ */
/* Sits in the same flex row as the batch chips, never shrinking below
   its label, so it stays beside them rather than dropping underneath. */
.wpee-dash-batches { align-items: center; }
.wpee-dash-join { display: inline-block; flex: 0 0 auto; }
.wpee-dash-join[open] { flex-basis: 100%; }
.wpee-dash-join summary {
	cursor: pointer; list-style: none;
	border-style: dashed; background: transparent; color: #64748b;
	user-select: none;
}
.wpee-dash-join summary::-webkit-details-marker { display: none; }
.wpee-batch-chip-add { display: inline-flex; align-items: center; gap: 5px; }
.wpee-dash-join summary:hover {
	color: var(--wpee-primary, #2952e3);
	border-color: var(--wpee-primary, #2952e3);
	background: color-mix(in srgb, var(--wpee-primary, #2952e3) 6%, #fff);
}
.wpee-dash-join[open] summary { margin-bottom: 10px; }
.wpee-dash-join-form { margin: 0; max-width: 340px; }
.wpee-dash-join-form .wpee-join-field input[type="text"] { font-size: .95rem; padding: 9px 12px; }
.wpee-dash-join-form .wpee-join-submit { padding-inline: 18px; }

/* --- Leaderboard ---------------------------------------------- */
.wpee-lb-summary {
	display: flex; flex-wrap: wrap; gap: 10px;
	margin: 0 0 18px;
}
.wpee-lb-summary-item {
	flex: 1 1 120px;
	padding: 12px 14px;
	background: #f8fafc;
	border: 1px solid #e9edf4;
	border-radius: 10px;
	text-align: center;
}
.wpee-lb-summary-item strong {
	display: block; font-size: 1.35rem; letter-spacing: -.02em; color: #0f172a; line-height: 1.2;
}
.wpee-lb-summary-item span {
	font-size: .72rem; font-weight: 600; letter-spacing: .07em;
	text-transform: uppercase; color: #94a3b8;
}
.wpee-lb-summary-you {
	background: color-mix(in srgb, var(--wpee-primary, #2952e3) 7%, #fff);
	border-color: color-mix(in srgb, var(--wpee-primary, #2952e3) 30%, #fff);
}
.wpee-lb-summary-you strong { color: var(--wpee-primary, #2952e3); }

/* Top three get a medal behind the number. Rank is still printed, and
   still announced to screen readers, so the colour is decoration and
   never the only signal. */
.wpee-lb-rank { position: relative; }
.wpee-lb-medal { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; opacity: .22; }
.wpee-lb-medal svg { width: 20px; height: 20px; }
.wpee-lb-rank-num { position: relative; z-index: 1; }

.wpee-lb-row { transition: background .15s, transform .15s; }
.wpee-lb-row:hover { background: #f8fafc; }

.wpee-lb-rank-1 .wpee-lb-rank { background: linear-gradient(135deg, #fde68a, #fbbf24); color: #78350f; box-shadow: 0 2px 6px rgba(251, 191, 36, .35); }
.wpee-lb-rank-2 .wpee-lb-rank { background: linear-gradient(135deg, #e8edf3, #c3ccd8); color: #3f4a58; }
.wpee-lb-rank-3 .wpee-lb-rank { background: linear-gradient(135deg, #fcd9bd, #f0a868); color: #7c2d12; }

.wpee-lb-accuracy { display: flex; align-items: center; gap: 8px; }
.wpee-lb-accuracy-bar {
	display: block; width: 56px; height: 6px;
	background: #e9edf4; border-radius: 999px; overflow: hidden;
}
.wpee-lb-accuracy-bar i {
	display: block; height: 100%;
	background: var(--wpee-primary, #2952e3);
	border-radius: 999px;
}
.wpee-lb-accuracy-num { font-variant-numeric: tabular-nums; min-width: 34px; text-align: right; }
.wpee-lb-score { font-variant-numeric: tabular-nums; }

@media (max-width: 640px) {
	.wpee-lb-accuracy-bar { display: none; }
	.wpee-lb-accuracy { display: block; }
	.wpee-lb-summary-item { flex: 1 1 90px; padding: 10px; }
}

/* ---------------------------------------------------------------
   Chapter notes (v3.12.0)

   Only the note-specific pieces live here. The page shell, sidebar,
   card grid and buttons are the same classes the chapter pages use,
   so a reader moving between notes and questions sees one design
   rather than two.
   --------------------------------------------------------------- */

.wpee-note-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 14px;
	align-items: baseline;
	margin: -4px 0 18px;
	font-size: 0.94em;
	opacity: 0.85;
}

.wpee-note-updated {
	font-size: 0.9em;
	opacity: 0.8;
}

.wpee-note-figure {
	margin: 0 0 22px;
}

.wpee-note-figure img {
	max-width: 100%;
	height: auto;
	border-radius: var(--wpee-radius, 8px);
	display: block;
}

.wpee-note-footer-actions {
	margin-top: 30px;
	padding-top: 20px;
	border-top: 1px solid #e9edf4;
}

/* The note body is long-form prose written in the editor, so it gets
   readable measure and vertical rhythm the card-based pages do not
   need. Deliberately scoped under .wpee-prose so no theme content is
   touched. */
.wpee-prose {
	line-height: 1.75;
}

.wpee-prose > * + * {
	margin-top: 1em;
}

.wpee-prose h2 {
	margin-top: 1.7em;
	font-size: 1.35em;
	line-height: 1.3;
}

.wpee-prose h3 {
	margin-top: 1.4em;
	font-size: 1.15em;
	line-height: 1.35;
}

.wpee-prose img {
	max-width: 100%;
	height: auto;
	border-radius: var(--wpee-radius, 8px);
}

.wpee-prose table {
	width: 100%;
	border-collapse: collapse;
	/* Long formula tables would otherwise push the whole column wide
	   on a phone and break the layout rather than scrolling. */
	display: block;
	overflow-x: auto;
}

.wpee-prose th,
.wpee-prose td {
	border: 1px solid #e9edf4;
	padding: 8px 10px;
	text-align: left;
}

.wpee-prose blockquote {
	margin-left: 0;
	padding-left: 14px;
	border-left: 3px solid var(--wpee-primary, #2952e3);
	opacity: 0.9;
}

.wpee-prose code {
	background: #f3f5f9;
	padding: 1px 5px;
	border-radius: 4px;
	font-size: 0.92em;
}

.wpee-button-notes {
	display: inline-flex;
	align-items: center;
	gap: 7px;
}

/* "Notes" marker on an archive card and beside a sibling in the
   sidebar. Both carry a text label or an aria-label, so the colour is
   never the only thing carrying the meaning. */
.wpee-card-badge {
	display: inline-block;
	margin-left: 7px;
	padding: 1px 7px;
	border-radius: 999px;
	font-size: 0.72em;
	font-weight: 600;
	letter-spacing: 0.02em;
	vertical-align: middle;
	white-space: nowrap;
}

.wpee-badge-notes {
	background: #eef2ff;
	color: #3730a3;
}

.wpee-notes-dot {
	color: var(--wpee-primary, #2952e3);
	font-size: 1.1em;
	line-height: 1;
}

.wpee-note-card .wpee-card-meta {
	opacity: 0.8;
}

/* Notes index: Exam → Subject → Chapter grouping (v3.12.3) */

.wpee-notes-exam + .wpee-notes-exam {
	margin-top: 38px;
}

.wpee-notes-index .wpee-group-heading {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	flex-wrap: wrap;
}

.wpee-subgroup-heading {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	flex-wrap: wrap;
	margin: 22px 0 12px;
	font-size: 1.02em;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	opacity: 0.72;
}

.wpee-subgroup-heading a,
.wpee-notes-index .wpee-group-heading a {
	color: inherit;
	text-decoration: none;
}

.wpee-subgroup-heading a:hover,
.wpee-notes-index .wpee-group-heading a:hover {
	text-decoration: underline;
}

/* Counts are supporting detail, never the thing you read first. */
.wpee-group-count {
	font-size: 0.78em;
	font-weight: 500;
	letter-spacing: 0;
	text-transform: none;
	opacity: 0.7;
	white-space: nowrap;
}

/* ---------------------------------------------------------------
   Report a problem, and placement slots (v3.14.0)
   --------------------------------------------------------------- */

.wpee-report { margin-top: 12px; }

/* A quiet control. It must be findable when something is wrong and
   invisible the rest of the time — it is not a call to action. */
.wpee-report-open {
	background: none;
	border: 0;
	padding: 0;
	font: inherit;
	font-size: 0.86em;
	color: #8a90a8;
	cursor: pointer;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.wpee-report-open:hover { color: var(--wpee-primary, #2952e3); }

.wpee-report-form {
	margin-top: 10px;
	padding: 12px;
	background: #f7f8fb;
	border: 1px solid #e3e5f0;
	border-radius: var(--wpee-radius, 8px);
	max-width: 460px;
}

.wpee-report-label { display: block; font-size: 0.85em; font-weight: 600; margin-bottom: 5px; }
.wpee-report-reason, .wpee-report-comment { width: 100%; margin-bottom: 8px; }
.wpee-report-actions { display: flex; gap: 8px; }
.wpee-report-done { margin-top: 8px; font-size: 0.88em; color: #2e7d5b; }

/* Slots print nothing at all unless a listener returned something, so
   this only ever wraps real content. */
.wpee-slot { margin: 22px 0; }
.wpee-slot:empty { display: none; margin: 0; }

/* Saved placements (Ad Slots). One wrapper per row inside the slot
   wrapper, so a site can reserve the height of each unit — an ad that
   arrives after layout is a Core Web Vitals problem, not a cosmetic
   one. Deliberately almost unstyled: whatever goes in here is the site
   owner's, and the plugin should not second-guess its spacing. */
.wpee-placement { margin: 0 0 14px; }
.wpee-placement:last-child { margin-bottom: 0; }
.wpee-placement img { max-width: 100%; height: auto; }
