.nc-h1 { font-size: clamp(1.5rem, 2.5vw, 2rem); font-weight: 700; color: var(--nc-dark-text); margin: 0 0 8px; letter-spacing: -0.02em; }
.nc-h2 { font-size: 1.25rem; font-weight: 600; color: var(--nc-dark-text); margin: 24px 0 12px; }
.nc-h3 { font-size: 1.05rem; font-weight: 600; color: var(--nc-dark-text); margin: 0 0 8px; }
.nc-lead { font-size: 1rem; color: var(--nc-body); margin: 0 0 20px; max-width: 65ch; }
.nc-muted { color: var(--nc-secondary); }
.nc-caption { font-size: 12px; color: var(--nc-muted); }

.nc-page-head { margin-bottom: 24px; }
.nc-breadcrumb { font-size: 13px; color: var(--nc-muted); margin-bottom: 16px; }
.nc-breadcrumb a { color: var(--nc-primary); text-decoration: none; font-weight: 600; }

.nc-card {
  background: var(--nc-white);
  border: 1px solid var(--nc-border);
  border-radius: var(--nc-radius);
  padding: 20px;
  box-shadow: var(--nc-shadow);
}
.nc-card-highlight { border-color: var(--nc-primary); border-top: 4px solid var(--nc-primary); }
.nc-mb-lg { margin-bottom: 24px; }

.nc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: var(--nc-radius-sm);
  border: 1px solid transparent;
  font-family: inherit;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
}
.nc-btn-primary { background: var(--nc-primary); color: #fff; border-color: var(--nc-primary); }
.nc-btn-primary:hover { filter: brightness(0.95); }
.nc-btn-secondary { background: var(--nc-white); color: var(--nc-primary); border-color: var(--nc-border); }
.nc-btn-ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,0.2); }
.nc-btn-sm { min-height: 36px; padding: 0 12px; font-size: 13px; }
.nc-btn-block { width: 100%; }
.nc-btn-danger { background: var(--nc-danger); color: #fff; border-color: var(--nc-danger); }

.nc-input, .nc-select, .nc-textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  border-radius: var(--nc-radius-sm);
  border: 1px solid var(--nc-border);
  background: var(--nc-white);
  color: var(--nc-dark-text);
  font-family: inherit;
  font-size: 14px;
}
.nc-textarea { min-height: 120px; resize: vertical; }
.nc-input:focus, .nc-select:focus, .nc-textarea:focus {
  outline: none;
  border-color: var(--nc-primary);
  box-shadow: 0 0 0 3px rgba(127, 86, 217, 0.18);
}
.nc-input-search { max-width: 420px; }

.nc-label { display: block; font-weight: 600; font-size: 14px; color: var(--nc-dark-text); margin-bottom: 8px; }
.nc-stack { display: flex; flex-direction: column; gap: 14px; }
.nc-stack-lg { gap: 20px; }
.nc-fieldset { border: 1px solid var(--nc-border); border-radius: var(--nc-radius); padding: 12px 14px; }
.nc-inline-form { display: inline; }

.nc-flash { padding: 12px 16px; border-radius: var(--nc-radius-sm); margin-bottom: 16px; font-weight: 600; }
.nc-flash-success { background: rgba(16,185,129,0.12); border: 1px solid rgba(16,185,129,0.35); color: #047857; }
.nc-flash-error { background: rgba(220,38,38,0.1); border: 1px solid rgba(220,38,38,0.35); color: #b91c1c; }

.nc-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--nc-card);
  border: 1px solid var(--nc-border);
  color: var(--nc-secondary);
  text-transform: capitalize;
}
.nc-badge-completed { background: rgba(16,185,129,0.12); border-color: rgba(16,185,129,0.35); color: #047857; }
.nc-badge-in_progress { background: rgba(127,86,217,0.1); border-color: rgba(127,86,217,0.35); color: var(--nc-primary-dark); }

.nc-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.nc-chip {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--nc-border);
  text-decoration: none;
  font-weight: 600;
  font-size: 13px;
  color: var(--nc-dark-text);
  background: var(--nc-white);
}
.nc-chip.is-active { border-color: var(--nc-primary); background: rgba(127,86,217,0.08); color: var(--nc-primary-dark); }

.nc-product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}
.nc-product-card {
  background: var(--nc-white);
  border: 1px solid var(--nc-border);
  border-radius: 14px;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.nc-product-card:not(.is-disabled):hover { transform: translateY(-2px); box-shadow: var(--nc-shadow); }
.nc-product-card.is-disabled { opacity: 0.5; pointer-events: none; }
.nc-product-accent { height: 4px; background: linear-gradient(90deg, var(--nc-primary), var(--nc-primary-light)); }
.nc-product-body { padding: 22px; display: flex; flex-direction: column; gap: 12px; }
.nc-progress-bar {
  height: 8px;
  border-radius: 999px;
  background: var(--nc-border);
  position: relative;
  overflow: hidden;
}
.nc-progress-bar::after {
  content: "";
  position: absolute;
  inset: 0;
  width: var(--p, 0%);
  background: linear-gradient(90deg, var(--nc-primary), var(--nc-primary-light));
}
.nc-progress-inline { display: flex; flex-direction: column; gap: 6px; }

.nc-module-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.nc-module-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-radius: var(--nc-radius);
  border: 1px solid var(--nc-border);
  background: var(--nc-white);
}
.nc-module-title { font-weight: 700; color: var(--nc-dark-text); text-decoration: none; }
.nc-module-title:hover { color: var(--nc-primary); }
.nc-module-meta { text-align: right; flex-shrink: 0; }

