:host(nx-editor) {
	position: relative;
	height: 100%;
	width: 100%;

	display: flex;
	flex-direction: column;
	border: 1px solid #ddd;
	border-radius: 4px;
	background: white;
	overflow: hidden; /* 에디터가 삐져나가지 않게 */



	#editor-container {
		flex: 1;
		min-height: 0; /* 중요: 이 설정이 있어야 내부에서 스크롤이 터짐 */
		display: flex;
		flex-direction: column;
	}

	.menu-bar {
		background: #f8f9fa;
		padding: 5px;
		border-bottom: 1px solid #ddd;
		display: flex;
		flex-wrap: wrap;
		gap: 4px;
	}

	.menu-bar button, .menu-bar input[type="color"] {
		width: 32px;
		height: 32px;
		cursor: pointer;
		border: 1px solid #dee2e6;
		background: white;
		border-radius: 4px;
		font-size: 12px;
	}

	.menu-bar select {
		background: white;
		border: 1px solid #dee2e6;
		border-radius: 2px;
		color: #333;
		padding: 0 4px;
		outline: none;
	}

	.menu-bar input[type="color"] {
		padding: 4px;
		color: #333;
	}

	.menu-bar button {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		padding: 0;
		transition: all 0.2s;
		color: #333;
	}

	/* 모든 아이콘 공통 스타일 */
	.menu-bar button i {
		display: inline-block;
		width: 18px; /* 아이콘 크기 살짝 키움 */
		height: 18px;
		background-repeat: no-repeat;
		background-position: center;
		background-size: contain;
		/* mask-image 방식을 쓰면 is-active 시 색상 제어가 편합니다 */
		background-color: currentColor;
		-webkit-mask-repeat: no-repeat;
		-webkit-mask-position: center;
	}

	.menu-bar button:hover {
		background-color: #f8f9fa;
		border-color: #adb5bd;
	}
	.menu-bar button:active {
		background-color: green;
	}

	.menu-bar button.is-active {
		background-color: green; /* 연한 파란색 배경 */
		color: white;           /* 파란색 아이콘 */
		--border-color: darkgreen;
	}



	/* 버튼 활성화 시 아이콘 색상 자동 변경 */
	.menu-bar button.is-active i {
		background-color: white; /* 버튼 배경이 파란색이면 아이콘은 흰색으로 */
	}

	/* 하이라이트 아이콘 정의 */
	.icon-highlight { -webkit-mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-highlighter" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M11.096.644a2 2 0 0 1 2.791.036l1.433 1.433a2 2 0 0 1 .035 2.791l-.413.435-8.07 8.995a.5.5 0 0 1-.372.166h-3a.5.5 0 0 1-.234-.058l-.412.412A.5.5 0 0 1 2.5 15h-2a.5.5 0 0 1-.354-.854l1.412-1.412A.5.5 0 0 1 1.5 12.5v-3a.5.5 0 0 1 .166-.372l8.995-8.07zm-.115 1.47L2.727 9.52l3.753 3.753 7.406-8.254zm3.585 2.17.064-.068a1 1 0 0 0-.017-1.396L13.18 1.387a1 1 0 0 0-1.396-.018l-.068.065zM5.293 13.5 2.5 10.707v1.586L3.707 13.5z"/></svg>'); }
	.icon-left { -webkit-mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-text-left" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M2 12.5a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7a.5.5 0 0 1-.5-.5m0-3a.5.5 0 0 1 .5-.5h11a.5.5 0 0 1 0 1h-11a.5.5 0 0 1-.5-.5m0-3a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7a.5.5 0 0 1-.5-.5m0-3a.5.5 0 0 1 .5-.5h11a.5.5 0 0 1 0 1h-11a.5.5 0 0 1-.5-.5"/></svg>'); }
	.icon-center { -webkit-mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-text-center" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M4 12.5a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7a.5.5 0 0 1-.5-.5m-2-3a.5.5 0 0 1 .5-.5h11a.5.5 0 0 1 0 1h-11a.5.5 0 0 1-.5-.5m2-3a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7a.5.5 0 0 1-.5-.5m-2-3a.5.5 0 0 1 .5-.5h11a.5.5 0 0 1 0 1h-11a.5.5 0 0 1-.5-.5"/></svg>'); }
	.icon-right { -webkit-mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-text-right" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M6 12.5a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7a.5.5 0 0 1-.5-.5m-4-3a.5.5 0 0 1 .5-.5h11a.5.5 0 0 1 0 1h-11a.5.5 0 0 1-.5-.5m4-3a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7a.5.5 0 0 1-.5-.5m-4-3a.5.5 0 0 1 .5-.5h11a.5.5 0 0 1 0 1h-11a.5.5 0 0 1-.5-.5"/></svg>'); }
	.icon-ul { -webkit-mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-list-ul" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M5 11.5a.5.5 0 0 1 .5-.5h9a.5.5 0 0 1 0 1h-9a.5.5 0 0 1-.5-.5m0-4a.5.5 0 0 1 .5-.5h9a.5.5 0 0 1 0 1h-9a.5.5 0 0 1-.5-.5m0-4a.5.5 0 0 1 .5-.5h9a.5.5 0 0 1 0 1h-9a.5.5 0 0 1-.5-.5m-3 1a1 1 0 1 0 0-2 1 1 0 0 0 0 2m0 4a1 1 0 1 0 0-2 1 1 0 0 0 0 2m0 4a1 1 0 1 0 0-2 1 1 0 0 0 0 2"/></svg>'); }
	.icon-ol { -webkit-mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-list-ol" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M5 11.5a.5.5 0 0 1 .5-.5h9a.5.5 0 0 1 0 1h-9a.5.5 0 0 1-.5-.5m0-4a.5.5 0 0 1 .5-.5h9a.5.5 0 0 1 0 1h-9a.5.5 0 0 1-.5-.5m0-4a.5.5 0 0 1 .5-.5h9a.5.5 0 0 1 0 1h-9a.5.5 0 0 1-.5-.5"/><path d="M1.713 11.865v-.474H2c.217 0 .363-.137.363-.317 0-.185-.158-.31-.361-.31-.223 0-.367.152-.373.31h-.59c.016-.467.373-.787.986-.787.588-.002.954.291.957.703a.595.595 0 0 1-.492.594v.033a.615.615 0 0 1 .569.631c.003.533-.502.8-1.051.8-.656 0-1-.37-1.008-.794h.582c.008.178.186.306.422.309.254 0 .424-.145.422-.35-.002-.195-.155-.348-.414-.348h-.3zm-.004-4.699h-.604v-.035c0-.408.295-.844.958-.844.583 0 .96.326.96.756 0 .389-.257.617-.476.848l-.537.572v.03h1.054V9H1.143v-.395l.957-.99c.138-.142.293-.304.293-.508 0-.18-.147-.32-.342-.32a.33.33 0 0 0-.342.338zM2.564 5h-.635V2.924h-.031l-.598.42v-.567l.629-.443h.635z"/></svg>'); }
	.icon-image { -webkit-mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-image" viewBox="0 0 16 16"><path d="M6.002 5.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0"/><path d="M2.002 1a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V3a2 2 0 0 0-2-2zm12 1a1 1 0 0 1 1 1v6.5l-3.777-1.947a.5.5 0 0 0-.577.093l-3.71 3.71-2.66-1.772a.5.5 0 0 0-.63.062L1.002 12V3a1 1 0 0 1 1-1z"/></svg>'); }
	.icon-undo { -webkit-mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-arrow-counterclockwise" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M8 3a5 5 0 1 1-4.546 2.914.5.5 0 0 0-.908-.417A6 6 0 1 0 8 2z"/><path d="M8 4.466V.534a.25.25 0 0 0-.41-.192L5.23 2.308a.25.25 0 0 0 0 .384l2.36 1.966A.25.25 0 0 0 8 4.466"/></svg>'); }
	.icon-redo { -webkit-mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-arrow-clockwise" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M8 3a5 5 0 1 0 4.546 2.914.5.5 0 0 1 .908-.417A6 6 0 1 1 8 2z"/><path d="M8 4.466V.534a.25.25 0 0 1 .41-.192l2.36 1.966c.12.1.12.284 0 .384L8.41 4.658A.25.25 0 0 1 8 4.466"/></svg>'); }


	.tiptap {
		flex: 1; /* 부모인 container의 남은 높이를 다 씀 */
		padding: 15px;
		overflow-y: auto;
		outline: none;
		background: white;
		min-height: 250px;
		font-family: Arial, sans-serif !important;
	}

	.tiptap p {
		margin: 0; /* 혹은 아주 적은 여백 */
	}
	.tiptap img { max-width: 100%; height: auto; border-radius: 4px; }
	.tiptap [style*="text-align: left"] { text-align: left; }
	.tiptap [style*="text-align: center"] { text-align: center; }
	.tiptap [style*="text-align: right"] { text-align: right; }


	.tiptap {
		font-synthesis: style weight !important; /* 브라우저가 임의로 기울임꼴과 굵기를 생성하도록 허용 */
		-webkit-font-smoothing: antialiased;
	}

	.tiptap em {
		font-style: italic !important;
		font-display: swap;
	}

	/* 혹시 모르니 i 태그도 함께 지정 */
	.tiptap i {
		--font-style: italic !important;
		font-style: oblique;
	}

	.tiptap span[style*="font-size"] {
		display: inline-block; /* 크기 적용이 더 확실해짐 */
	}


	/* ProseMirror 필수 에디터 스타일 */
	#editor-container .ProseMirror {
		white-space: pre-wrap;       /* 줄바꿈과 공백을 보존 */
		word-wrap: break-word;       /* 긴 단어 자동 줄바꿈 */
		outline: none;               /* 포커스 시 테두리 제거 (선택) */
		padding: 10px;               /* 에디터 안쪽 여백 */
		min-height: 200px;           /* 에디터 최소 높이 */
	}

	/* 에디터 내의 단락(p) 간격 조절 */
	#editor-container .ProseMirror p {
		margin: 0;
	}
}

/* readonly일 때 에디터 외관 조절 (선택사항) */
:host([readonly]) #editor-container {
	border-color: transparent;
	background-color: #f9f9f9;
	cursor: default;
}