:root {
	--bg: #0f1419;
	--panel: #1a2332;
	--border: #2d3a4d;
	--text: #e7ecf3;
	--muted: #8b9cb3;
	--accent: #3d8bfd;
	--accent-dim: #2563c7;
	--sidebar-w: 280px;
	font-family: "DM Sans", system-ui, sans-serif;
}

* {
	box-sizing: border-box;
}

body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	min-height: 100vh;
	line-height: 1.55;
	display: flex;
	flex-direction: column;
}

a {
	color: var(--accent);
	text-decoration: none;
}
a:hover {
	text-decoration: underline;
}

.topbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-shrink: 0;
	padding: 0.75rem 1.25rem;
	background: var(--panel);
	border-bottom: 1px solid var(--border);
}
.topbar .brand {
	font-weight: 700;
	letter-spacing: -0.02em;
}
.topbar-nav {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	justify-content: flex-end;
	gap: 0.35rem 0.85rem;
}
.topbar-nav a {
	color: var(--muted);
	font-size: 0.9rem;
}
.topbar-nav a:hover {
	color: var(--text);
}
.topbar-user {
	color: var(--muted);
	font-size: 0.85rem;
}

.shell {
	display: flex;
	align-items: stretch;
	flex: 1;
	min-height: 0;
}

.sidebar {
	width: min(var(--sidebar-w), 100%);
	flex-shrink: 0;
	background: var(--panel);
	border-right: 1px solid var(--border);
	overflow-x: hidden;
	overflow-y: auto;
	max-height: calc(100vh - 52px);
	padding: 1rem 0;
}

.sidebar-title {
	margin: 0 1rem 0.75rem;
	font-size: 0.75rem;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--muted);
	line-height: 1.35;
}

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

.sidebar li a {
	display: block;
	padding: 0.55rem 1rem;
	color: var(--text);
	font-size: 0.9rem;
	border-left: 3px solid transparent;
	line-height: 1.35;
}
.sidebar li a:hover {
	background: rgba(61, 139, 253, 0.08);
}
.sidebar li a.active {
	border-left-color: var(--accent);
	background: rgba(61, 139, 253, 0.12);
	color: #fff;
}
.sidebar li a.lesson-nav-item {
	display: flex;
	align-items: flex-start;
	gap: 0.35rem;
}
.sidebar li a.is-done:not(.active) {
	color: var(--muted);
}
.lesson-check {
	flex-shrink: 0;
	color: #4ade80;
	font-weight: 700;
	font-size: 0.85em;
	line-height: 1.4;
}
.lesson-nav-text {
	min-width: 0;
}

.course-progress-strip {
	flex-shrink: 0;
	background: rgba(26, 35, 50, 0.95);
	border-bottom: 1px solid var(--border);
	padding: 0.45rem 1rem;
}
.course-progress-inner {
	max-width: 72rem;
	margin: 0 auto;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.35rem 1rem;
}
.course-progress-label {
	font-weight: 600;
	font-size: 0.9rem;
}
.course-progress-count {
	font-size: 0.85rem;
	color: var(--muted);
}
.progress-bar-wrap {
	height: 8px;
	background: var(--border);
	border-radius: 99px;
	overflow: hidden;
	flex: 1 1 120px;
	min-width: 80px;
	max-width: 220px;
}
.progress-bar-wrap--strip {
	max-width: 280px;
	flex: 1 1 180px;
	height: 6px;
}
.progress-bar {
	height: 100%;
	border-radius: 99px;
	background: linear-gradient(90deg, var(--accent-dim), var(--accent));
	transition: width 0.25s ease;
}
.progress-meta {
	display: flex;
	justify-content: space-between;
	font-size: 0.8rem;
	color: var(--muted);
	margin-bottom: 0.25rem;
}
.card-course .card-progress {
	margin-top: 0.75rem;
}
.lesson-progress-form {
	margin: 0 0 1.25rem;
}
.study-summary {
	margin: -0.25rem 0 1.25rem;
	font-size: 0.95rem;
}

