:root { --brand: #4f46e5; }
html, body { height: 100%; }
[data-lucide], svg.lucide { width: 18px; height: 18px; stroke-width: 2; flex-shrink: 0; }

.nav-link { display: flex; align-items: center; gap: .7rem; padding: .55rem .75rem; border-radius: .6rem; color: #475569; font-weight: 500; transition: background .15s, color .15s; cursor: pointer; }
.nav-link:hover { background: #f1f5f9; color: #0f172a; }
.nav-link.active { background: #eef2ff; color: #4338ca; }
.nav-sub { display: flex; align-items: center; gap: .6rem; padding: .45rem .75rem; border-radius: .55rem; color: #64748b; font-size: .82rem; }
.nav-sub:hover { background: #f8fafc; color: #0f172a; }
.nav-sub.active { color: #4338ca; background: #f5f7ff; }

.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: .6rem; color: #475569; transition: background .15s; }
.icon-btn:hover { background: #f1f5f9; color: #0f172a; }
.icon-btn:disabled { opacity: .4; cursor: not-allowed; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; height: 38px; padding: 0 1rem; border-radius: .65rem; font-size: .875rem; font-weight: 600; transition: background .15s, border-color .15s, color .15s; white-space: nowrap; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-sm { height: 32px; padding: 0 .75rem; font-size: .8rem; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover:not(:disabled) { background: #4338ca; }
.btn-secondary { background: #fff; color: #334155; border: 1px solid #e2e8f0; }
.btn-secondary:hover:not(:disabled) { background: #f8fafc; border-color: #cbd5e1; }
.btn-ghost { color: #475569; }
.btn-ghost:hover:not(:disabled) { background: #f1f5f9; }
.btn-danger { background: #fff; color: #dc2626; border: 1px solid #fecaca; }
.btn-danger:hover:not(:disabled) { background: #fef2f2; }
.btn-dark { background: rgba(255,255,255,.1); color: #fff; }
.btn-dark:hover:not(:disabled) { background: rgba(255,255,255,.18); }

.input, .select, .textarea { width: 100%; border: 1px solid #e2e8f0; background: #fff; border-radius: .6rem; padding: .5rem .75rem; font-size: .875rem; outline: none; transition: border-color .15s, box-shadow .15s; }
.input:focus, .select:focus, .textarea:focus { border-color: #818cf8; box-shadow: 0 0 0 3px rgba(99,102,241,.15); }
.textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
.label { display: block; font-size: .8rem; font-weight: 600; color: #334155; margin-bottom: .35rem; }

.card { background: #fff; border: 1px solid #e2e8f0; border-radius: 1rem; }
.chip { display: inline-flex; align-items: center; gap: .3rem; padding: .15rem .55rem; border-radius: 999px; font-size: .72rem; font-weight: 600; background: #f1f5f9; color: #475569; }

.progress { height: 6px; background: #eef2f7; border-radius: 99px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--brand); border-radius: 99px; transition: width .4s; }

.tab { padding: .7rem .1rem; font-size: .875rem; font-weight: 600; color: #64748b; border-bottom: 2px solid transparent; margin-bottom: -1px; display: inline-flex; gap: .45rem; align-items: center; }
.tab:hover { color: #0f172a; }
.tab.active { color: #4338ca; border-color: #4f46e5; }

.lesson-row { display: flex; align-items: flex-start; gap: .75rem; padding: .7rem .9rem; border-radius: .7rem; cursor: pointer; transition: background .12s; }
.lesson-row:hover { background: #f8fafc; }
.lesson-row.active { background: #eef2ff; }
.lesson-row.locked { cursor: not-allowed; opacity: .55; }
.status-dot { width: 22px; height: 22px; border-radius: 99px; display: inline-flex; align-items: center; justify-content: center; border: 2px solid #cbd5e1; flex-shrink: 0; color: #fff; }
.status-dot svg { width: 13px; height: 13px; stroke-width: 3; }
.status-dot.done { background: #10b981; border-color: #10b981; }
.status-dot.partial { border-color: #6366f1; }
.status-dot.lock { border: none; color: #94a3b8; }
.status-dot.lock svg { width: 15px; height: 15px; stroke-width: 2; }

/* Markdown */
.prose-doc { font-size: .92rem; line-height: 1.7; color: #334155; }
.prose-doc h1, .prose-doc h2, .prose-doc h3 { color: #0f172a; font-weight: 700; line-height: 1.3; margin: 1.3em 0 .5em; }
.prose-doc h1 { font-size: 1.4rem; } .prose-doc h2 { font-size: 1.18rem; } .prose-doc h3 { font-size: 1.02rem; }
.prose-doc > :first-child { margin-top: 0; }
.prose-doc p { margin: .7em 0; }
.prose-doc ul { list-style: disc; padding-left: 1.4em; margin: .6em 0; }
.prose-doc ol { list-style: decimal; padding-left: 1.4em; margin: .6em 0; }
.prose-doc li { margin: .25em 0; }
.prose-doc a { color: #4f46e5; text-decoration: underline; text-underline-offset: 2px; }
.prose-doc code { background: #f1f5f9; padding: .1em .4em; border-radius: .35rem; font-size: .85em; color: #be185d; }
.prose-doc pre { background: #0f172a; color: #e2e8f0; padding: 1rem; border-radius: .75rem; overflow-x: auto; margin: .9em 0; font-size: .83rem; }
.prose-doc pre code { background: none; color: inherit; padding: 0; }
.prose-doc blockquote { border-left: 3px solid #a5b4fc; background: #f5f7ff; padding: .6rem 1rem; border-radius: 0 .5rem .5rem 0; color: #475569; margin: .9em 0; }
.prose-doc table { width: 100%; border-collapse: collapse; margin: .9em 0; font-size: .86rem; }
.prose-doc th, .prose-doc td { border: 1px solid #e2e8f0; padding: .45rem .7rem; text-align: left; }
.prose-doc th { background: #f8fafc; font-weight: 600; }
.prose-doc hr { border: none; border-top: 1px solid #e2e8f0; margin: 1.4em 0; }

/* Player */
.player-wrap { background: #0b0f1a; position: relative; aspect-ratio: 16 / 9; width: 100%; }
.player-wrap video { width: 100%; height: 100%; background: #000; display: block; }
.autoplay-overlay { position: absolute; inset: 0; background: rgba(2,6,23,.85); display: flex; align-items: center; justify-content: center; color: #fff; text-align: center; padding: 1.5rem; }
.ring { transform: rotate(-90deg); }
.ring circle { transition: stroke-dashoffset 1s linear; }

.toast { background: #0f172a; color: #fff; font-size: .85rem; padding: .65rem 1rem; border-radius: .7rem; display: flex; align-items: center; gap: .5rem; animation: toastIn .25s ease; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.fade-in { animation: fadeIn .25s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.skeleton { background: linear-gradient(90deg, #f1f5f9, #e9eef5, #f1f5f9); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: .6rem; }
@keyframes sk { from { background-position: 200% 0; } to { background-position: -200% 0; } }

.spinner { width: 18px; height: 18px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 99px; animation: spin .7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

.scroll-thin::-webkit-scrollbar { width: 8px; height: 8px; }
.scroll-thin::-webkit-scrollbar-thumb { background: #e2e8f0; border-radius: 8px; }

.modal-backdrop { position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 50; display: flex; align-items: flex-start; justify-content: center; padding: 3rem 1rem; overflow-y: auto; }
.modal { background: #fff; border-radius: 1rem; width: 100%; max-width: 640px; animation: fadeIn .2s ease; }

.dropzone { border: 2px dashed #cbd5e1; border-radius: .9rem; padding: 1.25rem; text-align: center; transition: border-color .15s, background .15s; cursor: pointer; }
.dropzone:hover, .dropzone.drag { border-color: #818cf8; background: #f5f7ff; }

.indeterminate { position: relative; overflow: hidden; }
.indeterminate > span { position: absolute; width: 40%; animation: indet 1.2s ease-in-out infinite; }
@keyframes indet { from { left: -40%; } to { left: 100%; } }

kbd { font-family: ui-monospace, monospace; font-size: .72rem; background: #f1f5f9; border: 1px solid #e2e8f0; border-bottom-width: 2px; padding: .05rem .35rem; border-radius: .3rem; color: #334155; }
