@charset "utf-8";
@font-face {
  font-family: 'Paperlogy';
  src: url('../../assets/fonts/Paperlogy-4Regular.ttf') format('truetype');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Paperlogy';
  src: url('../../assets/fonts/Paperlogy-7Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
:root {
	--ql-fz-lg: 28px !important;
	--ql-fz-md: 20px !important;
	--ql-fz-sm: 16px !important;
	--ql-h2-color: #006133;
	--ql-h3-color: #006133;
	--ql-prose-width: 700px;
	--ql-table-accent: #006133;
	--ql-table-head-bg: #f1faf4;
	--ql-table-row-head-bg: #f5f6f8;
	--ql-table-cell-bg: #fff;
	--ql-table-border: #d6dce5;
	--ql-table-cell-padding-y: 1rem;
	--ql-table-cell-padding-x: 1rem;
	--ql-link-state-color: rgb(241, 247, 244);
	--ql-font-family: "Pretendard", "Nanum Gothic", system-ui, -apple-system, "Segoe UI", sans-serif;
	--ql-font-subheading: clamp(24px, 2.6vw, 36px);
	--ql-font-card: clamp(22px, 2vw, 30px);
	--ql-font-body: clamp(17px, 1.25vw, 20px);
	--ql-color-brand: #006133;
	--ql-color-ink: #17251e;
}

@media screen and (max-width: 576px) {
	:root {
		--ql-fz-lg: 20px !important;
		--ql-fz-md: 18px !important;
		--ql-fz-sm: 16px !important;
	}
}

/* quill editor -------------------------------------------------- */
.ql-editor {
	background-color: #FFF;
	color: var(--ql-color-text-main);
	font-family: "Pretendard", Arial, sans-serif;
	padding: 3rem;
	counter-reset: h2-counter;
	height: auto !important;
	min-height: 500px !important;
	max-height: none !important;
	width: 100%;
	max-width: none !important;
	margin: 0 auto;
	word-break: normal !important;
	break-word: normal;
	overflow-x: hidden !important;
}

/* 사용자 폰트가 없는 본문은 기본 글꼴을 상속한다. */
.ql-editor * {
	font-family: inherit;
}

/* 800px 읽기 폭은 일반 본문에만 적용하고, 표는 부모의 가용 폭을 사용한다. */
.ql-editor > :not(table):not(.table-responsive):not(img):not(video):not(iframe) {
	width: 100%;
	max-width: var(--ql-prose-width);
	margin-left: auto !important;
	margin-right: auto !important;
}

.ql-editor > img {
	display: block;
	max-width: min(100%, var(--ql-prose-width)) !important;
	margin-left: auto !important;
	margin-right: auto !important;
}

.ql-editor > table {
	margin-left: auto;
	margin-right: auto;
}

.ql-editor>p {
	line-height: 2;
	margin-left: 1rem !important;
	font-size: var(--ql-fz-sm);
}

.ql-editor li.ql-indent-1:not(.ql-direction-rtl) {
	padding-left: 2.5em;
}

.ql-editor .hash-heading {
	font-weight: 600;
	color: var(--ql-color-brand);
	font-size: 1.05rem;
}



.ql-table-menus-container {
	z-index: 9999 !important;
	margin: 0 !important;
}

.ql-table-tooltip-hover {
	z-index: 10000 !important;
}

.ql-toolbar button.ql-tableCenter.ql-table-button-disabled,
.ql-toolbar button.ql-tableCenter[disabled] {
	opacity: 1 !important;
	pointer-events: auto !important;
}

/* quill-table-better override */
.ql-table-properties-form .properties-form-row {
	justify-content: flex-start !important;
	gap: 1rem !important;
}

.ql-container .label-field-view-input-wrapper>label {
	/* top: auto !important;
	bottom: 100% !important;
	transform: translateY(-2px) scale(0.75) !important;
	transform-origin: left bottom !important; */
	margin-bottom: 0 !important;
	top: auto !important;
	bottom: 100% !important;
	transform: none !important;
}

.ql-table-dropdown-properties {
	width: max-content !important;
}

.ql-table-dropdown-label,
.ql-table-dropdown-properties-label {
	margin: 16px 0 0 !important;
}

.ql-container .ql-table-color-container .color-picker .color-picker-select {
	z-index: 10030 !important;
}

.ql-container .ql-table-color-container .color-picker .color-picker-select>.erase-container {
	position: relative !important;
	z-index: 10031 !important;
}

.ql-container .ql-table-color-container .color-picker .color-picker-palette {
	z-index: 10032 !important;
}

/* table/cell properties 창을 선택 위치와 무관하게 에디터 좌상단에 고정 */
.ql-container .ql-table-properties-form {
	/* top: 12px !important;
	left: 12px !important;
	right: auto !important;
	bottom: auto !important; */
	/* transform: none !important; */
	z-index: 10020 !important;
	max-height: calc(100vh - 32px) !important;
	overflow: auto !important;
}

/* .ql-container .ql-table-properties-form .ql-table-check-container {
	display: none !important;
} */



/* 태그  */
.ql-tag {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	padding: 0.15rem 0.5rem;
	margin: 0 0.25rem;
	border-radius: 0.375rem;
    background: rgba(var(--ql-color-brand-rgb), 0.1);
    color: var(--ql-color-brand);
	font-weight: 600;
	font-size: var(--fz-md);
	white-space: nowrap;
	user-select: none;
	-webkit-user-select: none;
	vertical-align: middle;
	border: 1px solid rgba(11, 94, 215, 0.12);
	box-shadow: none;
}

.ql-editor .ql-tag {
	font-family: inherit;
}

.ql-tag.clickable {
	cursor: pointer;
	transition: background .12s ease, transform .06s ease;
}

.ql-tag.clickable:hover {
	background: #d8eaff;
	transform: translateY(-1px);
}

.ql-tag.buttonlike {
	background: #0d6efd;
	color: #fff;
	border-color: rgba(13, 110, 253, 0.2);
	box-shadow: 0 2px 6px rgba(13, 110, 253, 0.12);
}

.ql-tag:focus {
	outline: 2px solid rgba(13, 110, 253, 0.25);
	outline-offset: 2px;
}

.ql-tag.small {
	padding: 0.08rem 0.35rem;
	font-size: 0.8rem;
}

.ql-tag.large {
	padding: 0.25rem 0.6rem;
	font-size: 1.05rem;
}

.ql-tag .tag-remove {
	display: inline-block;
	font-size: 0.85em;
	opacity: 0.7;
	margin-left: 0.25rem;
}

.ql-tag.clickable .tag-remove {
	display: inline-block;
}

.ql-tag:not(:hover) .tag-remove {
	opacity: 0;
	transition: opacity .15s ease;
}

.ql-tag:hover .tag-remove {
	opacity: 1;
}

.ql-tag[data-tag] {
	max-width: 12rem;
	overflow: hidden;
	text-overflow: ellipsis;
}

@media (max-width:480px) {
	.ql-tag {
		margin: 0 0.15rem;
		font-size: 0.85rem;
	}
}

/* ── 테이블 모바일 반응형: 에디터는 넘침 숨김, 테이블만 독립 가로 스크롤 ── */
.ql-container {
	font-size: 16px;
}

/* 활성 Quill은 DOM을 감싸지 않고 에디터 자체가 초과 폭만 스크롤한다. */
.ql-editor[contenteditable="true"] {
	overflow-x: auto !important;
}

.ql-editor table {
	white-space: normal !important;
	max-width: none !important;
	border-collapse: collapse !important;
	border-spacing: 0 !important;
	border-right: 1px solid var(--ql-table-border);
	border-bottom: 1px solid var(--ql-table-border);
	border-left: 1px solid var(--ql-table-border);
	margin-top: 26px;
}

.ql-editor table.ql-table-better {
  table-layout: auto !important;
}

.ql-editor table.ql-table-better thead {
  display: table-header-group !important;
}

.ql-editor table.ql-table-better tbody {
  display: table-row-group !important;
}

.ql-editor table.ql-table-better tr {
  display: table-row !important;
}

.ql-editor table.ql-table-better th,
.ql-editor table.ql-table-better td {
  display: table-cell !important;
}

.ql-editor table.ql-table-better[style*="width: fit-content"],
.ql-editor table.ql-table-better[style*="width:fit-content"] {
  width: max-content !important;
}

.ql-editor table.ql-table-better td:not([style*="vertical-align"]),
.ql-editor table.ql-table-better th:not([style*="vertical-align"]) {
	vertical-align: middle;
}

.ql-editor table.ql-table-better p {
	margin: 0 !important;
	line-height: 1;
	font-size: var(--ql-fz-sm);
}

.ql-editor .table-responsive {
	width: 100%;
	max-width: 100%;
	overflow-x: auto !important;
	-webkit-overflow-scrolling: touch !important;
	margin-block: 2rem;
	padding-bottom: 0;
}

.ql-editor .table-responsive > table {
	width: auto;
	margin-left: auto;
	margin-right: auto;
}

.ql-editor .table-responsive.is-scrollable {
	cursor: grab;
}
.ql-editor .table-responsive table.table::-webkit-scrollbar{
	display: none !important;
	width: 0 !important;
	height: 0 !important;
}
.ql-editor table th,
.ql-editor table td {
	white-space: normal !important;
	padding: var(--ql-table-cell-padding-y) var(--ql-table-cell-padding-x);
	min-width: 60px !important;
	vertical-align: middle;
	border-top: 1px solid var(--ql-table-border);
	border-right: 1px solid var(--ql-table-border);
	border-bottom: 1px solid var(--ql-table-border);
	border-left: 1px solid var(--ql-table-border);
	box-shadow: none !important;
}

/* Bootstrap의 헤더 구분선보다 기본 테두리색을 우선하되 인라인 수정은 허용한다. */
.ql-editor table.table > :not(:last-child) > :last-child > * {
    border-bottom-color: var(--ql-table-border);
}

/* 셀 안의 Quill 글자 크기·색상·강조는 상속/인라인 포맷으로 변경할 수 있다. */
.ql-editor table tbody td {
	background-color: var(--ql-table-cell-bg);
}

.ql-editor table th {
	background-color: var(--ql-table-row-head-bg);
	color: inherit;
	font-weight: 700;
	text-align: left;
}

.ql-editor table thead th,
.ql-editor table thead td {
	background-color: var(--ql-table-head-bg);
	color: var(--ql-table-accent);
	font-weight: 700;
	text-align: center;
}

.ql-editor table tbody tr:last-child > th,
.ql-editor table tbody tr:last-child > td {
	border-bottom: 0;
}

/***************** 미디어 쿼리 *****************/
@media (max-width: 768px) {
	:root {
		--ql-table-cell-padding-y: .875rem;
		--ql-table-cell-padding-x: 1rem;
	}

	.ql-editor {
		padding: 1rem;
	}



	.ql-editor h3 {
		font-size: var(--ql-fz-md);
		line-height: 1.5;
		margin-top: 1.2rem !important;
		margin-bottom: 0.5rem !important;
		font-weight: 600;
		margin-left: 0 !important;
		margin-right: 0 !important;
	}

	.ql-editor h3::before {
		display: inline !important;
		position: static !important;
	}

	.ql-editor p {
		font-size: var(--ql-fz-sm);
		margin-left: 0 !important;
		margin-right: 0 !important;
	}

	.ql-editor li {
		margin-left: 1rem !important;
	}
}


/* lawjibsa board style (youtube) */

/* lawjibsa media timestamp a tag style */
.board-lawjibsa {
	counter-reset: h2-counter;
}


.board-lawjibsa h3:first-of-type {
	color: #1D4585 !important;
	font-size: 1.2rem !important;
	font-weight: 700 !important;
	margin-bottom: 15px !important;
	display: flex !important;
	align-items: center !important;
}

/* 요약 제목 앞에 아이콘 느낌 추가 */
.board-lawjibsa h3:first-of-type::before {
	content: "💡";
	margin-right: 8px !important;
}

/* 요약 박스 (첫 번째 UL) */
.board-lawjibsa h2 {
	background: transparent !important;
	padding: 0 !important;
	color: var(--ql-color-brand) !important;
	border: none !important;
}

.board-lawjibsa h3 {
	margin-top: 4rem !important;
}

.board-lawjibsa h3::before {
	content: "" !important;
}

.board-lawjibsa li {
	line-height: 2;
}

.ql-editor a[href^="#t="] {
	display: inline-block !important;
	background-color: #f1f3f5;
	color: #495057;
	text-decoration: none !important;
	padding: 2px 8px;
	border-radius: 4px !important;
	font-size: 0.9em;
	font-weight: 700;
	border: 1px solid #dee2e6;
	margin-right: 6px !important;
	transition: all 0.2s !important;
	white-space: nowrap !important;
}

.ql-editor a[href^="#t="]:hover {
	background-color: #228be6;
	color: white;
	border-color: #228be6;
}

.ql-editor li:has(a[href^="#t="]) {
	list-style: none !important;
	margin-bottom: 10px !important;
	padding-left: 0;
	/* display: inline-block !important;  */
	align-items: center !important;
}

/* 유튜브 추론 본문의 ordered list는 Quill이 생성하는 순번을 표시하지 않는다. */
.ql-editor.board-youtube ol > li[data-list="ordered"] > .ql-ui,
.read-article-detail--youtube .ql-editor ol > li[data-list="ordered"] > .ql-ui {
	display: none !important;
}

/* 구버전 Quill의 li::before 방식도 함께 초기화한다. */
.ql-editor.board-youtube ol > li[data-list="ordered"]::before,
.read-article-detail--youtube .ql-editor ol > li[data-list="ordered"]::before {
	display: none !important;
	content: none !important;
}

/*    Quill v2 data-list="bullet" 강제 스타일 초기화*/
.board-lawjibsa li[data-list="bullet"]:has(a[href^="#t="]) .ql-ui {
	display: none !important;
}

.board-lawjibsa li[data-list="bullet"]:has(a[href^="#t="]) {
	margin-left: 1.5rem !important;
}

/* 체크리스트 커스텀 */
.checklist-count {
	margin: 12px 0;
	padding: 8px 12px;
	background: #f4f8ff;
	/* border-left: 4px solid #1d4585; */
	font-weight: 600;
	color: #1d4585;
	font-size: var(--ql-fz-md);
}

/* 체크 아이콘 자체 */
.ql-editor li[data-list="checked"],
.ql-editor li[data-list="unchecked"] {
	position: relative !important;
	padding-left: 0;
	text-align: left !important;
	line-height: 2.2em;
}

.ql-editor li[data-list="checked"]>.ql-ui,
.ql-editor li[data-list="unchecked"]>.ql-ui {
	position: absolute !important;
	left: -1.6em !important;
	/* top: 0.2em !important; */
	width: 2.2em !important;
	height: 2.2em !important;
	cursor: pointer !important;
}

.ql-editor li[data-list="checked"]>.ql-ui:before,
.ql-editor li[data-list="unchecked"]>.ql-ui:before {
	margin-left: 0 !important;
}

/* 클릭 히트 영역 확장 */
/* .ql-editor li[data-list="checked"] > .ql-ui::after,
.ql-editor li[data-list="unchecked"] > .ql-ui::after{
  content: "";
  position: absolute;
  inset: -8px;
} */



/* ================================
   News Source Blot
================================*/
/* .ql-news-source .news-source__link::after {
	content: none !important;
} */
.ql-news-source .news-source__link {
	position: relative;
}

.ql-news-source .news-source__link::before,
.ql-news-source .news-source__link::after {
	content: "" !important;
	display: block !important;
	position: absolute;
	width: 64px;
	height: 64px;
	background-color: var(--ql-color-brand, #006133);
	-webkit-mask: url("../phosphor-icons/SVGs/fill/quotes-fill.svg") center / contain no-repeat;
	mask: url("../phosphor-icons/SVGs/fill/quotes-fill.svg") center / contain no-repeat;
	pointer-events: none;
}

.ql-news-source .news-source__link::before {
	top: 8px;
	left: 8px;
	transform: rotate(180deg);
}

.ql-news-source .news-source__link::after {
	right: 8px;
	bottom: 8px;
}
.ql-news-source {
	display: flex !important;
	margin: 1.5rem 0 !important;
}

.ql-news-source .news-source__link {
	display: flex !important;
	color: inherit !important;
	text-decoration: none !important;
	text-align: left !important;
	background: transparent !important;
	border: none !important;
	padding: 0 !important;
	margin: 0 !important;
	cursor: pointer !important;
	height: 250px !important;
	align-items: stretch !important;
	justify-content: center !important;
	width: 100% !important;
}

.ql-news-source .news-source__link:visited,
.ql-news-source .news-source__link:hover,
.ql-news-source .news-source__link:active,
.ql-news-source .news-source__link:focus {
	color: inherit !important;
	text-decoration: none !important;
}

.ql-news-source .news-source__link:hover {
	background-color: #f3f4f6 !important;
	border-color: #c7d2fe !important;
}

.ql-news-source .news-source-inner {
	padding: 1rem 2rem !important;
	display: flex !important;
	flex-direction: row !important;
	gap: 1rem !important;
	flex-wrap: nowrap !important;
	align-items: stretch !important;
	width: 100% !important;
}


.ql-news-source .news-source-meta {
	flex: 1 1 0 !important;
	display: flex !important;
	flex-direction: column !important;
	justify-content: center !important;
	height: auto !important;
	min-height: 1px !important;
	border-radius: 0 12px 12px 0 !important;
}

.ql-news-source .news-source-label {
	display: inline-block !important;
	margin-bottom: 0.25rem !important;

	font-size: var(--ql-fz-sm) !important;
	font-weight: 600 !important;
	line-height: 1.2 !important;
	letter-spacing: -0.01em !important;

	color: #2563eb !important;
}

.ql-news-source .news-source-title {
	margin-top: 0.25rem !important;
	font-size: var(--ql-fz-md) !important;
	font-weight: 600 !important;
	line-height: 1.25 !important;
	letter-spacing: -0.015em !important;
	color: #111827 !important;
}

.ql-news-source .news-source-info {
	margin-top: 0.25rem !important;
	font-size: var(--ql-fz-sm) !important;
	font-weight: 400 !important;
	line-height: 1.4 !important;
	letter-spacing: -0.01em !important;
	color: #6b7280 !important;
	display: inline-flex;
}

.ql-news-source .news-source-date {
	margin-left: 0.25rem !important;
}

.ql-news-source .news-source-image {
	flex: 0 0 320px !important;
	height: auto !important;
	min-height: 1px !important;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	overflow: hidden !important;
	border-radius: 6px !important;
}

@media (max-width: 1200px) {
	.ql-news-source .news-source__link {
		height: auto !important;
	}

	.ql-news-source .news-source-inner {
		flex-direction: column !important;
	}

	.ql-news-source .news-source-meta {
		flex: 1 1 auto !important;
		padding: .5rem !important;
	}

	.ql-news-source .news-source-image {
		flex: 1 1 auto !important;
	}

}

.ql-news-source .news-source-image img {
	display: block !important;
	width: 100% !important;
	height: auto !important;
	object-fit: cover !important;
	pointer-events: none !important;
	margin: 0 !important;
}

.ql-news-source .news-source__link * {
	pointer-events: none !important;
}

.ql-editor h1 {
	display: block !important;
	margin: 0 0 32px !important;
	padding: 0;
	border: 0;
	background: transparent;
	color: rgb(36, 39, 40);
	font-size: 36px;
	font-weight: 700;
	line-height: 46.8px;
	letter-spacing: -0.72px;
}

.ql-editor h2 {
	    scroll-margin-top: 120px !important;
	    margin-top: 86px !important;
	    font-weight: 600;
	    padding-top: 25px;
	    border-top: 1px solid var(--pale);
	    font-size: 34px;
	    line-height: 1.2;
	    word-break: normal !important;;
	counter-increment: h2-counter !important;
	font-family: 'Paperlogy', sans-serif;
}

.ql-editor h2:first-child {
	margin-top: 48px !important;
}

.ql-editor h3 {
	position: static !important;
	margin: 32px 0 12px !important;
	padding: 0;
	color: rgb(36, 39, 40);
	font-size: 22px;
	font-weight: 700;
	line-height: 30.8px;
	letter-spacing: -0.44px;
}

.ql-editor h1::before,
.ql-editor h3::before {
	display: none !important;
	content: none !important;
}

.ql-editor h2::before {
	/* display: inline-flex !important;
	margin-right: 16px;
	content: counter(h2-counter, decimal-leading-zero) !important;
	color: var(--charcoal, #343a37) !important;
	font-family: "Noto Sans KR", "Malgun Gothic", sans-serif;
	font-weight: 700 !important; */    
	display: flex;
    /* margin-right: 16px; */
    content: counter(h2-counter, decimal-leading-zero) !important;
    color: #fff;
    font-family: "Noto Sans KR", "Malgun Gothic", sans-serif;
    font-weight: 700 !important;
    background-color: var(--ql-color-brand, #006134);
    padding-left: 8px
}

.ql-editor p {
	/* margin: 0 0 20px !important;
	color: rgb(60, 65, 67);
	font-size: 17px;
	font-weight: 400;
	line-height: 27.2px;
	letter-spacing: -0.32px; */
	    margin-top: 26px;
    color: #36453d;
    font-size: 17px;
    line-height: 2;
    word-break: normal;
}

.ql-editor strong,
.ql-editor b {
	font-weight: 700;
}

.ql-editor a {
	display: inline !important;
	cursor: pointer !important;
	padding: 0;
	border: 0;
	border-radius: 0 !important;
	background: transparent;
	color: rgb(46, 139, 99);
	font-weight: inherit;
	text-decoration: underline !important;
	text-underline-offset: 4px;
	transition: color 0.2s ease !important;
}

.ql-editor a::after {
	display: none !important;
	content: none !important;
}

/* .ql-editor a:hover,
.ql-editor a:focus,
.ql-editor a:visited {
	color: var(--ql-link-state-color);
} */

.ql-editor ul,
.ql-editor ol {
	margin: 16px 0 24px !important;
	padding-left: 24px !important;
}

.ql-editor li {
	margin: 0 0 8px !important;
	padding: 0;
	color: rgb(60, 65, 67);
	line-height: 27.2px;
}

.ql-editor blockquote {
    margin: 32px 0 !important;
    padding: 20px 24px;
    border-left-width: 5px;
    background-color: rgb(241, 247, 244);
    border-top-width: 0;
    border-bottom-width: 0;
    font-style: italic;
    border-left: 5px solid var(--ql-color-brand) !important;
}

.ql-editor blockquote.customer-review__body {
	border: 0 !important;
	border-radius: 20px;
}

.ql-editor hr {
	margin: 40px 0 !important;
	border: 0 !important;
	border-top: 1px solid #121212 !important;
}

.ql-editor img {
	display: block;
	max-width: 100% !important;
	height: auto !important;
	margin: 24px 0 !important;
	border-radius: 8px;
	box-shadow: none;
}

/* 리사이즈 모듈은 이미지 또는 이를 감싼 span에 정렬 클래스를 저장한다. */
.ql-editor img.ql-resize-style-center,
.ql-editor .ql-resize-style-center > img {
	margin-left: auto !important;
	margin-right: auto !important;
}

.ql-editor .ql-resize-style-full {
	display: block;
}

.ql-editor img.ql-resize-style-full,
.ql-editor .ql-resize-style-full > img {
	width: 100% !important;
	max-width: 100% !important;
}

/* 전체 너비 이미지는 일반 문단의 읽기 폭 제한을 벗어나게 한다. */
.ql-editor > p:has(.ql-resize-style-full),
.ql-editor > .ql-resize-style-full {
	max-width: 100% !important;
	margin-left: 0 !important;
	margin-right: 0 !important;
}

/* 공개 본문·관리자 상세·WYSIWYG 편집기의 본문 타이포그래피를 동일하게 유지한다. */
.ql-editor {
	font-family: var(--ql-font-family);
	font-size: var(--ql-font-body);
	line-height: 1.9;
}

.ql-editor :is(p, li) {
	font-size: var(--ql-font-body);
	line-height: 1.9;
}

.ql-editor h2 {
	color: var(--ql-color-brand);
	font-size: var(--ql-font-subheading);
	line-height: 1.45;
}

.ql-editor h3 {
	color: var(--ql-color-ink);
	font-size: var(--ql-font-card);
	line-height: 1.5;
}

.ql-editor >h4,
.ql-editor >h5,
.ql-editor >h6 {
	margin-top: 30px;
}

@media (max-width: 576px) {
	.ql-news-source .news-source__link::before,
	.ql-news-source .news-source__link::after {
		width: 36px !important;
		height: 36px !important;
	}
}

/* 제목 번호는 저장된 사용자 속성이 있을 때만 기본값을 덮어쓴다. */
.ql-editor h2::before {
    color: var(--ql-heading-number-color, #fff);
    background-color: var(--ql-heading-number-background, var(--ql-color-brand, #006134));
}
.ql-editor h2[data-heading-number="none"] { counter-increment: none !important; }
.ql-editor h2[data-heading-number="none"]::before { display: none; content: none !important; }
.ql-editor h2[data-heading-number="decimal"]::before { content: counter(h2-counter, decimal) !important; }
.ql-editor h2[data-heading-number="roman"]::before { content: counter(h2-counter, upper-roman) !important; }

/* 기본 문단의 크기보다 사용자가 선택한 Quill 크기/폰트를 우선한다. */
.ql-editor .ql-size-small { font-size: .75em; }
.ql-editor .ql-size-large { font-size: 1.5em; }
.ql-editor .ql-size-huge { font-size: 2.5em; }
.ql-editor .ql-font-serif { font-family: Georgia, "Noto Serif KR", serif; }
.ql-editor .ql-font-monospace { font-family: monospace; }

/* 태그는 유지하고 선경 H2 디자인만 해제한다. 인라인 사용자 서식은 그대로 적용한다. */
.ql-editor h2[data-heading-style="plain"] {
    counter-increment: none !important;
    margin: 1.25em 0 .5em !important;
    padding: 0;
    border: 0;
    color: inherit;
    font-family: inherit;
    font-size: 1.5em;
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: normal;
}
.ql-editor h2[data-heading-style="plain"]::before {
    display: none;
    content: none !important;
}

.ql-toolbar.ql-snow .quill-style-toolbar {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex: 0 0 auto;
    white-space: nowrap;
}
.ql-toolbar.ql-snow .quill-style-toolbar__toggle {
    float: none;
    flex: 0 0 auto;
    width: auto;
    min-width: 84px;
    white-space: nowrap;
    padding: 3px 7px;
    font-size: 12px;
    font-weight: 600;
}
.ql-toolbar .quill-style-toolbar__toggle[aria-pressed="true"] {
    color: var(--ql-color-brand);
    background: var(--ql-table-head-bg);
}
.ql-toolbar .quill-style-toolbar__toggle:disabled { opacity: .4; cursor: default; }
.ql-toolbar.ql-snow .quill-style-toolbar__restore {
    float: none;
    flex: 0 0 auto;
    min-width: 72px;
    width: auto;
    height: 26px;
    padding: 3px 7px;
    white-space: nowrap;
    font-size: 12px;
    color: inherit;
    border: 1px solid var(--tblr-border-color, #d7dce1);
    border-radius: 3px;
    background: var(--tblr-bg-surface, #fff);
}
.quill-style-toolbar__section {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    min-width: 0;
    max-width: 100%;
}
.quill-style-toolbar__label { color: var(--tblr-secondary-color, #626976); font-size: 12px; font-weight: 600; margin-right: 4px; white-space: nowrap; }
.quill-style-toolbar__section--restore { padding-left: 10px; margin-left: 6px; border-left: 1px solid var(--tblr-border-color, #d7dce1); }
@media (max-width: 768px) {
    .quill-style-toolbar__section { width: 100%; }
    .quill-style-toolbar__section--restore { padding-left: 0; margin-left: 0; border-left: 0; }
}

/* 편집 보조 라벨은 가상 요소로만 표시하므로 저장 HTML과 공개 본문에 포함되지 않는다.
   H2 번호의 ::before, 목록 번호의 ::before와 겹치지 않도록 ::after를 쓴다. */
.ql-editor[contenteditable="true"].quill-editor--tag-guides > :is(h1, h2, h3, h4, h5, h6, p, blockquote),
.ql-editor[contenteditable="true"].quill-editor--tag-guides li {
    position: relative !important;
}
.ql-editor[contenteditable="true"].quill-editor--tag-guides > :is(h1, h2, h3, h4, h5, h6, p, blockquote)::after,
.ql-editor[contenteditable="true"].quill-editor--tag-guides li::after {
    position: absolute;
    left: -34px;
    top: 2px;
    display: block;
    width: 28px;
    padding: 1px 0;
    color: #7b8580;
    background: transparent;
    border: 0;
    font: 10px/1.4 monospace;
    letter-spacing: 0;
    text-align: right;
    pointer-events: none;
    user-select: none;
}
.ql-editor[contenteditable="true"].quill-editor--tag-guides > h1::after { content: 'H1'; }
.ql-editor[contenteditable="true"].quill-editor--tag-guides > h2::after { content: 'H2'; }
.ql-editor[contenteditable="true"].quill-editor--tag-guides > h3::after { content: 'H3'; }
.ql-editor[contenteditable="true"].quill-editor--tag-guides > h4::after { content: 'H4'; }
.ql-editor[contenteditable="true"].quill-editor--tag-guides > h5::after { content: 'H5'; }
.ql-editor[contenteditable="true"].quill-editor--tag-guides > h6::after { content: 'H6'; }
.ql-editor[contenteditable="true"].quill-editor--tag-guides > p::after { content: 'P'; }
.ql-editor[contenteditable="true"].quill-editor--tag-guides > blockquote::after { content: '인용'; }
.ql-editor[contenteditable="true"].quill-editor--tag-guides li::after { content: 'LI'; left: -52px; }
@media (max-width: 768px) {
    .ql-editor[contenteditable="true"].quill-editor--tag-guides { padding-left: 2.75rem !important; }
}

/* 디자인 토글은 사용자 인라인 서식을 유지하며 Quill 기본 표시로 전환한다.
   table-temporary가 보존하는 CSS 변수는 실제 table에도 복사되어 공개 화면에 적용된다. */
.ql-editor table[style*="--ql-table-design: plain"] {
    border: 0;
    margin-top: 0;
    table-layout: fixed !important;
}
.ql-editor table[style*="--ql-table-design: plain"] th,
.ql-editor table[style*="--ql-table-design: plain"] td {
    min-width: 0 !important;
    padding: 2px 5px;
    border: 1px solid #000;
    background: transparent;
    color: inherit;
    font-weight: inherit;
    text-align: start;
}
.ql-editor table[style*="--ql-table-design: plain"] th { font-weight: bold; text-align: center; }
.ql-editor table[style*="--ql-table-design: plain"] td:not([style*="vertical-align"]),
.ql-editor table[style*="--ql-table-design: plain"] th:not([style*="vertical-align"]) { vertical-align: inherit; }
.ql-editor table[style*="--ql-table-design: plain"] p {
    font-size: inherit;
    line-height: inherit;
}
.ql-editor blockquote[data-quote-style="plain"] {
    padding: 0 0 0 16px;
    border: 0;
    border-left: 4px solid #ccc !important;
    border-radius: 0;
    background: transparent;
    color: inherit;
    font-style: normal;
}
/* 좁은 화면에서는 버튼 글자 대신 버튼 그룹을 줄바꿈한다. */
.ql-toolbar.ql-snow .quill-style-toolbar { flex-wrap: wrap; min-width: 0; max-width: 100%; }

/* 선경 표/Bootstrap의 마지막 행·헤더 구분선보다 Quill 기본 테두리를 우선한다. */
.ql-editor table[style*="--ql-table-design: plain"] tbody tr:last-child > :is(th, td) { border-bottom: 1px solid #000; }
.ql-editor table.table[style*="--ql-table-design: plain"] > :not(:last-child) > :last-child > * { border-bottom-color: #000; }

/* 색상 팔레트의 설명 말풍선만 숨기고 정렬/표 도구의 설명은 유지한다. */
.ql-table-properties-form .color-list .ql-table-tooltip { display: none !important; }
.ql-table-properties-form .quill-table-properties__wheel { padding: 8px; }

/* 글자색·글자 배경색의 직접 선택. 기존 팔레트와 같은 팝업 안에서 사용한다. */
.ql-snow .ql-color-picker .ql-picker-options.quill-text-color__options { width: 196px; max-width: calc(100vw - 16px); }
.ql-toolbar.ql-snow .quill-text-color__open { float: none; width: 100%; height: 28px; padding: 4px; margin-top: 5px; border-top: 1px solid #ddd; font-size: 12px; white-space: nowrap; }
.quill-text-color__body { padding: 8px 0 2px; }
.quill-text-color__body[hidden] { display: none; }
.quill-text-color__label { display: flex; align-items: center; gap: 6px; margin-top: 8px; color: #36453d; font-size: 12px; }
.ql-snow .quill-text-color__hex { min-width: 0; width: 120px; padding: 4px 6px; border: 1px solid #d6dce5; border-radius: 3px; font: 13px/1.4 monospace; }
.ql-snow .quill-text-color__hex[aria-invalid="true"] { border-color: #d63939; }

.quill-text-color { display: flow-root; clear: both; white-space: normal; }