.page-course .content-column,
.page-course .sidebar {
	max-height: calc(100vh - 52px - 48px);
}

.sidebar-empty {
	padding: 0 1rem;
	font-size: 0.9rem;
}

/* Cột nội dung: căn giữa, không thừa khoảng trống bên phải */
.content-column {
	flex: 1;
	min-width: 0;
	display: flex;
	justify-content: center;
	align-items: flex-start;
	overflow-y: auto;
	overflow-x: hidden;
	max-height: calc(100vh - 52px);
	padding: clamp(0.75rem, 2vw, 1.5rem) clamp(0.75rem, 3vw, 2rem) 2.5rem;
}

.main {
	width: 100%;
	max-width: 42rem;
	margin: 0;
	padding: clamp(1rem, 2.5vw, 1.75rem) clamp(1rem, 3vw, 1.75rem) 2.25rem;
	background: rgba(22, 30, 44, 0.82);
	border: 1px solid var(--border);
	border-radius: 12px;
	box-shadow: 0 4px 32px rgba(0, 0, 0, 0.22);
	overflow-x: hidden;
	word-wrap: break-word;
}

.main h1 {
	margin-top: 0;
	font-size: clamp(1.2rem, 4vw, 1.65rem);
	letter-spacing: -0.02em;
	line-height: 1.25;
}

/* Trang danh sách khóa học */
.page-wrap {
	flex: 1;
	min-height: 0;
	overflow-y: auto;
	padding: clamp(1rem, 3vw, 2rem) clamp(0.75rem, 3vw, 1.25rem) 3rem;
}
.page-narrow {
	max-width: 36rem;
	margin: 0 auto;
	width: 100%;
}
.page-narrow h1 {
	margin-top: 0;
	font-size: clamp(1.25rem, 4vw, 1.6rem);
}

@media (max-width: 767px) {
	.topbar {
		padding: 0.5rem 0.75rem;
	}

	.shell {
		flex-direction: column;
	}

	.sidebar {
		width: 100%;
		max-height: none;
		border-right: none;
		border-bottom: 1px solid var(--border);
		padding: 0.5rem 0 0.65rem;
		overflow-y: visible;
	}

	.sidebar-title {
		margin: 0 0.75rem 0.45rem;
		font-size: 0.68rem;
		max-width: 100%;
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
	}

	.sidebar-list {
		display: flex;
		flex-direction: row;
		flex-wrap: nowrap;
		gap: 0.4rem;
		overflow-x: auto;
		overflow-y: hidden;
		padding: 0 0.75rem 0.15rem;
		-webkit-overflow-scrolling: touch;
		scrollbar-width: thin;
	}

	.sidebar-list li {
		flex: 0 0 auto;
		max-width: min(88vw, 300px);
	}

	.sidebar-list li a {
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
		max-width: min(88vw, 300px);
		border-left: none;
		border-radius: 999px;
		padding: 0.45rem 0.85rem;
		border: 1px solid var(--border);
		background: var(--bg);
	}

	.sidebar-list li a.active {
		border-color: var(--accent);
		background: rgba(61, 139, 253, 0.18);
	}

	.content-column {
		max-height: none;
		flex: 1;
		min-height: 0;
		padding: 0.65rem 0.75rem 2rem;
	}

	.main {
		max-width: 40rem;
		border-radius: 10px;
		padding: 0.9rem 1rem 1.75rem;
	}

	.lesson-body {
		font-size: 1rem;
	}

	.page-course .content-column,
	.page-course .sidebar {
		max-height: none;
	}

	.course-progress-inner {
		flex-direction: column;
		align-items: stretch;
	}
	.progress-bar-wrap--strip {
		max-width: none;
	}
}

/* WordPress content */
.lesson-body {
	font-size: 1.05rem;
}
.lesson-body figure.wp-block-table {
	max-width: 100%;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}
