
#blackboard.canvas-cursor {
    pointer-events: auto;
}
#penBoardWrapper{
    z-index: 97;
    display: block;
    position: absolute; /* fixed -> absolute: 스크롤 있는 문서 전체 높이를 덮기 위함 */
    top: 55px;
    left: 0;
    width: 100%;
    height: 100%;
}
#toolbar-box {
	position: fixed;
	right: 15px;
	top: 75px;
	background: rgba(255, 255, 255, 0.95);
	padding: 8px 8px;
	border-radius: 12px;
	box-shadow: 0 0 15px rgba(0,0,0,0.35);
	display: flex;
	align-items: center;
	flex-direction: column;
	z-index: 999;
	width:100px;
	background: #d9f2d0;
}
#toolbar {
	display: flex;
	align-items: center;
	flex-direction: column;
	gap: 10px;
}

#blackboard.canvas-cursor {
    pointer-events: auto;
}

	#toolbar .toolbar-title {
	    display: flex;
		align-items: center;
		cursor:move;
	}
		#toolbar .toolbar-title .title-txt {
			font-size: 14px;
			text-align: center;
			width: 80%;
			font-weight: 600;
			    color: #335e24;
		}
		#toolbar .toolbar-title .material-symbols-outlined {
			width: 20%;
			font-size: 20px;
			color: #4ca32d;
		}

	#toolbar .toolbar-onoff {
	    display: flex;
		align-items: center;
		border-radius: 5px 5px;
		color:#ffffff;
		width:100%;
		justify-content: center;
		cursor:pointer;
		font-size: 12px;
		gap:5px;
		    padding: 5px;
	}

		#toolbar .toolbar-onoff.turnon {
		font-size: 14px;
		background: #3b7d23;
		}
			#toolbar .toolbar-onoff span span {
			background: #ffffff;
			padding:1px 3px;
			font-size: 12px;
			border-radius:3px 3px;
			color:#c11111;
			}
		#toolbar .toolbar-onoff.turnoff {
		font-size: 12px;
		background: #000000;}

			#toolbar .toolbar-onoff .btn-on > span,
			#toolbar .toolbar-onoff .btn-off > span {
				font-size: 12px;
			}
			#toolbar .toolbar-onoff.turnon .btn-on {
				display: flex;
				font-size: 12px;
				align-items: center;
				gap: 5px;
				justify-content: center;
				width: 100%;
			}
			#toolbar .toolbar-onoff.turnon .btn-off {display: none;
				font-size: 12px;
				align-items: center;
				gap: 5px;
				}

			#toolbar .toolbar-onoff.turnoff .btn-on {font-size: 12px;display: none}
			#toolbar .toolbar-onoff.turnoff .btn-off {
				display: flex;
				font-size: 12px;
				align-items: center;
				gap: 5px;
				justify-content: center;
				width: 100%;
				    letter-spacing: -1px;
				}
	#toolbar .toolbar-box {
		display: flex;
		flex-direction: column;
		gap: 5px;
		font-size: 14px;
		width: 100%;
		padding: 0px;
		border-radius:5px 5px;
	}
	#toolbar .toolbar-box .pentool-range,
	#toolbar .toolbar-box .pentool-range input {width: 100%;}
#toolbar .toolbar-box .color-palette {
    display: flex;
    align-items: center;
    gap: 5px;
    width: 100%;
}
#toolbar .toolbar-box .color-palette .color {
    position: relative;
    width: 13px;
    height: 20px;
    min-width: 13px;
    min-height: 20px;
    flex: 0 0 13px;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
	cursor: pointer;
}
	#toolbar .toolbar-box .color-palette {
		display: flex;
		align-items: center;
		gap: 3px;
		width: 100%;
		justify-content: space-between;
	}

		/* 실제 radio는 숨김 */
		#toolbar .toolbar-box .color-palette .color input[type="radio"] {
			position: absolute;
			opacity: 0;
			width: 0;
			height: 0;
		}
		/* 체크 아이콘 기본적으로 숨김 */
		#toolbar .toolbar-box .color-palette .color .material-symbols-outlined {
			position: absolute;
			left: 50%;
			top: 50%;
			transform: translate(-50%, -50%);
			display: none;
			width: 16px;
			height: 16px;
			font-size: 14px;
			line-height: 16px;
			text-align: center;
			color: #fff;
			pointer-events: none;
		}
		#toolbar .toolbar-box .color-palette .color.white .material-symbols-outlined {
			color: #000;
		}

		/* 체크된 경우만 표시 */
		#toolbar .toolbar-box .color-palette .color input:checked + .material-symbols-outlined {
			display: block;
		}
	#toolbar .tool-box {
	    display: grid;
		gap:5px
	}
