/* Extracted from new/templ/page/learn.templ (templ classBar + classesModal) */
.class-bar-scroll {
	overflow-x: auto;
	gap: 10px;
	scrollbar-width: none;
	-webkit-overflow-scrolling: touch;
	/* Let the strip scroll instead of squashing its pills; pad so the
	   pill hover lift/shadow isn't clipped. */
	min-width: 0;
	padding: 4px 2px;
	margin: -4px -2px;
	-webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
	mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
}
.class-bar-scroll::-webkit-scrollbar { display: none; }
.class-pill {
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 999px;
	padding: 6px 16px 6px 6px;
	gap: 10px;
	white-space: nowrap;
	/* Never shrink to fit: the strip scrolls horizontally. */
	flex: 0 0 auto;
	max-width: 260px;
	color: #0f172a;
	font-weight: 600;
	transition: all 0.2s;
	cursor: pointer;
}
.class-pill:hover {
	border-color: var(--primary);
	background: #f0f7ff;
	color: var(--primary);
	transform: translateY(-1px);
	box-shadow: 0 8px 18px -8px rgba(99, 102, 241, 0.45) !important;
}
.class-pill-icon {
	width: 36px;
	height: 36px;
	min-width: 36px;
	border-radius: 50%;
	object-fit: cover;
	background: linear-gradient(135deg, #eef2ff 0%, #f0f7ff 100%);
	color: var(--primary);
}
.class-pill-name {
	overflow: hidden;
	text-overflow: ellipsis;
	min-width: 0;
}
.class-pill-count:empty { display: none; }
.class-pill-count {
	flex-shrink: 0;
	color: #64748b;
	font-size: 0.8rem;
	font-weight: 500;
}
.class-pill:hover .class-pill-count { color: var(--primary); }
.class-bar-all {
	white-space: nowrap;
	font-weight: 700;
	color: #0f172a;
	border: 1px solid #e2e8f0;
	transition: all 0.2s;
}
.class-bar-all:hover {
	color: var(--primary);
	border-color: var(--primary);
	transform: translateY(-1px);
}

/* Classes modal */
.classes-modal-content {
	border: none;
	border-radius: 26px;
	overflow: hidden;
	box-shadow: 0 30px 70px -15px rgba(15, 23, 42, 0.4);
}
.classes-modal-header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 16px;
	padding: 26px 26px 22px 26px;
	color: #fff;
	background: linear-gradient(120deg, var(--primary) 0%, #5b3bb3 60%, #7b3bd6 100%);
	position: relative;
	overflow: hidden;
	/* overflow:hidden zeroes the flex min-height, so a scrollable dialog
	   would squash the header (clipping icon + subtitle) without this. */
	flex-shrink: 0;
}
.classes-modal-header::before {
	content: "";
	position: absolute;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.07);
	width: 260px;
	height: 260px;
	top: -140px;
	right: -70px;
	pointer-events: none;
}
.classes-modal-header::after {
	content: "";
	position: absolute;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.06);
	width: 150px;
	height: 150px;
	bottom: -90px;
	left: 30%;
	pointer-events: none;
}
.classes-modal-header .modal-title {
	color: #fff;
	font-size: 1.45rem;
	letter-spacing: -0.02em;
}
.classes-modal-header-main {
	display: flex;
	align-items: center;
	gap: 16px;
	position: relative;
	z-index: 1;
}
.classes-modal-header-icon {
	width: 52px;
	height: 52px;
	min-width: 52px;
	border-radius: 16px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 22px;
	color: #fff;
	background: rgba(255, 255, 255, 0.16);
	border: 1px solid rgba(255, 255, 255, 0.25);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 8px 18px -8px rgba(0, 0, 0, 0.35);
	backdrop-filter: blur(4px);
}
.classes-modal-header-right {
	display: flex;
	align-items: center;
	gap: 12px;
	position: relative;
	z-index: 1;
}
.classes-modal-count-chip {
	background: rgba(255, 255, 255, 0.18);
	border: 1px solid rgba(255, 255, 255, 0.28);
	color: #fff;
	font-size: 0.78rem;
	font-weight: 700;
	padding: 5px 14px;
	border-radius: 999px;
	white-space: nowrap;
	letter-spacing: 0.02em;
}
.classes-modal-header .btn-close {
	position: relative;
	z-index: 1;
	opacity: 0.8;
	transition: opacity 0.2s;
}
.classes-modal-header .btn-close:hover { opacity: 1; }
.classes-modal-sub {
	opacity: 0.85;
	font-size: 0.88rem;
}
.classes-modal-body {
	padding: 24px 26px 26px 26px;
	background: linear-gradient(180deg, #f6f8fc 0%, #eef2f9 100%);
}
.classes-modal-card {
	background: #fff;
	border: 1px solid #eef2f7;
	border-radius: 20px;
	overflow: hidden;
	height: 100%;
	display: flex;
	flex-direction: column;
	box-shadow: 0 10px 25px -10px rgba(15, 23, 42, 0.08);
	transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.classes-modal-card:hover {
	transform: translateY(-4px);
	border-color: rgba(99, 102, 241, 0.35);
	box-shadow: 0 22px 40px -14px rgba(91, 59, 179, 0.28);
}
.classes-modal-banner {
	height: 84px;
	background: linear-gradient(120deg, #6a5af9 0%, #a55af9 55%, #d66efd 100%);
	background-size: cover;
	background-position: center;
	position: relative;
	overflow: hidden;
}
.classes-modal-banner-shade {
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, rgba(15, 23, 42, 0) 40%, rgba(15, 23, 42, 0.18) 100%);
}
.classes-modal-banner-orb {
	position: absolute;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.14);
	width: 130px;
	height: 130px;
	top: -60px;
	right: -30px;
	pointer-events: none;
}
.classes-modal-banner-orb-2 {
	width: 80px;
	height: 80px;
	top: auto;
	right: auto;
	bottom: -45px;
	left: 22px;
	background: rgba(255, 255, 255, 0.1);
}
.classes-modal-card-body {
	padding: 0 20px 20px 20px;
	flex: 1;
	display: flex;
	flex-direction: column;
}
.classes-modal-icon {
	position: relative;
	z-index: 2;
	width: 58px;
	height: 58px;
	border-radius: 17px;
	object-fit: cover;
	border: 3px solid #fff;
	background: linear-gradient(135deg, #eef2ff 0%, #f0f7ff 100%);
	margin-top: -29px;
	box-shadow: 0 10px 20px -6px rgba(15, 23, 42, 0.22);
	color: var(--primary);
	font-size: 22px;
}
.classes-modal-card-name {
	margin: 12px 0 10px 0;
	font-size: 1.05rem;
	letter-spacing: -0.01em;
	color: #0f172a;
}
.classes-modal-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: auto;
}
.classes-modal-chip {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	background: #f1f5f9;
	border: 1px solid #e8edf4;
	color: #475569;
	font-size: 0.8rem;
	font-weight: 600;
	padding: 5px 12px;
	border-radius: 999px;
	white-space: nowrap;
}
.classes-modal-chip i {
	font-size: 0.72rem;
	color: var(--primary);
	opacity: 0.85;
}
.classes-modal-empty {
	padding: 44px 20px;
}
.classes-modal-empty-icon {
	width: 76px;
	height: 76px;
	border-radius: 24px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: linear-gradient(135deg, #eef2ff 0%, #f3e8ff 100%);
	box-shadow: 0 12px 26px -12px rgba(99, 102, 241, 0.45);
}
.classes-modal-empty-icon i {
	font-size: 32px;
	color: var(--primary);
}

/* ============ Dark theme ============ */
/* theme.css stamps html[data-theme="dark"] and supplies the --tt-* scale.
   The modal header gradient and card banner gradient are brand artwork
   with white text and keep their light-mode look. */

/* Class pills */
html[data-theme="dark"] .class-pill {
	background: linear-gradient(160deg, var(--tt-surface-2, #17233b) 0%, var(--tt-surface, #111a2e) 70%);
	border-color: var(--tt-line-strong, #33436a);
	color: var(--tt-ink, #e6ebf5);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 8px 20px -12px rgba(0, 0, 0, 0.6);
}
html[data-theme="dark"] .class-pill-icon {
	box-shadow: 0 0 0 2px rgba(124, 128, 242, 0.35);
	color: #a5b4fc;
}
html[data-theme="dark"] .class-pill:hover {
	border-color: var(--primary, #008cff);
	background: rgba(0, 140, 255, 0.12);
	color: #38b6ff;
	box-shadow: 0 8px 18px -8px rgba(0, 0, 0, 0.6) !important;
}
html[data-theme="dark"] .class-pill-icon {
	background: linear-gradient(135deg, rgba(99, 102, 241, 0.18) 0%, rgba(0, 140, 255, 0.14) 100%);
}
html[data-theme="dark"] .class-pill-count { color: var(--tt-muted, #94a3b8); }
html[data-theme="dark"] .class-pill:hover .class-pill-count { color: #38b6ff; }
/* The hover shine sweep is tuned for white pills; at full strength it
   flashbangs on dark surfaces. */
html[data-theme="dark"] .class-pill::after {
	background: linear-gradient(105deg, transparent 0%, rgba(255, 255, 255, 0.12) 50%, transparent 100%);
}
html[data-theme="dark"] .class-bar-all {
	color: var(--tt-ink, #e6ebf5);
	border-color: var(--tt-line, #263450);
}

/* Classes modal */
html[data-theme="dark"] .classes-modal-content {
	box-shadow: 0 30px 70px -15px rgba(0, 0, 0, 0.65);
}
html[data-theme="dark"] .classes-modal-body {
	background: linear-gradient(180deg, var(--tt-bg, #0b1120) 0%, #0a0f1c 100%);
}
html[data-theme="dark"] .classes-modal-card {
	background: var(--tt-surface, #111a2e);
	border-color: var(--tt-line, #263450);
	box-shadow: 0 10px 25px -10px rgba(0, 0, 0, 0.4);
}
html[data-theme="dark"] .classes-modal-card:hover {
	border-color: rgba(0, 140, 255, 0.45);
	box-shadow: 0 22px 40px -14px rgba(0, 0, 0, 0.6);
}
html[data-theme="dark"] .classes-modal-icon {
	border-color: var(--tt-surface, #111a2e);
	background: var(--tt-surface-2, #17233b);
	box-shadow: 0 10px 20px -6px rgba(0, 0, 0, 0.45);
}
html[data-theme="dark"] .classes-modal-card-name { color: var(--tt-ink, #e6ebf5); }
html[data-theme="dark"] .classes-modal-chip {
	background: var(--tt-surface-2, #17233b);
	border-color: var(--tt-line, #263450);
	color: var(--tt-muted, #94a3b8);
}
html[data-theme="dark"] .classes-modal-chip i { color: #38b6ff; }
html[data-theme="dark"] .classes-modal-empty-icon {
	background: linear-gradient(135deg, rgba(99, 102, 241, 0.18) 0%, rgba(166, 90, 249, 0.14) 100%);
	box-shadow: 0 12px 26px -12px rgba(0, 0, 0, 0.5);
}

/* ===================== Sexy upgrade: class bar ===================== */
.class-pill {
	position: relative;
	overflow: hidden;
	animation: classPillIn 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes classPillIn {
	from { opacity: 0; transform: translateY(10px) scale(0.96); }
	to { opacity: 1; transform: translateY(0) scale(1); }
}
.class-pill::after {
	content: "";
	position: absolute;
	top: 0;
	left: -80%;
	width: 50%;
	height: 100%;
	background: linear-gradient(105deg, transparent 0%, rgba(255, 255, 255, 0.55) 50%, transparent 100%);
	transform: skewX(-20deg);
	pointer-events: none;
}
.class-pill:hover::after {
	animation: classPillShine 0.7s ease;
}
@keyframes classPillShine {
	from { left: -80%; }
	to { left: 130%; }
}
.class-pill:hover { transform: translateY(-2px) scale(1.02); }
.class-pill:active { transform: translateY(0) scale(0.98); }
.class-pill-icon {
	transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
	box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.18);
}
.class-pill:hover .class-pill-icon { transform: rotate(-8deg) scale(1.12); }
.class-pill-go {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 0;
	overflow: hidden;
	color: var(--primary);
	font-size: 0.75rem;
	opacity: 0;
	transition: width 0.25s ease, opacity 0.25s ease, transform 0.25s ease;
	transform: translateX(-6px);
}
.class-pill:hover .class-pill-go {
	width: 16px;
	opacity: 1;
	transform: translateX(0);
}

/* ===================== Classes overview modal polish ===================== */
.classes-modal-aurora {
	position: absolute;
	inset: -40%;
	pointer-events: none;
	background:
		radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.14) 0%, transparent 30%),
		radial-gradient(circle at 80% 70%, rgba(255, 182, 255, 0.18) 0%, transparent 35%),
		radial-gradient(circle at 60% 20%, rgba(120, 200, 255, 0.16) 0%, transparent 30%);
	animation: classesAurora 9s ease-in-out infinite alternate;
}
@keyframes classesAurora {
	from { transform: translate3d(-3%, -2%, 0) rotate(0deg); }
	to { transform: translate3d(3%, 2%, 0) rotate(4deg); }
}
.classes-modal-card-wrap {
	animation: classPillIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.classes-modal-card {
	display: flex;
	flex-direction: column;
	cursor: pointer;
	color: inherit;
}
.classes-modal-card:hover .classes-modal-banner { filter: saturate(1.15); }
.classes-modal-card-cta {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	margin-top: 12px;
	color: var(--primary);
	font-size: 0.82rem;
	font-weight: 700;
	opacity: 0;
	transform: translateY(4px);
	transition: opacity 0.25s ease, transform 0.25s ease;
}
.classes-modal-card:hover .classes-modal-card-cta {
	opacity: 1;
	transform: translateY(0);
}
.classes-modal-card-cta i { transition: transform 0.25s ease; }
.classes-modal-card:hover .classes-modal-card-cta i { transform: translateX(4px); }

/* ===================== Class detail modal ===================== */
.cdm-content {
	border: none;
	border-radius: 30px;
	overflow: hidden;
	background: #f7f9fd;
	box-shadow:
		0 0 0 1px rgba(255, 255, 255, 0.55),
		0 50px 110px -24px rgba(15, 23, 42, 0.55),
		0 18px 40px -20px rgba(91, 59, 179, 0.35);
}
.class-detail-modal .modal-dialog {
	transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.35s ease;
}
.class-detail-modal.fade .modal-dialog { transform: translateY(28px) scale(0.96); }
.class-detail-modal.show .modal-dialog { transform: translateY(0) scale(1); }

/* Hero */
.cdm-hero {
	position: relative;
	color: #fff;
	min-height: 196px;
	display: flex;
	align-items: flex-end;
	isolation: isolate;
}
.cdm-hero::after {
	/* soft lift into the tab bar so the hero never ends on a hard line */
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 70px;
	background: linear-gradient(180deg, rgba(10, 8, 30, 0) 0%, rgba(10, 8, 30, 0.28) 100%);
	pointer-events: none;
	z-index: 1;
}
.cdm-hero-banner {
	position: absolute;
	inset: 0;
	background-size: cover;
	background-position: center;
}
.cdm-hero-shade {
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, rgba(15, 23, 42, 0.05) 0%, rgba(15, 23, 42, 0.68) 100%);
}
.cdm-hero-banner-gradient {
	background:
		radial-gradient(120% 90% at 100% 0%, rgba(255, 173, 230, 0.55) 0%, rgba(255, 173, 230, 0) 55%),
		radial-gradient(90% 80% at 0% 100%, rgba(80, 200, 255, 0.45) 0%, rgba(80, 200, 255, 0) 60%),
		linear-gradient(120deg, #5b4cf6 0%, #8b5af9 40%, #b45af9 75%, #e070ff 100%);
	background-size: 100% 100%, 100% 100%, 220% 220%;
	animation: cdmGradientDrift 10s ease-in-out infinite alternate;
	overflow: hidden;
}
.cdm-hero-banner-gradient::before {
	/* faint grid gives the gradient some texture */
	content: "";
	position: absolute;
	inset: 0;
	background-image:
		linear-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px),
		linear-gradient(90deg, rgba(255, 255, 255, 0.07) 1px, transparent 1px);
	background-size: 28px 28px;
	mask-image: radial-gradient(80% 80% at 50% 40%, #000 20%, transparent 100%);
	-webkit-mask-image: radial-gradient(80% 80% at 50% 40%, #000 20%, transparent 100%);
	pointer-events: none;
}
@keyframes cdmGradientDrift {
	from { background-position: 0% 30%; }
	to { background-position: 100% 70%; }
}
.cdm-orb {
	position: absolute;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.14);
	pointer-events: none;
	box-shadow: inset 0 0 40px rgba(255, 255, 255, 0.18);
}
.cdm-orb-1 { width: 190px; height: 190px; top: -90px; right: -40px; animation: cdmFloat 7s ease-in-out infinite alternate; }
.cdm-orb-2 { width: 110px; height: 110px; bottom: -50px; left: 18%; background: rgba(255, 255, 255, 0.1); animation: cdmFloat 9s ease-in-out infinite alternate-reverse; }
.cdm-orb-3 { width: 64px; height: 64px; top: 24px; left: 55%; background: rgba(255, 255, 255, 0.12); animation: cdmFloat 6s ease-in-out infinite alternate; }
@keyframes cdmFloat {
	from { transform: translate3d(0, 0, 0); }
	to { transform: translate3d(10px, 14px, 0); }
}
.cdm-hero-shine {
	position: absolute;
	top: 0;
	left: -60%;
	width: 45%;
	height: 100%;
	background: linear-gradient(105deg, transparent 0%, rgba(255, 255, 255, 0.22) 50%, transparent 100%);
	transform: skewX(-18deg);
	animation: cdmHeroShine 5.5s ease-in-out infinite;
	pointer-events: none;
}
@keyframes cdmHeroShine {
	0%, 55% { left: -60%; }
	85%, 100% { left: 140%; }
}
.cdm-close {
	position: absolute;
	top: 16px;
	right: 16px;
	z-index: 3;
	opacity: 1;
	width: 38px;
	height: 38px;
	padding: 0;
	border-radius: 50%;
	/* btn-close-white inverts the whole button (glass turns grey), so paint
	   a white X ourselves instead. */
	filter: none !important;
	background-color: rgba(255, 255, 255, 0.16);
	background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23fff'%3e%3cpath d='M.293.293a1 1 0 0 1 1.414 0L8 6.586 14.293.293a1 1 0 1 1 1.414 1.414L9.414 8l6.293 6.293a1 1 0 0 1-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 0 1-1.414-1.414L6.586 8 .293 1.707a1 1 0 0 1 0-1.414z'/%3e%3c/svg%3e");
	background-size: 12px;
	border: 1px solid rgba(255, 255, 255, 0.3);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
	transition: background-color 0.2s ease, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.cdm-close:hover { background-color: rgba(255, 255, 255, 0.3); transform: rotate(90deg) scale(1.06); }
.cdm-hero-content {
	position: relative;
	z-index: 2;
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 22px 26px;
	width: 100%;
	animation: cdmRise 0.55s cubic-bezier(0.22, 1, 0.36, 1) both 0.05s;
}
@keyframes cdmRise {
	from { opacity: 0; transform: translateY(14px); }
	to { opacity: 1; transform: translateY(0); }
}
.cdm-icon {
	width: 72px;
	height: 72px;
	min-width: 72px;
	border-radius: 22px;
	object-fit: cover;
	border: 3px solid rgba(255, 255, 255, 0.9);
	background: linear-gradient(145deg, rgba(255, 255, 255, 0.32), rgba(255, 255, 255, 0.12));
	color: #fff;
	font-size: 28px;
	box-shadow:
		0 18px 34px -12px rgba(0, 0, 0, 0.5),
		0 0 0 6px rgba(255, 255, 255, 0.12),
		inset 0 1px 0 rgba(255, 255, 255, 0.5);
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
	animation: cdmIconPop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both 0.08s;
}
@keyframes cdmIconPop {
	from { opacity: 0; transform: scale(0.7) rotate(-8deg); }
	to { opacity: 1; transform: scale(1) rotate(0); }
}
.cdm-name {
	color: #fff;
	font-size: 1.7rem;
	line-height: 1.1;
	letter-spacing: -0.03em;
	text-shadow: 0 2px 14px rgba(0, 0, 0, 0.3);
}
.cdm-hero-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.cdm-chip {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	background: rgba(255, 255, 255, 0.18);
	border: 1px solid rgba(255, 255, 255, 0.34);
	color: #fff;
	font-size: 0.78rem;
	font-weight: 700;
	padding: 5px 13px;
	border-radius: 999px;
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 6px 16px -10px rgba(0, 0, 0, 0.5);
	white-space: nowrap;
}
.cdm-chip i { font-size: 0.7rem; opacity: 0.9; }

/* Tabs: a horizontal scroller (edge-faded) with a glider pill that slides
   under the active tab. The scroller must stay overflow-x:auto on every
   breakpoint so narrow phones can swipe to the Work tab. */
.cdm-tabbar {
	position: relative;
	background: #fff;
	border-bottom: 1px solid #eef2f7;
	z-index: 2;
}
.cdm-tabbar::before,
.cdm-tabbar::after {
	content: "";
	position: absolute;
	top: 0;
	bottom: 0;
	width: 34px;
	pointer-events: none;
	opacity: 0;
	transition: opacity 0.2s ease;
	z-index: 2;
}
.cdm-tabbar::before { left: 0; background: linear-gradient(90deg, #fff 20%, rgba(255, 255, 255, 0)); }
.cdm-tabbar::after { right: 0; background: linear-gradient(270deg, #fff 20%, rgba(255, 255, 255, 0)); }
.cdm-tabbar.cdm-fade-left::before, .cdm-tabbar.cdm-fade-right::after { opacity: 1; }
.cdm-tabs {
	position: relative;
	display: flex;
	gap: 4px;
	padding: 10px 14px;
	overflow-x: auto;
	overflow-y: hidden;
	-webkit-overflow-scrolling: touch;
	overscroll-behavior-x: contain;
	touch-action: pan-x;
	scrollbar-width: none;
	scroll-padding: 0 14px;
}
.cdm-tabs::-webkit-scrollbar { display: none; }
.cdm-tab-glider {
	position: absolute;
	top: 10px;
	left: 0;
	height: calc(100% - 20px);
	width: 0;
	border-radius: 14px;
	background: linear-gradient(135deg, rgba(99, 102, 241, 0.14), rgba(166, 90, 249, 0.14));
	box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.18);
	opacity: 0;
	transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), width 0.4s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.2s ease;
	pointer-events: none;
	z-index: 0;
}
.cdm-tab-glider.is-ready { opacity: 1; }
.cdm-tab {
	position: relative;
	z-index: 1;
	flex: 0 0 auto;
	appearance: none;
	border: none;
	background: transparent;
	color: #64748b;
	font-weight: 700;
	font-size: 0.9rem;
	padding: 10px 15px;
	border-radius: 14px;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	white-space: nowrap;
	transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
	-webkit-tap-highlight-color: transparent;
}
.cdm-tab i { font-size: 0.82rem; transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); }
.cdm-tab:hover { color: var(--primary); }
.cdm-tab:hover i { transform: translateY(-1px) scale(1.15); }
.cdm-tab:active { transform: scale(0.96); }
.cdm-tab.active { color: var(--primary); }
.cdm-tab.active i { transform: scale(1.1); }
/* no-JS / pre-measure fallback so the active tab is still obvious */
.cdm-tabs:not(:has(.cdm-tab-glider.is-ready)) .cdm-tab.active {
	background: linear-gradient(135deg, rgba(99, 102, 241, 0.14), rgba(166, 90, 249, 0.14));
}
.cdm-tab-badge {
	background: #eef2ff;
	color: var(--primary);
	font-size: 0.7rem;
	font-weight: 800;
	min-width: 20px;
	height: 20px;
	padding: 0 6px;
	border-radius: 999px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.2s, color 0.2s, box-shadow 0.2s;
}
.cdm-tab.active .cdm-tab-badge {
	background: linear-gradient(135deg, var(--primary), #a55af9);
	color: #fff;
	transform: scale(1.08);
	box-shadow: 0 6px 14px -6px rgba(99, 102, 241, 0.7);
}

/* Body + panes */
.cdm-body {
	background:
		radial-gradient(70% 40% at 50% 0%, rgba(139, 92, 246, 0.08) 0%, rgba(139, 92, 246, 0) 100%),
		linear-gradient(180deg, #f7f9fd 0%, #eef2f9 100%);
	padding: 22px 22px 28px 22px;
	min-height: 300px;
}
.cdm-pane { display: none; }
.cdm-pane.active { display: block; animation: cdmRise 0.35s ease both; }

/* Overview stats */
.cdm-stats {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 12px;
	margin-bottom: 16px;
}
.cdm-stat {
	position: relative;
	overflow: hidden;
	background: #fff;
	border: 1px solid #eef2f7;
	border-radius: 20px;
	padding: 18px 12px 16px 12px;
	text-align: center;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	box-shadow: 0 10px 25px -14px rgba(15, 23, 42, 0.12);
	animation: cdmPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
	transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.cdm-stat::before {
	content: "";
	position: absolute;
	inset: 0 0 auto 0;
	height: 3px;
	background: linear-gradient(90deg, var(--primary), #a55af9);
	opacity: 0;
	transition: opacity 0.25s ease;
}
.cdm-stat:hover {
	transform: translateY(-3px);
	box-shadow: 0 18px 34px -14px rgba(91, 59, 179, 0.28);
}
.cdm-stat:hover::before { opacity: 1; }
.cdm-stat:hover .cdm-stat-icon { transform: translateY(-2px) scale(1.08) rotate(-4deg); }
@keyframes cdmPop {
	from { opacity: 0; transform: translateY(12px) scale(0.9); }
	to { opacity: 1; transform: translateY(0) scale(1); }
}
.cdm-stat-icon {
	width: 42px;
	height: 42px;
	border-radius: 14px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 16px;
	color: #fff;
	transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.cdm-stat-icon-blue { background: linear-gradient(135deg, #60a5fa, #6366f1); box-shadow: 0 10px 20px -8px rgba(99, 102, 241, 0.6); }
.cdm-stat-icon-purple { background: linear-gradient(135deg, #a78bfa, #8b5cf6); box-shadow: 0 10px 20px -8px rgba(139, 92, 246, 0.6); }
.cdm-stat-icon-pink { background: linear-gradient(135deg, #f472b6, #d946ef); box-shadow: 0 10px 20px -8px rgba(217, 70, 239, 0.55); }
.cdm-stat-num {
	font-weight: 900;
	font-size: 1.45rem;
	color: #0f172a;
	letter-spacing: -0.02em;
	line-height: 1;
}
.cdm-stat-label {
	color: #64748b;
	font-size: 0.75rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

/* Tutor spotlight */
.cdm-tutor-card {
	display: flex;
	align-items: center;
	gap: 14px;
	background: linear-gradient(120deg, #fff 0%, #f6f4ff 100%);
	border: 1px solid #e9e5fb;
	border-radius: 18px;
	padding: 14px 16px;
	margin-bottom: 16px;
	box-shadow: 0 10px 25px -14px rgba(91, 59, 179, 0.18);
	animation: cdmPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.cdm-tutor-avatar {
	width: 52px;
	height: 52px;
	min-width: 52px;
	border-radius: 16px;
	object-fit: cover;
	border: 2px solid #fff;
	box-shadow: 0 8px 18px -8px rgba(15, 23, 42, 0.3);
}
.cdm-avatar-fallback {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: linear-gradient(135deg, #6a5af9, #a55af9);
	color: #fff;
	font-weight: 800;
	font-size: 1.1rem;
}
.cdm-tutor-label {
	color: #8b5cf6;
	font-size: 0.72rem;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.06em;
}
.cdm-tutor-name { font-weight: 800; color: #0f172a; }
.cdm-tutor-badge {
	width: 38px;
	height: 38px;
	border-radius: 12px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: linear-gradient(135deg, #fbbf24, #f59e0b);
	color: #fff;
	font-size: 14px;
	box-shadow: 0 8px 18px -8px rgba(245, 158, 11, 0.7);
	animation: cdmCrownBob 2.4s ease-in-out infinite;
}
@keyframes cdmCrownBob {
	0%, 100% { transform: translateY(0) rotate(0deg); }
	50% { transform: translateY(-3px) rotate(-6deg); }
}
.cdm-section-label {
	color: #64748b;
	font-size: 0.75rem;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	margin: 4px 2px 10px 2px;
	animation: cdmRise 0.4s ease both;
}

/* Students */
.cdm-students { display: flex; flex-direction: column; gap: 10px; }
.cdm-student {
	display: flex;
	align-items: center;
	gap: 12px;
	background: #fff;
	border: 1px solid #eef2f7;
	border-radius: 16px;
	padding: 10px 14px;
	box-shadow: 0 8px 20px -14px rgba(15, 23, 42, 0.12);
	animation: cdmSlideIn 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
	transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.cdm-student:hover {
	transform: translateX(4px);
	border-color: rgba(99, 102, 241, 0.35);
	box-shadow: 0 14px 28px -14px rgba(91, 59, 179, 0.22);
}
@keyframes cdmSlideIn {
	from { opacity: 0; transform: translateX(-14px); }
	to { opacity: 1; transform: translateX(0); }
}
.cdm-student-avatar {
	width: 42px;
	height: 42px;
	min-width: 42px;
	border-radius: 50%;
	object-fit: cover;
	border: 2px solid #fff;
	box-shadow: 0 6px 14px -6px rgba(15, 23, 42, 0.25);
	font-size: 0.95rem;
}
.cdm-student-name { font-weight: 700; color: #0f172a; font-size: 0.95rem; }
.cdm-student-sub { color: #94a3b8; font-size: 0.75rem; font-weight: 600; }
.cdm-student-chip {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	font-size: 0.74rem;
	font-weight: 700;
	padding: 4px 11px;
	border-radius: 999px;
	white-space: nowrap;
}
.cdm-student-chip-active { background: #ecfdf5; color: #059669; border: 1px solid #d1fae5; }
.cdm-student-chip-away { background: #f8fafc; color: #94a3b8; border: 1px solid #e2e8f0; }
.cdm-pulse-dot {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #10b981;
	animation: cdmPulse 1.8s ease-in-out infinite;
}
@keyframes cdmPulse {
	0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5); }
	50% { box-shadow: 0 0 0 5px rgba(16, 185, 129, 0); }
}

/* Courses */
.cdm-course {
	display: flex;
	align-items: center;
	gap: 12px;
	background: #fff;
	border: 1px solid #eef2f7;
	border-radius: 16px;
	padding: 12px 14px;
	margin-bottom: 10px;
	color: inherit;
	box-shadow: 0 8px 20px -14px rgba(15, 23, 42, 0.12);
	animation: cdmSlideIn 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
	transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.cdm-course:hover {
	transform: translateY(-2px);
	border-color: rgba(99, 102, 241, 0.4);
	box-shadow: 0 16px 32px -14px rgba(91, 59, 179, 0.3), 0 0 0 4px rgba(99, 102, 241, 0.06);
	color: inherit;
}
.cdm-course:hover .cdm-course-icon { transform: scale(1.06) rotate(-3deg); }
.cdm-course-icon {
	width: 46px;
	height: 46px;
	min-width: 46px;
	border-radius: 13px;
	object-fit: cover;
	background: linear-gradient(135deg, #eef2ff 0%, #f3e8ff 100%);
	color: var(--primary);
	font-size: 17px;
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 6px 14px -8px rgba(99, 102, 241, 0.4);
	transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.cdm-course-title { font-weight: 800; color: #0f172a; font-size: 0.95rem; }
.cdm-course-sub { color: #94a3b8; font-size: 0.78rem; font-weight: 600; }
.cdm-course-go {
	width: 34px;
	height: 34px;
	min-width: 34px;
	border-radius: 50%;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: #eef2ff;
	color: var(--primary);
	font-size: 0.8rem;
	transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.2s, color 0.2s;
}
.cdm-course:hover .cdm-course-go {
	background: var(--primary);
	color: #fff;
	transform: translateX(3px) scale(1.08);
}

/* Empty states */
.cdm-empty { padding: 40px 20px; }
.cdm-empty-icon {
	width: 70px;
	height: 70px;
	border-radius: 22px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: linear-gradient(135deg, #eef2ff 0%, #f3e8ff 100%);
	color: var(--primary);
	font-size: 28px;
	box-shadow: 0 12px 26px -12px rgba(99, 102, 241, 0.45);
	animation: cdmFloat 4s ease-in-out infinite alternate;
}

.min-width-0 { min-width: 0; }

@media (max-width: 575.98px) {
	.cdm-stats { gap: 8px; }
	.cdm-stat { padding: 12px 8px; }
	.cdm-tabs { padding: 8px 10px; gap: 2px; }
	.cdm-tab-glider { top: 8px; height: calc(100% - 16px); }
	.cdm-tab { padding: 9px 13px; font-size: 0.85rem; }
	.cdm-hero { min-height: 172px; }
	.cdm-hero-content { padding: 18px 20px; }
	.cdm-icon { width: 62px; height: 62px; min-width: 62px; border-radius: 19px; font-size: 24px; }
	.cdm-name { font-size: 1.45rem; }
	.cdm-content { border-radius: 26px; }
}

@media (prefers-reduced-motion: reduce) {
	.class-pill, .classes-modal-card-wrap, .cdm-hero-content, .cdm-stat, .cdm-icon,
	.cdm-tutor-card, .cdm-student, .cdm-course, .cdm-section-label, .cdm-pane.active,
	.cdm-hero-banner-gradient, .cdm-orb, .cdm-hero-shine, .cdm-tutor-badge,
	.cdm-pulse-dot, .classes-modal-aurora, .cdm-empty-icon {
		animation: none !important;
	}
}

/* ============ Dark theme: class detail modal ============ */
html[data-theme="dark"] .cdm-content {
	background: var(--tt-bg, #0b1120);
	box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06), 0 50px 110px -24px rgba(0, 0, 0, 0.8), 0 18px 40px -20px rgba(0, 140, 255, 0.25);
}
html[data-theme="dark"] .cdm-hero::after { background: linear-gradient(180deg, rgba(11, 17, 32, 0) 0%, rgba(11, 17, 32, 0.55) 100%); }
html[data-theme="dark"] .cdm-tabbar {
	background: var(--tt-surface, #111a2e);
	border-bottom-color: var(--tt-line, #263450);
}
html[data-theme="dark"] .cdm-tabbar::before { background: linear-gradient(90deg, var(--tt-surface, #111a2e) 20%, rgba(17, 26, 46, 0)); }
html[data-theme="dark"] .cdm-tabbar::after { background: linear-gradient(270deg, var(--tt-surface, #111a2e) 20%, rgba(17, 26, 46, 0)); }
html[data-theme="dark"] .cdm-tab { color: var(--tt-muted, #94a3b8); }
html[data-theme="dark"] .cdm-tab:hover,
html[data-theme="dark"] .cdm-tab.active { color: #38b6ff; }
html[data-theme="dark"] .cdm-tab-glider,
html[data-theme="dark"] .cdm-tabs:not(:has(.cdm-tab-glider.is-ready)) .cdm-tab.active {
	background: linear-gradient(135deg, rgba(0, 140, 255, 0.18), rgba(166, 90, 249, 0.16));
	box-shadow: inset 0 0 0 1px rgba(56, 182, 255, 0.22);
}
html[data-theme="dark"] .cdm-tab-badge { background: var(--tt-surface-2, #17233b); color: #38b6ff; }
html[data-theme="dark"] .cdm-tab.active .cdm-tab-badge { background: linear-gradient(135deg, var(--primary, #008cff), #a55af9); color: #fff; box-shadow: 0 6px 14px -6px rgba(0, 140, 255, 0.7); }
html[data-theme="dark"] .cdm-body {
	background:
		radial-gradient(70% 40% at 50% 0%, rgba(0, 140, 255, 0.1) 0%, rgba(0, 140, 255, 0) 100%),
		linear-gradient(180deg, var(--tt-bg, #0b1120) 0%, #0a0f1c 100%);
}
html[data-theme="dark"] .cdm-stat::before { background: linear-gradient(90deg, var(--primary, #008cff), #a55af9); }
html[data-theme="dark"] .cdm-stat,
html[data-theme="dark"] .cdm-student,
html[data-theme="dark"] .cdm-course {
	background: var(--tt-surface, #111a2e);
	border-color: var(--tt-line, #263450);
	box-shadow: 0 8px 20px -14px rgba(0, 0, 0, 0.5);
}
html[data-theme="dark"] .cdm-stat-num,
html[data-theme="dark"] .cdm-student-name,
html[data-theme="dark"] .cdm-course-title,
html[data-theme="dark"] .cdm-tutor-name { color: var(--tt-ink, #e6ebf5); }
html[data-theme="dark"] .cdm-tutor-card {
	background: linear-gradient(120deg, var(--tt-surface, #111a2e) 0%, #141b33 100%);
	border-color: var(--tt-line, #263450);
}
html[data-theme="dark"] .cdm-student-chip-active { background: rgba(16, 185, 129, 0.12); border-color: rgba(16, 185, 129, 0.25); }
html[data-theme="dark"] .cdm-student-chip-away { background: var(--tt-surface-2, #17233b); border-color: var(--tt-line, #263450); }
html[data-theme="dark"] .cdm-course-icon { background: var(--tt-surface-2, #17233b); color: #38b6ff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 6px 14px -8px rgba(0, 0, 0, 0.6); }
html[data-theme="dark"] .cdm-course:hover { box-shadow: 0 16px 32px -14px rgba(0, 0, 0, 0.6), 0 0 0 4px rgba(0, 140, 255, 0.08); border-color: rgba(56, 182, 255, 0.4); }
html[data-theme="dark"] .cdm-course-go { background: var(--tt-surface-2, #17233b); color: #38b6ff; }
html[data-theme="dark"] .cdm-course:hover .cdm-course-go { background: var(--primary, #008cff); color: #fff; }
html[data-theme="dark"] .cdm-empty-icon {
	background: linear-gradient(135deg, rgba(99, 102, 241, 0.18) 0%, rgba(166, 90, 249, 0.14) 100%);
	color: #38b6ff;
}

/* ============ Work tab (assigned tasks inside the class modal) ============ */
.cdm-tab-badge-hot { background: #fee2e2; color: #dc2626; }
.cdm-tab.active .cdm-tab-badge-hot { background: #dc2626; color: #fff; }
.cdm-task-icon i { font-size: 17px; }
.cdm-task-done .cdm-task-icon { background: #dcfce7; color: #15803d; }
.cdm-task-done .cdm-course-title { color: #64748b; text-decoration: line-through; }
.cdm-task-bar {
	height: 6px;
	border-radius: 999px;
	background: #eef2f7;
	margin-top: 8px;
	overflow: hidden;
}
.cdm-task-bar span {
	display: block;
	height: 100%;
	border-radius: 999px;
	background: linear-gradient(90deg, var(--primary) 0%, #a78bfa 100%);
	transition: width 0.4s ease;
}
.cdm-task-done .cdm-task-bar span { background: #22c55e; }
.cdm-task-due { color: #64748b; font-weight: 700; }
.cdm-task-due-urgent { color: #dc2626; }
html[data-theme="dark"] .cdm-task-bar { background: var(--tt-surface-2, #17233b); }
html[data-theme="dark"] .cdm-task-done .cdm-task-icon { background: rgba(34, 197, 94, 0.18); color: #4ade80; }