.lesson-body table {
	width: 100%;
	border-collapse: collapse;
}
.lesson-body img {
	max-width: 100%;
	height: auto;
	border-radius: 6px;
	cursor: zoom-in;
}
.lesson-body a:has(img) {
	cursor: zoom-in;
}
.lesson-body p {
	margin: 0.85rem 0;
}
.lesson-body h2,
.lesson-body h3 {
	margin: 1.5rem 0 0.5rem;
	color: #fff;
}
.lesson-body blockquote {
	margin: 1rem 0;
	padding-left: 1rem;
	border-left: 3px solid var(--accent);
	color: var(--muted);
}
.lesson-body ul,
.lesson-body ol {
	padding-left: 1.35rem;
}

/* Responsive YouTube / embed */
.study-video-wrap {
	position: relative;
	width: 100%;
	max-width: 800px;
	padding-bottom: 56.25%;
	height: 0;
	overflow: hidden;
	margin: 1.25rem 0;
	border-radius: 8px;
	background: #000;
	border: 1px solid var(--border);
}
.study-video-wrap iframe {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

.card {
	background: var(--panel);
	border: 1px solid var(--border);
	border-radius: 10px;
	padding: 1.25rem 1.5rem;
	margin-bottom: 0.75rem;
}
.card h3 {
	margin: 0 0 0.35rem;
	font-size: 1.05rem;
}
.card p {
	margin: 0;
	color: var(--muted);
	font-size: 0.9rem;
}

.auth-wrap {
	max-width: 400px;
	margin: 3rem auto;
	padding: 0 1rem;
}
.auth-box {
	background: var(--panel);
	border: 1px solid var(--border);
	border-radius: 12px;
	padding: 1.75rem;
}
.auth-box h1 {
	margin: 0 0 1rem;
	font-size: 1.35rem;
}
.field {
	margin-bottom: 1rem;
}
.field label {
	display: block;
	font-size: 0.85rem;
	color: var(--muted);
	margin-bottom: 0.35rem;
}
.field input {
	width: 100%;
	padding: 0.6rem 0.75rem;
	border-radius: 8px;
	border: 1px solid var(--border);
	background: var(--bg);
	color: var(--text);
	font-size: 1rem;
}
.btn {
	display: inline-block;
	padding: 0.65rem 1.1rem;
	border-radius: 8px;
	border: none;
	background: var(--accent);
	color: #fff;
	font-weight: 600;
	font-size: 0.95rem;
	cursor: pointer;
	font-family: inherit;
}
.btn:hover {
	background: var(--accent-dim);
}
.btn-secondary {
	background: transparent;
	color: var(--text);
	border: 1px solid var(--border);
}
.btn-secondary:hover {
	background: var(--panel);
	border-color: var(--muted);
}
.btn-sm {
	padding: 0.45rem 0.85rem;
	font-size: 0.85rem;
}
.btn-xs {
	padding: 0.3rem 0.55rem;
	font-size: 0.8rem;
}
.btn-danger {
	background: #b91c1c;
	color: #fff;
	border: 1px solid #991b1b;
}
.btn-danger:hover {
	background: #991b1b;
}
.admin-actions {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 0.5rem 0.75rem;
	white-space: nowrap;
}
.th-actions {
	min-width: 8rem;
}
.btn-block {
	width: 100%;
}
.error {
	background: rgba(239, 68, 68, 0.15);
	color: #fca5a5;
	padding: 0.65rem 0.85rem;
	border-radius: 8px;
	margin-bottom: 1rem;
	font-size: 0.9rem;
}
.muted {
	color: var(--muted);
	font-size: 0.9rem;
	margin-top: 1rem;
}

.empty {
	color: var(--muted);
	padding: 2rem 0;
}

/* Lightbox xem ảnh phóng to */
.study-lightbox {
	position: fixed;
	inset: 0;
	z-index: 10000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1rem;
}
.study-lightbox[hidden] {
	display: none;
}
.study-lightbox-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.88);
	cursor: zoom-out;
}
.study-lightbox-close {
	position: absolute;
	top: 0.75rem;
	right: 0.75rem;
	z-index: 2;
	width: 2.5rem;
	height: 2.5rem;
	border: 1px solid var(--border);
	border-radius: 8px;
	background: var(--panel);
	color: var(--text);
	font-size: 1.5rem;
	line-height: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	font-family: inherit;
}
.study-lightbox-close:hover {
	background: var(--border);
}
.study-lightbox-frame {
	position: relative;
	z-index: 1;
	max-width: min(96vw, 1400px);
	max-height: 92vh;
	display: flex;
	align-items: center;
	justify-content: center;
}
.study-lightbox-frame img {
	max-width: 100%;
	max-height: 92vh;
	width: auto;
	height: auto;
	object-fit: contain;
	border-radius: 6px;
	box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
	cursor: default;
}