#toolbar .tool-box > button {
    display: flex;
    width: 100%;
    border: 0;
    align-items: center;
    padding: 5px 5px;
    border-radius: 5px;
    color: #ffffff;
    gap: 5px;
    transition: all 0.15s ease-in-out;
	cursor: pointer;
}
/* 버튼 */
#toolbar .toolbar-box.deact .tool-box > button {
    color: #ffffff !important;
    background-color: #bfbfbf !important;
    cursor: default;
}


/* color palette */
#toolbar .toolbar-box.deact .color-palette .color {
    color: #ffffff !important;
    background-color: #bfbfbf !important;
    cursor: not-allowed;
}


/* color palette 체크 아이콘 */
#toolbar .toolbar-box.deact .color-palette .color .material-symbols-outlined {
    color: #ffffff !important;
}


/* tool-box 안 아이콘 / 텍스트 */
#toolbar .toolbar-box.deact .tool-box,
#toolbar .toolbar-box.deact .tool-box button,
#toolbar .toolbar-box.deact .tool-box button .material-symbols-outlined,
#toolbar .toolbar-box.deact .tool-box button .txt-sub {
    color: #ffffff !important;
}


/* 전체적으로 클릭 불가 느낌 */
#toolbar .toolbar-box.deact .tool-box > button {
    opacity: 1;
}
#toolbar .toolbar-box .pentool-range {
    width: 100%;
}

#toolbar .toolbar-box .pentool-range input[type="range"] {
    --range-progress: 10%;

    width: 100%;
    height: 4px;

    margin: 0;
    padding: 0;

    appearance: none;
    -webkit-appearance: none;

    border: 0;
    outline: none;

    background: linear-gradient(
        to right,
        #007475 0%,
        #007475 var(--range-progress),
        #bfbfbf var(--range-progress),
        #bfbfbf 100%
    );

    border-radius: 10px;
    cursor: pointer;
}


/* Chrome / Edge / Safari */
#toolbar .toolbar-box .pentool-range input[type="range"]::-webkit-slider-runnable-track {
    height: 4px;
    background: transparent;
    border: 0;
    border-radius: 10px;
}


/* Chrome / Edge / Safari Thumb */
#toolbar .toolbar-box .pentool-range input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    -webkit-appearance: none;

    width: 14px;
    height: 14px;

    margin-top: -5px;

    border: 0;
    border-radius: 50%;

    background: #007475;

    cursor: pointer;
}


/* Firefox */
#toolbar .toolbar-box .pentool-range input[type="range"]::-moz-range-track {
    height: 4px;
    background: #bfbfbf;
    border: 0;
    border-radius: 10px;
}


/* Firefox 진행 부분 */
#toolbar .toolbar-box .pentool-range input[type="range"]::-moz-range-progress {
    height: 4px;
    background: #007475;
    border-radius: 10px;
}


/* Firefox Thumb */
#toolbar .toolbar-box .pentool-range input[type="range"]::-moz-range-thumb {
    width: 14px;
    height: 14px;

    border: 0;
    border-radius: 50%;

    background: #007475;

    cursor: pointer;
}


#toolbar .toolbar-box.deact .pentool-range input[type="range"] {
    background: #bfbfbf !important;
    cursor: not-allowed;
}

#toolbar .toolbar-box.deact .pentool-range input[type="range"]::-webkit-slider-runnable-track {
    background: transparent !important;
}

#toolbar .toolbar-box.deact .pentool-range input[type="range"]::-webkit-slider-thumb {
    background: #bfbfbf !important;
    cursor: not-allowed;
}

#toolbar .toolbar-box.deact .pentool-range input[type="range"]::-moz-range-track {
    background: #bfbfbf !important;
}

#toolbar .toolbar-box.deact .pentool-range input[type="range"]::-moz-range-progress {
    background: #bfbfbf !important;
}