.nc-module-page-wrap {
  padding: 32px 40px 80px;
  max-width: 1200px;
  margin: 0 auto;
}
.nc-module-breadcrumb { font-size: 13px; color: var(--nc-muted); margin-bottom: 24px; }
.nc-module-breadcrumb a { color: var(--nc-primary); text-decoration: none; font-weight: 600; }
.nc-module-breadcrumb a:hover { color: var(--nc-primary-dark); }
.nc-module-breadcrumb span[aria-hidden] { margin: 0 6px; }

.nc-module-layout {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 28px;
  align-items: start;
}
.nc-module-layout-full {
  grid-template-columns: 1fr 280px;
}
@media (max-width: 900px) {
  .nc-module-page-wrap { padding: 24px 20px 60px; }
  .nc-module-layout, .nc-module-layout-full { grid-template-columns: 1fr; }
  .nc-module-toc { order: -1; }
}
.nc-module-toc {
  position: sticky;
  top: 72px;
  padding: 16px;
  border-radius: var(--nc-radius);
  border: 1px solid var(--nc-border);
  background: var(--nc-white);
}
.nc-module-toc ol { margin: 0; padding-left: 18px; }
.nc-module-toc a { color: var(--nc-primary); font-weight: 600; text-decoration: none; font-size: 14px; }

.nc-prose { max-width: 72ch; }
.nc-prose :where(p, ul, ol) { margin: 0 0 12px; }
.nc-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.nc-table th, .nc-table td { border: 1px solid var(--nc-border); padding: 8px 10px; text-align: left; }
.nc-table-wrap { overflow-x: auto; border-radius: var(--nc-radius); border: 1px solid var(--nc-border); background: var(--nc-white); }

.nc-video {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  border-radius: var(--nc-radius);
  overflow: hidden;
  border: 1px solid var(--nc-border);
}
.nc-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.nc-tool-frame {
  border-radius: var(--nc-radius);
  overflow: hidden;
  border: 1px solid var(--nc-border);
  min-height: 520px;
}
.nc-tool-frame iframe { width: 100%; height: 720px; border: 0; background: #fff; }

.nc-quiz-form .nc-choice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--nc-border);
  border-radius: var(--nc-radius-sm);
  margin-bottom: 8px;
  cursor: pointer;
  background: var(--nc-white);
}
.nc-quiz-form .nc-choice input { margin-top: 3px; }

.nc-library-toolbar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }

.nc-resource-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.nc-resource-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--nc-radius);
  border: 1px solid var(--nc-border);
  background: var(--nc-white);
}
.nc-resource-item a { font-weight: 700; color: var(--nc-dark-text); text-decoration: none; }
.nc-resource-item a:hover { color: var(--nc-primary); }

.nc-login-card {
  width: 100%;
  max-width: 420px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 16px;
  padding: 36px 32px;
  color: #fff;
  backdrop-filter: blur(8px);
}
.nc-login-title { margin: 0 0 6px; font-size: 22px; font-weight: 800; }
.nc-login-sub { margin: 0 0 24px; color: var(--nc-primary-light); font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.nc-login-meta { margin-top: 16px; font-size: 13px; }
.nc-login-meta a { color: var(--nc-primary-light); font-weight: 600; text-decoration: none; }
.nc-login-hint { margin-top: 20px; font-size: 11px; color: rgba(255,255,255,0.55); }
.nc-login-hint code { color: #e8e8f0; }
.nc-login-logo { margin: 0 auto 12px; }
.nc-login-logo--purple { display: none; }
.nc-login-logo--white { display: block; }

.nc-alert { padding: 10px 14px; border-radius: var(--nc-radius-sm); font-size: 14px; margin-bottom: 12px; }
.nc-alert-error { background: rgba(220,38,38,0.15); border: 1px solid rgba(220,38,38,0.4); color: #fecaca; }
.nc-alert-success { background: rgba(16,185,129,0.15); border: 1px solid rgba(16,185,129,0.35); color: #bbf7d0; }

.nc-login-card .nc-input {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.14);
  color: #fff;
}
.nc-login-card .nc-label { color: #f4f4f7; }

/* Light theme — login card */
html[data-theme="light"] .nc-login-card {
  background: #fff;
  border: 1px solid #e5e0f0;
  color: #1a1a2e;
  box-shadow: 0 8px 32px rgba(127,86,217,0.08), 0 1px 3px rgba(0,0,0,0.06);
}
html[data-theme="light"] .nc-login-title { color: #1a1a2e; }
html[data-theme="light"] .nc-login-sub { color: #7F56D9; }
html[data-theme="light"] .nc-login-meta a { color: #7F56D9; }
html[data-theme="light"] .nc-login-card .nc-label { color: #3a3a4a; }
html[data-theme="light"] .nc-login-card .nc-input {
  background: #f8f7fc;
  border-color: #ddd6ee;
  color: #1a1a2e;
}
html[data-theme="light"] .nc-login-card .nc-input::placeholder { color: #a0a0b0; }
html[data-theme="light"] .nc-login-card .nc-input:focus {
  border-color: #7F56D9;
  box-shadow: 0 0 0 3px rgba(127,86,217,0.12);
}
html[data-theme="light"] .nc-login-logo--white { display: none; }
html[data-theme="light"] .nc-login-logo--purple { display: block; }
html[data-theme="dark"] .nc-login-logo--white { display: block; }
html[data-theme="dark"] .nc-login-logo--purple { display: none; }
html[data-theme="light"] .nc-alert-error { background: #fef2f2; border-color: #fca5a5; color: #991b1b; }
html[data-theme="light"] .nc-alert-success { background: #ecfdf5; border-color: #6ee7b7; color: #065f46; }

.nc-max-form { max-width: 520px; }