/* Admin */
.page-wide {
	max-width: 56rem;
	margin: 0 auto;
	width: 100%;
}
.admin-page h1 {
	margin-top: 0;
}
.admin-table-wrap {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	margin: 1rem 0;
	border: 1px solid var(--border);
	border-radius: 10px;
}
.admin-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.9rem;
}
.admin-table th,
.admin-table td {
	padding: 0.65rem 0.75rem;
	text-align: left;
	border-bottom: 1px solid var(--border);
	vertical-align: middle;
}
.admin-table th {
	background: var(--panel);
	color: var(--muted);
	font-weight: 600;
	font-size: 0.75rem;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}
.admin-table tr:last-child td {
	border-bottom: none;
}
.admin-table a {
	font-weight: 500;
}
.admin-lessons-hint {
	font-size: 0.85rem;
	margin: 0.35rem 0 0.75rem;
}
.admin-lesson-board-wrap {
	padding: 0;
}
.admin-lesson-board {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.9rem;
}
.admin-lesson-board-head,
.admin-lesson-row {
	display: grid;
	grid-template-columns: minmax(4.5rem, auto) minmax(0, 1fr) auto;
	align-items: center;
	gap: 0.65rem;
	padding: 0.65rem 0.75rem;
	border-bottom: 1px solid var(--border);
	text-align: left;
}
.admin-lesson-board-head {
	background: var(--panel);
	color: var(--muted);
	font-weight: 600;
	font-size: 0.75rem;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}
.admin-lessons-tbody .admin-lesson-row:last-child {
	border-bottom: none;
}
.lesson-drag-zone {
	display: flex;
	align-items: center;
	justify-content: flex-start;
	gap: 0.45rem;
	cursor: grab;
	touch-action: none;
	user-select: none;
	-webkit-user-select: none;
	color: var(--muted);
	min-height: 2.25rem;
	border-radius: 8px;
	padding: 0.15rem 0.35rem;
	margin: -0.15rem -0.35rem;
}
.lesson-drag-zone:hover {
	background: rgba(148, 163, 184, 0.12);
	color: var(--text);
}
.lesson-drag-zone:active {
	cursor: grabbing;
}
.lesson-drag-grip {
	font-weight: 700;
	letter-spacing: -0.15em;
	line-height: 1;
	opacity: 0.85;
}
.admin-lesson-row .lesson-rank {
	color: inherit;
	font-variant-numeric: tabular-nums;
	font-weight: 600;
	min-width: 1.25rem;
}
.admin-lesson-row .admin-actions {
	cursor: default;
}
.admin-lesson-row.is-dragging {
	opacity: 0.92;
	background: rgba(61, 139, 253, 0.12);
	box-shadow: 0 0 0 1px rgba(61, 139, 253, 0.45);
}
body.lesson-reorder-dragging {
	cursor: grabbing !important;
	user-select: none;
}
.lesson-title-cell {
	min-width: 0;
	word-break: break-word;
}
.admin-lesson-board .admin-actions a {
	font-weight: 500;
}
.admin-lesson-board .admin-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.35rem 0.5rem;
	justify-content: flex-end;
}
.lesson-status-form {
	display: inline;
	margin: 0;
}
.btn-publish {
	background: rgba(34, 197, 94, 0.22);
	border-color: rgba(34, 197, 94, 0.45);
	color: #bbf7d0;
}
.btn-publish:hover {
	background: rgba(34, 197, 94, 0.32);
	border-color: rgba(34, 197, 94, 0.55);
	color: #ecfdf5;
}
.role-badge {
	display: inline-block;
	padding: 0.2rem 0.5rem;
	border-radius: 6px;
	font-size: 0.8rem;
	font-weight: 600;
}
.role-admin {
	background: rgba(61, 139, 253, 0.2);
	color: #93c5fd;
}
.role-student {
	background: rgba(148, 163, 184, 0.15);
	color: var(--muted);
}
.inline-form {
	display: flex;
	align-items: center;
	gap: 0.35rem;
	flex-wrap: wrap;
}
.flex-wrap {
	flex-wrap: wrap;
}
.select-sm,
.input-sm {
	padding: 0.35rem 0.5rem;
	border-radius: 6px;
	border: 1px solid var(--border);
	background: var(--bg);
	color: var(--text);
	font-size: 0.85rem;
	font-family: inherit;
}
.input-sm {
	min-width: 7rem;
}
.flash {
	padding: 0.65rem 0.85rem;
	border-radius: 8px;
	margin: 0 0 1rem;
	font-size: 0.9rem;
}
.flash-ok {
	background: rgba(34, 197, 94, 0.15);
	color: #86efac;
}
.flash-err {
	background: rgba(239, 68, 68, 0.15);
	color: #fca5a5;
}