#toolbar .toolbar-box.deact .pentool-range input[type="range"]::-moz-range-thumb {
    background: #bfbfbf !important;
    cursor: not-allowed;
}


		/* 색상 */
		#toolbar .toolbar-box .color-palette .red {
			background: #f76e59;
		}
		#toolbar .toolbar-box .color-palette .blue {
			background: #498fe0;
		}
		#toolbar .toolbar-box .color-palette .green {
			background: #4ec476;
		}
		#toolbar .toolbar-box .color-palette .yellow {
			background: #ffd700;
		}
		#toolbar .toolbar-box .color-palette .black {
			background: #535353;
		}
		#toolbar .toolbar-box .color-palette .white {
			background: #ffffff;
		}

#toolbar .color-palette .color input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

#toolbar .color-palette .color .material-symbols-outlined {
    display: none;
    color: #fff;
    font-size: 20px;
}

#toolbar .color-palette .color input:checked + .material-symbols-outlined {
    display: block;
}



		/*툴 버튼 셋*/
		#toolbar .tool-box #lightpenBtn,
		#toolbar .tool-box #penBtn,
		#toolbar .tool-box #eraserBtn{
			justify-content: center;
			flex-direction: column;
			background:#bfbfbf;
		}
			#toolbar .tool-box #lightpenBtn.lightpenOn,
			#toolbar .tool-box #penBtn.penOn,
			#toolbar .tool-box #eraserBtn.eraserOn {
				background:#156082;
			}
		#toolbar .tool-box #stickBtn {
			justify-content: center;
			flex-direction: column;
			background: #fff2ab;
			color: #996633;
		}
		#toolbar .tool-box #boardBtn_on {
			justify-content: center;
			flex-direction: column;
			background:#3e7f26;
		}
		#toolbar .tool-box #boardBtn_off {
			display:none;
			justify-content: center;
			flex-direction: column;
			background:#000000;
		}
		#toolbar .tool-box #undoBtn {
			justify-content: flex-start;
			background:#7f7f7f;
		}
		#toolbar .tool-box #visibility_on {
			justify-content: flex-start;
			background:#156082;
		}
		#toolbar .tool-box #visibility_off {
			display:none;
			justify-content: flex-start;
			background:#7f7f7f;
		}
		#toolbar .tool-box #resetBtn {
			justify-content: center;
			flex-direction: column;
			background:#7f7f7f;
		}
			#toolbar .tool-box #visibility_off span,
			#toolbar .tool-box #undoBtn span,
			#toolbar .tool-box #visibility_on span,
			#toolbar .tool-box #visibility_off span {width: 20%;}

			#toolbar .tool-box #visibility_on .txt-sub,
			#toolbar .tool-box #visibility_off .txt-sub,
			#toolbar .tool-box #undoBtn .txt-sub,
			#toolbar .tool-box #resetBtn .txt-sub{width: 80%; text-align:center}
    #toolbar > button {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      padding: 8px 12px;
      border: 1px solid #ccc;
      border-radius: 6px;
      background: #fff;
      cursor: pointer;
      font-size: 14px;
      transition: background 0.2s;
	  cursor:pointer;
    }

    #toolbar > button:hover {
      background: #f0f0f0;
    }

    .material-symbols-outlined {
      font-size: 20px;
    }

    /* 색상 버튼 및 체크 아이콘 스타일 */
	.color-palette > button {
	    display: inline-flex;
    align-items: center;
    gap: 4px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
    min-width: 15px;
	}

    .color .material-symbols-outlined {
      font-size: 18px;
      color: #ffffff;
      display: none;
      user-select: none;
    }

    .color[data-color="yellow"] .material-symbols-outlined {
      text-shadow: 0 0 2px rgba(0, 0, 0, 0.5);
    }

    .color.active .material-symbols-outlined {
      display: inline-block;
    }

/* 드래그 중 텍스트 선택 방지 */
body.drag-no-select {
	user-select: none;
	-webkit-user-select: none;
}

/* 드래그 핸들 커서 */
#toolbar .toolbar-title .toolbar-drag,
.memo-content h3 {
	cursor: grab;
}
body.drag-no-select #toolbar .toolbar-title .toolbar-drag,
body.drag-no-select .memo-content h3 {
	cursor: grabbing;
}

