/* =========================================================
 * style-annotation.css — v2.0
 * 형광펜 모드 (Annotation Layer) 전용 스타일
 * 도구별 서브패널 / 컬러피커 / 선택핸들 포함
 * ========================================================= */

/* ── 툴바 래퍼 ────────────────────────────────────────── */
#annotationToolbar {
    position: fixed;
    top: 60px;
    left: 12px;
    z-index: 9100;
    display: none;
    flex-direction: row;
    align-items: center;
    gap: 0;
}

/* ── 토글 버튼 ─────────────────────────────────────────── */
.ann-toggle-btn {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
    color: #64748b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(0,0,0,0.10);
    transition: background 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.ann-toggle-btn svg { display: block; }

/* 토글 버튼 이미지 아이콘 */
.ann-toggle-img {
    width: 26px;
    height: 26px;
    object-fit: contain;
    display: block;
    pointer-events: none;
    filter: grayscale(0.4) opacity(0.75);
    transition: filter 0.2s;
}
.ann-toggle-btn:hover .ann-toggle-img {
    filter: grayscale(0) opacity(1) brightness(1.05);
}
#annotationToolbar.mode-active .ann-toggle-btn .ann-toggle-img {
    filter: grayscale(0) opacity(1) brightness(1.3);
}
.ann-toggle-btn:hover {
    background: #f5f3ff;
    color: #7c3aed;
    border-color: #c4b5fd;
    box-shadow: 0 4px 16px rgba(124,58,237,0.18);
}
#annotationToolbar.mode-active .ann-toggle-btn {
    background: #7c3aed;
    color: #fff;
    border-color: #7c3aed;
    box-shadow: 0 4px 20px rgba(124,58,237,0.40);
}

/* ── 가로 확장 패널 ────────────────────────────────────── */
.ann-panel {
    display: flex;
    flex-direction: row;
    align-items: center;
    flex-wrap: nowrap;        /* 절대 줄바꿈 금지 */
    gap: 4px;
    background: #fff;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 6px 24px rgba(0,0,0,0.12);
    margin-left: 8px;
    max-width: 0;
    padding: 0;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    white-space: nowrap;
    transition:
        max-width 0.35s cubic-bezier(0.4,0,0.2,1),
        opacity   0.25s ease,
        padding   0.30s ease;
}
#annotationToolbar.mode-active .ann-panel {
    max-width: 1400px;
    padding: 5px 10px;
    opacity: 1;
    pointer-events: auto;
    overflow: visible;
}

/* ── 수평 그룹 / 구분선 ────────────────────────────────── */
.ann-h-group {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 3px;
    flex-shrink: 0;
}
.ann-h-sep {
    width: 1px;
    height: 22px;
    background: #e2e8f0;
    margin: 0 5px;
    flex-shrink: 0;
}