/* Toast */
.study-toast-stack {
	position: fixed;
	right: 1rem;
	bottom: 1rem;
	z-index: 20000;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 0.5rem;
	max-width: min(22rem, calc(100vw - 2rem));
	pointer-events: none;
}
.study-toast-stack .study-toast {
	pointer-events: auto;
}
.study-toast {
	padding: 0.75rem 1rem;
	border-radius: 10px;
	font-size: 0.9rem;
	line-height: 1.4;
	box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
	border: 1px solid var(--border);
	opacity: 0;
	transform: translateY(10px);
	transition: opacity 0.2s ease, transform 0.2s ease;
	word-break: break-word;
}
.study-toast--in {
	opacity: 1;
	transform: translateY(0);
}
.study-toast--out {
	opacity: 0;
	transform: translateY(6px);
}
.study-toast--ok {
	background: rgba(22, 101, 52, 0.95);
	color: #dcfce7;
	border-color: #166534;
}
.study-toast--err {
	background: rgba(127, 29, 29, 0.95);
	color: #fecaca;
	border-color: #991b1b;
}
.study-toast--info {
	background: rgba(30, 41, 59, 0.96);
	color: var(--text);
}
.study-toast--confirm {
	min-width: 260px;
	max-width: 100%;
}
.study-toast-confirm-msg {
	margin: 0 0 0.65rem;
	font-weight: 500;
}
.study-toast-confirm-actions {
	display: flex;
	justify-content: flex-end;
	gap: 0.5rem;
	flex-wrap: wrap;
}

