/* Extracted from new/templ/page/practice_body.templ (templ practiceBody) */
.message-content {
	padding-top: 0 !important;
}
.chat-box-area {
	padding-top: 0 !important;
}
#whiteboard {
	margin-top: 0 !important;
	padding-top: 0 !important;
	margin-bottom: 0 !important;
}
/* Scroll room below the question so the fixed answer footer doesn't cover
   it. Lives on the last item rather than the list itself so an empty
   whiteboard (content loader / error card showing) doesn't push the loader
   250px below the header. */
#whiteboard > li:last-child {
	margin-bottom: 250px !important;
}
.recent-jobs-list {
	margin-top: 0 !important;
	padding-top: 0 !important;
}
.recent-jobs-list ul {
	padding-top: 0 !important;
	margin-top: 0 !important;
}
.return-card-modern {
	margin-top: 0 !important;
}
.header {
	margin-bottom: 0 !important;
}
.page-content {
	padding-top: 0 !important;
}
.content-loader-modern {
	position: relative;
	min-height: 320px;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 18px;
	border-radius: 20px;
	overflow: hidden;
	background: linear-gradient(145deg, #f8faff 0%, #eef3ff 100%);
	animation: contentLoaderFade .3s ease;
}
@keyframes contentLoaderFade {
	from { opacity: 0; }
	to { opacity: 1; }
}
.content-loader-orb {
	position: absolute;
	border-radius: 50%;
	filter: blur(50px);
	opacity: .3;
	pointer-events: none;
}
.content-loader-orb-1 {
	width: 220px;
	height: 220px;
	background: var(--primary);
	top: -80px;
	left: -60px;
	animation: contentLoaderDrift 7s ease-in-out infinite alternate;
}
.content-loader-orb-2 {
	width: 180px;
	height: 180px;
	background: #38bdf8;
	bottom: -70px;
	right: -50px;
	animation: contentLoaderDrift 9s ease-in-out infinite alternate-reverse;
}
@keyframes contentLoaderDrift {
	from { transform: translate(0, 0); }
	to { transform: translate(25px, 20px); }
}
.content-loader-spinner {
	position: relative;
	width: 70px;
	height: 70px;
}
.content-loader-ring {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	border-radius: 50%;
	border: 4px solid transparent;
	border-top-color: var(--primary);
	animation: contentLoaderSpin 1.1s linear infinite;
}
.content-loader-ring:nth-child(2) {
	width: 78%;
	height: 78%;
	top: 11%;
	left: 11%;
	border-top-color: #38bdf8;
	animation-duration: 0.9s;
	animation-direction: reverse;
}
.content-loader-ring:nth-child(3) {
	width: 56%;
	height: 56%;
	top: 22%;
	left: 22%;
	border-top-color: #a5b4fc;
	animation-duration: 1.4s;
}
@keyframes contentLoaderSpin {
	to { transform: rotate(360deg); }
}
.content-loader-text {
	position: relative;
	font-weight: 700;
	font-size: 0.95rem;
	color: #4a4a68;
	letter-spacing: 0.02em;
}
/* Retrying: the loader keeps spinning, but warms up so it's obvious
   something is off without shouting at the learner. */
.content-loader-retry {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 7px 16px;
	border-radius: 999px;
	background: #fff7ed;
	border: 1px solid #fed7aa;
	box-shadow: 0 2px 10px rgba(249, 115, 22, .12);
	font-weight: 600;
	font-size: 0.85rem;
	color: #c2410c;
	animation: contentLoaderFade .3s ease;
}
.content-loader-retry-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #f97316;
	flex: 0 0 auto;
	animation: contentRetryPulse 1.4s ease-in-out infinite;
}
@keyframes contentRetryPulse {
	0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(249, 115, 22, .45); }
	50% { opacity: .5; box-shadow: 0 0 0 6px rgba(249, 115, 22, 0); }
}
.content-loader-modern.is-retrying .content-loader-ring {
	border-top-color: #fb923c;
}
.content-loader-modern.is-retrying .content-loader-ring:nth-child(2) {
	border-top-color: #fdba74;
}
.content-loader-modern.is-retrying .content-loader-ring:nth-child(3) {
	border-top-color: #fed7aa;
}
.content-loader-modern.is-retrying .content-loader-orb-2 {
	background: #fb923c;
}

/* Gave up retrying: an in-page card instead of a system-looking
   alert, so the failure sits in the same visual language as the
   questions it replaces. */
