.ielts-dashboard {
	max-width: 900px;
	margin: 20px auto;
	font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
.ielts-dashboard h2 {
	color: #1f3864;
}
.ielts-note {
	background: #fff2cc;
	border-left: 4px solid #bf8f00;
	padding: 8px 12px;
	color: #594100;
	font-size: 14px;
}
/* Stats: CSS-only donut + bar charts (no library, no JS — always renders). */
.ielts-stats-section {
	display: flex;
	flex-wrap: wrap;
	gap: 28px;
	align-items: flex-start;
	background: #f9fafc;
	border: 1px solid #e5e5e5;
	border-radius: 10px;
	padding: 18px 20px;
	margin: 16px 0 24px;
}
.ielts-donut-wrap {
	flex: 0 0 auto;
	text-align: center;
}
.ielts-donut {
	--pct: 0;
	position: relative;
	width: 96px;
	height: 96px;
	border-radius: 50%;
	background: conic-gradient(#2e75b6 calc(var(--pct) * 1%), #e1e7ee 0);
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0 auto;
}
.ielts-donut::before {
	content: "";
	position: absolute;
	width: 68px;
	height: 68px;
	background: #fff;
	border-radius: 50%;
}
.ielts-donut-label {
	position: relative;
	font-weight: 700;
	font-size: 16px;
	color: #1f3864;
}
.ielts-donut-sub {
	margin: 8px 0 0;
	font-size: 12px;
	color: #5a6675;
	max-width: 110px;
}
.ielts-stat-bars {
	flex: 1 1 260px;
	min-width: 220px;
	max-height: 230px;
	overflow-y: auto;
	padding-right: 4px;
}
.ielts-stat-row {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 8px;
}
.ielts-stat-label {
	flex: 0 0 auto;
	width: 150px;
	font-size: 13px;
	color: #333;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.ielts-stat-bar-track {
	flex: 1 1 auto;
	background: #e5e5e5;
	border-radius: 6px;
	height: 10px;
	overflow: hidden;
}
.ielts-stat-bar-fill {
	display: block;
	height: 100%;
	border-radius: 6px;
}
.ielts-stat-bar-good { background: #4c9a4c; }
.ielts-stat-bar-mid  { background: #d6a527; }
.ielts-stat-bar-low  { background: #c0504d; }
.ielts-stat-value {
	flex: 0 0 auto;
	width: 44px;
	font-size: 12px;
	color: #595959;
	text-align: right;
}

/* Custom-HTML test review — a static, non-interactive copy of the
   teacher's own test markup, shown after an attempt exists so nothing
   looks clickable-but-broken. */
.ielts-custom-html-static {
	opacity: 0.85;
}
.ielts-custom-html-static input,
.ielts-custom-html-static button,
.ielts-custom-html-static select,
.ielts-custom-html-static textarea {
	pointer-events: none;
}

.ielts-lesson-list {
	list-style: decimal;
	padding-left: 22px;
}
.ielts-lesson-list li {
	padding: 8px 0;
	border-bottom: 1px solid #e5e5e5;
}
.ielts-task-badges {
	margin-left: 10px;
}
.ielts-badge {
	display: inline-block;
	font-size: 11px;
	padding: 2px 8px;
	border-radius: 10px;
	margin-right: 4px;
	background: #dce6f1;
	color: #1f3864;
}
/* Colored by grading method rather than a fixed skill list, since
   different courses use different labels (Listening/Reading vs.
   Typing Test vs. Pronunciation, etc.) — green means auto-graded,
   orange means a teacher grades it. */
.ielts-badge-auto   { background: #d9ead3; color: #274e13; }
.ielts-badge-manual { background: #fce5cd; color: #7f4a00; }

.ielts-table {
	width: 100%;
	border-collapse: collapse;
	margin-top: 12px;
}
.ielts-table th, .ielts-table td {
	text-align: left;
	padding: 8px 10px;
	border-bottom: 1px solid #e5e5e5;
}
.ielts-table th {
	background: #1f3864;
	color: #fff;
}

.ielts-button {
	display: inline-block;
	background: #2e75b6;
	color: #fff !important;
	padding: 8px 14px;
	border-radius: 4px;
	text-decoration: none;
	margin-right: 8px;
	border: none;
	cursor: pointer;
	font-size: 14px;
}
.ielts-button-secondary {
	background: #e5e5e5;
	color: #333 !important;
}

/* Progress bars */
.ielts-overall-progress {
	margin: 16px 0 24px;
}
.ielts-progress-label {
	font-size: 14px;
	color: #333;
	margin-bottom: 6px;
}
.ielts-progress-bar-track {
	background: #e5e5e5;
	border-radius: 8px;
	height: 14px;
	width: 100%;
	overflow: hidden;
}
.ielts-progress-bar-track.ielts-progress-bar-small {
	height: 8px;
	max-width: 220px;
	display: inline-block;
	vertical-align: middle;
}
.ielts-progress-bar-fill {
	background: linear-gradient(90deg, #2e75b6, #66a3d9);
	height: 100%;
	border-radius: 8px;
	transition: width 0.3s ease;
}
.ielts-progress-row {
	margin-top: 6px;
	display: flex;
	align-items: center;
	gap: 8px;
}
.ielts-progress-text {
	font-size: 12px;
	color: #595959;
}

.ielts-lesson-link {
	text-decoration: none;
	color: #1f3864;
}
.ielts-lesson-link:hover {
	text-decoration: underline;
}

/* Lesson accordion (student dashboard) — collapsed by default, click the
   row (or arrow) to expand and see that lesson's tasks + Open Lesson
   button. Built with native <details>/<summary> so it works with zero
   JS and degrades gracefully on any browser. */
.ielts-lesson-accordion {
	margin: 0;
}
.ielts-lesson-acc {
	border: 1px solid #e5e5e5;
	border-radius: 8px;
	margin-bottom: 10px;
	overflow: hidden;
	background: #fff;
}
.ielts-lesson-acc[open] {
	border-color: #b7cbe6;
}
.ielts-lesson-summary {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px 16px;
	cursor: pointer;
	list-style: none;
	background: #f6f8fb;
	-webkit-user-select: none;
	user-select: none;
}
.ielts-lesson-summary::-webkit-details-marker {
	display: none;
}
.ielts-lesson-num {
	flex: 0 0 auto;
	width: 26px;
	height: 26px;
	border-radius: 50%;
	background: #1f3864;
	color: #fff;
	font-size: 13px;
	font-weight: 700;
	display: flex;
	align-items: center;
	justify-content: center;
}
.ielts-lesson-acc-done .ielts-lesson-num {
	background: #4c9a4c;
}
.ielts-lesson-acc-locked {
	opacity: 0.7;
}
.ielts-lesson-acc-locked .ielts-lesson-num {
	background: #9aa5b1;
	font-size: 12px;
}
.ielts-lesson-acc-locked .ielts-lesson-summary-title {
	color: #6b7688;
}
.ielts-lesson-summary-title {
	flex: 1 1 auto;
	font-weight: 600;
	color: #1f3864;
	font-size: 15px;
}
.ielts-lesson-summary-progress {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	gap: 8px;
}
.ielts-acc-chevron {
	flex: 0 0 auto;
	color: #7d8ba1;
	font-size: 12px;
	transition: transform 0.2s ease;
}
.ielts-lesson-acc[open] .ielts-acc-chevron {
	transform: rotate(180deg);
}
.ielts-lesson-acc-body {
	padding: 14px 16px 16px;
	border-top: 1px solid #e5e5e5;
}
.ielts-lesson-acc-body .ielts-task-badges {
	margin-left: 0;
	display: block;
	margin-bottom: 12px;
}

.ielts-badge-done {
	background: #d9ead3 !important;
	color: #274e13 !important;
}

/* Lesson detail / task cards */
.ielts-task-cards {
	display: flex;
	flex-direction: column;
	gap: 16px;
	margin-top: 16px;
}
.ielts-task-card {
	border: 1px solid #e5e5e5;
	border-radius: 6px;
	padding: 16px;
	background: #fff;
}
.ielts-task-card h3 {
	margin-top: 0;
}
.ielts-status-done {
	color: #274e13;
	font-weight: bold;
}

/* Task accordion inside a lesson — same collapsed-by-default pattern as
   the course-level lesson accordion, one level down. */
.ielts-task-acc {
	border: 1px solid #e5e5e5;
	border-radius: 8px;
	overflow: hidden;
	background: #fff;
}
.ielts-task-acc[open] {
	border-color: #b7cbe6;
}
.ielts-task-acc[open] .ielts-acc-chevron {
	transform: rotate(180deg);
}
.ielts-task-summary {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 12px 16px;
	cursor: pointer;
	list-style: none;
	background: #f6f8fb;
	-webkit-user-select: none;
	user-select: none;
}
.ielts-task-summary::-webkit-details-marker {
	display: none;
}
.ielts-task-summary-title {
	flex: 1 1 auto;
	font-weight: 600;
	color: #1f3864;
	font-size: 15px;
}
.ielts-task-status-icon {
	color: #274e13;
	font-weight: bold;
	font-size: 15px;
}
.ielts-task-acc .ielts-task-card {
	border: none;
	border-radius: 0;
	border-top: 1px solid #e5e5e5;
}
.ielts-resource-list-front {
	list-style: none;
	padding: 0;
}

/* Stage: in-browser voice recording */
.ielts-recording-widget {
	background: #f6f8fb;
	border-radius: 8px;
	padding: 14px 16px;
	margin-top: 10px;
}
.ielts-rec-timer {
	font-family: monospace;
	font-size: 13px;
	color: #5a6675;
	margin-left: 8px;
}
.ielts-rec-status {
	font-size: 13px;
	color: #5a6675;
	min-height: 18px;
}
.ielts-rec-preview {
	display: block;
	margin: 8px 0;
	width: 100%;
	max-width: 360px;
}
.ielts-recording-retry {
	margin-top: 8px;
}
.ielts-resource-list-front li {
	padding: 4px 0;
}

/* Stage 3: scored task cards */
.ielts-score-pill {
	display: inline-block;
	background: #1f3864;
	color: #fff;
	font-size: 12px;
	padding: 3px 10px;
	border-radius: 10px;
	margin-left: 8px;
	vertical-align: middle;
}

.ielts-task-body {
	display: block;
}
.ielts-task-body-split {
	display: flex;
	gap: 20px;
	align-items: flex-start;
}
.ielts-reading-passage,
.ielts-task-body-split .ielts-questions-panel {
	flex: 1 1 50%;
	max-height: 480px;
	overflow-y: auto;
	padding: 12px;
	border: 1px solid #eee;
	border-radius: 6px;
}
.ielts-reading-passage {
	background: #fafafa;
	line-height: 1.6;
}
@media (max-width: 700px) {
	.ielts-task-body-split {
		flex-direction: column;
	}
	.ielts-reading-passage,
	.ielts-task-body-split .ielts-questions-panel {
		max-height: none;
	}
}

.ielts-q {
	margin-bottom: 16px;
	padding-bottom: 12px;
	border-bottom: 1px solid #eee;
}
.ielts-q-text {
	font-weight: 600;
	margin-bottom: 6px;
}
.ielts-q-option {
	display: block;
	font-weight: normal;
	margin: 4px 0;
}
.ielts-correct-mark {
	color: #274e13;
	font-size: 12px;
	margin-left: 6px;
}
.ielts-q-was-correct {
	border-left: 3px solid #38761d;
	padding-left: 10px;
}
.ielts-q-was-wrong {
	border-left: 3px solid #cc0000;
	padding-left: 10px;
}
.ielts-q-result-icon {
	font-weight: bold;
	margin-left: 6px;
}
.ielts-q-was-correct .ielts-q-result-icon {
	color: #38761d;
}
.ielts-q-was-wrong .ielts-q-result-icon {
	color: #cc0000;
}

/* Stage 4: course picker */
.ielts-course-cards {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
	margin-top: 16px;
}
.ielts-course-card {
	display: block;
	flex: 1 1 220px;
	max-width: 280px;
	border: 1px solid #e5e5e5;
	border-radius: 8px;
	padding: 18px;
	background: #fff;
	text-decoration: none;
	color: inherit;
	transition: box-shadow 0.15s ease, border-color 0.15s ease;
}
.ielts-course-card:hover {
	border-color: #2e75b6;
	box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.ielts-course-card h3 {
	margin: 0 0 10px;
	color: #1f3864;
}
.ielts-course-card-meta {
	color: #595959;
	font-size: 13px;
	margin: 0;
}

/* Full-screen reading mode + timer (split-screen reading tests). Locking
   scroll on <html>/<body> while a card is in full-screen keeps the rest
   of the page from scrolling underneath the overlay. */
html.ielts-fullscreen-open,
body.ielts-fullscreen-open {
	overflow: hidden;
}
.ielts-fs-toolbar {
	display: flex;
	align-items: center;
	gap: 14px;
	margin-bottom: 12px;
}
.ielts-fs-timer {
	font-family: monospace;
	font-size: 18px;
	font-weight: 700;
	color: #1f3864;
}
.ielts-task-card.ielts-fullscreen-active {
	position: fixed;
	inset: 0;
	z-index: 100000;
	margin: 0;
	border-radius: 0;
	border: none;
	background: #fff;
	padding: 18px 24px;
	overflow-y: auto;
	display: flex;
	flex-direction: column;
}
.ielts-task-card.ielts-fullscreen-active .ielts-fs-toolbar {
	position: sticky;
	top: 0;
	background: #fff;
	padding: 6px 0 12px;
	z-index: 2;
	border-bottom: 1px solid #eee;
	margin-bottom: 14px;
}
.ielts-task-card.ielts-fullscreen-active .ielts-task-body {
	flex: 1 1 auto;
	min-height: 0;
}
.ielts-task-card.ielts-fullscreen-active .ielts-task-body-split {
	height: 100%;
}
.ielts-task-card.ielts-fullscreen-active .ielts-reading-passage,
.ielts-task-card.ielts-fullscreen-active .ielts-task-body-split .ielts-questions-panel {
	max-height: none;
	height: 100%;
}
@media (max-width: 700px) {
	.ielts-task-card.ielts-fullscreen-active .ielts-task-body-split {
		height: auto;
	}
	.ielts-task-card.ielts-fullscreen-active .ielts-reading-passage,
	.ielts-task-card.ielts-fullscreen-active .ielts-task-body-split .ielts-questions-panel {
		height: auto;
		max-height: 45vh;
	}
}

/* Multi-part reading test (Inspera-style): several .ielts-part blocks
   inside one Task's Custom Test HTML, switched by reading-timer.js.
   Each part provides its own passage/questions split; only the active
   one is shown, the rest stay in the DOM (hidden) so their answers
   still post with the one shared form submit. */
.ielts-part {
	display: none;
}
.ielts-part.ielts-part-active {
	display: flex;
	gap: 20px;
	align-items: flex-start;
}
.ielts-part-passage,
.ielts-part-questions {
	flex: 1 1 50%;
	max-height: 480px;
	overflow-y: auto;
	padding: 12px;
	border: 1px solid #eee;
	border-radius: 6px;
	/* Without this, height:100% (set below, in full-screen mode) excludes
	   the 12px padding + 1px border, so the box quietly renders a bit
	   taller than its allotted flex space and spills over onto whatever
	   sits right below it — which is exactly why the Submit button was
	   appearing partly covered by the passage/questions panel above it. */
	box-sizing: border-box;
}
.ielts-part-passage {
	background: #fafafa;
	line-height: 1.6;
}
@media (max-width: 700px) {
	.ielts-part.ielts-part-active {
		flex-direction: column;
	}
	.ielts-part-passage,
	.ielts-part-questions {
		max-height: none;
	}
}
.ielts-task-card.ielts-fullscreen-active .ielts-part.ielts-part-active {
	/* flex:1 1 auto alone (no explicit height) — the .ielts-part sits in
	   the same flex column as the "Submit Answers" button below it
	   (both are children of the same <form>). Setting height:100% here
	   too, on top of flex-grow, made this element claim the *entire*
	   column height regardless of the button needing room, so the
	   button ended up squeezed to nothing / rendered underneath the
	   part instead of visible below it. */
	flex: 1 1 auto;
	min-height: 0;
}
.ielts-task-card.ielts-fullscreen-active .ielts-part-passage,
.ielts-task-card.ielts-fullscreen-active .ielts-part-questions {
	max-height: none;
	height: 100%;
}
/* The height:100% rules above only resolve to a real pixel value if
   every ancestor between the fixed-position fullscreen card and
   .ielts-part actually has a defined height too. For a multi-part test
   there's no passage in the main content editor, so .ielts-task-body
   never gets the .ielts-task-body-split class (that's what carries the
   existing height:100% chain for the older single-passage layout) —
   without this, the whole overlay just grew to fit all 3 parts stacked
   and scrolled as one block, and the bottom navbar ended up wherever
   that content happened to end instead of pinned to the bottom.
   :not(.ielts-task-body-split) keeps this scoped to only the
   multi-part case, so the existing single-passage split-screen
   fullscreen layout above is untouched. */
.ielts-task-card.ielts-fullscreen-active .ielts-task-body:not(.ielts-task-body-split) {
	/* No explicit height here — a plain, unscoped rule further up
	   already gives every fullscreen .ielts-task-body "flex:1 1 auto;
	   min-height:0" so it sizes correctly next to its siblings (the
	   toolbar above, the navbar below, both in the same flex column).
	   Adding height:100% on top of that flex-grow made this claim more
	   room than it was actually given, pushing the Submit button and
	   the navbar below it out of the visible/clickable area — which is
	   exactly why Submit stopped working. display:flex here is only to
	   turn this into a column for its own child. */
	display: flex;
	flex-direction: column;
}
.ielts-task-card.ielts-fullscreen-active .ielts-task-body:not(.ielts-task-body-split) > .ielts-questions-panel {
	flex: 1 1 auto;
	min-height: 0;
	display: flex;
	flex-direction: column;
}
.ielts-task-card.ielts-fullscreen-active .ielts-task-body:not(.ielts-task-body-split) > .ielts-questions-panel > form {
	flex: 1 1 auto;
	min-height: 0;
	display: flex;
	flex-direction: column;
}
.ielts-task-card.ielts-fullscreen-active .ielts-task-body:not(.ielts-task-body-split) > .ielts-questions-panel > form > .ielts-task-actions {
	flex: 0 0 auto;
	display: flex;
	gap: 10px;
	align-items: center;
	margin-top: 14px;
	padding-top: 4px;
}
@media (max-width: 700px) {
	.ielts-task-card.ielts-fullscreen-active .ielts-task-body:not(.ielts-task-body-split) {
		height: auto;
	}
	.ielts-task-card.ielts-fullscreen-active .ielts-part.ielts-part-active {
		flex-direction: column;
		height: auto;
	}
	.ielts-task-card.ielts-fullscreen-active .ielts-part-passage,
	.ielts-task-card.ielts-fullscreen-active .ielts-part-questions {
		height: auto;
		max-height: 45vh;
	}
}
/* Belt-and-braces: even once the height cascade above is correct, keep
   the navbar glued to the bottom edge of the fullscreen viewport rather
   than just wherever it falls in the flex column. */
.ielts-task-card.ielts-fullscreen-active .ielts-part-navbar {
	position: sticky;
	bottom: 0;
	flex: 0 0 auto;
	background: #fff;
}

.ielts-part-banner {
	background: #eef3fb;
	border-left: 4px solid #2e75b6;
	padding: 10px 14px;
	margin-bottom: 14px;
	border-radius: 4px;
	font-size: 13.5px;
	color: #1f3864;
}
.ielts-part-banner strong {
	margin-right: 6px;
}

.ielts-part-navbar {
	position: sticky;
	bottom: 0;
	background: #fff;
	border-top: 1px solid #e5e5e5;
	padding: 10px 14px;
	margin-top: 16px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 12px;
	z-index: 3;
}
.ielts-part-navbar-pills {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}
.ielts-qpill {
	width: 28px;
	height: 28px;
	border-radius: 6px;
	border: 1.5px solid #cfd8e3;
	background: #fff;
	font-size: 12px;
	cursor: pointer;
	color: #333;
}
.ielts-qpill.answered {
	background: #eaf4ea;
	border-color: #4c9a4c;
	color: #274e13;
}
.ielts-part-navbar-others {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
}
.ielts-part-link {
	background: none;
	border: 1px solid #cfd8e3;
	border-radius: 6px;
	padding: 4px 10px;
	font-size: 12px;
	cursor: pointer;
	color: #1f3864;
}
.ielts-part-link:hover {
	border-color: #2e75b6;
}
.ielts-part-navbar-arrows {
	display: flex;
	gap: 6px;
}
.ielts-part-navbar-arrows button {
	width: 32px;
	height: 32px;
	border-radius: 6px;
	border: none;
	background: #1f3864;
	color: #fff;
	cursor: pointer;
	font-size: 14px;
}
.ielts-part-navbar-arrows button:disabled {
	background: #cfd8e3;
	cursor: default;
}

.ielts-attempt-history {
	background: #f6f7f7;
	border: 1px solid #dcdcde;
	border-radius: 6px;
	padding: 8px 14px;
	margin-bottom: 14px;
	font-size: 13.5px;
}
.ielts-attempt-history summary {
	cursor: pointer;
	font-weight: 600;
	color: #1f3864;
}
.ielts-attempt-history ul {
	margin: 8px 0 2px 20px;
	list-style: disc;
}
.ielts-attempt-history li {
	margin-bottom: 4px;
}