.admin-course-block {
	margin: 2rem 0;
	padding-bottom: 1.5rem;
	border-bottom: 1px solid var(--border);
}
.admin-course-block:last-of-type {
	border-bottom: none;
}
.admin-course-heading {
	font-size: 1.1rem;
	margin: 0 0 0.75rem;
}
.admin-lessons-title {
	font-size: 0.95rem;
	margin: 0;
	color: var(--muted);
	flex: 1;
	min-width: 0;
}
.admin-lessons-toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	margin: 1.25rem 0 0.5rem;
}
.admin-subheading {
	font-size: 1rem;
	margin: 0 0 0.75rem;
}
.admin-create-user {
	margin-bottom: 1.5rem;
}
.admin-flash {
	margin: 0.5rem 0 1rem;
	padding: 0.55rem 0.75rem;
	border-radius: 8px;
	font-size: 0.9rem;
}
.admin-flash.ok {
	background: rgba(34, 197, 94, 0.12);
	border: 1px solid rgba(34, 197, 94, 0.35);
	color: #86efac;
}
.admin-flash.err {
	background: rgba(248, 113, 113, 0.1);
	border: 1px solid rgba(248, 113, 113, 0.35);
	color: #fecaca;
}
.badge-draft {
	display: inline-block;
	margin-left: 0.4rem;
	padding: 0.1rem 0.4rem;
	border-radius: 4px;
	font-size: 0.7rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	vertical-align: middle;
	background: rgba(251, 191, 36, 0.2);
	color: #fcd34d;
	border: 1px solid rgba(251, 191, 36, 0.35);
}
.field-label-text {
	display: block;
	font-size: 0.85rem;
	color: var(--muted);
	margin-bottom: 0.4rem;
}
.radio-row {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}
.radio-label {
	display: flex;
	align-items: flex-start;
	gap: 0.45rem;
	cursor: pointer;
	font-size: 0.9rem;
	line-height: 1.35;
}
.radio-label input {
	margin-top: 0.15rem;
	flex-shrink: 0;
}
.btn-inline-hint {
	font-size: 0.85rem;
	align-self: center;
}
.card-like {
	background: rgba(22, 30, 44, 0.5);
	border: 1px solid var(--border);
	border-radius: 10px;
	padding: 1rem 1.25rem;
	margin-bottom: 1rem;
}
.admin-form .field {
	margin-bottom: 1rem;
}
.admin-form .field label {
	display: block;
	font-size: 0.85rem;
	color: var(--muted);
	margin-bottom: 0.35rem;
}
.admin-form input[type='password'],
.admin-form input[type='text'],
.admin-form select,
.admin-form textarea {
	width: 100%;
	max-width: 100%;
	padding: 0.55rem 0.65rem;
	border-radius: 8px;
	border: 1px solid var(--border);
	background: var(--bg);
	color: var(--text);
	font-size: 0.95rem;
	font-family: inherit;
}
.textarea-sm {
	min-height: 3rem;
	resize: vertical;
}
.textarea-code {
	font-family: ui-monospace, monospace;
	font-size: 0.82rem;
	line-height: 1.45;
	resize: vertical;
	min-height: 320px;
}
.form-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.75rem;
	margin-top: 1rem;
}
.lesson-edit-page .page-wide {
	max-width: 52rem;
}
.lesson-body-field .lesson-editor-hint {
	margin: 0 0 0.5rem;
	font-size: 0.85rem;
}
.lesson-edit-page .tox-tinymce {
	border-radius: 10px;
	border-color: var(--border) !important;
}
.lesson-edit-page .tox .tox-edit-area__iframe {
	background: var(--bg);
}

.media-library-page .media-upload-card {
	margin-bottom: 1.5rem;
}
.media-upload-hint {
	font-size: 0.85rem;
	margin-top: 0;
}
.media-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 1rem;
	margin-top: 1rem;
}
.media-card {
	background: rgba(22, 30, 44, 0.5);
	border: 1px solid var(--border);
	border-radius: 10px;
	overflow: hidden;
	display: flex;
	flex-direction: column;
}
.media-card-preview {
	aspect-ratio: 16 / 10;
	background: var(--panel);
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
}
.media-card-preview img,
.media-card-preview video {
	width: 100%;
	height: 100%;
	object-fit: contain;
}
.media-card-fallback {
	font-size: 0.75rem;
	color: var(--muted);
	padding: 0.5rem;
	text-align: center;
}
.media-card-meta {
	padding: 0.65rem 0.75rem;
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
}
.media-card-name {
	margin: 0;
	font-size: 0.85rem;
	font-weight: 600;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.media-card-url {
	margin: 0;
	font-size: 0.72rem;
	word-break: break-all;
	max-height: 2.6em;
	overflow: hidden;
}
.media-card-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.35rem;
	margin-top: 0.25rem;
}

.lesson-body video {
	max-width: 100%;
	height: auto;
	border-radius: 8px;
}