.content-error-card {
	position: relative;
	min-height: 320px;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	gap: 14px;
	padding: 40px 28px;
	border-radius: 20px;
	overflow: hidden;
	background: linear-gradient(145deg, #fffaf6 0%, #fdf2f8 100%);
	box-shadow: 0 10px 30px rgba(15, 23, 42, .06);
	animation: contentErrorIn .35s cubic-bezier(.22, 1, .36, 1);
}
@keyframes contentErrorIn {
	from { opacity: 0; transform: translateY(12px); }
	to { opacity: 1; transform: none; }
}
.content-error-orb {
	position: absolute;
	border-radius: 50%;
	filter: blur(50px);
	opacity: .28;
	pointer-events: none;
}
.content-error-orb-1 {
	width: 220px;
	height: 220px;
	background: #fb923c;
	top: -80px;
	left: -60px;
	animation: contentLoaderDrift 7s ease-in-out infinite alternate;
}
.content-error-orb-2 {
	width: 180px;
	height: 180px;
	background: #f472b6;
	bottom: -70px;
	right: -50px;
	animation: contentLoaderDrift 9s ease-in-out infinite alternate-reverse;
}
.content-error-icon {
	position: relative;
	width: 72px;
	height: 72px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	background: #fff;
	color: #f97316;
	box-shadow: 0 6px 18px rgba(249, 115, 22, .18);
}
.content-error-icon svg {
	width: 34px;
	height: 34px;
}
.content-error-title {
	position: relative;
	font-weight: 800;
	font-size: 1.35rem;
	color: #1f2937;
	letter-spacing: -0.01em;
}
.content-error-text {
	position: relative;
	max-width: 420px;
	font-size: 0.95rem;
	line-height: 1.5;
	color: #64748b;
}
.content-error-actions {
	position: relative;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 10px;
	margin-top: 6px;
}
.content-error-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	border: none;
	border-radius: 14px;
	padding: 12px 24px;
	font-weight: 700;
	font-size: 0.95rem;
	cursor: pointer;
	transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.content-error-btn svg {
	width: 18px;
	height: 18px;
}
.content-error-btn-primary {
	background: var(--primary);
	color: #fff;
	box-shadow: 0 4px 0 rgba(0, 0, 0, .12);
}
.content-error-btn-primary:hover {
	transform: translateY(-1px);
	box-shadow: 0 6px 0 rgba(0, 0, 0, .12);
}
.content-error-btn-primary:active {
	transform: translateY(2px);
	box-shadow: 0 1px 0 rgba(0, 0, 0, .12);
}
.content-error-btn-ghost {
	background: transparent;
	color: #64748b;
	border: 1px solid #e2e8f0;
}
.content-error-btn-ghost:hover {
	background: #f8fafc;
	color: #475569;
}
.content-error-card.is-busy .content-error-btn {
	pointer-events: none;
	opacity: .6;
}
.content-error-card.is-busy .content-error-btn-primary svg {
	animation: contentLoaderSpin .9s linear infinite;
}
@media (prefers-reduced-motion: reduce) {
	.content-error-card,
	.content-error-orb,
	.content-loader-retry,
	.content-loader-retry-dot {
		animation: none !important;
	}
}

/* ============ Dark theme ============ */
/* Loader and error cards sit directly on the --tt-bg canvas; re-seat their
   pale gradients on the dark surface scale. The blurred colour orbs and
   spinner rings stay - they glow nicely against a dark card. */
html[data-theme="dark"] .content-loader-modern {
	background:
		linear-gradient(145deg, rgba(96, 165, 250, 0.1) 0%, rgba(96, 165, 250, 0.04) 100%),
		var(--tt-surface, #111a2e);
}
html[data-theme="dark"] .content-loader-text {
	color: #c3cddd;
}
html[data-theme="dark"] .content-loader-retry {
	background: rgba(251, 191, 36, 0.15);
	border-color: rgba(251, 191, 36, 0.35);
	color: #fbbf24;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}
html[data-theme="dark"] .content-error-card {
	background:
		linear-gradient(145deg, rgba(251, 146, 60, 0.08) 0%, rgba(244, 114, 182, 0.08) 100%),
		var(--tt-surface, #111a2e);
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}
html[data-theme="dark"] .content-error-icon {
	background: var(--tt-surface-2, #17233b);
	color: #fb923c;
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}
html[data-theme="dark"] .content-error-title {
	color: var(--tt-ink, #e6ebf5);
}
html[data-theme="dark"] .content-error-text {
	color: var(--tt-muted, #94a3b8);
}
html[data-theme="dark"] .content-error-btn-primary {
	box-shadow: 0 4px 0 rgba(0, 0, 0, 0.35);
}
html[data-theme="dark"] .content-error-btn-primary:hover {
	box-shadow: 0 6px 0 rgba(0, 0, 0, 0.35);
}
html[data-theme="dark"] .content-error-btn-primary:active {
	box-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
}
html[data-theme="dark"] .content-error-btn-ghost {
	color: var(--tt-muted, #94a3b8);
	border-color: var(--tt-line, #263450);
}
html[data-theme="dark"] .content-error-btn-ghost:hover {
	background: var(--tt-surface-2, #17233b);
	color: #c3cddd;
}

/* Rendered-markdown structure inside lesson text pieces (headings, lists,
   tables) - generated content leans on these to break up long prose, so they
   must read well on a phone-width card. */
li[data-type="text"] .text-content p {
	margin-bottom: 0.85em;
}
li[data-type="text"] .text-content p:last-child {
	margin-bottom: 0;
}
li[data-type="text"] .text-content h1,
li[data-type="text"] .text-content h2,
li[data-type="text"] .text-content h3,
li[data-type="text"] .text-content h4,
li[data-type="text"] .text-content h5 {
	font-size: 1.05rem;
	font-weight: 800;
	color: #1f2937;
	margin: 1.1em 0 0.45em;
	line-height: 1.35;
}
li[data-type="text"] .text-content h1:first-child,
li[data-type="text"] .text-content h2:first-child,
li[data-type="text"] .text-content h3:first-child,
li[data-type="text"] .text-content h4:first-child,
li[data-type="text"] .text-content h5:first-child {
	margin-top: 0;
}
li[data-type="text"] .text-content ul,
li[data-type="text"] .text-content ol {
	margin: 0 0 0.9em;
	padding-left: 1.35em;
}
li[data-type="text"] .text-content ul li,
li[data-type="text"] .text-content ol li {
	margin-bottom: 0.45em;
}
/* practice.css blows list items up to 1.2rem with 10/20px padding via
   #whiteboard; pull them back in line with the body copy so a slide with a
   diagram plus a short list fits on one screen. */
#whiteboard li[data-type="text"] .text-content ul li,
#whiteboard li[data-type="text"] .text-content ol li {
	font-size: 1.02rem !important;
	line-height: 1.5;
	padding: 6px 14px;
	margin-bottom: 6px;
}
@media (max-width: 576px) {
	li[data-type="text"] .text-content {
		font-size: 0.98rem !important;
		line-height: 1.5 !important;
	}
	li[data-type="text"] .text-content p {
		margin-bottom: 0.6em;
	}
	#whiteboard li[data-type="text"] .text-content ul li,
	#whiteboard li[data-type="text"] .text-content ol li {
		font-size: 0.95rem !important;
		line-height: 1.4;
		padding: 5px 10px;
		margin-bottom: 4px;
		margin-left: 0.6em;
	}
}
li[data-type="text"] .text-content ul li::marker {
	color: var(--primary, #6366f1);
}
li[data-type="text"] .text-content ol li::marker {
	color: var(--primary, #6366f1);
	font-weight: 700;
}
li[data-type="text"] .text-content table {
	display: block;
	width: 100%;
	overflow-x: auto;
	border-collapse: collapse;
	margin: 0.4em 0 1em;
	font-size: 0.98rem;
	line-height: 1.45;
}
li[data-type="text"] .text-content th,
li[data-type="text"] .text-content td {
	border: 1px solid #e5e7eb;
	padding: 8px 12px;
	text-align: left;
	vertical-align: top;
	min-width: 90px;
}
li[data-type="text"] .text-content th {
	background: var(--rgba-primary-1, rgba(99, 102, 241, 0.08));
	color: #1f2937;
	font-weight: 800;
	white-space: nowrap;
}
li[data-type="text"] .text-content tr:nth-child(even) td {
	background: #fafafa;
}
li[data-type="text"] .text-content blockquote {
	margin: 0 0 0.9em;
	padding: 10px 16px;
	border-left: 4px solid var(--primary, #6366f1);
	background: var(--rgba-primary-1, rgba(99, 102, 241, 0.06));
	border-radius: 0 10px 10px 0;
}
li[data-type="text"] .text-content blockquote p:last-child {
	margin-bottom: 0;
}

html[data-theme="dark"] li[data-type="text"] .text-content h1,
html[data-theme="dark"] li[data-type="text"] .text-content h2,
html[data-theme="dark"] li[data-type="text"] .text-content h3,
html[data-theme="dark"] li[data-type="text"] .text-content h4,
html[data-theme="dark"] li[data-type="text"] .text-content h5 {
	color: var(--tt-ink, #e6ebf5);
}
html[data-theme="dark"] li[data-type="text"] .text-content th,
html[data-theme="dark"] li[data-type="text"] .text-content td {
	border-color: var(--tt-line, #263450);
}
html[data-theme="dark"] li[data-type="text"] .text-content th {
	background: var(--tt-surface-2, #17233b);
	color: var(--tt-ink, #e6ebf5);
}
html[data-theme="dark"] li[data-type="text"] .text-content tr:nth-child(even) td {
	background: rgba(255, 255, 255, 0.02);
}