#canvas {
	position: absolute; /* fixed -> absolute: 부모(#penBoardWrapper) 기준으로 문서 전체 높이를 덮음 */
	top: 0;
	left: 0;
	width: 100%;
	height: 100%; /* 실제 픽셀 크기는 JS에서 문서 전체 높이로 재계산됨 */
	z-index: 55;
	pointer-events: auto; /* 터치 및 마우스 이벤트 활성화 */
}
.canvas-cursor{pointer-events: auto;}
.canvas-cursor.red {cursor:url('/images/icon/cursor-red.svg') 6 34, auto;}
.canvas-cursor.blue {cursor:url('/images/icon/cursor-blue.svg') 6 34, auto;}
.canvas-cursor.green {cursor:url('/images/icon/cursor-green.svg') 6 34, auto;}
.canvas-cursor.yellow {cursor:url('/images/icon/cursor-yellow.svg') 6 34, auto;}
.canvas-cursor.black {cursor:url('/images/icon/cursor-black.svg') 6 34, auto;}
.canvas-cursor.white {cursor:url('/images/icon/cursor-white.svg') 6 34, auto;}

.canvas-cursor.lightred {cursor:url('/images/icon/cursor-red.svg') 6 34, auto;}
.canvas-cursor.lightblue {cursor:url('/images/icon/cursor-blue.svg') 6 34, auto;}
.canvas-cursor.lightgreen {cursor:url('/images/icon/cursor-green.svg') 6 34, auto;}
.canvas-cursor.lightyellow {cursor:url('/images/icon/cursor-yellow.svg') 6 34, auto;}
.canvas-cursor.lightblack {cursor:url('/images/icon/cursor-black.svg') 6 34, auto;}
.canvas-cursor.lightwhite {cursor:url('/images/icon/cursor-white.svg') 6 34, auto;}

.canvas-cursor.eraser {cursor:url('/images/icon/cursor-eraser.svg') 23 18, auto;}



#blackboard{
	display: none;
	position: fixed;
    top: 55px;
    left: 0;
    width: 100vw;
    height: 100dvh;
    z-index: 55;
    background: #3b7d23;
    pointer-events: auto;
    border: solid 10px #996633;
}
    .content-bg {
      padding: 20px;
      position: relative;
      z-index: 0;
    }

    /* 메모 입력용 모달 레이어 스타일 */
	#textmemo {
		display: none;
		position: fixed;
		top: 75px;
		right: 125px;
		z-index: 999;

		/* 크기 조절 설정 */
		min-width: 250px;
		min-height: 200px;
		width: 410px;  /* 초기 고정 너비 지정 */
		height: 450px; /* 초기 고정 높이 지정 */

		resize: both;
		overflow: hidden;
		direction: rtl; /* 좌하단 리사이즈 핸들 */
		box-sizing: border-box;
	}

	#textmemo .memo-content {
		direction: ltr;
		display: flex;
		flex-direction: column;
		width: 100%;
		height: 100%;
		min-height: auto; /* 기존 min-height 320px 충돌 제거 */
		box-sizing: border-box;
	}

	#textmemo #textInput {
		flex: 1;
		width: 100%;
		height: 100% !important;
		resize: none !important;
		box-sizing: border-box;
	}

    .memo-content {
		background: #fff2ab;
		padding: 15px;
		border-radius: 8px;
		box-shadow: 0 4px 12px rgba(0,0,0,0.2);
		display: flex;
		flex-direction: column;
		gap: 12px;
		width: 100%;
		height: 100%;
		min-height: 320px;
		direction: ltr;
		box-sizing: border-box;
    }

    .memo-content .memo-title {
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap:5px;
    }
		.memo-content .memo-title .cursor {
			cursor:pointer;
		}

    .memo-content h3 {
		margin: 0;
		font-size: 16px;
		display: flex;
		align-items: center;
		color: #9c6b37;
		    justify-content: space-between;
			width:100%
    }
    .memo-content h3 span {
	    color: #bc9e02;
    }
    .memo-content h3 .mg-left-auto {
		margin-left: auto;
    }

    .memo-content textarea {
		display: block;
		border: none;
		field-sizing: content;
		font-size: 18px;
		padding: 10px;
		outline: 0;
    }
		.memo-content textarea::placeholder {
			color: #a6a6a6;
			font-size: 15px;
		}
    .memo-buttons {
      display: flex;
      justify-content: flex-end;
      gap: 8px;
    }

    .memo-buttons button {
      padding: 6px 12px;
      border-radius: 4px;
      border: none;
      cursor: pointer;
    }

    #textSubmitBtn {
      background: #007bff;
      color: #fff;
    }

    #textCancelBtn {
      background: #e0e0e0;
    }

