#coursesPanel.profile-content {
  background: var(--panel, #161a22);
  border-radius: 16px;
  color: var(--text, #e9edf1);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 1.5rem;
}

#coursesPanel .cards-grid {
  margin-top: 0;
}

#coursesPanel .empty-state {
  margin: 0;
}

.course-tab-header {
  align-items: flex-start;
  background: var(--panel-2, #1b2030);
  border: 1px solid var(--stroke, rgba(15, 18, 38, 0.4));
  border-radius: 18px;
  box-shadow: 0 14px 38px rgba(8, 10, 25, 0.28);
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
}

.course-tab-heading {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.course-tab-heading h2 {
  color: var(--text, #e9edf1);
  font-size: 1.4rem;
  font-weight: 700;
  margin: 0;
}

.course-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  color: var(--text-dim, #aab5c0);
}

.count-badge {
  align-items: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  display: inline-flex;
  font-size: 0.78rem;
  font-weight: 500;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.count-value {
  color: var(--text, #e9edf1);
  font-weight: 700;
}

.course-tab-controls {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: flex-end;
}

.course-filter {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  display: inline-flex;
  padding: 0.25rem;
}

.filter-btn {
  background: transparent;
  border: 0;
  border-radius: 999px;
  color: var(--text-dim, #aab5c0);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.4rem 0.95rem;
  transition: background 0.2s ease, color 0.2s ease;
}

.filter-btn:hover {
  color: var(--text, #e9edf1);
}

.filter-btn.is-active {
  background: var(--ring, #3b82f6);
  color: #ffffff;
}

.filter-btn:focus-visible {
  outline: 2px solid var(--ring, #3b82f6);
  outline-offset: 2px;
}

#coursesPanel #courseTabActions.course-tab-actions {
  margin: 0;
}

.course-tab-controls #courseTabActions.course-tab-actions {
  display: flex;
}

.course-tab-controls #courseTabActions.course-tab-actions.hidden {
  display: none;
}

.cards-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  margin-top: 1.5rem;
}

.course-card {
  background: var(--panel-2, #1b2030);
  border: 1px solid var(--stroke, rgba(15, 18, 38, 0.35));
  border-radius: 18px;
  box-shadow: 0 16px 40px rgba(10, 12, 30, 0.28);
  color: var(--text, #e9edf1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.course-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 24px 48px rgba(10, 12, 30, 0.36);
  border-color: var(--ring, #3b82f6);
}

.course-card:hover .course-cover {
  transform: scale(1.02);
}

.course-card:focus-within {
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.45), 0 18px 40px rgba(10, 12, 30, 0.32);
  border-color: var(--ring, #3b82f6);
}

.course-card.is-published::after {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.12), rgba(16, 185, 129, 0.12));
  content: '';
  inset: 0;
  pointer-events: none;
  position: absolute;
}

.course-cover {
  aspect-ratio: 16 / 9;
  background-color: rgba(255, 255, 255, 0.04);
  background-position: center;
  background-size: cover;
  border-bottom: 1px solid var(--stroke, rgba(15, 18, 38, 0.35));
  transition: transform 0.3s ease;
  width: 100%;
}

.course-body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 0.85rem;
  padding: 1.35rem;
  position: relative;
  z-index: 1;
}

.course-title {
  color: var(--text, #e9edf1);
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.35;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  word-break: break-word;
}

.course-summary {
  color: var(--text-dim, #aab5c0);
  font-size: 0.95rem;
  line-height: 1.55;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.course-badges {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.course-badges .badge {
  background: rgba(99, 102, 241, 0.18);
  border: 1px solid rgba(99, 102, 241, 0.22);
  border-radius: 999px;
  color: #d1d5ff;
  display: inline-flex;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 0.35rem 0.7rem;
  text-transform: uppercase;
}


.course-badges .badge--draft {
  background: rgba(239, 68, 68, 0.18);
  border-color: rgba(239, 68, 68, 0.35);
  color: #fecaca;
}

.course-badges .badge--published {
  background: rgba(16, 185, 129, 0.18);
  border-color: rgba(16, 185, 129, 0.32);
  color: #bbf7d0;
}

.course-badges .badge--access {
  background: rgba(59, 130, 246, 0.18);
  border-color: rgba(59, 130, 246, 0.32);
  color: #bfdbfe;
}

.course-progress {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.progress-track {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  height: 6px;
  overflow: hidden;
  width: 100%;
}

.progress-bar {
  background: linear-gradient(90deg, var(--brand, #0ea5e9), var(--brand-2, #36bffa));
  height: 100%;
  transition: width 0.3s ease;
  width: 0;
}

.progress-meta {
  color: var(--text-dim, #aab5c0);
  display: flex;
  font-size: 0.8rem;
  justify-content: space-between;
}

.progress-meta span:last-child {
  font-weight: 600;
}

.course-actions {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.1rem;
  padding-top: 1.1rem;
}

.course-actions button,
.course-actions a {
  align-items: center;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.32);
  border-radius: 10px;
  color: var(--text, #e9edf1);
  cursor: pointer;
  display: inline-flex;
  font-size: 0.85rem;
  font-weight: 600;
  gap: 0.35rem;
  padding: 0.45rem 0.9rem;
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.course-actions button:hover,
.course-actions a:hover {
  background: var(--ring, #3b82f6);
  border-color: var(--ring, #3b82f6);
  color: #ffffff;
}

.course-actions button.secondary {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
  color: var(--text, #e9edf1);
}

.course-actions button.secondary:hover {
  background: rgba(255, 255, 255, 0.16);
  color: var(--text, #e9edf1);
}

.course-actions button.danger {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.36);
  color: #fca5a5;
}

.course-actions button.danger:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.45);
  color: #fee2e2;
}


.course-actions button:focus-visible,
.course-actions a:focus-visible {
  outline: 2px solid var(--ring, #3b82f6);
  outline-offset: 2px;
}

.course-card a {
  color: inherit;
  transition: color 0.2s ease;
}

.course-card a:hover {
  color: #ffffff;
}

.course-loading {
  align-items: center;
  color: var(--text-dim, #aab5c0);
  display: flex;
  font-size: 0.95rem;
  justify-content: center;
  min-height: 140px;
  padding: 1.5rem;
}

.empty-state {
  align-items: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px dashed rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  color: var(--text-dim, #aab5c0);
  display: flex;
  font-size: 0.95rem;
  justify-content: center;
  min-height: 140px;
  padding: 1.5rem;
  text-align: center;
}



.empty-state.hidden {
  display: none;
}


@media (max-width: 640px) {
  .cards-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }

  .course-card {
    border-radius: 12px;
  }

  #coursesPanel.profile-content {
    padding: 1.1rem;
  }

  .course-tab-header {
    align-items: stretch;
    flex-direction: column;
    gap: 1rem;
  }

  .course-tab-controls {
    align-items: stretch;
    flex-direction: column;
    gap: 0.65rem;
  }

  .course-filter {
    width: 100%;
    justify-content: space-between;
  }

  .filter-btn {
    flex: 1 1 auto;
    text-align: center;
  }
}
.course-builder {
  background: #f8fafc;
  color: #0f172a;
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  margin: 0;
  min-height: 100vh;
}

.builder-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.builder-top {
  align-items: flex-start;
  background: #0f172a;
  color: #ffffff;
  display: flex;
  gap: 1.5rem;
  justify-content: space-between;
  padding: 1.75rem 2.5rem;
}

.builder-top__titles {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-width: 640px;
}

.builder-breadcrumb {
  font-size: 0.9rem;
  margin: 0;
}

.builder-breadcrumb a {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
}

.builder-breadcrumb a:hover,
.builder-breadcrumb a:focus {
  color: #ffffff;
  text-decoration: underline;
}

.builder-summary {
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.95rem;
  margin: 0;
}

.builder-state {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 0.35rem 0.75rem;
  text-transform: uppercase;
}

.builder-state.is-published {
  background: rgba(34, 197, 94, 0.18);
  color: #bbf7d0;
}

.builder-state.is-draft {
  background: rgba(239, 68, 68, 0.18);
  color: #fecaca;
}

.builder-layout {
  box-sizing: border-box;
  display: flex;
  flex: 1;
  gap: 2rem;
  margin: 0 auto;
  padding: 2rem;
  width: min(1180px, 100%);
}

.builder-sidebar {
  background: #ffffff;
  border: 1px solid rgba(15, 18, 38, 0.1);
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  max-height: calc(100vh - 5rem);
  overflow-y: auto;
  padding: 1.5rem;
  position: sticky;
  top: 1.5rem;
  width: 320px;
}

.builder-sidebar__header {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
}

.builder-add-section {
  background: linear-gradient(120deg, #6366f1, #8b5cf6);
  border: none;
  border-radius: 999px;
  color: #ffffff;
  cursor: pointer;
  font-weight: 600;
  padding: 0.5rem 1rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.builder-add-section:hover,
.builder-add-section:focus {
  box-shadow: 0 10px 24px rgba(99, 102, 241, 0.3);
  transform: translateY(-1px);
}

.builder-sections-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.builder-empty {
  color: #6b7280;
  font-size: 0.95rem;
  margin: 0;
  text-align: center;
}

.builder-section {
  background: #f9fafb;
  border: 1px solid rgba(15, 18, 38, 0.08);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem 1.1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.builder-section.is-active {
  border-color: rgba(99, 102, 241, 0.55);
  box-shadow: 0 10px 20px rgba(99, 102, 241, 0.15);
}

.builder-section__header {
  align-items: center;
  display: flex;
  gap: 0.65rem;
}

.builder-section__drag {
  align-items: center;
  background: none;
  border: none;
  color: #9ca3af;
  cursor: grab;
  display: inline-flex;
  font-size: 1.05rem;
  padding: 0;
}

.builder-section__drag:focus {
  outline: 2px solid rgba(99, 102, 241, 0.4);
  outline-offset: 2px;
}

.builder-section__drag:active {
  cursor: grabbing;
}

.builder-section__title {
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: text;
  flex: 1;
  font-size: 1rem;
  font-weight: 600;
  min-height: 1.9rem;
  padding: 0.2rem 0.45rem;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.builder-section__title:hover {
  background: rgba(99, 102, 241, 0.08);
}

.builder-section__title[contenteditable='true']:focus {
  background: rgba(99, 102, 241, 0.12);
  border-color: rgba(99, 102, 241, 0.4);
  outline: none;
}

.builder-section__count {
  background: rgba(15, 18, 38, 0.06);
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.6rem;
}

.builder-section__add {
  background: rgba(99, 102, 241, 0.12);
  border: none;
  border-radius: 999px;
  color: #4338ca;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  transition: background 0.2s ease, color 0.2s ease;
}

.builder-section__add:hover,
.builder-section__add:focus {
  background: #4338ca;
  color: #ffffff;
}

.builder-lessons {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.builder-lesson {
  align-items: flex-start;
  display: flex;
  gap: 0.6rem;
}

.builder-lesson__drag {
  align-items: center;
  background: none;
  border: none;
  color: #9ca3af;
  cursor: grab;
  display: inline-flex;
  font-size: 0.95rem;
  margin-top: 0.15rem;
  padding: 0;
}

.builder-lesson__drag:focus {
  outline: 2px solid rgba(99, 102, 241, 0.4);
  outline-offset: 2px;
}

.builder-lesson__drag:active {
  cursor: grabbing;
}

.builder-lesson__title {
  border: 1px solid transparent;
  border-radius: 8px;
  flex: 1;
  font-weight: 500;
  min-height: 1.6rem;
  padding: 0.15rem 0.4rem;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.builder-lesson__title:hover {
  background: rgba(99, 102, 241, 0.08);
}

.builder-lesson__title[contenteditable='true']:focus {
  background: rgba(99, 102, 241, 0.12);
  border-color: rgba(99, 102, 241, 0.4);
  outline: none;
}

.builder-lesson__meta {
  color: #6b7280;
  font-size: 0.8rem;
  margin-left: auto;
}

.builder-lesson--empty {
  color: #9ca3af;
  font-style: italic;
}

.builder-main {
  background: #ffffff;
  border: 1px solid rgba(15, 18, 38, 0.08);
  border-radius: 24px;
  box-shadow: 0 20px 40px rgba(15, 18, 38, 0.08);
  flex: 1;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.builder-main__header h2 {
  margin: 0 0 0.25rem;
}

.builder-hint {
  color: #6b7280;
  font-size: 0.95rem;
  margin: 0;
}

.builder-form {
  display: grid;
  gap: 1.25rem;
}

.builder-form.is-disabled {
  opacity: 0.6;
}

.builder-form__field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.builder-field-help {
  color: #64748b;
  font-size: 0.85rem;
  margin: -0.25rem 0 0;
}

.builder-form__field label {
  font-weight: 600;
}

.builder-form__field input,
.builder-form__field select,
.builder-form__field textarea {
  border: 1px solid rgba(15, 18, 38, 0.15);
  border-radius: 10px;
  font: inherit;
  padding: 0.65rem 0.75rem;
}

.builder-form__field textarea {
  resize: vertical;
}

.rich-editor {
  background: #ffffff;
  border: 1px solid rgba(15, 18, 38, 0.12);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.rich-editor__toolbar {
  align-items: center;
  background: #f1f5f9;
  border-bottom: 1px solid rgba(15, 18, 38, 0.08);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
}

.rich-editor__btn {
  background: #ffffff;
  border: 1px solid rgba(15, 18, 38, 0.12);
  border-radius: 8px;
  color: #0f172a;
  cursor: pointer;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.35rem 0.65rem;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.rich-editor__btn span {
  font-weight: 700;
}

.rich-editor__btn:hover,
.rich-editor__btn:focus-visible {
  background: #e2e8f0;
  border-color: rgba(15, 18, 38, 0.25);
  outline: none;
}

.rich-editor__btn--primary {
  background: #2563eb;
  border-color: #2563eb;
  color: #ffffff;
}

.rich-editor__btn--primary:hover,
.rich-editor__btn--primary:focus-visible {
  background: #1d4ed8;
  border-color: #1d4ed8;
}

.rich-editor__divider {
  align-self: stretch;
  background: rgba(15, 18, 38, 0.08);
  width: 1px;
}

.rich-editor__spacer {
  flex: 1 1 auto;
}

.rich-editor__color {
  align-items: center;
  display: inline-flex;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.rich-editor__color input[type='color'] {
  appearance: none;
  background: none;
  border: 1px solid rgba(15, 18, 38, 0.15);
  border-radius: 6px;
  cursor: pointer;
  height: 28px;
  padding: 0;
  width: 28px;
}

.rich-editor__color input[type='color']::-webkit-color-swatch,
.rich-editor__color input[type='color']::-moz-color-swatch {
  border: none;
  border-radius: 6px;
}

.rich-editor__content {
  font: inherit;
  min-height: 180px;
  outline: none;
  padding: 1rem;
}

.rich-editor__content:focus-visible {
  box-shadow: inset 0 0 0 2px rgba(37, 99, 235, 0.35);
}

.rich-editor__content.is-disabled {
  background: #f8fafc;
  color: #94a3b8;
}

.rich-editor__preview {
  background: #f8fafc;
  border-top: 1px solid rgba(15, 18, 38, 0.08);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.85rem 1rem 1.1rem;
}

.rich-editor__preview-label {
  color: #475569;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  margin: 0;
  text-transform: uppercase;
}

.rich-editor__preview-body {
  background: #ffffff;
  border: 1px dashed rgba(15, 18, 38, 0.15);
  border-radius: 10px;
  min-height: 120px;
  padding: 0.75rem;
}

.rich-editor__preview-empty {
  color: #94a3b8;
  font-size: 0.9rem;
  margin: 0;
}

.rich-editor__preview-body :where(h1, h2, h3, h4, h5, h6) {
  color: inherit;
  margin-top: 0;
}

.rich-editor__preview-body :where(p, ul, ol) {
  margin: 0 0 0.75rem;
}

.rich-editor__preview-body :where(ul, ol) {
  padding-left: 1.25rem;
}

.rich-editor__preview-body :where(blockquote) {
  border-left: 3px solid rgba(15, 18, 38, 0.15);
  color: #475569;
  margin: 0 0 0.75rem;
  padding-left: 0.75rem;
}

.rich-editor__preview-body :last-child {
  margin-bottom: 0;
}

.rich-editor__embed {
  margin: 0 0 1rem;
}

.rich-editor__embed iframe {
  aspect-ratio: 16 / 9;
  border: none;
  border-radius: 12px;
  display: block;
  height: auto;
  width: 100%;
}

.rich-editor__embed video {
  border-radius: 12px;
  display: block;
  max-height: 480px;
  width: 100%;
}

.builder-form.is-disabled .rich-editor__content {
  background: #f8fafc;
  color: #94a3b8;
  pointer-events: none;
}

.builder-form.is-disabled .rich-editor__btn,
.builder-form.is-disabled .rich-editor__color input[type='color'] {
  opacity: 0.6;
  pointer-events: none;
}

.builder-form__field--inline {
  align-items: center;
  flex-direction: row;
  gap: 0.75rem;
}

.builder-submit {
  align-self: flex-start;
  background: #111827;
  border: none;
  border-radius: 999px;
  color: #ffffff;
  cursor: pointer;
  font-weight: 600;
  padding: 0.65rem 1.5rem;
  transition: background 0.2s ease, transform 0.2s ease;
}

.builder-submit:hover,
.builder-submit:focus {
  background: #1f2937;
  transform: translateY(-1px);
}

.builder-status {
  color: #6b7280;
  font-size: 0.9rem;
  margin: 0;
}

.builder-status.is-error {
  color: #dc2626;
}

.builder-status.is-success {
  color: #047857;
}

.builder-status--global {
  margin-top: auto;
}

@media (max-width: 980px) {
  .builder-layout {
    flex-direction: column;
    width: min(100%, 720px);
  }

  .builder-sidebar {
    max-height: none;
    position: static;
    width: 100%;
  }
}

@media (max-width: 640px) {
  .builder-top {
    align-items: stretch;
    flex-direction: column;
    padding: 1.5rem;
  }

  .builder-layout {
    padding: 1.5rem;
  }

  .builder-main {
    padding: 1.5rem;
  }
}
/* Course public view */
body.course-view {
  background: var(--surface, #f8fafc);
  color: var(--text-strong, #111827);
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  margin: 0;
  min-height: 100vh;
}

.course-hero {
  position: relative;
  overflow: hidden;
  padding: 4rem 1.5rem 3rem;
  color: #fff;
}

.course-hero__backdrop {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: brightness(0.6);
  transition: transform 0.6s ease;
}

.course-hero__backdrop::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(17, 24, 39, 0.6), rgba(17, 24, 39, 0.9));
}

.course-hero__backdrop.is-empty {
  background: linear-gradient(135deg, #1f2937, #4f46e5);
  filter: none;
}

.course-hero:hover .course-hero__backdrop {
  transform: scale(1.02);
}

.course-hero__content {
  position: relative;
  max-width: 960px;
  margin: 0 auto;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.course-hero__crumb a {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  font-size: 0.95rem;
}

.course-hero__crumb a:hover {
  text-decoration: underline;
}

.course-hero__title {
  font-size: clamp(2rem, 5vw, 3rem);
  margin: 0;
}

.course-hero__summary {
  margin: 0;
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.85);
  max-width: 680px;
}

.course-hero__meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.course-hero__enroll {
  appearance: none;
  border: none;
  border-radius: 999px;
  background: linear-gradient(120deg, #6366f1, #8b5cf6);
  color: #fff;
  font-weight: 600;
  padding: 0.65rem 1.5rem;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.course-hero__enroll:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 10px 25px rgba(99, 102, 241, 0.35);
}

.course-hero__enroll:disabled {
  cursor: not-allowed;
  opacity: 0.75;
}

.course-hero__enroll.is-success {
  background: rgba(20, 184, 166, 0.3);
  color: #e0f2f1;
  box-shadow: none;
}

.course-hero__progress {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 320px;
}

.course-hero__progress-label {
  margin: 0;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.8);
}

.badge--paid {
  background: rgba(248, 113, 113, 0.2);
  color: #fee2e2;
  border: 1px solid rgba(248, 113, 113, 0.4);
}

.course-layout {
  display: grid;
  grid-template-columns: minmax(240px, 320px) 1fr;
  gap: 2rem;
  max-width: 1200px;
  margin: -2rem auto 3rem;
  padding: 0 1.5rem;
}

.course-sidebar {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 15px 45px rgba(15, 18, 38, 0.08);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.course-sidebar__title {
  margin: 0;
  font-size: 1.1rem;
}

.course-outline {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.course-outline__empty {
  margin: 0;
  color: var(--text-muted, #6b7280);
}

.course-outline__section {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.course-outline__section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.course-outline__section-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.course-outline__lessons {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.course-outline__lesson-btn {
  width: 100%;
  background: #f9fafb;
  border: 1px solid rgba(148, 163, 184, 0.4);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
  font-size: 0.95rem;
  color: inherit;
}

.course-outline__lesson-btn:hover {
  background: #eef2ff;
  border-color: rgba(99, 102, 241, 0.5);
  transform: translateX(2px);
}

.course-outline__lesson-btn.is-active {
  background: #e0e7ff;
  border-color: rgba(99, 102, 241, 0.8);
  box-shadow: 0 8px 20px rgba(79, 70, 229, 0.25);
}

.course-outline__lesson-btn.is-locked {
  background: #f3f4f6;
  border-style: dashed;
  color: #6b7280;
}

.course-outline__lesson-btn.is-locked:hover {
  transform: none;
  background: #f3f4f6;
}

.course-outline__lesson-title {
  font-weight: 600;
}

.course-outline__lesson-meta {
  font-size: 0.8rem;
  color: #6b7280;
}

.course-viewer {
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 20px 50px rgba(15, 18, 38, 0.08);
  padding: 2rem;
  min-height: 520px;
  display: flex;
  flex-direction: column;
}

.course-viewer__placeholder {
  margin: auto;
  text-align: center;
  color: #6b7280;
}

.course-lesson {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.course-lesson__header {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.course-lesson__title {
  margin: 0;
  font-size: 1.75rem;
}

.course-lesson__meta {
  margin: 0;
  font-size: 0.9rem;
  color: #6b7280;
}

.course-lesson__content {
  font-size: 1rem;
  line-height: 1.65;
  color: #1f2937;
}

.course-lesson__content p {
  margin-bottom: 1rem;
}

.course-lesson__media {
  width: 100%;
  background: #0f172a;
  border-radius: 16px;
  overflow: hidden;
}

.course-lesson__video {
  width: 100%;
  height: auto;
  display: block;
}

.course-lesson__download {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1rem;
  border-radius: 10px;
  background: #eef2ff;
  color: #4338ca;
  font-weight: 600;
  text-decoration: none;
}

.course-lesson__download:hover {
  background: #e0e7ff;
}

.course-lesson__empty {
  margin: 0;
  padding: 1.5rem;
  color: #e2e8f0;
}

.course-lesson__notes {
  margin-top: 1rem;
  padding: 1rem;
  background: #f9fafb;
  border-radius: 12px;
}

.course-lesson__cta {
  align-self: flex-start;
  border: none;
  border-radius: 10px;
  background: #4f46e5;
  color: #fff;
  font-weight: 600;
  padding: 0.6rem 1.2rem;
  cursor: pointer;
}

.course-lesson__cta:hover {
  background: #4338ca;
}

@media (max-width: 960px) {
  .course-layout {
    grid-template-columns: 1fr;
    margin-top: -1.5rem;
  }

  .course-sidebar {
    position: sticky;
    top: 1rem;
  }
}

@media (max-width: 640px) {
  .course-hero {
    padding: 3rem 1rem 2rem;
  }

  .course-layout {
    padding: 0 1rem;
  }

  .course-viewer {
    padding: 1.5rem;
  }
}