/* Popup chèn ảnh (trang sửa bài) */
body.study-img-modal-open {
	overflow: hidden;
}
.study-img-modal-root {
	display: none;
	position: fixed;
	inset: 0;
	z-index: 100050;
	align-items: center;
	justify-content: center;
	padding: 1rem;
}
.study-img-modal-root.is-open {
	display: flex;
}
.study-img-modal-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.65);
	cursor: pointer;
}
.study-img-modal-dialog {
	position: relative;
	width: min(720px, 100%);
	max-height: min(88vh, 640px);
	display: flex;
	flex-direction: column;
	background: var(--panel);
	border: 1px solid var(--border);
	border-radius: 12px;
	box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
	overflow: hidden;
}
.study-img-modal-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0.85rem 1rem;
	border-bottom: 1px solid var(--border);
	flex-shrink: 0;
}
.study-img-modal-header h2 {
	margin: 0;
	font-size: 1.1rem;
	font-weight: 600;
}
.study-img-modal-close {
	background: none;
	border: none;
	color: var(--muted);
	font-size: 1.5rem;
	line-height: 1;
	cursor: pointer;
	padding: 0.15rem 0.35rem;
	border-radius: 6px;
}
.study-img-modal-close:hover {
	color: var(--text);
	background: rgba(255, 255, 255, 0.06);
}
.study-img-modal-tabs {
	display: flex;
	gap: 0;
	border-bottom: 1px solid var(--border);
	flex-shrink: 0;
}
.study-img-modal-tab {
	flex: 1;
	padding: 0.65rem 1rem;
	border: none;
	background: transparent;
	color: var(--muted);
	font: inherit;
	font-weight: 600;
	cursor: pointer;
	border-bottom: 2px solid transparent;
	margin-bottom: -1px;
}
.study-img-modal-tab:hover {
	color: var(--text);
}
.study-img-modal-tab.is-active {
	color: var(--accent);
	border-bottom-color: var(--accent);
}
.study-img-modal-body {
	padding: 1rem;
	overflow: auto;
	flex: 1;
	min-height: 200px;
}
.study-img-modal-panel.is-hidden {
	display: none;
}
.study-img-modal-hint {
	margin: 0 0 0.75rem;
	font-size: 0.88rem;
}
.study-img-dropzone {
	position: relative;
	border: 2px dashed var(--border);
	border-radius: 10px;
	padding: 2rem 1rem;
	text-align: center;
	cursor: pointer;
	transition: border-color 0.15s, background 0.15s;
}
.study-img-dropzone:hover,
.study-img-dropzone:focus {
	outline: none;
	border-color: var(--accent);
	background: rgba(61, 139, 253, 0.06);
}
.study-img-dropzone.is-dragover {
	border-color: var(--accent);
	background: rgba(61, 139, 253, 0.1);
}
.study-img-dropzone-label {
	color: var(--muted);
	font-size: 0.95rem;
}
.study-img-file-input {
	position: absolute;
	width: 0;
	height: 0;
	opacity: 0;
	pointer-events: none;
}
.study-img-upload-status {
	margin: 0.75rem 0 0;
	min-height: 1.25em;
	font-size: 0.88rem;
}
.study-img-modal-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
	gap: 0.5rem;
}
.study-img-modal-loading {
	margin: 0;
}
.study-img-modal-tile {
	display: block;
	padding: 0;
	margin: 0;
	border: 2px solid var(--border);
	border-radius: 8px;
	overflow: hidden;
	cursor: pointer;
	background: var(--bg);
	aspect-ratio: 1;
}
.study-img-modal-tile img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}
.study-img-modal-tile.is-selected {
	border-color: var(--accent);
	box-shadow: 0 0 0 2px rgba(61, 139, 253, 0.35);
}
.study-img-modal-footer {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	padding: 0.85rem 1rem;
	border-top: 1px solid var(--border);
	flex-shrink: 0;
}
.study-img-alt-label {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	font-size: 0.88rem;
	color: var(--muted);
	flex: 1;
	min-width: 160px;
}
.study-img-alt-input {
	flex: 1;
	min-width: 0;
	padding: 0.45rem 0.6rem;
	border-radius: 8px;
	border: 1px solid var(--border);
	background: var(--bg);
	color: var(--text);
	font: inherit;
}
.study-img-modal-actions {
	display: flex;
	gap: 0.5rem;
	flex-shrink: 0;
}