/* ── 도구 버튼 ─────────────────────────────────────────── */
.ann-tool,
.ann-action {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #64748b;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}
.ann-tool:hover  { background: #f1f5f9; color: #334155; }
.ann-tool.active { background: #ede9fe; color: #7c3aed; box-shadow: 0 0 0 2px #7c3aed40; }
.ann-action:hover { background: #fee2e2; color: #dc2626; }

/* 툴 버튼 내부 이미지 아이콘 */
.ann-tool-img {
    width: 22px;
    height: 22px;
    object-fit: contain;
    display: block;
    pointer-events: none;
    transition: filter 0.15s;
}
.ann-tool:hover  .ann-tool-img { filter: brightness(0.8); }
.ann-tool.active .ann-tool-img { filter: brightness(1) drop-shadow(0 0 2px #7c3aed80); }

/* ── 서브패널 (도구별 컨텍스트 옵션) ──────────────────── */
.ann-sub-panel {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

/* ── 굵기(크기) 버튼 ──────────────────────────────────── */
.ann-size,
.ann-arrow-size {
    width: 34px;
    height: 28px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #f8fafc;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    flex-shrink: 0;
    transition: background 0.15s, border-color 0.15s;
}
.ann-sz-bar {
    display: block;
    background: #64748b;
    border-radius: 2px;
}
.ann-size:hover,
.ann-arrow-size:hover { background: #f1f5f9; border-color: #94a3b8; }
.ann-size.active,
.ann-arrow-size.active { background: #ede9fe; border-color: #7c3aed; }
.ann-size.active .ann-sz-bar,
.ann-arrow-size.active .ann-sz-bar { background: #7c3aed; }

/* ── 색상 버튼 ─────────────────────────────────────────── */
.ann-color {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2.5px solid transparent;
    cursor: pointer;
    flex-shrink: 0;
    padding: 0;
    transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.ann-color:hover { transform: scale(1.22); box-shadow: 0 2px 8px rgba(0,0,0,0.22); }
.ann-color.active {
    border-color: #1e293b;
    box-shadow: 0 0 0 2px #1e293baa;
    transform: scale(1.12);
}

/* ── 컴팩트 그룹 (라벨 + 드롭다운) ──────────────────────── */
.ann-compact-group {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}
.ann-label {
    font-size: 11px;
    color: #64748b;
    font-weight: 500;
    user-select: none;
}

/* ── 드롭다운 공통 ────────────────────────────────────────  */
.ann-dropdown-wrap {
    position: relative;
}
.ann-dropdown-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    height: 28px;
    padding: 0 7px;
    border: 1.5px solid #e2e8f0;
    border-radius: 7px;
    background: #f8fafc;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    font-size: 12px;
    color: #374151;
}
.ann-dropdown-btn:hover { border-color: #7c3aed; background: #faf5ff; }
.ann-dropdown-btn.open  { border-color: #7c3aed; background: #faf5ff; }
.ann-dropdown-val { font-size: 12px; font-weight: 600; min-width: 16px; text-align: center; }
.ann-chevron { flex-shrink: 0; color: #94a3b8; transition: transform 0.2s; }
.ann-dropdown-btn.open .ann-chevron { transform: rotate(180deg); }

/* ── 선 두께 드롭다운 메뉴 ───────────────────────────────── */
.ann-dropdown-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 100px;
    background: #fff;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.13);
    padding: 5px 0;
    display: none;
    flex-direction: column;
    gap: 0;
    z-index: 9500;
}
.ann-dropdown-menu.open { display: flex; }

/* ── 드롭다운 아이템 공통 (형광펜/화살표 통일) ───────────── */
.ann-size-opt, .ann-arr-size-opt, .ann-dash-opt, .ann-head-opt, .ann-arrow-type-opt,
.ann-pen-size-opt, .ann-pen-opacity-opt {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    cursor: pointer;
    border: none;
    background: transparent;
    transition: background 0.12s;
    text-align: left;
    font-size: 12px;
    color: #374151;
    white-space: nowrap;
}
.ann-size-opt:hover, .ann-arr-size-opt:hover,
.ann-dash-opt:hover, .ann-head-opt:hover, .ann-arrow-type-opt:hover,
.ann-pen-size-opt:hover, .ann-pen-opacity-opt:hover { background: #f1f5f9; }
.ann-size-opt.active, .ann-arr-size-opt.active,
.ann-dash-opt.active, .ann-head-opt.active, .ann-arrow-type-opt.active,
.ann-pen-size-opt.active, .ann-pen-opacity-opt.active { background: #ede9fe; color: #7c3aed; }
.ann-size-opt span:last-child, .ann-arr-size-opt span:last-child,
.ann-dash-opt span:last-child, .ann-head-opt span:last-child,
.ann-arrow-type-opt span:last-child,
.ann-pen-size-opt span:last-child { font-weight: 600; }

/* ── 스탬프 메뉴 (2열 그리드) ────────────────────────────── */
.ann-stamp-menu {
    display: none;
    grid-template-columns: repeat(2, 1fr) !important;
    min-width: 130px;
    padding: 5px;
    gap: 2px;
}
.ann-stamp-menu.open { display: grid !important; }
.ann-stamp-opt {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 8px;
    cursor: pointer;
    border: none;
    background: transparent;
    border-radius: 6px;
    transition: background 0.12s;
    font-size: 12px;
    color: #374151;
}
.ann-stamp-opt:hover  { background: #f1f5f9; }
.ann-stamp-opt.active { background: #ede9fe; color: #7c3aed; }
.ann-stamp-opt span   { font-size: 11px; user-select: none; }
.ann-stamp-opt svg    { pointer-events: none; }
.ann-stamp-menu       { user-select: none; }

/* ── 색상 드롭다운 버튼 ──────────────────────────────────── */
.ann-color-btn { padding: 0 6px; }
.ann-color-swatch {
    display: inline-block;
    width: 18px;
    height: 18px;
    border-radius: 4px;
    border: 1.5px solid rgba(0,0,0,0.12);
    flex-shrink: 0;
}

/* ── 색상 팝업 ───────────────────────────────────────────── */
.ann-color-popup {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    background: #fff;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    padding: 10px;
    display: none;
    flex-direction: column;
    gap: 8px;
    z-index: 9500;
}
.ann-color-popup.open { display: flex; }

/* ── 색상 팝업 내부 그리드 ───────────────────────────────── */
.ann-cpicker-grid {
    display: grid;
    grid-template-columns: repeat(6, 24px);
    gap: 5px;
}
.ann-cpicker-grid .ann-color {
    width: 24px;
    height: 24px;
}

/* ── hex 입력 줄 ─────────────────────────────────────────── */
.ann-cpicker-hex {
    display: flex;
    align-items: center;
    gap: 5px;
    padding-top: 4px;
    border-top: 1px solid #f1f5f9;
}
.ann-hex-input {
    flex: 1;
    height: 26px;
    border: 1.5px solid #e2e8f0;
    border-radius: 6px;
    font-size: 12px;
    font-family: 'Courier New', monospace;
    padding: 0 6px;
    color: #1e293b;
    background: #f8fafc;
    outline: none;
    transition: border-color 0.15s;
    min-width: 0;
}
.ann-hex-input:focus { border-color: #7c3aed; background: #fff; }
.ann-hex-confirm {
    width: 26px;
    height: 26px;
    border: 1.5px solid #7c3aed;
    border-radius: 6px;
    background: #7c3aed;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s;
    padding: 0;
}
.ann-hex-confirm:hover { background: #6d28d9; }
.ann-hex-picker-btn {
    width: 26px;
    height: 26px;
    border: 1.5px solid #e2e8f0;
    border-radius: 6px;
    background: #f8fafc;
    color: #64748b;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: border-color 0.15s, color 0.15s;
}
.ann-hex-picker-btn:hover { border-color: #7c3aed; color: #7c3aed; }

/* ── 자유 컬러피커 래퍼 ────────────────────────────────── */
.ann-custom-color-wrap {
    position: relative;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2.5px solid #94a3b8;
    cursor: pointer;
    overflow: hidden;
    flex-shrink: 0;
    transition: border-color 0.15s, box-shadow 0.15s;
    box-shadow: 0 0 0 1px #e2e8f0;
}
.ann-custom-color-wrap:hover {
    border-color: #7c3aed;
    box-shadow: 0 0 0 3px #7c3aed30;
}
.ann-color-preview {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    pointer-events: none;
}
.ann-color-native {
    display: none;   /* JS에서 .click()으로만 트리거, 화면에 표시 안 함 */
}

/* ── 선 스타일 버튼 (화살표용) ──────────────────────────── */
.ann-line-style {
    width: 38px;
    height: 28px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #f8fafc;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    color: #64748b;
    flex-shrink: 0;
    transition: background 0.15s, border-color 0.15s;
}
.ann-line-style:hover  { background: #f1f5f9; border-color: #94a3b8; }
.ann-line-style.active { background: #ede9fe; border-color: #7c3aed; color: #7c3aed; }

/* ── 화살표 머리 버튼 ──────────────────────────────────── */
.ann-arrow-head {
    width: 38px;
    height: 28px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #f8fafc;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    color: #64748b;
    flex-shrink: 0;
    transition: background 0.15s, border-color 0.15s;
}
.ann-arrow-head:hover  { background: #f1f5f9; border-color: #94a3b8; }
.ann-arrow-head.active { background: #ede9fe; border-color: #7c3aed; color: #7c3aed; }

/* ── 힌트 텍스트 ───────────────────────────────────────── */
.ann-hint-text {
    font-size: 11px;
    color: #94a3b8;
    white-space: nowrap;
    padding: 0 6px;
}

/* ── 형광펜 모드 공통 ──────────────────────────────────── */
body.annotation-mode #notepad .note-display { pointer-events: none; }
/* #notepad 자신은 JS가 cursor 제어 — 자식만 inherit 강제 */
body.annotation-mode #notepad * { cursor: inherit !important; }

/* ── 지우개: hover 강조 ────────────────────────────────── */
body.annotation-mode #annotationCanvas [data-ann-id]:hover {
    opacity: 0.6;
    cursor: pointer;
}

/* ── 선택 핸들 오버레이 ────────────────────────────────── */
#annSelectionOverlay {
    pointer-events: none;     /* 오버레이 자체는 비활성 */
}
#annSelectionOverlay rect.ann-sel-border {
    fill: none;
    stroke: #3b82f6;
    stroke-width: 1.5;
    stroke-dasharray: 5,3;
    pointer-events: none;
}
#annSelectionOverlay circle.ann-sel-handle {
    fill: #fff;
    stroke: #3b82f6;
    stroke-width: 2;
    r: 6;
    pointer-events: all;      /* 핸들만 클릭 가능 */
    transition: fill 0.12s;
}
#annSelectionOverlay circle.ann-sel-handle:hover,
#annSelectionOverlay circle.ann-sel-handle.dragging {
    fill: #3b82f6;
}
#annSelectionOverlay circle.ann-sel-handle[data-corner="nw"] { cursor: nw-resize; }
#annSelectionOverlay circle.ann-sel-handle[data-corner="ne"] { cursor: ne-resize; }
#annSelectionOverlay circle.ann-sel-handle[data-corner="sw"] { cursor: sw-resize; }
#annSelectionOverlay circle.ann-sel-handle[data-corner="se"] { cursor: se-resize; }

/* 회전 zone (핸들 바깥 투명 링) — 커서는 JS에서 crosshair 적용 */
#annSelectionOverlay circle[data-rotate-corner] {
    pointer-events: all;
    cursor: crosshair;
}

/* 회전 아이콘 배경 원 */
#annSelectionOverlay .ann-rot-icon-bg {
    fill: white;
    stroke: #3b82f6;
    stroke-width: 1.5;
    opacity: 0.85;
    cursor: crosshair;
    transition: fill 0.15s, opacity 0.15s;
}
#annSelectionOverlay .ann-rot-icon-bg:hover,
#annSelectionOverlay .ann-rot-icon-bg.active {
    fill: #dbeafe;
    opacity: 1;
}

/* 회전 아이콘 (곡선 화살표 그룹) */
#annSelectionOverlay .ann-rot-icon {
    opacity: 0.75;
    cursor: crosshair;
    transition: opacity 0.15s;
    pointer-events: none; /* 이벤트는 bg에서 처리 */
}
#annSelectionOverlay .ann-rot-icon-bg:hover ~ .ann-rot-icon,
#annSelectionOverlay .ann-rot-icon.active {
    opacity: 1;
}

/* ── 툴바 래퍼 ────────────────────────────────────────── */
#annotationToolbar {
    position: fixed;
    top: 60px;
    left: 12px;      /* JS에서 사이드바 너비에 맞게 동적 조정 */
    z-index: 9100;
    display: none;   /* 노트 로드 시 JS에서 flex로 변경 */
    flex-direction: row;
    align-items: center;
    gap: 0;
}

/* ── 토글 버튼 (항상 표시, 비활성/활성 전환) ──────────── */
.ann-toggle-btn {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
    color: #64748b;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.10);
    transition: background 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.ann-toggle-btn:hover {
    background: #f5f3ff;
    color: #7c3aed;
    border-color: #c4b5fd;
    box-shadow: 0 4px 16px rgba(124, 58, 237, 0.18);
}

/* 활성화 시 토글 버튼 강조 */
#annotationToolbar.mode-active .ann-toggle-btn {
    background: #7c3aed;
    color: #fff;
    border-color: #7c3aed;
    box-shadow: 0 4px 20px rgba(124, 58, 237, 0.40);
}

/* ── 가로 확장 패널 ────────────────────────────────────── */
.ann-panel {
    display: flex;
    flex-direction: row;
    align-items: center;
    flex-wrap: nowrap;
    white-space: nowrap;
    gap: 4px;
    background: #fff;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
    margin-left: 8px;
    /* 접힌 상태 */
    max-width: 0;
    padding: 0;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transition:
        max-width 0.35s cubic-bezier(0.4, 0, 0.2, 1),
        opacity   0.25s ease,
        padding   0.3s  ease;
}

/* 활성화 시 패널 펼쳐짐 */
#annotationToolbar.mode-active .ann-panel {
    max-width: 1400px;
    padding: 5px 10px;
    opacity: 1;
    pointer-events: auto;
    overflow: visible;
}

/* ── 수평 그룹 (버튼들을 가로로 묶음) ─────────────────── */
.ann-h-group {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 3px;
    flex-shrink: 0;
}

/* ── 수직 구분선 ───────────────────────────────────────── */
.ann-h-sep {
    width: 1px;
    height: 22px;
    background: #e2e8f0;
    margin: 0 5px;
    flex-shrink: 0;
}

/* ── 도구 / 액션 버튼 ─────────────────────────────────── */
.ann-tool,
.ann-action {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #64748b;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}

.ann-tool:hover {
    background: #f1f5f9;
    color: #334155;
}

.ann-tool.active {
    background: #ede9fe;
    color: #7c3aed;
    box-shadow: 0 0 0 2px #7c3aed40;
}

.ann-action:hover {
    background: #fee2e2;
    color: #dc2626;
}

/* ── 굵기 버튼 ────────────────────────────────────────── */
.ann-size {
    width: 34px;
    height: 28px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #f8fafc;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    flex-shrink: 0;
    transition: background 0.15s, border-color 0.15s;
}

.ann-sz-bar {
    display: block;
    width: 100%;
    background: #64748b;
    border-radius: 2px;
}

.ann-size:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
}

.ann-size.active {
    background: #ede9fe;
    border-color: #7c3aed;
}

.ann-size.active .ann-sz-bar {
    background: #7c3aed;
}

/* ── 색상 버튼 ────────────────────────────────────────── */
.ann-color {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2.5px solid transparent;
    cursor: pointer;
    flex-shrink: 0;
    padding: 0;
    transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.ann-color:hover {
    transform: scale(1.22);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.22);
}

.ann-color.active {
    border-color: #1e293b;
    box-shadow: 0 0 0 2px #1e293baa;
    transform: scale(1.12);
}

/* ── 형광펜 모드 중: 단락 이벤트 차단 ───────────────────── */
body.annotation-mode #notepad .note-display { pointer-events: none; }

/* ── 지우개 모드: 어노테이션 요소 hover 강조 ────────────── */
body.annotation-mode #annotationCanvas [data-ann-id]:hover {
    opacity: 0.6;
    cursor: pointer;
}

/* ── 형광펜 모드 커서: notepad 내 모든 요소가 cursor:inherit 하도록 강제
   (텍스트/입력 요소가 cursor:text를 오버라이드하는 것을 차단)          */
body.annotation-mode #notepad,
body.annotation-mode #notepad * {
    cursor: inherit !important;
}

/* ── 형광펜 모드 토글 버튼 크기 보정 ─────────────────────── */
.ann-toggle-btn svg {
    display: block;
}

/* ── 뒤집기 플로팅 툴바 ──────────────────────────────── */
#annFlipBar {
    display: none;
    position: fixed;
    z-index: 9200;
    align-items: center;
    gap: 2px;
    background: rgba(255,255,255,0.97);
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 4px 6px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12), 0 1px 4px rgba(0,0,0,0.06);
    pointer-events: none;   /* 숨김 상태일 때 이벤트 차단 없음 */
    transform: translateX(-50%);
    white-space: nowrap;
    animation: flipBarIn 0.15s ease;
}
#annFlipBar[style*="flex"] {
    pointer-events: all;    /* 표시 상태일 때만 이벤트 활성 */
}
@keyframes flipBarIn {
    from { opacity: 0; transform: translateX(-50%) translateY(4px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
.ann-flip-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 5px 10px;
    border: none;
    background: transparent;
    border-radius: 7px;
    cursor: pointer;
    color: #475569;
    font-size: 10px;
    font-weight: 500;
    transition: background 0.13s, color 0.13s;
    line-height: 1;
}
.ann-flip-btn:hover { background: #eff6ff; color: #2563eb; }
.ann-flip-btn:active { background: #dbeafe; }
.ann-flip-btn svg { display: block; }
.ann-flip-sep {
    width: 1px;
    height: 24px;
    background: #e2e8f0;
    margin: 0 2px;
}

/* ── 모달 열림 시 형광펜 레이어를 모달 아래로 ──────────────
   Bootstrap 모달이 열리면 body에 .modal-open 클래스가 추가됨.
   annotation 관련 모든 fixed/absolute 레이어를 모달 backdrop(z-index:1050)
   아래로 내려 팝업창이 형광펜 객체 위에 정상 표시되도록 한다.
   #annotationCanvas는 JS에서 z-index:8999 인라인 적용되므로 !important 필요.
   ─────────────────────────────────────────────────────── */
body.modal-open #annotationToolbar,
body.modal-open #annFlipBar,
body.modal-open #annotationCanvas,
body.modal-open .ann-dropdown-menu,
body.modal-open .ann-color-popup,
body.modal-open .ann-stamp-menu,
body.modal-open #annSelectionOverlay {
    z-index: 1040 !important;
}

