/* =========================================================
   캔버스 영역
========================================================= */

.canvasWrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;

    width: 100%;
    margin: 0 auto;
}

canvas {
    display: block;
    max-width: 100%;
    margin: 0 auto;

    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
}

/* =========================================================
   선택 박스 / 리사이즈 핸들
========================================================= */

.bbox {
    position: absolute;
    display: none;

    width: 0;
    height: 0;
    border: 2px solid rgba(43, 108, 255, 0.95);
    border-radius: var(--radius-sm);

    background: transparent;
    pointer-events: auto;
    transform-origin: center center;
}

.bbox .h {
    position: absolute;
    width: 12px;
    height: 12px;

    border: 2px solid rgba(43, 108, 255, 0.95);
    border-radius: 3px;
    background: #ffffff;

    pointer-events: auto;
}

.bbox .h.nw {
    top: -8px;
    left: -8px;
    cursor: nwse-resize;
}

.bbox .h.ne {
    top: -8px;
    right: -8px;
    cursor: nesw-resize;
}

.bbox .h.n {
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    cursor: ns-resize;
}

.bbox .h.sw {
    bottom: -8px;
    left: -8px;
    cursor: nesw-resize;
}

.bbox .h.se {
    right: -8px;
    bottom: -8px;
    cursor: nwse-resize;
}

.bbox .h.e {
    top: 50%;
    right: -8px;
    transform: translateY(-50%);
    cursor: ew-resize;
}

.bbox .h.s {
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    cursor: ns-resize;
}

.bbox .h.w {
    top: 50%;
    left: -8px;
    transform: translateY(-50%);
    cursor: ew-resize;
}

/* =========================================================
   회전 핸들
========================================================= */

.bbox .rotLine {
    position: absolute;
    top: -14px;
    left: 50%;

    width: 2px;
    height: 14px;

    transform: translateX(-50%);
    background: rgba(43, 108, 255, 0.55);
    pointer-events: none;
}

.bbox .rot {
    position: absolute;
    top: -34px;
    left: 50%;

    width: 22px;
    height: 22px;
    border: 1px solid rgba(43, 108, 255, 0.95);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(16, 24, 40, 0.12);

    transform: translateX(-50%);
    background-color: #ffffff;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 14px 14px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M4.5 12a7.5 7.5 0 0 1 12.9-5.1' stroke='%232b6cff' stroke-width='2' stroke-linecap='round'/%3E%3Cpath d='M18 4v4h-4' stroke='%232b6cff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M19.5 12a7.5 7.5 0 0 1-12.9 5.1' stroke='%232b6cff' stroke-width='2' stroke-linecap='round'/%3E%3Cpath d='M6 20v-4h4' stroke='%232b6cff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");

    cursor: grab;
}

.bbox .rot:active {
    cursor: grabbing;
}

/* =========================================================
   터치 / 텍스트 선택 방지
========================================================= */

#canvasWrap,
#designCanvas,
#bbox,
#bbox .h,
#rotHandle {
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

/* =========================================================
   파일 업로드 영역
========================================================= */

.uploadRow {
    display: flex;
    align-items: center;
    gap: 14px;

    margin-top: 6px;
}

.fileBtn {
    width: auto;
    min-width: 120px;
    height: 44px;
    padding: 0 16px;
    border-radius: var(--radius-md);
    font-weight: 700;
    white-space: nowrap;
}

.fileName {
    overflow: hidden;
    max-width: 240px;

    color: #667085;
    font-size: var(--fs-13);
    white-space: nowrap;
    text-overflow: ellipsis;
}

.uploadGuide {
    flex: 1;
    color: var(--muted);
    font-size: var(--fs-12);
    line-height: 1.55;
}

.uploadGuide div {
    display: block;
}

/* =========================================================
   캔버스 제어 영역 내부 레이아웃
========================================================= */

.canvasControlRow {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: start;
    gap: 16px;
}

/* =========================================================
   캔버스 내부 안내문구
========================================================= */
.canvasNotice{
  /* min-height: 22px; */
  /* margin: 10px 0 14px; */
  font-size: 13px;
  padding-left: 10px;
  padding-bottom: 10px;
  /* line-height: 1.5; */
  color: #5f6b7a;
}

.canvasNotice.isOk{
  color: #039855;
}

.canvasNotice.isError{
  color: #d92d20;
}