/* Graph Master Web - Premium Studio Aesthetics */
:root {
  --bg-dark: #12181f;
  --panel-bg: rgba(26, 34, 44, 0.85);
  --panel-border: rgba(255, 255, 255, 0.08);
  --accent-cyan: #00d2d3;
  --accent-gold: #feca57;
  --accent-coral: #ff6b6b;
  --accent-blue: #54a0ff;
  --text-main: #f1f2f6;
  --text-muted: #a4b0be;
  --btn-hover: rgba(255, 255, 255, 0.06);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none !important;
  -webkit-tap-highlight-color: transparent !important;
  font-family: -apple-system, BlinkMacSystemFont, "Pretendard", "Segoe UI", Roboto, "Malgun Gothic", sans-serif;
}

html,
body {
  touch-action: none !important;
  overscroll-behavior: none !important;
  overscroll-behavior-x: none !important;
  overscroll-behavior-y: none !important;
  -webkit-touch-callout: none !important;
  -webkit-user-select: none !important;
  user-select: none !important;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* 상단 네비게이션 헤더 (13인치 액정 타블렛 특화: 38px 초슬림 컴팩트 & 접기 지원) */
header {
  height: 38px;
  background: var(--panel-bg);
  border-bottom: 1px solid var(--panel-border);
  backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  z-index: 180;
  transition: margin-top 0.22s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease;
}

/* 🌟 [대표님 핵심 기획]: 상단 바 숨겼을 때 화면 100% 칠판 극대화 */
body.header-collapsed header {
  margin-top: -38px;
  opacity: 0;
  pointer-events: none;
}

body.header-collapsed .main-workspace {
  height: 100vh !important;
}

/* 상단 바 접혔을 때 화면 최상단 중앙에 은은하게 뜨는 미니 복귀 탭 */
.header-show-tab {
  display: none;
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(18, 24, 31, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-top: none;
  border-radius: 0 0 12px 12px;
  padding: 2px 14px;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-cyan);
  cursor: pointer;
  z-index: 99;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  transition: all 0.15s ease;
}

.header-show-tab:hover {
  background: rgba(0, 210, 211, 0.22);
  border-color: var(--accent-cyan);
  padding-bottom: 4px;
  color: #ffffff;
}

body.header-collapsed .header-show-tab {
  display: flex;
  align-items: center;
  gap: 4px;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.logo-title {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.3px;
  background: linear-gradient(135deg, #00d2d3, #54a0ff);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.badge-tag {
  font-size: 9px;
  padding: 1px 6px;
  background: rgba(0, 210, 211, 0.15);
  color: var(--accent-cyan);
  border: 1px solid rgba(0, 210, 211, 0.3);
  border-radius: 10px;
  font-weight: 600;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  overflow-x: auto;
  scrollbar-width: none;
}

.header-actions::-webkit-scrollbar {
  display: none;
}

.btn-primary {
  background: linear-gradient(135deg, #00d2d3, #01a3a4);
  color: #0c2424;
  font-weight: 700;
  border: none;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 11.5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  transition: all 0.15s ease;
  box-shadow: 0 2px 8px rgba(0, 210, 211, 0.25);
  flex-shrink: 0;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 12px rgba(0, 210, 211, 0.4);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  border: 1px solid var(--panel-border);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.btn-secondary:hover {
  background: var(--btn-hover);
  border-color: rgba(255, 255, 255, 0.15);
}

/* 상단 바 접기 버튼 */
.btn-collapse-header {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  border: 1px solid var(--panel-border);
  width: 26px;
  height: 26px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
  margin-left: 2px;
}

.btn-collapse-header:hover {
  background: rgba(0, 210, 211, 0.2);
  color: var(--accent-cyan);
  border-color: var(--accent-cyan);
}

#btnCleanView.active {
  background: rgba(254, 202, 87, 0.18);
  border-color: #feca57;
  color: #feca57;
  box-shadow: 0 0 12px rgba(254, 202, 87, 0.35);
}

/* ↺ 실행 취소 & ↻ 다시 실행 (Undo / Redo) 버튼 */
.header-history-group {
  display: flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
  padding: 2px;
  gap: 2px;
}

.btn-history {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 4px;
  color: var(--text-main);
  font-size: 15px;
  cursor: pointer;
  transition: all 0.14s ease;
  padding: 0;
}

.btn-history:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.12);
  color: var(--accent-cyan);
  transform: translateY(-1px);
}

.btn-history:disabled {
  opacity: 0.28;
  cursor: not-allowed;
  color: var(--text-muted);
}

/* 메인 작업 영역 레이아웃 */
.main-workspace {
  flex: 1;
  display: flex;
  position: relative;
  overflow: hidden;
}

/* 좌측 플로팅 아이콘 독 & 슬라이드오버 서랍 (바를 완전히 없애고 칠판 위 플로팅) */
.sidebar-rail {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 0;
  height: 100%;
  z-index: 220;
  /* 🌟 대표님 기획: 문제 카드(#problemCardWidget, z-index: 150) 위에 최우선 상단 레이어로 소환 */
  pointer-events: none;
}

/* 좌측 플로팅 원형 아이콘 독 (우측 퀵 툴바와 대칭: 바 없이 바탕 위에 동그란 아이콘만 플로팅) */
.rail-dock {
  position: absolute;
  top: 18px;
  left: 18px;
  width: auto;
  height: auto;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0;
  gap: 10px;
  z-index: 225;
  pointer-events: auto;
  contain: layout style;
}

.rail-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(18, 26, 36, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50% !important;
  /* 대표님 절대 규칙: 완벽한 원형 동그라미 */
  cursor: pointer;
  color: var(--text-main);
  transition: transform 0.15s cubic-bezier(0.22, 1, 0.36, 1), background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
  padding: 0;
  position: relative;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

.rail-btn.is-hovered {
  background: rgba(35, 48, 64, 0.95);
  border-color: var(--accent-cyan);
  color: #ffffff;
  transform: scale(1.08);
  box-shadow: 0 6px 20px rgba(0, 210, 211, 0.25);
}

/* [대표님 지침]: 좌·우측 원형 아이콘은 마우스오버(:hover) 시에만 은은하게 변하고, 실행 중(.active) 상시 점등 효과는 제거 (유일 예외: 녹화 중 빨간색) */

.rail-icon {
  font-size: 19px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.rail-label {
  display: none !important;
}

.rail-toggle-btn {
  margin-top: 2px;
  height: 38px;
}

/* 🖐️ 좌측 레일 툴바 하단 양손패드 엄지 전용 큼직한 위/아래 줌 [+] / [−] */
.rail-zoom-dock {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 2px;
}

.rail-zoom-action-btn {
  width: 36px;
  height: 36px;
  border-radius: 50% !important;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(18, 26, 36, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-main);
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  transition: transform 0.15s cubic-bezier(0.22, 1, 0.36, 1), background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
  padding: 0;
}

.rail-zoom-action-btn:hover {
  background: rgba(35, 48, 64, 0.95);
  border-color: var(--accent-cyan);
  color: #ffffff;
  transform: scale(1.08);
  box-shadow: 0 6px 20px rgba(0, 210, 211, 0.25);
}

.rail-zoom-action-btn svg {
  display: block;
  pointer-events: none;
}

.rail-zoom-action-btn:hover {
  background: rgba(0, 210, 211, 0.16);
  border-color: rgba(0, 210, 211, 0.5);
  color: var(--accent-cyan, #00d2d3);
  transform: translateY(-1px);
}

.rail-zoom-action-btn:active {
  background: rgba(0, 210, 211, 0.3);
  border-color: var(--accent-cyan, #00d2d3);
  color: #ffffff;
  transform: scale(0.94);
}

body.theme-light .rail-zoom-dock {
  border-top-color: rgba(0, 0, 0, 0.08);
}

body.theme-light .rail-zoom-action-btn {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.12);
  color: #1e293b;
}

body.theme-light .rail-zoom-action-btn:hover {
  background: rgba(0, 210, 211, 0.12);
  border-color: #00b4b5;
  color: #008b8c;
}

body.theme-light .rail-zoom-action-btn:active {
  background: rgba(0, 210, 211, 0.25);
  color: #005f60;
}

/* 슬라이드오버 서랍 (Drawer - 바 없이 동그란 아이콘 바로 옆에 플로팅되는 초슬림 팝오버 글래스 카드) */
.rail-drawer {
  position: absolute;
  top: 18px;
  left: 66px;
  bottom: auto;
  width: 256px;
  height: auto;
  max-height: calc(100% - 36px);
  background: rgba(18, 24, 34, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.05);
  transform: none;
  opacity: 1;
  transition: opacity 0.12s ease, box-shadow 0.12s ease;
  overflow: hidden;
  z-index: 230;
  /* 🌟 최상단 레이어로 열려 문제 카드에 가려지지 않음 */
  pointer-events: auto;
}

.rail-drawer[data-active-panel="panelPresets"] {
  width: 344px;
}

.rail-drawer[data-active-panel="panelPresets"] .drawer-header {
  padding: 8px 12px;
}

.rail-drawer[data-active-panel="panelPresets"] .drawer-subpanels-container {
  padding: 8px 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

#panelPresets.active {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  gap: 6px;
}

#panelPresets>.panel-section:first-child {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* 서랍 접힘 상태 (슬라이드 이동 트랜지션을 제거하여 녹화/재생 중 서랍 열림 순간 좌표 튐 현상 0% 원천 차단) */
.sidebar-rail.drawer-collapsed .rail-drawer {
  transform: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  box-shadow: none !important;
}

.sidebar-rail.drawer-collapsed .rail-drawer * {
  pointer-events: none !important;
  visibility: hidden !important;
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(10, 14, 20, 0.5);
  flex-shrink: 0;
}

.drawer-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-drawer-close {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 13px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  transition: all 0.12s ease;
}

.btn-drawer-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.drawer-body {
  flex: 1;
  overflow: hidden;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* 상단 상시 노출 그래프 레이어 섹션 (메뉴바가 열려있는 한 항상 고정 노출) */
.drawer-persistent-layers {
  padding: 12px 14px 10px 14px;
  background: rgba(10, 15, 24, 0.55);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  max-height: 230px;
}

.drawer-persistent-layers .section-title {
  margin-bottom: 8px;
}

.drawer-persistent-layers .graph-layer-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
  max-height: 180px;
  padding-right: 3px;
}

.drawer-persistent-layers .graph-layer-list::-webkit-scrollbar {
  width: 4px;
}

.drawer-persistent-layers .graph-layer-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.16);
  border-radius: 4px;
}

/* 하단 탭 서브패널 전환 컨테이너 */
.drawer-subpanels-container {
  flex: 1;
  overflow-y: auto;
  padding: 11px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.drawer-subpanels-container::-webkit-scrollbar {
  width: 5px;
}

.drawer-subpanels-container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 4px;
}

.drawer-panel {
  display: none;
  flex-direction: column;
  gap: 12px;
}

.drawer-panel.active {
  display: flex;
  animation: fadeIn 0.18s ease-out;
}

/* 레거시 호환 */
.sidebar {
  width: 290px;
  background: var(--panel-bg);
  border-right: 1px solid var(--panel-border);
  backdrop-filter: blur(16px);
  display: flex;
  flex-direction: column;
  z-index: 20;
  overflow-y: auto;
}

.panel-section {
  padding: 14px 16px;
  border-bottom: 1px solid var(--panel-border);
}

.section-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* 다중 그래프 레이어 관리 */
.layer-btn-group {
  display: flex;
  align-items: center;
  gap: 5px;
}

.btn-clear-all {
  background: rgba(255, 118, 117, 0.12);
  border: 1px solid rgba(255, 118, 117, 0.45);
  color: #ff7675;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 10.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-clear-all:hover {
  background: #ff7675;
  color: #fff;
  box-shadow: 0 0 10px rgba(255, 118, 117, 0.4);
}

.btn-smart-input {
  background: rgba(254, 202, 87, 0.12);
  border: 1px solid rgba(254, 202, 87, 0.45);
  color: #feca57;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 10.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-smart-input:hover {
  background: #feca57;
  color: #2d1d00;
  box-shadow: 0 0 10px rgba(254, 202, 87, 0.4);
}

.btn-add-graph {
  background: rgba(0, 210, 211, 0.12);
  border: 1px solid rgba(0, 210, 211, 0.4);
  color: var(--accent-cyan);
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 10.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-add-graph:hover {
  background: var(--accent-cyan);
  color: #0c2424;
  box-shadow: 0 0 10px rgba(0, 210, 211, 0.4);
}

.graph-layer-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.layer-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.12s ease;
}

.layer-item:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.15);
}

.layer-item.active {
  border-color: var(--accent-cyan);
  background: rgba(0, 210, 211, 0.08);
}

.layer-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.layer-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  box-shadow: 0 0 6px currentColor;
}

.layer-title {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-main);
}

.layer-badge {
  font-size: 9.5px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.06);
  padding: 1px 5px;
  border-radius: 3px;
}

.btn-del-layer {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 3px;
  opacity: 0.6;
  transition: all 0.12s;
}

.btn-del-layer:hover {
  opacity: 1;
  color: var(--accent-coral);
  background: rgba(255, 107, 107, 0.15);
}

/* 함수 선택 탭 / 라디오 버튼 */
.category-tabs {
  display: flex;
  background: rgba(0, 0, 0, 0.25);
  padding: 2px;
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
}

.cat-tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 10px;
  padding: 5px 1px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
  white-space: nowrap;
  text-align: center;
  transition: all 0.12s ease;
}

.cat-tab-btn.active {
  background: var(--accent-cyan);
  color: #0c2424;
}

.func-list-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.func-list-grid.func-allinone-container {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow: hidden;
}

.func-top-blocks-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
}

.func-block-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 2px 1px;
  flex-shrink: 0;
}

body.theme-light .func-block-divider {
  background: rgba(15, 23, 42, 0.08);
}

.func-preset-section {
  flex: 1;
  min-height: 96px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding-top: 7px;
  margin-top: 2px;
  border-top: 1.5px solid rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

body.theme-light .func-preset-section {
  border-top-color: #cbd5e1;
}

.custom-graph-scroll-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-right: 2px;
}

.custom-graph-scroll-list::-webkit-scrollbar {
  width: 4px;
}

.custom-graph-scroll-list::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.35);
  border-radius: 4px;
}

.func-btn.shortcut-armed,
.custom-graph-card.shortcut-armed {
  border-color: rgba(0, 210, 211, 0.7) !important;
  background: rgba(0, 210, 211, 0.11) !important;
}

body.theme-light .func-btn.shortcut-armed,
body.theme-light .custom-graph-card.shortcut-armed {
  border-color: rgba(13, 148, 136, 0.65) !important;
  background: rgba(13, 148, 136, 0.09) !important;
}

.func-btn.shortcut-armed .func-num-badge,
.custom-graph-card.shortcut-armed .func-num-badge {
  background: #00d2d3 !important;
  color: #0f172a !important;
}

body.theme-light .func-btn.shortcut-armed .func-num-badge,
body.theme-light .custom-graph-card.shortcut-armed .func-num-badge {
  background: #0d9488 !important;
  color: #ffffff !important;
}

.func-cat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10.5px;
  font-weight: 700;
  color: #cbd5e1;
  line-height: 1.2;
  padding: 0 1px;
}

body.theme-light .func-cat-header {
  color: #334155;
}

.func-cat-title {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.func-cat-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 14px;
  height: 14px;
  padding: 0 3px;
  border-radius: 4px;
  font-size: 9.5px;
  font-weight: 800;
  background: rgba(0, 210, 211, 0.16);
  color: #00d2d3;
}

body.theme-light .func-cat-num {
  background: rgba(13, 148, 136, 0.12);
  color: #0f766e;
}

.func-cat-grid {
  display: grid;
  gap: 4px;
}

.func-cat-grid.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.func-cat-grid.cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.func-btn {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--panel-border);
  color: var(--text-muted);
  border-radius: 6px;
  padding: 4px 5px;
  min-height: 26px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.13s ease;
  user-select: none;
  min-width: 0;
}

.func-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  border-color: rgba(255, 255, 255, 0.22);
  transform: translateY(-1px);
}

.func-btn.active {
  background: rgba(0, 210, 211, 0.14);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  box-shadow: 0 0 8px rgba(0, 210, 211, 0.18);
}

.func-num-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
  padding: 2px 3.5px;
  border-radius: 3.5px;
  background: rgba(255, 255, 255, 0.08);
  color: #94a3b8;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

.func-btn:hover .func-num-badge,
.func-btn.active .func-num-badge {
  background: rgba(0, 210, 211, 0.22);
  color: #00d2d3;
}

body.theme-light .func-num-badge {
  background: rgba(15, 23, 42, 0.07);
  color: #64748b;
}

body.theme-light .func-btn:hover .func-num-badge,
body.theme-light .func-btn.active .func-num-badge {
  background: rgba(13, 148, 136, 0.16);
  color: #0f766e;
}

.func-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.mini-func-icon {
  width: 14px;
  height: 12px;
  opacity: 0.85;
  transition: all 0.13s ease;
}

.func-btn:hover .mini-func-icon {
  opacity: 1;
}

.func-btn.active .mini-func-icon {
  opacity: 1;
  filter: drop-shadow(0 0 3px var(--accent-cyan));
}

.func-name-text {
  font-size: 10.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.2px;
}

/* 변환 & 반전 툴바 */
.transform-toolbar {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.transform-btn {
  flex: 1;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--panel-border);
  color: var(--text-main);
  padding: 6px 0;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.12s;
}

.transform-btn:hover {
  background: var(--btn-hover);
}

.btn-inverse-highlight:hover {
  background: rgba(162, 155, 254, 0.35) !important;
  border-color: #a29bfe !important;
  box-shadow: 0 0 8px rgba(162, 155, 254, 0.3);
}

/* 체크박스 & 슬라이더 행 */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 12px;
}

.toggle-label {
  display: flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  color: var(--text-main);
}

.toggle-label input[type="checkbox"] {
  accent-color: var(--accent-cyan);
  cursor: pointer;
}

.slider-group {
  margin-bottom: 10px;
}

.slider-header {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  margin-bottom: 5px;
  color: var(--text-muted);
}

.slider-bar {
  width: 100%;
  height: 5px;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  outline: none;
}

.slider-bar::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent-cyan);
  cursor: pointer;
  box-shadow: 0 0 8px rgba(0, 210, 211, 0.5);
}

/* 컬러 피커 팔레트 */
.color-palette {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.color-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform 0.12s ease;
}

.color-dot:hover {
  transform: scale(1.15);
}

.color-dot.active {
  border-color: #ffffff;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}

/* 캔버스 스테이지 영역 */
.canvas-container {
  flex: 1;
  position: relative;
  background-color: #1e272e;
  overflow: hidden;
  cursor: default;
  -webkit-touch-callout: none !important;
  -webkit-user-select: none !important;
  user-select: none !important;
  touch-action: none !important;
}

#graphCanvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  touch-action: none !important;
  -webkit-touch-callout: none !important;
  -webkit-user-select: none !important;
  user-select: none !important;
}

/* [대표님 기획]: 하단 안내창(토스트) 팝업 완전 제거 (시각적 잡음 방지) */
.toast-msg {
  display: none !important;
}

.toast-msg.show {
  display: none !important;
}

/* 상단 헤더 완전 제거: 센터 판서 공간 100% 개방 & Chrome x버튼 간섭 원천 차단 */
header,
.header-show-tab,
body.fullscreen-mode header {
  display: none !important;
}

.main-workspace,
body.fullscreen-mode .main-workspace {
  height: 100vh !important;
}

body.fullscreen-mode .sidebar-rail {
  display: flex !important;
}

body.fullscreen-mode #btnFullscreen #iconFullscreenEnter,
#btnFullscreen.quick-fab-exit #iconFullscreenEnter {
  display: none !important;
}

body.fullscreen-mode #btnFullscreen #iconFullscreenExit,
#btnFullscreen.quick-fab-exit #iconFullscreenExit {
  display: inline-flex !important;
}

.btn-exit-fullscreen,
body.fullscreen-mode .btn-exit-fullscreen {
  display: none !important;
}

/* ==========================================================================
   [스마트 수식 입력 모달 스타일 - 프리미엄 다크 글래스모피즘]
   ========================================================================== */
.smart-modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10, 15, 22, 0.75);
  backdrop-filter: blur(12px);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.smart-modal-backdrop.show {
  display: flex;
  opacity: 1;
}

.smart-modal-card {
  width: 100%;
  max-width: 480px;
  background: rgba(26, 36, 48, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.65), 0 0 20px rgba(0, 210, 211, 0.12);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(12px) scale(0.98);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.smart-modal-backdrop.show .smart-modal-card {
  transform: translateY(0) scale(1);
}

.smart-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid var(--panel-border);
}

.smart-modal-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-icon {
  font-size: 15px;
  font-weight: 800;
  color: #feca57;
  background: rgba(254, 202, 87, 0.15);
  padding: 3px 7px;
  border-radius: 5px;
}

.modal-title-text {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
}

.badge-smart {
  font-size: 10px;
  font-weight: 700;
  color: var(--accent-cyan);
  background: rgba(0, 210, 211, 0.15);
  padding: 2px 6px;
  border-radius: 10px;
}

.btn-modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.12s ease;
}

.btn-modal-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.smart-modal-body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.input-field-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.smart-math-input {
  width: 100%;
  background: rgba(15, 22, 30, 0.85);
  border: 1.5px solid rgba(0, 210, 211, 0.4);
  border-radius: var(--radius-md);
  padding: 12px 38px 12px 14px;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  font-family: 'Consolas', 'Courier New', monospace;
  outline: none;
  transition: all 0.2s ease;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.4);
}

.smart-math-input:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 15px rgba(0, 210, 211, 0.35), inset 0 2px 6px rgba(0, 0, 0, 0.4);
}

.btn-clear-expr {
  position: absolute;
  right: 10px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  padding: 4px;
  transition: color 0.12s ease;
}

.btn-clear-expr:hover {
  color: #fff;
}

/* 실시간 수식 해석 결과창 */
.smart-preview-card {
  background: rgba(0, 210, 211, 0.06);
  border: 1px solid rgba(0, 210, 211, 0.25);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: all 0.2s ease;
}

.smart-preview-card.has-error {
  background: rgba(255, 107, 107, 0.08);
  border-color: rgba(255, 107, 107, 0.35);
}

.preview-header {
  display: flex;
  align-items: center;
  gap: 6px;
}

.preview-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: 0 0 6px var(--accent-cyan);
}

.smart-preview-card.has-error .preview-dot {
  background: #ff6b6b;
  box-shadow: 0 0 6px #ff6b6b;
}

.preview-title {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.preview-math {
  font-size: 16px;
  font-weight: 700;
  color: #feca57;
  font-family: 'Consolas', 'Courier New', monospace;
  text-shadow: 0 0 8px rgba(254, 202, 87, 0.3);
}

.smart-preview-card.has-error .preview-math {
  font-size: 13px;
  font-weight: 500;
  color: #ff6b6b;
  text-shadow: none;
}

.preview-details {
  font-size: 11.5px;
  color: var(--text-main);
  opacity: 0.85;
}

/* 터치 키패드 그리드 */
.touch-keypad {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
}

.key-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--panel-border);
  color: var(--text-main);
  border-radius: 6px;
  padding: 8px 4px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.12s ease;
  user-select: none;
}

.key-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  transform: translateY(-1px);
}

.key-btn:active {
  transform: translateY(0);
}

.key-btn.key-op {
  color: #feca57;
  font-weight: 700;
}

.key-btn.key-accent {
  color: var(--accent-cyan);
  font-weight: 700;
}

/* 원터치 퀵 칩 */
.quick-chips-area {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.chips-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}

.chips-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  padding: 4px 9px;
  border-radius: 12px;
  font-size: 11.5px;
  font-family: 'Consolas', monospace;
  cursor: pointer;
  transition: all 0.12s ease;
}

.chip-btn:hover {
  background: rgba(0, 210, 211, 0.15);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

/* 모달 푸터 버튼 */
.smart-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 18px;
  background: rgba(0, 0, 0, 0.2);
  border-top: 1px solid var(--panel-border);
}

.btn-glow {
  box-shadow: 0 4px 18px rgba(0, 210, 211, 0.45);
}

.btn-glow:hover {
  box-shadow: 0 6px 24px rgba(0, 210, 211, 0.6);
}

/* ========================================================
   뷰파인더(Viewfinder) UI 스타일링
   ======================================================== */
/* ==========================================================================
   🌟 [대표님 기획: ⚙️ 설정 패널 & 원터치 캡처영역 버튼 스타일] 🌟
   ========================================================================== */
.settings-toggle-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.setting-toggle-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.setting-toggle-item:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(0, 210, 211, 0.3);
}

.setting-text-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.setting-name {
  font-size: 12px;
  font-weight: 700;
  color: #f1f2f6;
}

.setting-sub {
  font-size: 10px;
  color: #a4b0be;
}

/* 📷 캡처영역 바깥 원터치 버튼 활성 글로우 */
#btnRailToggleVf.active {
  background: rgba(0, 210, 211, 0.22) !important;
  border-color: var(--accent-cyan) !important;
  color: var(--accent-cyan) !important;
  box-shadow: 0 0 12px rgba(0, 210, 211, 0.35) !important;
}

#btnRailToggleVf.active .rail-icon,
#btnRailToggleVf.active .rail-label {
  color: var(--accent-cyan) !important;
  font-weight: 700 !important;
}

.vf-toggle-wrap {
  position: relative;
  display: inline-block;
  width: 32px;
  height: 18px;
  cursor: pointer;
}

.vf-toggle-wrap input {
  opacity: 0;
  width: 0;
  height: 0;
}

.vf-toggle-slider {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.15);
  border-radius: 18px;
  transition: all 0.2s ease;
}

.vf-toggle-slider:before {
  position: absolute;
  content: "";
  height: 12px;
  width: 12px;
  left: 3px;
  bottom: 3px;
  background-color: #fff;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.vf-toggle-wrap input:checked+.vf-toggle-slider {
  background-color: #feca57;
}

.vf-toggle-wrap input:checked+.vf-toggle-slider:before {
  transform: translateX(14px);
  background-color: #1e272e;
}

.vf-aspect-chips {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  margin-top: 6px;
}

.vf-chip {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--panel-border);
  color: var(--text-muted);
  font-size: 10.5px;
  font-weight: 600;
  padding: 4px 0;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.12s ease;
}

.vf-chip:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
}

.vf-chip.active {
  background: rgba(254, 202, 87, 0.18);
  border-color: #feca57;
  color: #feca57;
  font-weight: 700;
}

.vf-dpi-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
}

.vf-dpi-label {
  font-size: 11px;
  color: var(--text-muted);
}

.vf-dpi-group {
  display: flex;
  gap: 4px;
}

.dpi-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--panel-border);
  color: var(--text-muted);
  font-size: 10.5px;
  font-weight: 600;
  padding: 3px 6px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.12s ease;
}

.dpi-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
}

.dpi-btn.active {
  background: rgba(0, 210, 211, 0.15);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  font-weight: 700;
}

/* ==========================================================================
   [우측 플로팅 퀵 액션 툴바 & 촤라락 플라이아웃 메뉴]
   ========================================================================== */
.canvas-quick-toolbar {
  position: absolute;
  top: 18px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 485;
}

.quick-btn-wrapper {
  position: relative;
}

.quick-fab-btn {
  width: 36px;
  height: 36px;
  border-radius: 50% !important;
  background: rgba(18, 26, 36, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  transition: transform 0.15s cubic-bezier(0.22, 1, 0.36, 1), background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.quick-fab-btn.is-hovered {
  background: rgba(35, 48, 64, 0.95);
  border-color: var(--accent-cyan);
  transform: scale(1.08);
  box-shadow: 0 6px 20px rgba(0, 210, 211, 0.25);
}

#btnQuickNewCanvas.is-hovered {
  background: rgba(244, 63, 94, 0.22);
  border-color: #fb7185;
  color: #fb7185;
  box-shadow: 0 6px 20px rgba(244, 63, 94, 0.28);
}

.quick-fab-btn.snap-off {
  opacity: 0.5;
  filter: grayscale(0.85);
}

.quick-fab-btn:disabled {
  opacity: 0.25;
  cursor: not-allowed;
  pointer-events: none;
  transform: none !important;
  box-shadow: none !important;
}

.fab-icon {
  font-size: 16px;
  line-height: 1;
}

/* 촤라락 플라이아웃 패널 (좌측으로 부드럽게 전개) */
.quick-flyout-panel {
  position: absolute;
  top: 50%;
  right: calc(100% + 12px);
  background: rgba(26, 36, 48, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.52), 0 0 16px rgba(0, 210, 211, 0.15);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 12px;
  width: 175px;
  display: none;
  flex-direction: column;
  gap: 8px;
  z-index: 250 !important;
  user-select: none;
}

.quick-flyout-panel.show {
  display: flex !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  transform: translateY(-50%) !important;
  animation: flyoutSlideIn 0.16s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes flyoutSlideIn {
  from {
    opacity: 0;
    transform: translateY(-50%) translateX(10px) scale(0.96);
  }

  to {
    opacity: 1;
    transform: translateY(-50%) translateX(0) scale(1);
  }
}

.flyout-header {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-cyan);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.theme-palette-grid {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.theme-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  color: var(--text-main);
  font-size: 11.5px;
  font-weight: 500;
  text-align: left;
  transition: all 0.14s ease;
}

.theme-chip:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
}

.theme-chip.active {
  background: rgba(0, 210, 211, 0.14);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  font-weight: 700;
}

.theme-color-preview {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  flex-shrink: 0;
}

.theme-name {
  flex: 1;
  white-space: nowrap;
}

/* --- [✂️ 구간별 합성 함수 (Piecewise) 스타일] --- */
.piecewise-section {
  border-left: 3px solid #a29bfe;
}

.pw-controls-container {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pw-mode-row {
  display: flex;
  background: rgba(0, 0, 0, 0.25);
  padding: 2px;
  border-radius: var(--radius-sm);
  gap: 2px;
}

.pw-mode-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 10px;
  padding: 4px 2px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.12s ease;
  white-space: nowrap;
  text-align: center;
}

.pw-mode-btn.active {
  background: #6c5ce7;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(108, 92, 231, 0.35);
}

.pw-action-row {
  display: flex;
  gap: 6px;
}

.btn-sub-action {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #c8d6e5;
  font-size: 11px;
  font-weight: 600;
  padding: 5px 0;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
}

.btn-sub-action:hover {
  background: rgba(108, 92, 231, 0.25);
  border-color: #a29bfe;
  color: #ffffff;
}

.pw-slider-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.pw-slider-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pw-label {
  font-size: 11px;
  font-weight: bold;
  color: #a29bfe;
  width: 44px;
}

.pw-slider-row input[type="range"] {
  flex: 1;
  accent-color: #a29bfe;
  cursor: pointer;
}

.num-compact {
  width: 50px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #ffffff;
  font-size: 11px;
  padding: 2px 4px;
  border-radius: 3px;
  text-align: right;
}

.pw-desc-badge {
  background: rgba(15, 20, 30, 0.85);
  border: 1px solid rgba(162, 155, 254, 0.3);
  color: #a29bfe;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 10px;
  font-weight: 600;
  padding: 5px 8px;
  border-radius: 4px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* 캔버스 N-구간 함수 선택 플로팅 팝오버 */
.pw-region-popover {
  position: absolute;
  display: none;
  flex-direction: column;
  gap: 3px;
  background: rgba(18, 24, 38, 0.96);
  border: 1px solid rgba(162, 155, 254, 0.65);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 16px rgba(162, 155, 254, 0.3);
  border-radius: 10px;
  padding: 6px;
  min-width: 155px;
  backdrop-filter: blur(12px);
  z-index: 120;
  pointer-events: auto;
  animation: popIn 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes popIn {
  from {
    opacity: 0;
    transform: translateY(-4px) scale(0.96);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.pw-popover-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  color: #e2e8f0;
  cursor: pointer;
  transition: all 0.12s ease;
}

.pw-popover-item:hover {
  background: rgba(162, 155, 254, 0.22);
  color: #ffffff;
  transform: translateX(2px);
}

.pw-popover-item.active {
  background: rgba(162, 155, 254, 0.32);
  border: 1px solid rgba(162, 155, 254, 0.7);
  color: #a29bfe;
}

.pw-popover-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 6px currentColor;
}

/* --- [📐 사각형 모드 패널 스타일] --- */
.quad-mode-section {
  border-left: 3px solid #1dd1a1;
}

.quad-mode-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  background: rgba(0, 0, 0, 0.25);
  padding: 3px;
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}

.quad-mode-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 10.5px;
  padding: 6px 2px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.12s ease;
  white-space: nowrap;
  text-align: center;
}

.quad-mode-btn:hover {
  background: rgba(29, 209, 161, 0.14);
  color: #ffffff;
}

.quad-mode-btn.active {
  background: #10ac84;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(16, 172, 132, 0.4);
}

.quad-mode-hint {
  margin-top: 6px;
  font-size: 10px;
  color: var(--text-muted);
  text-align: center;
  opacity: 0.85;
}

/* =====================================================================
   [🔗 공유 링크 & 학생용 모드 & QR 코드 스타일]
   ===================================================================== */

/* 1. 상단 복원 안내 바 (Reset Bar) */
.shared-reset-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 18px;
  background: linear-gradient(90deg, rgba(0, 210, 211, 0.18), rgba(254, 202, 87, 0.18));
  border-bottom: 1px solid rgba(0, 210, 211, 0.35);
  font-size: 12px;
  color: var(--text-main);
  animation: slideDown 0.25s ease-out;
}

.reset-bar-msg strong {
  color: var(--accent-cyan);
}

.reset-bar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-reset-original {
  background: var(--accent-cyan);
  color: #0b1e1e;
  border: none;
  font-size: 11.5px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 2px 6px rgba(0, 210, 211, 0.3);
}

.btn-reset-original:hover {
  background: #20e4e5;
  transform: translateY(-1px);
}

.btn-reset-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
  padding: 4px;
}

.btn-reset-close:hover {
  color: #ffffff;
}

/* 2. 헤더 공유 버튼 강조 */
.btn-share-highlight {
  border-color: rgba(0, 210, 211, 0.5) !important;
  color: var(--accent-cyan) !important;
}

.btn-share-highlight:hover {
  background: rgba(0, 210, 211, 0.15) !important;
  box-shadow: 0 2px 10px rgba(0, 210, 211, 0.3) !important;
}

/* 3. 공유 모달 스타일 */
.share-modal-card {
  max-width: 540px;
}

.share-modal-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 18px 22px;
}

.share-field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.share-field-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-main);
}

.share-input-row {
  display: flex;
  gap: 8px;
}

.share-link-input {
  flex: 1;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--panel-border);
  color: var(--text-main);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-family: Consolas, monospace;
  outline: none;
  user-select: all;
}

.share-link-input:focus {
  border-color: var(--accent-cyan);
}

.share-hint-text {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* 4. QR 코드 생성 영역 */
.qr-section {
  margin-top: 4px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  padding: 14px;
}

.qr-preview-box {
  display: flex;
  align-items: center;
  gap: 18px;
}

#qrCanvas {
  background: #ffffff;
  padding: 6px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  flex-shrink: 0;
}

.qr-meta-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.qr-target-badge {
  display: inline-block;
  align-self: flex-start;
  font-size: 11px;
  font-weight: 700;
  color: #feca57;
  background: rgba(254, 202, 87, 0.15);
  padding: 3px 8px;
  border-radius: 4px;
}

.qr-tip-text {
  font-size: 11.5px;
  color: var(--text-main);
  line-height: 1.4;
}

/* 5. 🎓 학생용 인터랙티브 모드 (Student Mode) */
body.student-mode .sidebar,
body.student-mode .sidebar-rail {
  display: none !important;
}

body.student-mode .main-workspace {
  width: 100vw;
  height: calc(100vh - 46px);
}

body.student-mode .header {
  background: rgba(15, 23, 32, 0.85);
}

body.student-mode #btnOpenShareModal,
body.student-mode #btnDownload,
body.student-mode #btnCopy {
  display: none !important;
}

/* ❄️ 형상 프리징 (Freeze) 스타일 */
#btnToggleFreeze.active {
  background: rgba(0, 210, 211, 0.25) !important;
  border-color: #00d2d3 !important;
  color: #fff !important;
  box-shadow: 0 0 10px rgba(0, 210, 211, 0.35);
}

.layer-freeze-btn {
  background: none;
  border: none;
  font-size: 11px;
  cursor: pointer;
  padding: 2px 4px;
  opacity: 0.45;
  transition: all 0.15s ease;
  border-radius: 3px;
}

.layer-freeze-btn:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.1);
}

.layer-freeze-btn.active {
  opacity: 1;
  color: #00d2d3;
  background: rgba(0, 210, 211, 0.2);
}

.layer-item.is-frozen {
  border-left: 3px solid #00d2d3 !important;
}

.layer-frozen-badge {
  font-size: 9.5px;
  font-weight: 700;
  color: #00d2d3;
  background: rgba(0, 210, 211, 0.15);
  padding: 1px 4px;
  border-radius: 3px;
  margin-left: 4px;
}

/* 🧑‍🏫 라이브 판서 분할 모드 (Stage & Board Mode) 스타일 */
#btnBoardMode.active,
#btnQuickBoardMode.active {
  background: rgba(0, 210, 211, 0.22) !important;
  border-color: #00d2d3 !important;
  color: #00d2d3 !important;
  box-shadow: 0 0 14px rgba(0, 210, 211, 0.4) !important;
  font-weight: 700;
}

/* ==========================================================================
   🌟 [대표님 기획: 상단 중앙 초슬림 캡슐바 (Curve Context Bar)] 🌟
   - 화면 상단 중앙 플로팅 알약 (38px 다크 글래스모피즘)
   - 곡선 선택 시 부드럽게 slideDown
   - 곡선/핸들 드래그 시 은은한 반투명(dimmed 0.25)으로 판서 시야 100% 확보
   - 빈 공간 클릭 또는 필기 펜 모드 시 즉시 사라짐
   ========================================================================== */
.curve-context-bar {
  position: absolute;
  top: 9px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 125;
  display: flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 10px 0 14px;
  background: rgba(18, 26, 36, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.42), 0 2px 8px rgba(0, 0, 0, 0.2);
  user-select: none;
  pointer-events: auto;
  opacity: 1;
  transition: opacity 0.15s ease, transform 0.15s cubic-bezier(0.22, 1, 0.36, 1), top 0.2s ease;
  animation: slideDownCapsule 0.18s cubic-bezier(0.22, 1, 0.36, 1);
}

body.header-collapsed .curve-context-bar {
  top: 28px;
}

@keyframes slideDownCapsule {
  from {
    opacity: 0;
    transform: translate(-50%, -10px) scale(0.96);
  }

  to {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
  }
}

.curve-context-bar.dimmed {
  opacity: 0.25;
  pointer-events: none;
}

.curve-context-bar .ctx-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding-right: 4px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
}

.curve-context-bar .ctx-color-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  box-shadow: 0 0 8px currentColor;
  flex-shrink: 0;
}

.curve-context-bar .ctx-name {
  font-size: 12px;
  color: #f1f2f6;
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.curve-context-bar .ctx-sep {
  width: 1px;
  height: 16px;
  background: rgba(255, 255, 255, 0.14);
  margin: 0 2px;
  flex-shrink: 0;
}

.curve-context-bar .ctx-btn {
  height: 28px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: #e2e8f0;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  transition: all 0.15s cubic-bezier(0.22, 1, 0.36, 1);
}

.curve-context-bar .ctx-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(0, 210, 211, 0.5);
  color: #ffffff;
  transform: translateY(-1px);
}

.curve-context-bar .ctx-btn:active {
  transform: translateY(0);
}

.curve-context-bar .ctx-btn.active {
  background: rgba(0, 210, 211, 0.22);
  border-color: var(--accent-cyan, #00d2d3);
  color: var(--accent-cyan, #00d2d3);
  font-weight: 700;
  box-shadow: 0 0 10px rgba(0, 210, 211, 0.3);
}

.curve-context-bar .ctx-btn-inverse {
  background: rgba(162, 155, 254, 0.16);
  border-color: rgba(162, 155, 254, 0.45);
  color: #a29bfe;
  font-weight: 700;
}

.curve-context-bar .ctx-btn-inverse:hover {
  background: rgba(162, 155, 254, 0.28);
  border-color: #a29bfe;
  color: #fff;
}

.curve-context-bar .ctx-btn-link {
  background: rgba(255, 107, 107, 0.22);
  border-color: rgba(255, 107, 107, 0.6);
  color: #ff7675;
  font-weight: 700;
  animation: pulseLinkCapsule 2s infinite;
}

@keyframes pulseLinkCapsule {
  0% {
    box-shadow: 0 0 0 rgba(255, 107, 107, 0);
  }

  50% {
    box-shadow: 0 0 10px rgba(255, 107, 107, 0.4);
  }

  100% {
    box-shadow: 0 0 0 rgba(255, 107, 107, 0);
  }
}

.curve-context-bar .ctx-btn-link:hover {
  background: rgba(255, 107, 107, 0.38);
  border-color: #ff7675;
  color: #fff;
}

.curve-context-bar .ctx-btn-dup {
  background: rgba(255, 234, 167, 0.15);
  border-color: rgba(255, 234, 167, 0.4);
  color: #ffeaa7;
  font-weight: 700;
}

.curve-context-bar .ctx-btn-dup:hover {
  background: rgba(255, 234, 167, 0.28);
  color: #ffffff;
}

.curve-context-bar .ctx-btn-del {
  color: #ff7675;
  padding: 0 8px;
}

.curve-context-bar .ctx-btn-del:hover {
  background: rgba(255, 107, 107, 0.25);
  border-color: rgba(255, 107, 107, 0.6);
  color: #ffffff;
}

.curve-context-bar .ctx-btn-close {
  padding: 0 8px;
  color: #a4b0be;
  font-size: 13px;
}

.curve-context-bar .ctx-btn-close:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

.curve-context-bar .ctx-caret,
.curve-context-bar .ctx-caret-svg {
  flex-shrink: 0;
  opacity: 0.85;
  margin-left: 1px;
}

.curve-context-bar .ctx-sub-popover {
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 8px;
  background: rgba(18, 26, 36, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.38);
  white-space: nowrap;
  z-index: 442;
}

.curve-context-bar .ctx-sub-btn {
  height: 29px;
  padding: 0 10px;
  font-size: 11.5px;
}

/* Light Theme support */
body.theme-light .curve-context-bar {
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid rgba(0, 0, 0, 0.14);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08), 0 2px 6px rgba(0, 0, 0, 0.04);
  color: #1e293b;
}

body.theme-light .curve-context-bar .ctx-badge .ctx-name {
  color: #1e293b;
  font-weight: 700;
}

body.theme-light .curve-context-bar .ctx-sep {
  background: rgba(0, 0, 0, 0.12);
}

body.theme-light .curve-context-bar .ctx-btn {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.12);
  color: #334155;
}

body.theme-light .curve-context-bar .ctx-btn:hover {
  background: rgba(37, 99, 235, 0.06);
  border-color: rgba(37, 99, 235, 0.45);
  color: #2563eb;
  transform: translateY(-1px);
}

body.theme-light .curve-context-bar .ctx-btn.active {
  background: rgba(37, 99, 235, 0.12);
  border-color: #2563eb;
  color: #2563eb;
  font-weight: 700;
  box-shadow: 0 0 8px rgba(37, 99, 235, 0.25);
}

body.theme-light .curve-context-bar .ctx-btn-inverse {
  background: rgba(124, 58, 237, 0.08);
  border-color: rgba(124, 58, 237, 0.3);
  color: #6d28d9;
  font-weight: 700;
}

body.theme-light .curve-context-bar .ctx-btn-inverse:hover {
  background: rgba(124, 58, 237, 0.16);
  border-color: #6d28d9;
  color: #5b21b6;
}

body.theme-light .curve-context-bar .ctx-btn-link {
  background: rgba(220, 38, 38, 0.08);
  border-color: rgba(220, 38, 38, 0.35);
  color: #dc2626;
  font-weight: 700;
}

body.theme-light .curve-context-bar .ctx-btn-dup {
  background: rgba(217, 119, 6, 0.08);
  border-color: rgba(217, 119, 6, 0.3);
  color: #b45309;
  font-weight: 700;
}

body.theme-light .curve-context-bar .ctx-btn-dup:hover {
  background: rgba(217, 119, 6, 0.16);
  color: #92400e;
}

body.theme-light .curve-context-bar .ctx-btn-del {
  color: #dc2626;
  background: rgba(220, 38, 38, 0.05);
  border-color: rgba(220, 38, 38, 0.25);
}

body.theme-light .curve-context-bar .ctx-btn-del:hover {
  background: rgba(220, 38, 38, 0.15);
  border-color: #dc2626;
  color: #b91c1c;
}

body.theme-light .curve-context-bar .ctx-btn-close {
  color: #64748b;
}

body.theme-light .curve-context-bar .ctx-btn-close:hover {
  background: rgba(0, 0, 0, 0.06);
  color: #1e293b;
}

body.theme-light .curve-context-bar .ctx-sub-popover {
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(0, 0, 0, 0.14);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.10), 0 2px 6px rgba(0, 0, 0, 0.05);
}

.board-mode-bar {
  position: absolute;
  top: 14px;
  right: 76px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(18, 26, 36, 0.90);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(0, 210, 211, 0.45);
  padding: 6px 14px;
  border-radius: 24px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.5);
  z-index: 95;
  animation: fadeInDownBoard 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeInDownBoard {
  from {
    opacity: 0;
    transform: translateY(-10px) scale(0.96);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.board-bar-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: #00d2d3;
  letter-spacing: -0.2px;
}

.board-pulse-dot {
  width: 7px;
  height: 7px;
  background: #00d2d3;
  border-radius: 50%;
  box-shadow: 0 0 8px #00d2d3;
  animation: boardDotPulse 1.8s infinite ease-in-out;
}

@keyframes boardDotPulse {

  0%,
  100% {
    opacity: 0.35;
    transform: scale(0.85);
  }

  50% {
    opacity: 1;
    transform: scale(1.25);
  }
}

.board-ratio-selector {
  display: flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.38);
  border-radius: 12px;
  padding: 2px;
  gap: 2px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.board-ratio-btn {
  background: transparent;
  border: none;
  color: #a4b0be;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.board-ratio-btn:hover {
  color: #fff;
}

.board-ratio-btn.active {
  background: #00d2d3;
  color: #0c2424;
  font-weight: 700;
  box-shadow: 0 0 8px rgba(0, 210, 211, 0.4);
}

.board-bar-tip {
  font-size: 11px;
  color: #a4b0be;
  padding: 0 4px;
}

.btn-exit-board {
  background: rgba(255, 107, 107, 0.16);
  border: 1px solid rgba(255, 107, 107, 0.45);
  color: #ff6b6b;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-exit-board:hover {
  background: #ff6b6b;
  color: #fff;
}

/* =====================================================================
   [🔀 정통 N축 합성함수 해석 모드 UI 스타일]
   ===================================================================== */
#btnNAxisMode.active,
#btnQuickNAxisMode.active {
  background: linear-gradient(135deg, #6c5ce7, #a29bfe) !important;
  color: #ffffff !important;
  border-color: #a29bfe !important;
  box-shadow: 0 0 14px rgba(162, 155, 254, 0.6) !important;
}

.n-axis-mode-bar {
  position: absolute;
  top: 14px;
  right: 76px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(18, 22, 36, 0.92);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(162, 155, 254, 0.5);
  padding: 6px 14px;
  border-radius: 24px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.55), 0 0 16px rgba(162, 155, 254, 0.2);
  z-index: 95;
  animation: fadeInDownNAxis 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeInDownNAxis {
  from {
    opacity: 0;
    transform: translateY(-10px) scale(0.96);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.n-axis-bar-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: #a29bfe;
  letter-spacing: -0.2px;
}

.n-axis-pulse-dot {
  width: 7px;
  height: 7px;
  background: #a29bfe;
  border-radius: 50%;
  box-shadow: 0 0 8px #a29bfe;
  animation: nAxisDotPulse 1.8s infinite ease-in-out;
}

@keyframes nAxisDotPulse {

  0%,
  100% {
    opacity: 0.4;
    transform: scale(0.85);
  }

  50% {
    opacity: 1;
    transform: scale(1.25);
  }
}

.n-axis-role-selector {
  display: flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 14px;
  padding: 3px 6px;
  gap: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.n-axis-role-chip {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
}

.n-axis-role-chip.outer .role-badge {
  background: rgba(0, 210, 211, 0.2);
  color: #00d2d3;
  font-size: 9px;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 4px;
}

.n-axis-role-chip.inner .role-badge {
  background: rgba(254, 202, 87, 0.2);
  color: #feca57;
  font-size: 9px;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 4px;
}

.n-axis-role-chip .role-name {
  font-size: 11px;
  font-weight: 700;
  color: #f1f2f6;
}

.btn-n-axis-swap {
  display: flex;
  align-items: center;
  gap: 3px;
  background: rgba(162, 155, 254, 0.2);
  border: 1px solid rgba(162, 155, 254, 0.5);
  color: #dcdde1;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-n-axis-swap:hover {
  background: #6c5ce7;
  color: #fff;
  border-color: #a29bfe;
  transform: scale(1.05);
}

.btn-n-axis-swap:hover .swap-icon {
  transform: rotate(180deg);
  transition: transform 0.3s ease;
}

.n-axis-bar-tip {
  font-size: 11px;
  color: #a4b0be;
  padding: 0 4px;
}

.btn-exit-n-axis {
  background: rgba(255, 107, 107, 0.16);
  border: 1px solid rgba(255, 107, 107, 0.45);
  color: #ff6b6b;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-exit-n-axis:hover {
  background: #ff6b6b;
  color: #fff;
}

.n-axis-zoom-control {
  display: flex;
  align-items: center;
  gap: 2px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 2px 4px;
}

.btn-n-axis-zoom {
  background: transparent;
  border: none;
  color: #a4b0be;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-n-axis-zoom:hover {
  background: rgba(162, 155, 254, 0.25);
  color: #fff;
}

.btn-n-axis-zoom-val {
  background: rgba(162, 155, 254, 0.15);
  border: 1px solid rgba(162, 155, 254, 0.35);
  color: #a29bfe;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-n-axis-zoom-val:hover {
  background: #6c5ce7;
  color: #fff;
}

/* ========================================================
   [교재 보조 수선(Drop Lines) & 축 좌표 라벨 인라인 에디터]
   ======================================================== */

.canvas-container.drop-line-active {
  cursor: crosshair !important;
}

.drop-line-label-input {
  position: absolute;
  z-index: 150;
  display: none;
  min-width: 32px;
  max-width: 140px;
  padding: 2px 6px;
  background: rgba(15, 23, 42, 0.95);
  border: 1.5px solid #00d2d3;
  border-radius: 4px;
  color: #ffffff;
  font-family: 'STIX Two Text', 'Times New Roman', 'Cambria Math', serif;
  font-size: 15px;
  font-weight: 500;
  text-align: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5), 0 0 10px rgba(0, 210, 211, 0.4);
  outline: none;
  transform: translate(-50%, -50%);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.drop-line-label-input:focus {
  border-color: #feca57;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.6), 0 0 12px rgba(254, 202, 87, 0.5);
}

/* ========================================================
   [캔버스 자유 수식 텍스트 라벨 (함수 이름표 & 축 이름표)]
   ======================================================== */

.canvas-container.text-tool-active {
  cursor: text !important;
}

.canvas-text-input {
  position: absolute;
  z-index: 160;
  display: none;
  min-width: 80px;
  max-width: 480px;
  padding: 4px 10px;
  background: rgba(15, 23, 42, 0.95);
  border: 1.5px solid #a29bfe;
  border-radius: 6px;
  color: #ffffff;
  font-family: 'STIX Two Text', 'Times New Roman', 'Cambria Math', serif;
  font-size: 20px;
  font-style: italic;
  font-weight: 500;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6), 0 0 12px rgba(162, 155, 254, 0.45);
  outline: none;
  transform: translate(0, -50%);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.canvas-text-input:focus {
  border-color: #00d2d3;
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.7), 0 0 14px rgba(0, 210, 211, 0.55);
}

/* =====================================================================
   [화이트 / 라이트 테마 전용 UI 스타일 정돈]
   - 시커멓게 번지던 32px 먹물 블러 그림자를 100% 제거
   - 애플/피그마 스타일의 1px 정갈한 헤어라인 경계선으로 전환
   ===================================================================== */
body.theme-light header {
  background: rgba(255, 255, 255, 0.95);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.03);
}

body.theme-light .btn-secondary {
  background: rgba(0, 0, 0, 0.04);
  color: #1e293b;
  border-color: rgba(0, 0, 0, 0.12);
}

body.theme-light .btn-secondary:hover {
  background: rgba(0, 0, 0, 0.08);
  color: #0f172a;
  border-color: rgba(0, 0, 0, 0.20);
}

body.theme-light .rail-drawer {
  background: rgba(255, 255, 255, 0.98);
  border-right: 1px solid rgba(0, 0, 0, 0.10);
  box-shadow: 3px 0 14px rgba(0, 0, 0, 0.05);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  color: #1e293b;
}

body.theme-light .drawer-header {
  background: rgba(248, 250, 252, 0.95);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

body.theme-light .drawer-title {
  color: #0f172a;
}

body.theme-light .btn-drawer-close {
  color: #64748b;
}

body.theme-light .btn-drawer-close:hover {
  background: rgba(0, 0, 0, 0.06);
  color: #0f172a;
}

body.theme-light .drawer-persistent-layers {
  background: rgba(248, 250, 252, 0.85);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

body.theme-light .layer-item {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(0, 0, 0, 0.10);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

body.theme-light .layer-title {
  color: #0f172a;
}

body.theme-light .cat-tab-btn {
  color: #64748b;
}

body.theme-light .cat-tab-btn.active {
  color: #0f172a;
  border-bottom-color: #00cec9;
}

body.theme-light .func-btn {
  background: rgba(248, 250, 252, 0.95);
  border: 1px solid rgba(0, 0, 0, 0.10);
  color: #1e293b;
}

body.theme-light .func-btn:hover {
  background: #ffffff;
  border-color: #00cec9;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

body.theme-light .func-btn.active {
  background: #f0fdfa;
  border-color: #00cec9;
}

body.theme-light .func-name-text {
  color: #1e293b;
}

body.theme-light .canvas-quick-toolbar .quick-fab-btn {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(0, 0, 0, 0.12);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.07);
  color: #0f172a;
}

body.theme-light .canvas-quick-toolbar .quick-fab-btn.is-hovered {
  background: #ffffff;
  border-color: #00cec9;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
}

body.theme-light .board-mode-bar {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(0, 0, 0, 0.14);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  color: #0f172a;
}

body.theme-light .board-bar-title {
  color: #0f172a;
}

body.theme-light .board-ratio-selector {
  background: rgba(0, 0, 0, 0.06);
}

body.theme-light .board-ratio-btn {
  color: #64748b;
}

body.theme-light .board-ratio-btn.active {
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

body.theme-light .board-bar-tip {
  color: #64748b;
}

body.theme-light .btn-exit-board {
  background: rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.12);
  color: #475569;
}

body.theme-light .btn-exit-board:hover {
  background: rgba(0, 0, 0, 0.10);
  color: #0f172a;
}

/* =====================================================================
   ✍️ [실시간 무한 칠판 필기 플로팅 툴바 (Ink Floating Dock)]
   - 굿노트/프로크리에이트 스타일 초슬림 글래스모피즘 독
   ===================================================================== */
.ink-floating-toolbar {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(18, 26, 36, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.48), 0 2px 8px rgba(0, 0, 0, 0.22);
  z-index: 120;
  user-select: none;
  animation: inkDockSlideUp 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes inkDockSlideUp {
  from {
    opacity: 0;
    transform: translate(-50%, 16px) scale(0.96);
  }

  to {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
  }
}

.ink-dock-drag-handle {
  cursor: grab;
  color: #64748b;
  font-size: 14px;
  letter-spacing: -2px;
  padding: 0 3px;
  opacity: 0.65;
  transition: opacity 0.15s;
}

.ink-dock-drag-handle:hover {
  opacity: 1;
  color: #94a3b8;
}

.ink-tool-group,
.ink-color-group,
.ink-size-group {
  display: flex;
  align-items: center;
  gap: 4px;
}

.ink-divider {
  width: 1px;
  height: 20px;
  background: rgba(255, 255, 255, 0.14);
  margin: 0 2px;
}

.ink-tool-btn {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s cubic-bezier(0.22, 1, 0.36, 1);
  font-size: 15px;
}

.ink-tool-btn.ink-zoom-val {
  width: auto !important;
  min-width: 44px;
  padding: 0 6px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
}

.ink-tool-btn.ink-zoom-val:hover {
  border-color: #00d2d3;
  color: #00d2d3;
}

.ink-zoom-group {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* 🔍 펜 툴바 일체형 큼직한 퀵 줌 버튼 [− | +] */
.ink-zoom-step-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.95);
  font-size: 19px;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
  transition: all 0.14s ease;
  touch-action: manipulation;
}

.ink-zoom-step-btn:hover {
  background: rgba(0, 210, 211, 0.22);
  border-color: #00d2d3;
  color: #00d2d3;
  transform: translateY(-1px);
}

.ink-zoom-step-btn:active {
  background: rgba(0, 210, 211, 0.38);
  transform: scale(0.92);
}

body.theme-light .ink-zoom-step-btn {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.16);
  color: #1e293b;
}

body.theme-light .ink-zoom-step-btn:hover {
  background: rgba(0, 210, 211, 0.15);
  border-color: #00b4b5;
  color: #008b8c;
}

.ink-tool-btn:hover {
  background: rgba(255, 255, 255, 0.10);
  color: #ffffff;
  transform: translateY(-1px);
}

.ink-tool-btn.active {
  background: rgba(0, 210, 211, 0.22);
  border-color: #00d2d3;
  color: #00d2d3;
  box-shadow: 0 0 12px rgba(0, 210, 211, 0.35);
}

.ink-color-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.25);
  cursor: pointer;
  padding: 0;
  transition: transform 0.14s ease, box-shadow 0.14s ease;
}

.ink-color-dot:hover {
  transform: scale(1.15);
}

.ink-color-dot.active {
  transform: scale(1.22);
  border-color: #ffffff;
  box-shadow: 0 0 0 2px #00d2d3, 0 0 10px rgba(0, 210, 211, 0.6);
}

body.theme-light .ink-color-dot {
  border: 2px solid rgba(0, 0, 0, 0.12);
}

body.theme-light .ink-color-dot.active {
  border-color: #ffffff;
  box-shadow: 0 0 0 2.5px #2563eb, 0 2px 8px rgba(37, 99, 235, 0.35);
}

.ink-size-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid transparent;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.14s ease;
}

.ink-size-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

.ink-size-btn.active {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.4);
}

.ink-size-circle {
  border-radius: 50%;
  background: #cbd5e1;
  display: block;
}

.ink-size-btn.active .ink-size-circle {
  background: #00d2d3;
}

.ink-close-btn:hover {
  background: rgba(255, 107, 107, 0.2) !important;
  color: #ff6b6b !important;
}

/* 🌟 [캔버스 펜/지우개/올가미 커서 상태] 🌟 */
/* 브라우저 OS의 crosshair 점멸 및 렉 완벽 차단: cursor: none 적용 */
canvas.ink-cursor-pen,
canvas.ink-cursor-highlighter,
canvas.ink-cursor-eraser {
  cursor: none !important;
}

canvas.ink-cursor-lasso {
  cursor: crosshair !important;
}

canvas.ink-cursor-lasso.is-hover-selection {
  cursor: move !important;
}

canvas.ink-cursor-grab {
  cursor: grab !important;
}

canvas.ink-cursor-grabbing {
  cursor: grabbing !important;
}

body.space-pan-ready,
body.space-pan-ready * {
  cursor: grab !important;
}

body.space-pan-dragging,
body.space-pan-dragging * {
  cursor: grabbing !important;
}

/* 🌟 [필기 모드 상시 가상 연필 & 지우개 인디케이터] 🌟 */
.virtual-stylus-pen {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 15;
  /* 메뉴 및 플로팅 툴바(z-index: 20~150)보다 낮춰 UI 겹침 원천 차단 */
  will-change: transform;
  transform: translate3d(-100px, -100px, 0);
  transform-origin: 0 0;
  /* 번쩍임 없이 단정하고 은은한 음영만 유지 (정신사나운 발광 필터 제거) */
  filter: drop-shadow(1px 2px 3px rgba(0, 0, 0, 0.35));
  user-select: none;
  -webkit-user-select: none;
  overflow: visible;
}

/* 실제 연필로 칠판에 글씨를 쓸 때(터치/다운) 종이를 살짝 누르는 감촉 피드백 (번쩍임 없음) */
.virtual-stylus-pen.drawing {
  filter: drop-shadow(1px 1px 2px rgba(0, 0, 0, 0.5));
}

.virtual-stylus-pen .stylus-svg {
  display: block;
  overflow: visible;
}

/* 라이트 테마 전용 인크 툴바 스타일 */
body.theme-light .ink-floating-toolbar {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(0, 0, 0, 0.12);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.14);
}

body.theme-light .ink-divider {
  background: rgba(0, 0, 0, 0.10);
}

body.theme-light .ink-tool-btn {
  color: #475569;
}

body.theme-light .ink-tool-btn:hover {
  background: rgba(0, 0, 0, 0.06);
  color: #0f172a;
}

body.theme-light .ink-tool-btn.active {
  background: #f0fdfa;
  border-color: #00cec9;
  color: #008b8b;
  box-shadow: 0 0 10px rgba(0, 206, 201, 0.3);
}

body.theme-light .ink-size-circle {
  background: #64748b;
}

body.theme-light .ink-size-btn.active .ink-size-circle {
  background: #008b8b;
}

/* ==========================================================================
   [📑 닥줌(DocZoom)형 PDF 교재 뷰어 & 2단 문제 박스 크롭 엔진 스타일]
   ========================================================================== */

/* 상단 헤더 PDF 크롭 버튼 하이라이트 */
.btn-pdf-highlight {
  background: linear-gradient(135deg, rgba(0, 210, 211, 0.18), rgba(9, 132, 227, 0.22)) !important;
  border: 1px solid rgba(0, 210, 211, 0.45) !important;
  color: #00cec9 !important;
  font-weight: 600;
  box-shadow: 0 0 12px rgba(0, 206, 201, 0.18);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-pdf-highlight:hover {
  background: linear-gradient(135deg, rgba(0, 210, 211, 0.28), rgba(9, 132, 227, 0.35)) !important;
  border-color: #00d2d3 !important;
  color: #ffffff !important;
  box-shadow: 0 0 18px rgba(0, 210, 211, 0.35);
  transform: translateY(-1px);
}

/* PDF 풀스크린 모달 백드롭 (블러 제거 & 100% 불투명 단색 배경으로 뒷창 GPU 합성 부하 0% 차단) */
.pdf-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: #090d16;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  display: flex;
  align-items: center;
  justify-content: center;
  overscroll-behavior: none !important;
  overscroll-behavior-x: none !important;
  overscroll-behavior-y: none !important;
}

/* PDF 뷰어가 열려 있는 동안 뒷창 4K 칠판·필기 캔버스·위젯·툴바의 GPU 페인팅/합성을 100% 일시정지 */
body.pdf-modal-open .main-workspace,
body.pdf-modal-open #quickPillRemote,
body.pdf-modal-open #inkFloatingToolbar,
body.pdf-modal-open #rightActionToolbar,
body.pdf-modal-open #lessonPlaylistNavBar,
body.pdf-modal-open #graphSnapFloatingBar,
body.pdf-modal-open #curveContextBar,
body.pdf-modal-open #lassoActionFloatingBar {
  visibility: hidden !important;
  pointer-events: none !important;
}

/* PDF 모달 컨테이너 - 광활한 전체화면급 뷰포트 */
.pdf-modal-container {
  width: 98vw;
  height: 96vh;
  max-width: none;
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  overscroll-behavior: none !important;
  overscroll-behavior-x: none !important;
  overscroll-behavior-y: none !important;
}

/* PDF 상단 컨트롤 툴바 */
.pdf-modal-header {
  height: 56px;
  padding: 0 14px;
  background: #1e293b;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  gap: 10px;
  overflow-x: auto;
  scrollbar-width: none;
}

.pdf-modal-header::-webkit-scrollbar {
  display: none;
}

.pdf-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 0 1 auto;
}

.pdf-file-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.pdf-file-title {
  font-size: 13.5px;
  font-weight: 600;
  color: #f1f5f9;
  max-width: 180px;
  min-width: 48px;
  flex: 0 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}


.pdf-header-btn-subtle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 30px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 600;
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  white-space: nowrap;
  flex-shrink: 0;
}

.pdf-header-btn-subtle:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.32);
  color: #ffffff;
}

.pdf-header-btn-subtle:active {
  transform: scale(0.97);
}

.pdf-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 12px;
  background: rgba(0, 210, 211, 0.15);
  border: 1px solid rgba(0, 210, 211, 0.35);
  color: #00d2d3;
}

/* 중앙 페이지 이동 & 줌 컨트롤 */
.pdf-header-center {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.pdf-nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  padding: 0 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  color: #e2e8f0;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.pdf-nav-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

.pdf-nav-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pdf-page-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 6px;
}

.pdf-page-input {
  width: 44px;
  height: 30px;
  background: #090d16;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  color: #00d2d3;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
}

.pdf-page-input:focus {
  border-color: #00d2d3;
  outline: none;
}

.pdf-page-slash {
  color: #64748b;
  font-size: 13px;
}

.pdf-total-pages {
  color: #94a3b8;
  font-size: 13px;
  font-weight: 500;
  min-width: 24px;
}

.pdf-divider {
  width: 1px;
  height: 18px;
  background: rgba(255, 255, 255, 0.15);
  margin: 0 4px;
}

.pdf-tool-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 30px;
  min-width: 30px;
  padding: 0 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  color: #cbd5e1;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

.pdf-tool-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.pdf-zoom-label {
  font-size: 12px;
  font-weight: 600;
  color: #94a3b8;
  min-width: 42px;
  text-align: center;
  white-space: nowrap;
  flex-shrink: 0;
}

/* 우측 닥줌 크롭 토글 버튼 */
.pdf-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.pdf-crop-toggle-btn {
  height: 34px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  color: #f1f5f9;
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
  flex-shrink: 0;
}

.pdf-crop-toggle-btn:hover {
  background: rgba(0, 210, 211, 0.15);
  border-color: rgba(0, 210, 211, 0.4);
  color: #00d2d3;
}

.pdf-crop-toggle-btn.active {
  background: #2563eb !important;
  border-color: #60a5fa !important;
  color: #ffffff !important;
  box-shadow: 0 0 16px rgba(37, 99, 235, 0.5) !important;
  animation: none !important;
}

@keyframes pulseCropBtn {
  from {
    box-shadow: 0 0 12px rgba(0, 206, 201, 0.4);
  }

  to {
    box-shadow: 0 0 22px rgba(0, 206, 201, 0.8);
  }
}

/* PDF 세로 연속 스크롤 뷰포트 (즉각적이고 시원시원한 네이티브 스크롤) */
.pdf-viewport {
  flex: 1;
  overflow-y: auto;
  overflow-x: auto;
  position: relative;
  background: #090d16;
  scroll-behavior: auto !important;
  cursor: default;
  touch-action: pan-x pan-y;
  overscroll-behavior: none !important;
  overscroll-behavior-x: none !important;
  overscroll-behavior-y: none !important;
}

.pdf-viewport.crop-mode {
  cursor: crosshair !important;
  user-select: none !important;
  -webkit-user-select: none !important;
  touch-action: none !important;
}

/* 페이지들이 세로로 차례대로 나열되는 컨테이너 (배율 확대 시 좌측 잘림 0% 보장) */
.pdf-pages-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: max-content;
  min-width: 100%;
  box-sizing: border-box;
  margin: 0 auto;
  gap: 28px;
  padding: 24px 28px 60px 28px;
  user-select: none !important;
  -webkit-user-select: none !important;
  overscroll-behavior: none !important;
}

/* 개별 페이지 래퍼 */
.pdf-page-wrapper {
  position: relative;
  display: block;
  flex-shrink: 0;
  margin: 0 auto;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.42);
  border-radius: 4px;
  background: #ffffff;
  user-select: none !important;
  -webkit-user-select: none !important;
  -webkit-user-drag: none !important;
}

.pdf-page-number-tag {
  position: absolute;
  top: -14px;
  left: 16px;
  background: #0f172a;
  color: #00d2d3;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid rgba(0, 210, 211, 0.4);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  z-index: 5;
  pointer-events: none !important;
  user-select: none !important;
}

.pdf-page-canvas {
  display: block;
  background: #ffffff;
  border-radius: 4px;
  user-select: none !important;
  -webkit-user-select: none !important;
  -webkit-user-drag: none !important;
}

/* 크롭 박스 (네온 민트 점선 — 독립 최상단 GPU 오버레이) */
.pdf-crop-box {
  position: fixed;
  left: 0;
  top: 0;
  will-change: transform, width, height;
  border: 2px dashed #00d2d3;
  background: rgba(0, 210, 211, 0.22);
  pointer-events: none !important;
  z-index: 99999;
  box-sizing: border-box;
  user-select: none !important;
}

.crop-handle {
  position: absolute;
  width: 8px;
  height: 8px;
  background: #00d2d3;
  border: 1.5px solid #ffffff;
  border-radius: 2px;
  pointer-events: none !important;
  user-select: none !important;
}

.handle-tl {
  top: -5px;
  left: -5px;
}

.handle-tr {
  top: -5px;
  right: -5px;
}

.handle-bl {
  bottom: -5px;
  left: -5px;
}

.handle-br {
  bottom: -5px;
  right: -5px;
}



/* PDF 모달 하단 액션 바 */
.pdf-modal-footer {
  height: 52px;
  padding: 0 20px;
  background: #1e293b;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.pdf-status-hint {
  font-size: 13px;
  color: #94a3b8;
}

.pdf-status-hint b {
  color: #00d2d3;
}

.pdf-footer-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ==========================================================================
   [📌 크롭된 문제 고정 카드 위젯 (Problem Card Widget - 전용 독립 캔버스 & 우측 하단 컨트롤 바)]
   - 문제 카드 내부에 전용 투명 <canvas id="problemCardCanvas">가 내장되어,
     메인 칠판 휠 스크롤/줌과 100% 독립적으로 문제 위에만 밑줄·동그라미·형광펜 필기!
   - 전자칠판 강사의 팔 높이를 배려해 컨트롤러 바를 문제 카드 [우측 하단]에 도킹!
   ========================================================================== */

.problem-card-widget {
  position: absolute;
  top: 18px;
  left: 72px;
  width: 520px;
  min-width: 280px;
  max-width: none;
  z-index: 150;
  background: transparent !important;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  user-select: none;
  pointer-events: none !important;
}

.graph-card-widget,
.extra-graph-card-widget {
  min-width: 170px !important;
}

/* 🌟 [대표님 지시: 두꺼운 선/음영 싹 걷어내고 깔끔하고 미니멀한 단일 카드 디자인] 🌟 */
.problem-card-body {
  position: relative;
  padding: 0 !important;
  background: transparent !important;
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
  border-radius: 10px !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35) !important;
  pointer-events: auto !important;
  overflow: hidden;
}

.problem-card-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 9px;
  pointer-events: none !important;
  user-select: none !important;
  -webkit-user-drag: none !important;
}

/* 문제 창 전용 독립 캔버스 (문제 이미지 위에 정확히 1:1 포개짐) */
.problem-card-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 5;
  pointer-events: auto;
  touch-action: none !important;
  cursor: crosshair;
}

/* 상단 고정 제자리 블라인드 컨트롤러 바 */
.problem-card-header {
  order: -1;
  align-self: flex-start;
  height: 30px;
  margin-top: 0;
  margin-bottom: 5px;
  padding: 0 7px 0 6px;
  background: rgba(15, 23, 42, 0.90);
  backdrop-filter: blur(12px);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  cursor: grab;
  pointer-events: auto !important;
  z-index: 15;
}

.problem-card-header:active {
  cursor: grabbing;
}

.problem-card-drag-handle {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #e2e8f0;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}

.card-drag-icon {
  color: #00d2d3;
  font-size: 14px;
}

.problem-card-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.card-btn {
  height: 25px;
  padding: 0 7px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 5px;
  color: #e2e8f0;
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  pointer-events: auto !important;
  white-space: nowrap;
}

.card-btn:hover {
  background: rgba(0, 210, 211, 0.2);
  border-color: rgba(0, 210, 211, 0.5);
  color: #ffffff;
}

.btn-card-close:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: rgba(239, 68, 68, 0.5);
  color: #ef4444;
}

/* 최소화(접기) 상태 (레이저가 켜진 상태에서도 접기 시 무조건 몸통/레이저 캔버스 숨김 보장!) */
.problem-card-widget.minimized .problem-card-body,
.problem-card-widget.minimized .card-laser-canvas {
  display: none !important;
  pointer-events: none !important;
}

.problem-card-widget.minimized {
  width: auto !important;
  min-width: 240px;
}

.problem-card-widget.minimized .problem-card-header {
  align-self: flex-start;
  border-radius: 10px;
  border: 1.5px solid rgba(0, 210, 211, 0.45);
}

/* 우하단 리사이즈 핸들 (문제 본문 우하단 모서리) */
.problem-card-resize-handle {
  position: absolute;
  right: 2px;
  bottom: 2px;
  width: 14px;
  height: 14px;
  cursor: nwse-resize;
  background: linear-gradient(135deg, transparent 50%, rgba(148, 163, 184, 0.35) 50%);
  border-radius: 0 0 7px 0;
  pointer-events: auto !important;
  z-index: 20;
  transition: opacity 0.15s ease;
}

.problem-card-body:hover .problem-card-resize-handle {
  background: linear-gradient(135deg, transparent 50%, rgba(148, 163, 184, 0.65) 50%);
}

/* ==========================================================================
   [📁 PDF 드래그 앤 드롭 오버레이]
   ========================================================================== */

.pdf-drop-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(8, 12, 20, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.pdf-drop-card {
  width: 170px;
  height: 170px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2.5px dashed #00d2d3;
  border-radius: 24px;
  background: rgba(15, 23, 42, 0.88);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45), 0 0 32px rgba(0, 210, 211, 0.25);
  animation: dropCardPulse 2s infinite alternate ease-in-out;
}

@keyframes dropCardPulse {
  0% {
    transform: scale(0.96);
    border-color: rgba(0, 210, 211, 0.55);
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.35), 0 0 20px rgba(0, 210, 211, 0.15);
  }

  100% {
    transform: scale(1.04);
    border-color: rgba(0, 210, 211, 0.95);
    box-shadow: 0 20px 56px rgba(0, 0, 0, 0.55), 0 0 40px rgba(0, 210, 211, 0.35);
  }
}

.drop-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #00d2d3;
  animation: dropIconFloat 2s infinite ease-in-out;
}

@keyframes dropIconFloat {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-5px);
  }
}

/* ==========================================================================
   [🎨 테마 동기화: PDF 뷰어 모달 & 교재 문제 크롭 라이트 테마 전용 스타일]
   ========================================================================== */

/* 1. PDF 모달 배경 및 컨테이너 */
body.theme-light .pdf-modal-backdrop {
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(8px);
}

body.theme-light .pdf-modal-container {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.14);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.22);
}

body.theme-light .pdf-modal-header,
body.theme-light .pdf-modal-footer {
  background: #f8fafc;
  border-color: rgba(0, 0, 0, 0.10);
}


body.theme-light .pdf-header-btn-subtle {
  color: #1e293b;
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.15);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

body.theme-light .pdf-header-btn-subtle:hover {
  background: #f1f5f9;
  border-color: #2563eb;
  color: #2563eb;
}

body.theme-light .pdf-file-title {
  color: #1e293b;
  font-weight: 700;
}

body.theme-light .pdf-file-icon {
  color: #2563eb;
}

/* 2. PDF 뷰포트 (종이 흰색과 대비되는 고급 소프트 그레이 배경) */
body.theme-light .pdf-viewport {
  background: #e2e8f0 !important;
}

body.theme-light .pdf-page-wrapper {
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.14);
}

/* 3. PDF 모달 상단/하단 버튼 및 입력 폼 */
body.theme-light .pdf-tool-btn,
body.theme-light .pdf-nav-btn {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.14);
  color: #1e293b;
  font-weight: 600;
}

body.theme-light .pdf-tool-btn:hover,
body.theme-light .pdf-nav-btn:hover:not(:disabled) {
  background: #f1f5f9;
  border-color: #2563eb;
  color: #2563eb;
}

body.theme-light .pdf-zoom-label {
  color: #1e293b;
  font-weight: 700;
}

body.theme-light .pdf-page-indicator {
  color: #1e293b;
}

body.theme-light .pdf-page-input {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.18);
  color: #1e293b;
  font-weight: 700;
}

body.theme-light .pdf-total-pages {
  color: #64748b;
}

/* 4. 자르기(Crop) 모드 토글 버튼 & 크롭 박스 */
body.theme-light .pdf-crop-toggle-btn {
  background: #ffffff;
  border: 1.5px solid rgba(37, 99, 235, 0.35);
  color: #2563eb;
  font-weight: 700;
}

body.theme-light .pdf-crop-toggle-btn:hover {
  background: rgba(37, 99, 235, 0.08);
  border-color: #2563eb;
  color: #1d4ed8;
}

body.theme-light .pdf-crop-toggle-btn.active {
  background: #2563eb !important;
  border-color: #2563eb !important;
  color: #ffffff !important;
  box-shadow: 0 2px 10px rgba(37, 99, 235, 0.35);
}

body.theme-light .pdf-crop-box {
  border: 2px dashed #2563eb !important;
  background: rgba(37, 99, 235, 0.14) !important;
}

body.theme-light .crop-handle {
  background: #2563eb !important;
  border: 1.5px solid #ffffff !important;
}

body.theme-light .btn-modal-close {
  color: #64748b;
}

body.theme-light .btn-modal-close:hover {
  background: rgba(0, 0, 0, 0.06);
  color: #dc2626;
}

body.theme-light .pdf-status-hint {
  color: #475569;
}

/* 5. PDF 드래그앤드롭 오버레이 */
body.theme-light .pdf-drop-overlay {
  background: rgba(241, 245, 249, 0.70) !important;
}

body.theme-light .pdf-drop-card {
  background: rgba(255, 255, 255, 0.92) !important;
  border-color: #2563eb !important;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.12), 0 0 32px rgba(37, 99, 235, 0.2) !important;
}

body.theme-light .drop-icon {
  color: #2563eb !important;
}

/* ==========================================================================
   [🎨 테마 동기화: 칠판 위 문제 카드 위젯 (#problemCardWidget) 라이트 테마 전용 스타일]
   ========================================================================== */

/* 1. 문제 본문 카드 컨테이너: 어두운 칠판용 청록(Cyan) 글로우를 싹 빼고 세련된 화이트 페이퍼 섀도우 적용 */
body.theme-light .problem-card-body {
  background: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.10) !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08) !important;
}

/* 2. 문제 창 하단 도킹 컨트롤러 바: 칠판용 다크 네이비 대신 깔끔한 화이트 글래스모피즘 */
body.theme-light .problem-card-header {
  background: rgba(255, 255, 255, 0.95) !important;
  backdrop-filter: blur(12px) !important;
  border: 1px solid rgba(0, 0, 0, 0.10) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06) !important;
}

body.theme-light .problem-card-widget.minimized .problem-card-header {
  border: 1px solid rgba(0, 0, 0, 0.10) !important;
}

/* 3. 드래그 핸들 텍스트 및 아이콘 */
body.theme-light .problem-card-drag-handle {
  color: #1e293b !important;
  font-weight: 700 !important;
}

body.theme-light .card-drag-icon {
  color: #2563eb !important;
}

/* 4. 카드 컨트롤 액션 버튼군 (차분한 무채색 슬레이트 톤) */
.btn-card-close {
  width: 26px !important;
  height: 25px !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 6px !important;
}

body.theme-light .card-btn {
  background: #f8fafc !important;
  border: 1px solid rgba(15, 23, 42, 0.12) !important;
  color: #475569 !important;
  font-weight: 600 !important;
}

body.theme-light .card-btn:hover {
  background: #e2e8f0 !important;
  border-color: rgba(15, 23, 42, 0.24) !important;
  color: #0f172a !important;
}

/* 다시 자르기 버튼 (로열 블루 하이라이트) */
body.theme-light #btnProblemCardReCrop {
  background: rgba(37, 99, 235, 0.08) !important;
  border: 1px solid rgba(37, 99, 235, 0.28) !important;
  color: #2563eb !important;
}

body.theme-light #btnProblemCardReCrop:hover {
  background: rgba(37, 99, 235, 0.16) !important;
  color: #1d4ed8 !important;
}

/* 닫기 버튼 (레드 경고) */
body.theme-light .btn-card-close:hover,
body.theme-light #btnProblemCardClose:hover {
  background: rgba(220, 38, 38, 0.12) !important;
  border-color: #dc2626 !important;
  color: #dc2626 !important;
}

/* 5. 우하단 리사이즈 핸들 */
body.theme-light .problem-card-resize-handle {
  background: linear-gradient(135deg, transparent 50%, rgba(37, 99, 235, 0.45) 50%) !important;
}


/* ==========================================================================
   [📱 13인치 액정 타블렛 & 노트북 반응형 뷰포트 최적화]
   화면 너비 1400px 이하 / 높이 800px 이하 환경에서 상단 메뉴 및 판서 공간 극대화
   ========================================================================== */

@media (max-width: 1400px) {
  header {
    padding: 0 8px;
    gap: 4px;
  }

  .logo-title {
    font-size: 13px;
  }

  .badge-tag {
    display: none;
    /* 13인치 좁은 너비에서 배지 숨김으로 여백 확보 */
  }

  .header-actions {
    gap: 4px;
  }

  .btn-primary,
  .btn-secondary {
    padding: 3px 6px;
    font-size: 10.5px;
    gap: 3px;
  }
}

@media (max-width: 1150px) {

  /* 1150px 이하 매우 좁은 환경: 보조 텍스트 숨기고 아이콘 위주 컴팩트 표시 */
  .btn-secondary .btn-text {
    display: none;
  }

  .btn-primary .btn-text {
    font-size: 10.5px;
  }
}

/* 세로 높이가 750px 이하인 13인치 창 모드 환경 */
@media (max-height: 750px) {
  header {
    height: 34px;
  }

  body.header-collapsed header {
    margin-top: -34px;
  }

  .btn-primary,
  .btn-secondary {
    padding: 2px 6px;
    font-size: 10px;
  }
}

/* 좌측 레일 및 우측 툴바 구분선 */
.rail-sep {
  width: 28px;
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
  margin: 4px 0;
  flex-shrink: 0;
}

.quick-sep {
  width: 24px;
  height: 1px;
  background: rgba(255, 255, 255, 0.12);
  margin: 3px auto;
  flex-shrink: 0;
}

/* 원클릭 복사 강조 버튼 */
.quick-fab-copy {
  background: rgba(0, 210, 211, 0.18) !important;
  border-color: rgba(0, 210, 211, 0.65) !important;
  color: var(--accent-cyan) !important;
  box-shadow: 0 0 14px rgba(0, 210, 211, 0.35) !important;
}

.quick-fab-copy:hover {
  background: rgba(0, 210, 211, 0.32) !important;
  border-color: var(--accent-cyan) !important;
  transform: translateY(-1px) scale(1.06) !important;
  box-shadow: 0 0 20px rgba(0, 210, 211, 0.6) !important;
}

/* ==========================================================================
   [🌟 시작 인트로 화면 (안 B): 군더더기 없는 퓨어 화이트 스튜디오 & 2단 시차 페이드인]
   ========================================================================== */
.welcome-splash {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: radial-gradient(circle at 50% 45%, #ffffff 0%, #f1f5f9 100%);
  display: none !important;
  align-items: center;
  justify-content: center;
  transition: opacity 0.22s ease;
  user-select: none;
}

.welcome-splash.whiteout-curtain {
  background: #ffffff !important;
  transition: none !important;
}

.welcome-splash.dismissed {
  opacity: 0;
  pointer-events: none !important;
  transform: none !important;
  transition: opacity 0.22s ease !important;
}

.welcome-splash.dismissed .splash-card {
  display: none !important;
}

.splash-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 780px;
  padding: 40px 30px;
  /* 시각적 중심(Optical Center)에 맞춰 전체 블록을 위쪽으로 끌어올림 */
  margin-bottom: 14vh;
  background: transparent;
  border: none;
  box-shadow: none;
  position: relative;
}

.splash-glow {
  position: absolute;
  top: 34%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 500px;
  height: 280px;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.13) 0%, rgba(14, 165, 233, 0.06) 48%, transparent 72%);
  filter: blur(42px);
  pointer-events: none;
  z-index: -1;
}

/* 1단계: Graphly.net 로고가 먼저 묵직하고 선명하게 등장 */
.splash-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 46px;
  opacity: 0;
  animation: splashLogoIn 0.65s cubic-bezier(0.16, 1, 0.3, 1) 0.05s forwards;
}

@keyframes splashLogoIn {
  0% {
    opacity: 0;
    transform: translateY(6px) scale(0.94);
    filter: blur(6px);
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

.splash-logo {
  font-size: 84px;
  font-weight: 800;
  letter-spacing: -2.4px;
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 55%, #2563eb 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: #0f172a;
  margin: 0;
  /* p, y 하단 꼬리(descender)가 background-clip에 절대 잘리지 않도록 충분한 line-height와 하단 패딩 부여 */
  line-height: 1.26;
  padding: 4px 8px 12px 8px;
}

/* 2단계: 로고 등장 직후(0.38s 뒤) [시작하기] 버튼이 아래에서 스르륵 떠오르며 시선 집중 + 은은한 숨쉬기 광채 */
.btn-splash-start {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 20px 64px;
  font-size: 23px;
  font-weight: 700;
  color: #ffffff;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  border: none;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 12px 32px rgba(37, 99, 235, 0.35), 0 0 0 0 rgba(37, 99, 235, 0.35);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease, background 0.2s ease;
  touch-action: manipulation;
  opacity: 0;
  animation:
    splashBtnFadeIn 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.38s forwards,
    splashBtnPulse 2.4s infinite ease-in-out 1.15s;
}

@keyframes splashBtnFadeIn {
  0% {
    opacity: 0;
    transform: translateY(18px) scale(0.92);
    filter: blur(6px);
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

@keyframes splashBtnPulse {

  0%,
  100% {
    box-shadow: 0 12px 32px rgba(37, 99, 235, 0.34), 0 0 0 0 rgba(37, 99, 235, 0.28);
  }

  50% {
    box-shadow: 0 16px 38px rgba(37, 99, 235, 0.48), 0 0 0 10px rgba(37, 99, 235, 0);
  }
}

.btn-splash-start:hover {
  transform: translateY(-3px) scale(1.03) !important;
  background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
  box-shadow: 0 18px 40px rgba(37, 99, 235, 0.48) !important;
}

.btn-splash-start:active {
  transform: scale(0.97) !important;
}

.btn-start-text {
  letter-spacing: -0.4px;
}

/* 🌟 [대표님 기획]: 우측 플로팅 액션 바 2열 콤팩트 그리드 & 최상단 ✕ 닫기 */
.quick-grid-row {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

.quick-fab-exit.is-hovered {
  background: rgba(255, 71, 87, 0.35) !important;
  border-color: #ff4757 !important;
  color: #ffffff !important;
  transform: scale(1.1) !important;
  box-shadow: 0 6px 20px rgba(255, 71, 87, 0.45) !important;
}

.canvas-quick-toolbar {
  position: absolute;
  top: 14px;
  right: 14px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  z-index: 170;
  max-height: calc(100vh - 28px);
  overflow: visible !important;
  padding: 4px;
  pointer-events: auto;
}

.canvas-quick-toolbar::-webkit-scrollbar {
  width: 4px;
}

.canvas-quick-toolbar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 4px;
}

/* 🌟 [대표님 긴급 해결: 버튼 클릭 시 포커스 링 깜빡임 원천 차단] 🌟 */
button:focus,
button:focus-visible,
.rail-btn:focus,
.transform-btn:focus,
.quick-fab-btn:focus,
.ink-tool-btn:focus,
.rail-zoom-action-btn:focus {
  outline: none !important;
}

/* 🌟 [대표님 긴급 해결: 모든 아이콘 및 버튼 터치/클릭 100% 즉각 반응 보장] 🌟 */
button,
.rail-btn,
.quick-fab-btn,
.transform-btn,
.ink-tool-btn,
.rail-zoom-action-btn,
.canvas-quick-toolbar,
.sidebar-rail,
.curve-context-bar {
  pointer-events: auto !important;
  touch-action: none !important;
  cursor: pointer;
}

.drawer-panel,
.rail-drawer,
.drawer-subpanels-container,
.graph-layer-list {
  pointer-events: auto !important;
  touch-action: pan-y !important;
}

/* 🌟 [스타일러스 펜 미세 미끄러짐 & 자식 아이콘 타겟 분리로 인한 클릭 씹힘 원천 차단] 🌟
   버튼 내부의 svg, path, span 등이 pointerdown/pointerup 타겟을 갈라놓지 않도록 버튼 본체로 단일화 */
button>svg,
button>span,
button>i,
.rail-btn>*,
.quick-fab-btn>*,
.ink-tool-btn>*,
.card-btn>*,
.func-btn>*,
.btn-trigger-graph-snap>* {
  pointer-events: none !important;
}


/* ==========================================================================
   🔀 세계 최초 N축 합성함수 4-분할 스튜디오 모달 전용 스타일
   ========================================================================== */
.n-axis-studio-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(8, 12, 18, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 9800;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: auto !important;
}

.n-axis-studio-backdrop.show {
  display: flex;
  opacity: 1;
}

.n-axis-studio-card {
  width: min(1160px, 96vw);
  max-height: 94vh;
  background: #002320;
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7);
  border: 1px solid rgba(0, 210, 211, 0.35);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(12px) scale(0.98);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.n-axis-studio-backdrop.show .n-axis-studio-card {
  transform: translateY(0) scale(1);
}

.n-axis-studio-header {
  height: 46px;
  background: rgba(13, 17, 23, 0.96);
  padding: 0 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.n-axis-header-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.n-axis-logo {
  font-size: 18px;
}

.n-axis-title-text {
  font-size: 14px;
  font-weight: 700;
  color: #00d2d3;
}

.n-axis-tag-badge {
  font-size: 10px;
  background: rgba(0, 210, 211, 0.15);
  color: #00d2d3;
  border: 1px solid rgba(0, 210, 211, 0.3);
  padding: 2px 7px;
  border-radius: 10px;
}

.btn-n-axis-close {
  background: transparent;
  border: none;
  color: #ff6b6b;
  font-size: 18px;
  cursor: pointer;
  border-radius: 6px;
  padding: 4px 8px;
  transition: all 0.15s;
}

.btn-n-axis-close:hover {
  background: rgba(255, 107, 107, 0.15);
  transform: scale(1.1);
}

.n-axis-studio-body {
  position: relative;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #002320;
  overflow: hidden;
}

#nAxisStudioCanvas {
  display: block;
  width: 1140px;
  height: 680px;
  max-width: 100%;
  object-fit: contain;
  cursor: crosshair;
}

.n-axis-control-quadrant {
  position: absolute;
  right: 16px;
  bottom: 16px;
  width: 520px;
  height: 310px;
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.45);
  z-index: 10;
  pointer-events: auto !important;
}

.n-axis-tab-header {
  display: flex;
  gap: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 6px;
  margin-bottom: 8px;
}

.n-axis-tab-btn {
  background: transparent;
  border: none;
  color: #a4b0be;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
}

.n-axis-tab-btn:hover {
  color: #f1f2f6;
  background: rgba(255, 255, 255, 0.05);
}

.n-axis-tab-btn.active {
  color: #00d2d3;
  background: rgba(0, 210, 211, 0.15);
  border: 1px solid rgba(0, 210, 211, 0.3);
}

.n-axis-tab-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.n-axis-input-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: rgba(0, 0, 0, 0.25);
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.n-axis-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.n-axis-input-row label {
  width: 75px;
  font-weight: 700;
  font-family: monospace;
}

.n-axis-math-input {
  flex: 1;
  background: #1e272e;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  padding: 5px 10px;
  color: #fff;
  font-family: monospace;
  font-size: 13px;
  outline: none;
  user-select: text !important;
  -webkit-user-select: text !important;
}

.n-axis-math-input:focus {
  border-color: #00d2d3;
  box-shadow: 0 0 8px rgba(0, 210, 211, 0.3);
}

.n-axis-quick-chips {
  display: flex;
  gap: 4px;
  margin-top: 2px;
}

.n-axis-chip {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  font-size: 10px;
  padding: 2px 6px;
  cursor: pointer;
  color: #a4b0be;
  transition: all 0.15s;
}

.n-axis-chip:hover {
  color: #00d2d3;
  border-color: #00d2d3;
  background: rgba(0, 210, 211, 0.1);
}

.n-axis-slider-box {
  background: rgba(0, 0, 0, 0.3);
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.n-axis-slider-header {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #54a0ff;
  font-weight: 600;
  margin-bottom: 3px;
}

.n-axis-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
}

.n-axis-stat-card {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  padding: 4px 8px;
  border-left: 3px solid #00cec9;
}

.n-axis-stat-label {
  font-size: 9px;
  color: #a4b0be;
}

.n-axis-stat-val {
  font-size: 12px;
  font-weight: 700;
  font-family: monospace;
  margin-top: 1px;
}

.n-axis-footer-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.n-axis-btn-action {
  background: #00d2d3;
  color: #0f172a;
  border: none;
  border-radius: 6px;
  font-weight: 700;
  padding: 6px 12px;
  font-size: 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s;
}

.n-axis-btn-action:hover {
  background: #00cec9;
}

.n-axis-btn-outline {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #f1f2f6;
  border-radius: 6px;
  font-size: 11px;
  padding: 6px 10px;
  cursor: pointer;
  transition: all 0.15s;
}

.n-axis-btn-outline:hover {
  border-color: #feca57;
  color: #feca57;
  background: rgba(254, 202, 87, 0.08);
}

.n-axis-speed-group {
  display: flex;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 6px;
  padding: 2px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.n-axis-speed-btn {
  background: transparent;
  border: none;
  color: #a4b0be;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
}

.n-axis-speed-btn.active {
  background: #00d2d3;
  color: #0f172a;
}

.n-axis-speed-btn:hover:not(.active) {
  color: #fff;
}

.n-axis-preset-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.n-axis-preset-item {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 6px 10px;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s;
  color: #f1f2f6;
}

.n-axis-preset-item:hover {
  background: rgba(0, 210, 211, 0.12);
  border-color: #00d2d3;
  transform: translateY(-1px);
}

.n-axis-preset-title {
  font-size: 11px;
  font-weight: 700;
  color: #00d2d3;
  margin-bottom: 2px;
}

.n-axis-preset-desc {
  font-size: 10px;
  color: #a4b0be;
}

.n-axis-preset-tip {
  font-size: 11px;
  color: #a4b0be;
  line-height: 1.4;
  background: rgba(255, 255, 255, 0.03);
  padding: 8px;
  border-radius: 6px;
  margin: 6px 0;
}


/* ==========================================================================
   [화이트보드 / 데스모스 스타일 라이트 테마 (theme-light) - 대표님 기획 하이엔드 UI]
   ========================================================================== */

/* 1. 좌측 플로팅 독 & 원형 아이콘 버튼 */
body.theme-light .rail-dock {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

body.theme-light .rail-btn {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(0, 0, 0, 0.12);
  color: #1e293b;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

body.theme-light .rail-btn.is-hovered {
  background: #ffffff;
  border-color: #00cec9;
  color: #00cec9;
  box-shadow: 0 6px 18px rgba(0, 206, 201, 0.22);
  transform: scale(1.08);
}

body.theme-light .rail-sep,
body.theme-light .quick-sep {
  background: rgba(0, 0, 0, 0.10);
}

body.theme-light .rail-zoom-dock {
  background: transparent;
}

body.theme-light .rail-zoom-action-btn {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(0, 0, 0, 0.12);
  color: #1e293b;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

body.theme-light .rail-zoom-action-btn.is-hovered {
  background: #ffffff;
  border-color: #00cec9;
  color: #00cec9;
  box-shadow: 0 6px 18px rgba(0, 206, 201, 0.22);
  transform: scale(1.08);
}

/* 2. 우측 1열 플로팅 독 & 원형 아이콘 버튼 */
body.theme-light .canvas-quick-toolbar .quick-fab-btn {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(0, 0, 0, 0.12);
  color: #1e293b;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

body.theme-light .canvas-quick-toolbar .quick-fab-btn.is-hovered {
  background: #ffffff;
  border-color: #00cec9;
  color: #00cec9;
  box-shadow: 0 6px 18px rgba(0, 206, 201, 0.22);
  transform: scale(1.08);
}

body.theme-light #btnQuickNewCanvas.is-hovered {
  background: #fff1f2;
  border-color: #e11d48;
  color: #e11d48;
  box-shadow: 0 6px 18px rgba(225, 29, 72, 0.22);
}

body.theme-light .quick-fab-copy {
  background: rgba(0, 206, 201, 0.12) !important;
  border-color: rgba(0, 206, 201, 0.5) !important;
  color: #009688 !important;
}

body.theme-light .quick-fab-exit.is-hovered {
  background: rgba(255, 71, 87, 0.22) !important;
  border-color: #e11d48 !important;
  color: #e11d48 !important;
  box-shadow: 0 6px 18px rgba(225, 29, 72, 0.25) !important;
  transform: scale(1.08);
}

body.theme-light .quick-flyout-panel {
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(0, 0, 0, 0.12);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.14);
  color: #1e293b;
}

body.theme-light .flyout-header {
  color: #64748b;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

body.theme-light .theme-chip {
  background: #f8fafc;
  border: 1px solid rgba(0, 0, 0, 0.08);
  color: #1e293b;
}

body.theme-light .theme-chip:hover {
  background: #ffffff;
  border-color: #00cec9;
}

body.theme-light .theme-chip.active {
  background: #f0fdfa;
  border-color: #00cec9;
  color: #00cec9;
}

/* 3. 서랍 (.rail-drawer) 플로팅 글래스 카드 라이트 모드 */
body.theme-light .rail-drawer {
  background: rgba(255, 255, 255, 0.98) !important;
  border: 1px solid rgba(0, 0, 0, 0.12) !important;
  border-radius: 16px !important;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.04) !important;
  color: #1e293b !important;
}

body.theme-light .main-workspace,
body.theme-light .canvas-container {
  background-color: #ffffff !important;
}

/* ==========================================================================
   🌟 [글씨 크기 / 굵기 화살표 스텝 & 드롭다운 플라이아웃 선택기] 🌟
   ========================================================================== */
.ink-size-stepper-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.ink-size-stepper {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 20px;
  padding: 2px 3px;
  gap: 2px;
  transition: all 0.16s ease;
}

.ink-size-stepper:hover {
  border-color: rgba(0, 210, 211, 0.4);
  background: rgba(255, 255, 255, 0.10);
}

.ink-size-stepper-btn {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  padding: 0;
}

.ink-size-stepper-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #00d2d3;
  transform: scale(1.12);
}

.ink-size-stepper-btn:active {
  transform: scale(0.92);
}

.ink-size-picker-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid transparent;
  border-radius: 12px;
  color: #f1f2f6;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.ink-size-picker-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(0, 210, 211, 0.45);
  color: #00d2d3;
}

.ink-size-indicator-dot {
  border-radius: 50%;
  background: #00d2d3;
  display: inline-block;
  transition: all 0.2s ease;
  box-shadow: 0 0 6px rgba(0, 210, 211, 0.4);
}

.ink-size-chevron {
  transition: transform 0.2s cubic-bezier(0.2, 0, 0.2, 1);
  opacity: 0.75;
}

.ink-size-picker-btn.open .ink-size-chevron {
  transform: rotate(180deg);
}

/* 플라이아웃 패널 */
.ink-size-flyout-panel {
  position: absolute;
  bottom: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%);
  width: 256px;
  padding: 12px 14px;
  background: rgba(18, 26, 36, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 16px;
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.52), 0 4px 12px rgba(0, 0, 0, 0.25);
  z-index: 150;
  user-select: none;
  animation: inkFlyoutSlideUp 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes inkFlyoutSlideUp {
  from {
    opacity: 0;
    transform: translate(-50%, 8px) scale(0.95);
  }

  to {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
  }
}

.ink-size-flyout-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.flyout-title {
  font-size: 11.5px;
  font-weight: 600;
  color: #e2e8f0;
}

.flyout-val-badge {
  background: rgba(0, 210, 211, 0.16);
  color: #00d2d3;
  border: 1px solid rgba(0, 210, 211, 0.4);
  padding: 2px 7px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
}

.ink-size-preview-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  background: rgba(0, 0, 0, 0.28);
  padding: 7px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.ink-size-preview-box {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  flex-shrink: 0;
}

.preview-circle {
  border-radius: 50%;
  background: #ffffff;
  display: block;
  transition: all 0.15s ease;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
}

.ink-size-preset-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.ink-size-chip {
  padding: 5px 0 !important;
  width: 100% !important;
  height: auto !important;
  border-radius: 8px !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  background: rgba(255, 255, 255, 0.05) !important;
  color: #cbd5e1 !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  text-align: center !important;
  cursor: pointer !important;
  transition: all 0.14s ease !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.ink-size-chip:hover {
  background: rgba(255, 255, 255, 0.14) !important;
  border-color: rgba(0, 210, 211, 0.45) !important;
  color: #ffffff !important;
  transform: translateY(-1px) !important;
}

.ink-size-chip.active {
  background: rgba(0, 210, 211, 0.22) !important;
  border-color: #00d2d3 !important;
  color: #00d2d3 !important;
  font-weight: 700 !important;
  box-shadow: 0 0 8px rgba(0, 210, 211, 0.35) !important;
}

/* 서랍 미세 화살표 스텝 버튼 */
.btn-step-arrow {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: #cbd5e1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.12s ease;
  padding: 0;
}

.btn-step-arrow:hover {
  background: rgba(0, 210, 211, 0.18);
  border-color: #00d2d3;
  color: #00d2d3;
  transform: scale(1.08);
}

.btn-step-arrow:active {
  transform: scale(0.92);
}

/* 화이트 테마 전용 스타일 (Light Mode) */
body.theme-light .ink-size-stepper {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.12);
}

body.theme-light .ink-size-stepper:hover {
  border-color: rgba(9, 132, 227, 0.4);
  background: rgba(0, 0, 0, 0.06);
}

body.theme-light .ink-size-stepper-btn {
  color: #475569;
}

body.theme-light .ink-size-stepper-btn:hover {
  background: rgba(9, 132, 227, 0.12);
  color: #0984e3;
}

body.theme-light .ink-size-picker-btn {
  background: #f1f5f9;
  color: #1e293b;
}

body.theme-light .ink-size-picker-btn:hover {
  background: #e2e8f0;
  color: #0984e3;
  border-color: rgba(9, 132, 227, 0.35);
}

body.theme-light .ink-size-flyout-panel {
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(0, 0, 0, 0.12);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.14), 0 4px 12px rgba(0, 0, 0, 0.06);
  color: #1e293b;
}

body.theme-light .flyout-title {
  color: #1e293b;
}

body.theme-light .flyout-val-badge {
  background: rgba(9, 132, 227, 0.10);
  color: #0984e3;
  border-color: rgba(9, 132, 227, 0.3);
}

body.theme-light .ink-size-preview-row {
  background: #f8fafc;
  border-color: rgba(0, 0, 0, 0.08);
}

body.theme-light .ink-size-preview-box {
  background: #ffffff;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.06);
}

body.theme-light .ink-size-chip {
  background: #f1f5f9 !important;
  border-color: rgba(0, 0, 0, 0.10) !important;
  color: #475569 !important;
}

body.theme-light .ink-size-chip:hover {
  background: #e2e8f0 !important;
  color: #0984e3 !important;
  border-color: rgba(9, 132, 227, 0.35) !important;
}

body.theme-light .ink-size-chip.active {
  background: rgba(9, 132, 227, 0.14) !important;
  border-color: #0984e3 !important;
  color: #0984e3 !important;
  box-shadow: 0 0 8px rgba(9, 132, 227, 0.25) !important;
}

body.theme-light .btn-step-arrow {
  background: #f1f5f9;
  border-color: rgba(0, 0, 0, 0.12);
  color: #475569;
}

body.theme-light .btn-step-arrow:hover {
  background: rgba(9, 132, 227, 0.12);
  border-color: #0984e3;
  color: #0984e3;
}


/* ==========================================================================
   [📸 그래프 스샷 플로팅 트리거 바 & 드래그 캡처 박스 & 그래프 카드 위젯]
   ========================================================================== */
/* 우측 상단 X 버튼(#btnExitFullscreen) 바로 왼쪽 옆에 나란히 배치! (하단 필기바 간섭 0%) */
.graph-snap-floating-bar {
  position: fixed;
  top: 18px;
  right: 62px;
  z-index: 185;
  display: flex;
  align-items: center;
  gap: 6px;
  pointer-events: auto;
}

.btn-return-covered-board {
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0 12px;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: -0.2px;
  color: #f8fafc;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(10px);
  border: 1.5px solid rgba(255, 255, 255, 0.24);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  transition: all 0.16s cubic-bezier(0.22, 1, 0.36, 1);
}

.btn-return-covered-board:hover {
  background: rgba(30, 41, 59, 0.96);
  border-color: #38bdf8;
  color: #38bdf8;
  transform: scale(1.03);
}

body.theme-light .btn-return-covered-board {
  color: #1e293b;
  background: rgba(255, 255, 255, 0.94);
  border: 1.5px solid rgba(15, 23, 42, 0.18);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.10);
}

body.theme-light .btn-return-covered-board:hover {
  background: #f8fafc;
  border-color: #2563eb;
  color: #2563eb;
}

.btn-return-covered-board>* {
  pointer-events: none !important;
}

.btn-trigger-graph-snap {
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.2px;
  color: #ffffff;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  border: 1.5px solid rgba(255, 255, 255, 0.32);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.38), 0 2px 6px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  transition: all 0.16s cubic-bezier(0.22, 1, 0.36, 1);
}

.btn-trigger-graph-snap:hover {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  transform: scale(1.04);
  box-shadow: 0 8px 22px rgba(37, 99, 235, 0.52);
}

.btn-trigger-graph-snap.active {
  background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.35), 0 8px 22px rgba(37, 99, 235, 0.5);
}

/* 🌟 그래프 보관 영역 드래그 시 무조건 십자(+) 포인터 최우선 적용! 🌟 */
canvas.graph-snap-crosshair,
body.graph-snap-crosshair,
body.graph-snap-crosshair #graphCanvas {
  cursor: crosshair !important;
}

.graph-snap-drag-box {
  position: absolute;
  z-index: 210;
  border: 2.2px dashed #2563eb;
  background: rgba(37, 99, 235, 0.08);
  border-radius: 8px;
  pointer-events: none;
  box-shadow: 0 0 0 9999px rgba(15, 23, 42, 0.18);
}

.card-btn-restore {
  width: 26px !important;
  height: 25px !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: rgba(255, 255, 255, 0.06) !important;
  color: #cbd5e1 !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
}

body.theme-light .card-btn-restore {
  background: #f8fafc !important;
  color: #475569 !important;
  border: 1px solid rgba(15, 23, 42, 0.12) !important;
}

body.theme-light .card-btn-restore:hover {
  background: #e2e8f0 !important;
  color: #0f172a !important;
  border-color: rgba(15, 23, 42, 0.24) !important;
}


/* 🌟 [그래프 보관 카드 & 문제 카드 이동/리사이즈/하단메뉴 클릭 중 상단 전체화면 종료 X 배지 출현 100% 원천 차단] 🌟 */
.problem-card-widget,
.problem-card-widget *,
.graph-card-widget,
.graph-card-widget *,
.problem-card-header,
.problem-card-actions,
.card-btn,
.problem-card-drag-handle,
.problem-card-resize-handle,
.problem-card-body,
.problem-card-canvas,
.ink-floating-toolbar,
.ink-dock-drag-handle,
.curve-context-bar,
.ctx-btn,
.pw-popover-item {
  touch-action: none !important;
  -webkit-touch-callout: none !important;
  -webkit-user-select: none !important;
  user-select: none !important;
  -webkit-user-drag: none !important;
}


/* 🌟 [대표님 킬러 기획: 카드 기본 상태는 몸통 잡고 슥 이동(pointer-events: none) + 상단 [✒️] 토글 ON 시 카드 위 밑줄·필기·지우개 허용!] 🌟 */
#btnProblemCardClearInk,
#btnGraphCardClearInk {
  display: none !important;
  pointer-events: none !important;
}

.problem-card-canvas,
#problemCardCanvas,
#graphCardCanvas {
  display: block !important;
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  z-index: 5 !important;
  pointer-events: none !important;
  touch-action: none !important;
}

body:not(.ink-laser-tool-active):not(.ink-sticker-tool-active) .problem-card-widget.card-ink-active:not(.minimized) .problem-card-canvas,
body:not(.ink-laser-tool-active):not(.ink-sticker-tool-active) #problemCardWidget.card-ink-active:not(.minimized) #problemCardCanvas,
body:not(.ink-laser-tool-active):not(.ink-sticker-tool-active) #graphCardWidget.card-ink-active:not(.minimized) #graphCardCanvas {
  pointer-events: auto !important;
  cursor: none !important;
}

body:not(.ink-laser-tool-active):not(.ink-sticker-tool-active) .problem-card-widget.card-ink-active:not(.minimized) .problem-card-body,
body:not(.ink-laser-tool-active):not(.ink-sticker-tool-active) .problem-card-widget.card-ink-active:not(.minimized) .problem-card-img {
  cursor: none !important;
}

.problem-card-body,
.problem-card-img,
.problem-card-header,
.problem-card-drag-handle {
  cursor: grab !important;
}

.problem-card-widget.is-dragging-card,
.problem-card-widget.is-dragging-card .problem-card-body,
.problem-card-widget.is-dragging-card .problem-card-img,
.problem-card-widget.is-dragging-card .problem-card-header,
.problem-card-widget.is-dragging-card .problem-card-drag-handle {
  cursor: grabbing !important;
}


/* 🌟 이동 탭 아이콘(✥) 제거 & 상단 제목+접기(▾/▸) 통합 배지 스타일링 🌟 */
.card-drag-icon {
  display: none !important;
}

.problem-card-widget.minimized .problem-card-header {
  margin-bottom: 0 !important;
}

.card-title-fold-btn {
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  height: 24px !important;
  padding: 0 8px !important;
  border-radius: 6px !important;
  background: rgba(255, 255, 255, 0.06) !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  color: #f1f5f9 !important;
  font-weight: 700 !important;
  font-size: 12px !important;
  cursor: pointer !important;
  transition: all 0.14s ease !important;
}

.card-title-fold-btn:hover {
  background: rgba(0, 210, 211, 0.18) !important;
  border-color: rgba(0, 210, 211, 0.45) !important;
  color: #ffffff !important;
}

.card-fold-chevron {
  display: inline-block;
  font-size: 12px;
  line-height: 1;
  color: #00d2d3;
  font-weight: 800;
}

body.theme-light .card-title-fold-btn {
  background: rgba(37, 99, 235, 0.07) !important;
  border: 1px solid rgba(37, 99, 235, 0.22) !important;
  color: #1e293b !important;
}

body.theme-light .card-title-fold-btn:hover {
  background: rgba(37, 99, 235, 0.15) !important;
  border-color: rgba(37, 99, 235, 0.45) !important;
  color: #1d4ed8 !important;
}

body.theme-light .card-fold-chevron {
  color: #2563eb;
}

.graph-card-widget .card-title-text {
  font-weight: 800 !important;
  font-size: 12.5px !important;
  color: inherit !important;
  background: transparent;
  padding: 0;
  border-radius: 0;
  letter-spacing: 0.2px;
}


/* 📤 내보내기 & 공유 플라이아웃 메뉴 스타일 */
.export-flyout-panel {
  width: 195px !important;
  padding: 10px !important;
}

.export-menu-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.export-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: var(--text-main, #f1f2f6);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: left;
}

.export-menu-item:hover {
  background: rgba(0, 210, 211, 0.16);
  border-color: rgba(0, 210, 211, 0.5);
  color: var(--accent-cyan, #00d2d3);
  transform: translateX(-2px);
}

.export-item-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: inherit;
  flex-shrink: 0;
}

.export-item-text {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 1;
}

.export-item-text kbd {
  font-size: 10px;
  font-family: inherit;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

body.theme-light .export-menu-item {
  background: #f8fafc;
  border: 1px solid rgba(0, 0, 0, 0.08);
  color: #1e293b;
}

body.theme-light .export-menu-item:hover {
  background: #f0fdfa;
  border-color: #00cec9;
  color: #009688;
}

body.theme-light .export-item-text kbd {
  background: #e2e8f0;
  color: #475569;
  border: 1px solid #cbd5e1;
}


/* 🌟 다중 문제 카드 (Extra Problem Card) 스타일 */
.extra-problem-card-widget {
  z-index: 155;
}

.extra-problem-card-widget .problem-card-img {
  height: auto !important;
  max-height: 80vh;
}

/* 🔁 구간 분할 주기 반복 컨트롤 라이트/다크 시인성 보강 */
#btnPwStepMinus,
#btnPwStepPlus,
#btnPwStepReset {
  background: rgba(255, 255, 255, 0.1) !important;
  border: 1px solid rgba(255, 255, 255, 0.22) !important;
  color: #f8fafc !important;
}

body.theme-light #btnPwStepMinus,
body.theme-light #btnPwStepPlus,
body.theme-light #btnPwStepReset {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  color: #1e293b !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

body.theme-light #btnPwStepMatch {
  background: rgba(245, 158, 11, 0.14) !important;
  border: 1px solid rgba(217, 119, 6, 0.45) !important;
  color: #b45309 !important;
}



/* 🌟 [구형 내장그래픽(Intel HD Graphics) 0ms 초경량 다이어트: 무거운 실시간 가우시안 유리 블러 제거] 🌟 */
.problem-card-header,
body.theme-light .problem-card-header,
.btn-return-covered-board,
body.theme-light .btn-return-covered-board,
body.theme-light .ink-floating-toolbar,
body.theme-light .curve-context-bar,
.ink-floating-toolbar,
.curve-context-bar,
.is-dragging-card,
.is-dragging-card * {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

.problem-card-header {
  background: rgba(15, 23, 42, 0.96) !important;
}

body.theme-light .problem-card-header {
  background: rgba(255, 255, 255, 0.98) !important;
}


/* 🌟 [N축 합성함수 4-분할 스튜디오: 화이트 테마(theme-light) 완벽 동기화 & 칠판 보관 버튼] 🌟 */
.btn-n-axis-archive {
  height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 11px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  color: #ffffff;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.28);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-n-axis-archive:hover {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

body.theme-light .n-axis-studio-backdrop {
  background: rgba(15, 23, 42, 0.48);
  backdrop-filter: none !important;
}

body.theme-light .n-axis-studio-card {
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.22);
}

body.theme-light .n-axis-studio-header {
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

body.theme-light .n-axis-logo {
  color: #2563eb;
}

body.theme-light .n-axis-title-text {
  color: #0f172a;
  font-weight: 800;
}

body.theme-light .n-axis-tag-badge {
  background: rgba(37, 99, 235, 0.10);
  color: #2563eb;
  border: 1px solid rgba(37, 99, 235, 0.28);
  font-weight: 700;
}

body.theme-light .btn-n-axis-close {
  color: #64748b;
}

body.theme-light .btn-n-axis-close:hover {
  background: rgba(220, 38, 38, 0.10);
  color: #dc2626;
}

body.theme-light .n-axis-studio-body {
  background: #ffffff;
}

body.theme-light .n-axis-control-quadrant {
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.10);
  backdrop-filter: none !important;
}

body.theme-light .n-axis-tab-header {
  border-bottom: 1px solid #e2e8f0;
}

body.theme-light .n-axis-tab-btn {
  color: #64748b;
}

body.theme-light .n-axis-tab-btn:hover {
  color: #0f172a;
  background: #e2e8f0;
}

body.theme-light .n-axis-tab-btn.active {
  color: #2563eb;
  background: rgba(37, 99, 235, 0.10);
  border: 1px solid rgba(37, 99, 235, 0.30);
}

body.theme-light .n-axis-input-group {
  background: #ffffff;
  border: 1px solid #e2e8f0;
}

body.theme-light .n-axis-math-input {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  color: #0f172a;
  font-weight: 700;
}

body.theme-light .n-axis-math-input:focus {
  background: #ffffff;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

body.theme-light .n-axis-chip {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #334155;
  font-weight: 600;
}

body.theme-light .n-axis-chip:hover {
  color: #2563eb;
  border-color: #2563eb;
  background: rgba(37, 99, 235, 0.08);
}

body.theme-light .n-axis-slider-box {
  background: #ffffff;
  border: 1px solid #e2e8f0;
}

body.theme-light .n-axis-slider-header {
  color: #2563eb;
}

body.theme-light .n-axis-stat-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-left-width: 3.5px;
}

body.theme-light .n-axis-stat-label {
  color: #64748b;
  font-weight: 600;
}

body.theme-light .n-axis-btn-action {
  background: #2563eb;
  color: #ffffff;
}

body.theme-light .n-axis-btn-action:hover {
  background: #1d4ed8;
}

body.theme-light .n-axis-btn-outline {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #334155;
  font-weight: 600;
}

body.theme-light .n-axis-btn-outline:hover {
  border-color: #2563eb;
  color: #2563eb;
  background: rgba(37, 99, 235, 0.06);
}

body.theme-light .n-axis-speed-group {
  background: #e2e8f0;
  border: 1px solid #cbd5e1;
}

body.theme-light .n-axis-speed-btn {
  color: #475569;
}

body.theme-light .n-axis-speed-btn.active {
  background: #2563eb;
  color: #ffffff;
}

body.theme-light .n-axis-speed-btn:hover:not(.active) {
  color: #0f172a;
}

body.theme-light .n-axis-preset-item {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #0f172a;
}

body.theme-light .n-axis-preset-item:hover {
  border-color: #2563eb;
  background: rgba(37, 99, 235, 0.04);
}

body.theme-light .n-axis-preset-title {
  color: #1e293b;
}

body.theme-light .n-axis-preset-desc {
  color: #64748b;
}

body.theme-light .n-axis-preset-tip {
  background: rgba(37, 99, 235, 0.06);
  color: #1d4ed8;
  border: 1px solid rgba(37, 99, 235, 0.18);
}


/* ==========================================================================
   🌟 [테마 3단계 완성: 전체 서랍 패널 · 수식/공유 모달 · 인라인 입력창 화이트 테마 완벽 동기화] 🌟
   ========================================================================== */
body.theme-light {
  --text-main: #0f172a;
  --text-muted: #475569;
  --panel-bg: rgba(255, 255, 255, 0.96);
  --panel-border: rgba(15, 23, 42, 0.12);
  --btn-hover: rgba(15, 23, 42, 0.05);
}

/* 1. 개형 선택 & 구간 분할 & 사각형 패널 */
body.theme-light .category-tabs {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
}

body.theme-light .cat-tab-btn.active {
  background: #2563eb;
  color: #ffffff;
}

body.theme-light .btn-smart-input {
  background: rgba(245, 158, 11, 0.14);
  border-color: rgba(217, 119, 6, 0.45);
  color: #b45309;
}

body.theme-light .btn-smart-input:hover {
  background: #f59e0b;
  color: #ffffff;
}

body.theme-light .btn-clear-all {
  background: rgba(220, 38, 38, 0.08);
  border-color: rgba(220, 38, 38, 0.35);
  color: #dc2626;
}

body.theme-light .btn-clear-all:hover {
  background: #dc2626;
  color: #ffffff;
}

body.theme-light .quad-mode-grid {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
}

body.theme-light .quad-mode-btn:hover {
  background: rgba(16, 172, 132, 0.12);
  color: #0f172a;
}

/* 2. 환경 설정 패널 (#panelSettings) */
body.theme-light .setting-toggle-item {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

body.theme-light .setting-toggle-item:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}

body.theme-light .setting-name {
  color: #0f172a;
}

body.theme-light .setting-sub {
  color: #64748b;
}

body.theme-light .vf-toggle-slider {
  background-color: #cbd5e1;
}

body.theme-light .vf-toggle-wrap input:checked+.vf-toggle-slider {
  background-color: #2563eb;
}

body.theme-light .vf-toggle-wrap input:checked+.vf-toggle-slider:before {
  background-color: #ffffff;
}

body.theme-light .vf-chip,
body.theme-light .dpi-btn {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #475569;
}

body.theme-light .vf-chip:hover,
body.theme-light .dpi-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
}

body.theme-light .vf-chip.active,
body.theme-light .dpi-btn.active {
  background: rgba(37, 99, 235, 0.12);
  border-color: #2563eb;
  color: #1d4ed8;
}

/* 3. 선 스타일 & 칠판 배경 패널 (#panelStyle) */
body.theme-light .slider-bar {
  background: #cbd5e1;
}

body.theme-light .color-dot {
  border: 1.5px solid rgba(15, 23, 42, 0.18);
}

body.theme-light .color-dot.active {
  border-color: #0f172a;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.45);
}

body.theme-light #selMathFont {
  background: #f8fafc !important;
  border: 1px solid #cbd5e1 !important;
  color: #0f172a !important;
}

body.theme-light .style-help-box {
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  color: #475569 !important;
}

body.theme-light .axis-auto-label-text {
  color: #0f172a !important;
}

body.theme-light .axis-name-input-box {
  background: #f8fafc !important;
  border: 1px solid #cbd5e1 !important;
}

body.theme-light .axis-name-input-box span {
  color: #475569 !important;
}

body.theme-light #inputAxisNameX,
body.theme-light #inputAxisNameY {
  color: #2563eb !important;
}

/* 4. 스마트 수식 입력 모달 (#modalSmartInput) & 그래프 공유 모달 (#modalShare) */
body.theme-light .smart-modal-backdrop {
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: none !important;
}

body.theme-light .smart-modal-card {
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.20);
  color: #0f172a;
}

body.theme-light .smart-modal-header,
body.theme-light .smart-modal-footer {
  background: #f8fafc;
  border-color: #e2e8f0;
}

body.theme-light .modal-icon {
  color: #2563eb;
  background: rgba(37, 99, 235, 0.10);
}

body.theme-light .badge-smart {
  color: #0284c7;
  background: rgba(2, 132, 199, 0.10);
}

body.theme-light .smart-math-input {
  background: #ffffff;
  border: 1.5px solid #94a3b8;
  color: #0f172a;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.05);
}

body.theme-light .smart-math-input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

body.theme-light .btn-clear-expr:hover {
  color: #dc2626;
}

body.theme-light .smart-preview-card {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
}

body.theme-light .preview-math {
  color: #1d4ed8;
  text-shadow: none;
}

body.theme-light .key-btn {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  color: #0f172a;
}

body.theme-light .key-btn:hover {
  background: #e2e8f0;
}

body.theme-light .key-btn.key-op {
  color: #d97706;
}

body.theme-light .key-btn.key-accent {
  color: #2563eb;
}

body.theme-light .chip-btn {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  color: #334155;
}

body.theme-light .chip-btn:hover {
  background: rgba(37, 99, 235, 0.10);
  border-color: #2563eb;
  color: #2563eb;
}

body.theme-light .share-link-input {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  color: #0f172a;
}

body.theme-light .qr-section {
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
}

body.theme-light .qr-target-badge {
  color: #b45309;
  background: rgba(245, 158, 11, 0.14);
}

/* 5. 구간별 함수 선택 팝오버 (.pw-region-popover) & 캔버스 인라인 에디터 */
body.theme-light .pw-region-popover {
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.14);
  backdrop-filter: none !important;
}

body.theme-light .pw-popover-item {
  color: #1e293b;
}

body.theme-light .pw-popover-item:hover {
  background: #f1f5f9;
  color: #0f172a;
}

body.theme-light .pw-popover-item.active {
  background: rgba(124, 58, 237, 0.12);
  border-color: rgba(124, 58, 237, 0.45);
  color: #6d28d9;
}

body.theme-light .drop-line-label-input,
body.theme-light .canvas-text-input {
  background: #ffffff;
  color: #0f172a;
  border-color: #2563eb;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.15);
}


/* ==========================================================================
   🍎 [iOS / iPadOS Safari & 태블릿 주소창 가림 방지 (100dvh 지원 - UI 크기 변형 없음)]
   ========================================================================== */
@supports (height: 100dvh) {

  body,
  .main-workspace,
  body.fullscreen-mode .main-workspace,
  body.header-collapsed .main-workspace {
    height: 100dvh !important;
  }
}

/* ==========================================================================
   ✏️ [굵기 선택 슬라이더(#sliderInkSize) 터치/마우스 히트박스 확장 & 먹통 방지]
   ========================================================================== */
.ink-size-preview-row {
  cursor: pointer;
  touch-action: none !important;
}

#sliderInkSize {
  height: 5px !important;
  margin: 0 !important;
  padding: 0 !important;
  cursor: pointer !important;
  touch-action: none !important;
  pointer-events: auto !important;
}

/* ==========================================================================
   📄 [PDF 페이지 통째 열기 (Concept Page Board) 버튼 & 상단 네비게이션 바]
   ========================================================================== */
.pdf-open-page-btn {
  height: 34px;
  padding: 0 12px;
  background: linear-gradient(135deg, #6d28d9, #4f46e5);
  border: 1.5px solid #7c3aed;
  border-radius: 8px;
  color: #ffffff !important;
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 10px rgba(79, 70, 229, 0.28);
  white-space: nowrap;
  flex-shrink: 0;
}

.pdf-open-page-btn:hover {
  background: linear-gradient(135deg, #5b21b6, #4338ca);
  border-color: #8b5cf6;
  color: #ffffff !important;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.42);
  transform: translateY(-1px);
}

.pdf-open-page-btn:active {
  transform: scale(0.97);
}

body.theme-light .pdf-open-page-btn {
  background: linear-gradient(135deg, #6d28d9, #4f46e5);
  border: 1.5px solid #5b21b6;
  color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.25);
}

body.theme-light .pdf-open-page-btn:hover {
  background: linear-gradient(135deg, #5b21b6, #4338ca);
  border-color: #4c1d95;
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.38);
}

.pdf-multi-crop-btn {
  height: 34px;
  padding: 0 12px;
  background: rgba(16, 185, 129, 0.12);
  border: 1.5px solid rgba(16, 185, 129, 0.45);
  border-radius: 8px;
  color: #059669;
  font-size: 12.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

body:not(.theme-light) .pdf-multi-crop-btn {
  background: rgba(16, 185, 129, 0.2);
  border-color: rgba(52, 211, 153, 0.55);
  color: #34d399;
}

.pdf-multi-crop-btn:hover {
  background: rgba(16, 185, 129, 0.22);
  transform: translateY(-1px);
}

.pdf-multi-crop-btn.active-waiting {
  background: rgba(245, 158, 11, 0.16);
  border-color: #f59e0b;
  color: #b45309;
}

body:not(.theme-light) .pdf-multi-crop-btn.active-waiting {
  color: #fbbf24;
}

.pdf-multi-crop-btn.ready-to-insert {
  background: linear-gradient(135deg, #059669, #10b981) !important;
  border-color: #047857 !important;
  color: #ffffff !important;
  box-shadow: 0 3px 12px rgba(16, 185, 129, 0.36);
}

.pdf-multi-crop-btn.ready-to-insert:hover {
  background: linear-gradient(135deg, #047857, #059669) !important;
  color: #ffffff !important;
}

.slim-pdf-capture-btn {
  width: auto !important;
  height: 26px !important;
  padding: 0 10px !important;
  border-radius: 999px !important;
  font-size: 11.5px !important;
  font-weight: 700 !important;
  gap: 4px !important;
  white-space: nowrap !important;
  flex-shrink: 0;
  border: 1px solid rgba(148, 163, 184, 0.3) !important;
  background: rgba(255, 255, 255, 0.08) !important;
  color: #e2e8f0 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.slim-pdf-capture-btn:hover {
  background: rgba(255, 255, 255, 0.16) !important;
  color: #ffffff !important;
  border-color: rgba(148, 163, 184, 0.5) !important;
}

body.theme-light .slim-pdf-capture-btn {
  background: #f1f5f9 !important;
  border-color: #cbd5e1 !important;
  color: #334155 !important;
}

body.theme-light .slim-pdf-capture-btn:hover {
  background: #e2e8f0 !important;
  border-color: #94a3b8 !important;
  color: #0f172a !important;
}

.slim-next-pdf-page-btn,
body.theme-light .slim-next-pdf-page-btn {
  background: linear-gradient(135deg, #6d28d9, #4f46e5) !important;
  border-color: #5b21b6 !important;
  color: #ffffff !important;
}

.slim-next-pdf-page-btn:hover,
body.theme-light .slim-next-pdf-page-btn:hover {
  background: linear-gradient(135deg, #5b21b6, #4338ca) !important;
  color: #ffffff !important;
}

.pdf-board-nav-bar {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 210;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(148, 163, 184, 0.26);
  border-radius: 999px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.38), 0 2px 8px rgba(0, 0, 0, 0.2);
  user-select: none;
}

.pdf-board-nav-btn {
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.07);
  color: #e2e8f0;
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: all 0.16s ease;
}

.pdf-board-nav-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.3);
  color: #ffffff;
}

.pdf-board-nav-btn:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

.pdf-board-next-primary {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.85), rgba(79, 70, 229, 0.9));
  border-color: rgba(167, 139, 250, 0.65);
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(124, 58, 237, 0.32);
}

.pdf-board-next-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #8b5cf6, #6366f1);
  border-color: #ddd6fe;
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.5);
}

.pdf-board-page-pill {
  height: 28px;
  padding: 0 11px;
  border-radius: 999px;
  border: 1px solid rgba(0, 210, 211, 0.32);
  background: rgba(0, 210, 211, 0.10);
  color: #00d2d3;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: all 0.16s ease;
}

.pdf-board-page-pill:hover {
  background: rgba(0, 210, 211, 0.20);
  border-color: rgba(0, 210, 211, 0.55);
}

.pdf-board-nav-divider {
  width: 1px;
  height: 16px;
  background: rgba(255, 255, 255, 0.16);
  margin: 0 2px;
}

.pdf-board-close-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: #94a3b8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.16s ease;
  padding: 0;
}

.pdf-board-close-btn:hover {
  background: rgba(239, 68, 68, 0.22);
  color: #fca5a5;
}

body.theme-light .pdf-board-nav-bar {
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(15, 23, 42, 0.14);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12), 0 2px 6px rgba(15, 23, 42, 0.06);
}

body.theme-light .pdf-board-nav-btn {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #1e293b;
}

body.theme-light .pdf-board-nav-btn:hover:not(:disabled) {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #0f172a;
}

body.theme-light .pdf-board-next-primary {
  background: linear-gradient(135deg, #7c3aed, #4f46e5);
  border-color: #6d28d9;
  color: #ffffff;
}

body.theme-light .pdf-board-next-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #6d28d9, #4338ca);
  color: #ffffff;
}

body.theme-light .pdf-board-page-pill {
  background: #f5f3ff;
  border-color: #c4b5fd;
  color: #6d28d9;
}

body.theme-light .pdf-board-page-pill:hover {
  background: #ede9fe;
  border-color: #8b5cf6;
}

body.theme-light .pdf-board-nav-divider {
  background: #e2e8f0;
}

body.theme-light .pdf-board-close-btn {
  background: #f1f5f9;
  color: #64748b;
}

body.theme-light .pdf-board-close-btn:hover {
  background: #fee2e2;
  color: #ef4444;
}

/* ==========================================================================
   [📝 판서 모드 (workspace-board-mode) vs 📈 그래프 모드 (workspace-graph-mode) UI 분리]
   ========================================================================== */
body.workspace-board-mode #btnQuickIntersection,
body.workspace-board-mode #btnQuickDropLine,
body.workspace-board-mode #btnQuickText,
body.workspace-board-mode #btnQuickCenter,
body.workspace-board-mode #btnQuickSnap,
body.workspace-board-mode #btnRailPiecewise,
body.workspace-board-mode #btnRailToggleVf,
body.workspace-board-mode #btnInkToggleAxes {
  display: none !important;
}

.pdf-to-graph-crop-bar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pdf-to-graph-crop-guide {
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.88);
  color: #f8fafc;
  font-size: 12.5px;
  font-weight: 700;
  border: 1px solid rgba(0, 210, 211, 0.45);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
  white-space: nowrap;
}

body.theme-light .pdf-to-graph-crop-guide {
  background: rgba(255, 255, 255, 0.96);
  color: #1e293b;
  border-color: rgba(124, 58, 237, 0.45);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.10);
}


/* ==========================================================================
   ☁️ [클라우드 내 보관함 · 수업 슬라이드(PPT) · 기출 공유 게시판 스타일]
   ========================================================================== */
.cloud-hub-modal-card {
  max-width: 820px !important;
  width: 94vw !important;
  max-height: 86vh !important;
  display: flex;
  flex-direction: column;
}

.cloud-hub-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.cloud-auth-area {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cloud-user-status {
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.14);
}

.btn-cloud-auth {
  height: 32px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid rgba(37, 99, 235, 0.45);
  background: rgba(37, 99, 235, 0.12);
  color: #2563eb;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  transition: all 0.16s ease;
}

.btn-cloud-auth:hover {
  background: #2563eb;
  color: #ffffff;
}

.cloud-hub-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
  padding: 18px 22px 22px !important;
}

.cloud-save-box {
  background: rgba(37, 99, 235, 0.06);
  border: 1px solid rgba(37, 99, 235, 0.24);
  border-radius: 12px;
  padding: 14px 16px;
}

.cloud-save-box-title {
  font-size: 13px;
  font-weight: 700;
  color: #2563eb;
  margin-bottom: 10px;
}

.cloud-save-inputs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.cloud-input-title {
  flex: 2;
  min-width: 210px;
  height: 36px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #0f172a;
  font-size: 13px;
}

.cloud-input-tags {
  flex: 1;
  min-width: 140px;
  height: 36px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #0f172a;
  font-size: 13px;
}

.cloud-save-btn,
.cloud-pub-btn {
  height: 36px !important;
  padding: 0 14px !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  border-radius: 8px !important;
}

.cloud-tabs-bar {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.25);
  padding-bottom: 8px;
}

.cloud-tab-btn {
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: #64748b;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.cloud-tab-btn.active {
  background: rgba(37, 99, 235, 0.12);
  border-color: rgba(37, 99, 235, 0.35);
  color: #2563eb;
}

.cloud-tab-count {
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.16);
  color: inherit;
}

.cloud-playlist-toolbar,
.cloud-search-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(148, 163, 184, 0.08);
}

.cloud-chk-all-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.cloud-playlist-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.cloud-playlist-hint {
  font-size: 12px;
  color: #64748b;
}

.btn-start-playlist {
  height: 34px;
  padding: 0 14px;
  border-radius: 8px;
  border: none;
  background: linear-gradient(135deg, #2563eb, #4f46e5);
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
  transition: all 0.16s ease;
}

.btn-start-playlist:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
}

.cloud-search-input {
  flex: 1;
  height: 36px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #0f172a;
  font-size: 13px;
}

.cloud-item-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 340px;
  overflow-y: auto;
  padding-right: 4px;
}

.cloud-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.26);
  background: rgba(255, 255, 255, 0.92);
  transition: all 0.15s ease;
}

body:not(.theme-light) .cloud-item-row {
  background: rgba(30, 41, 59, 0.85);
  border-color: rgba(255, 255, 255, 0.12);
}

.cloud-item-row:hover {
  border-color: #2563eb;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.08);
}

.cloud-item-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.cloud-item-chk {
  width: 17px;
  height: 17px;
  cursor: pointer;
  accent-color: #2563eb;
}

.cloud-item-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.cloud-item-title {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body:not(.theme-light) .cloud-item-title {
  color: #f8fafc;
}

.cloud-item-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 11.5px;
  color: #64748b;
}

.cloud-tag-pill {
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.1);
  color: #2563eb;
  font-weight: 600;
}

.cloud-summary-pill {
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(124, 58, 237, 0.1);
  color: #7c3aed;
  font-weight: 600;
}

.cloud-item-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.btn-cloud-load {
  height: 30px;
  padding: 0 12px;
  border-radius: 7px;
  border: 1px solid rgba(37, 99, 235, 0.4);
  background: rgba(37, 99, 235, 0.1);
  color: #2563eb;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.btn-cloud-load:hover {
  background: #2563eb;
  color: #ffffff;
}

.btn-cloud-share-item,
.btn-cloud-del-item {
  height: 30px;
  padding: 0 9px;
  border-radius: 7px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: transparent;
  color: #64748b;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.btn-cloud-del-item:hover {
  border-color: #ef4444;
  color: #ef4444;
  background: rgba(239, 68, 68, 0.08);
}

.cloud-empty-msg {
  text-align: center;
  padding: 36px 16px;
  color: #64748b;
  font-size: 13.5px;
}

.lesson-playlist-share-btn {
  background: rgba(37, 99, 235, 0.12) !important;
  border-color: rgba(37, 99, 235, 0.35) !important;
  color: #2563eb !important;
}

.lesson-playlist-share-btn:hover {
  background: #2563eb !important;
  color: #ffffff !important;
}

/* ============================================================================
   🌟 [대표님 피드백 반영: 제목(드래그 전용) + 옆 큰 삼각형 원버튼 접기 분리 & 하단 필기바 Z-Index 최우선 보장]
   ============================================================================ */
.problem-card-title-group {
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  min-width: 0;
  pointer-events: auto !important;
}

.problem-card-title-group .problem-card-drag-handle {
  display: inline-flex !important;
  align-items: center !important;
  height: 25px !important;
  padding: 0 8px !important;
  border-radius: 6px !important;
  background: rgba(255, 255, 255, 0.06) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  color: #e2e8f0 !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  cursor: grab !important;
  user-select: none !important;
}

body.theme-light .problem-card-title-group .problem-card-drag-handle {
  background: #f8fafc !important;
  border: 1px solid rgba(15, 23, 42, 0.12) !important;
  color: #334155 !important;
}

.problem-card-widget.is-dragging-card .problem-card-title-group .problem-card-drag-handle {
  cursor: grabbing !important;
}

/* 차분한 무채색(흑백/슬레이트) 접기/펼치기 아이콘 버튼 */
.card-fold-triangle-btn {
  width: 28px !important;
  height: 25px !important;
  min-width: 28px !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 6px !important;
  background: rgba(255, 255, 255, 0.06) !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  color: #cbd5e1 !important;
  cursor: pointer !important;
  flex-shrink: 0 !important;
  transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease !important;
}

.card-fold-triangle-btn:hover {
  background: rgba(255, 255, 255, 0.14) !important;
  border-color: rgba(255, 255, 255, 0.28) !important;
  color: #ffffff !important;
}

.card-fold-triangle-btn:active {
  transform: scale(0.95);
}

.card-fold-triangle-btn .card-fold-chevron {
  font-size: 18px !important;
  line-height: 1 !important;
  font-weight: 900 !important;
  color: inherit !important;
  display: inline-block !important;
  transform: scale(1.3) translateY(-0.5px);
  pointer-events: none !important;
}

body.theme-light .card-fold-triangle-btn {
  background: #f8fafc !important;
  border: 1px solid rgba(15, 23, 42, 0.12) !important;
  color: #475569 !important;
}

body.theme-light .card-fold-triangle-btn:hover {
  background: #e2e8f0 !important;
  border-color: rgba(15, 23, 42, 0.24) !important;
  color: #0f172a !important;
}

/* 하단 필기 바(#inkFloatingToolbar) 및 주요 툴바가 문제/그래프 카드(z-index: 150~190)에 절대 덮이지 않도록 최상위 우선순위 보장 */
#inkFloatingToolbar,
.ink-floating-toolbar {
  z-index: 450 !important;
}

.ink-size-flyout-panel {
  z-index: 460 !important;
}

.canvas-quick-toolbar {
  z-index: 485 !important;
}

.sidebar-rail {
  z-index: 420 !important;
}

header {
  z-index: 430 !important;
}

.curve-context-bar {
  z-index: 440 !important;
}

.pdf-board-nav-bar,
.lesson-playlist-nav-bar {
  z-index: 445 !important;
}

/* ✒️ [카드 전용 상단 필기 잠금/허용 토글 버튼([✒️]) — 차분한 무채색(회색) 톤] */
.btn-card-laser {
  width: 26px !important;
  height: 25px !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 6px !important;
  color: #cbd5e1 !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  background: rgba(255, 255, 255, 0.06) !important;
  transition: all 0.16s cubic-bezier(0.22, 1, 0.36, 1) !important;
}

.btn-card-laser:hover {
  background: rgba(255, 255, 255, 0.14) !important;
  border-color: rgba(255, 255, 255, 0.28) !important;
  color: #ffffff !important;
}

.btn-card-laser.active {
  background: rgba(148, 163, 184, 0.35) !important;
  border-color: rgba(203, 213, 225, 0.55) !important;
  color: #ffffff !important;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2) !important;
}

body.theme-light .btn-card-laser {
  color: #475569 !important;
  background: #f8fafc !important;
  border-color: rgba(15, 23, 42, 0.12) !important;
}

body.theme-light .btn-card-laser:hover {
  background: #e2e8f0 !important;
  border-color: rgba(15, 23, 42, 0.24) !important;
  color: #0f172a !important;
}

body.theme-light .btn-card-laser.active {
  color: #334155 !important;
  background: #cbd5e1 !important;
  border-color: #94a3b8 !important;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.1) !important;
}

.card-laser-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.card-laser-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
  z-index: 8;
  touch-action: none !important;
}

body.ink-laser-tool-active .problem-card-widget:not(.minimized) .card-laser-canvas,
.problem-card-widget.card-laser-active:not(.minimized) .card-laser-canvas {
  display: block !important;
  pointer-events: auto !important;
  cursor: none !important;
  z-index: 9 !important;
}

body.ink-laser-tool-active .problem-card-widget:not(.minimized) .problem-card-body,
.problem-card-widget.card-laser-active:not(.minimized) .problem-card-body {
  cursor: none !important;
}

.problem-card-widget .problem-card-resize-handle {
  z-index: 15 !important;
}

/* 🛡️ [가상 펜/지우개 커서가 카드(150~190)나 하단 필기 툴바(450) 뒤로 숨지 않도록 z-index 상향 & 클릭 간섭 0% 보장] */
#virtualStylusPen,
.virtual-stylus-pen {
  z-index: 500 !important;
  pointer-events: none !important;
}

/* 📚 [통째 수업 세트(1~30문항 풀세트) 게시판 공유 & 내 드라이브(.graphly) 파일 연동 스타일] */
.cloud-save-box-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.cloud-save-box-header .cloud-save-box-title {
  margin-bottom: 0 !important;
}

.cloud-drive-file-btns {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-cloud-drive-file {
  padding: 5px 10px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid rgba(56, 189, 248, 0.45);
  background: rgba(14, 165, 233, 0.14);
  color: #38bdf8;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-cloud-drive-file:hover {
  background: rgba(14, 165, 233, 0.28);
  border-color: #38bdf8;
  color: #ffffff;
  transform: translateY(-1px);
}

.btn-cloud-drive-open {
  border-color: rgba(168, 85, 247, 0.45);
  background: rgba(168, 85, 247, 0.14);
  color: #c084fc;
}

.btn-cloud-drive-open:hover {
  background: rgba(168, 85, 247, 0.28);
  border-color: #c084fc;
  color: #ffffff;
}

body.theme-light .btn-cloud-drive-file {
  background: #e0f2fe;
  border-color: #7dd3fc;
  color: #0369a1;
}

body.theme-light .btn-cloud-drive-file:hover {
  background: #bae6fd;
  color: #0c4a6e;
}

body.theme-light .btn-cloud-drive-open {
  background: #f3e8ff;
  border-color: #d8b4fe;
  color: #7e22ce;
}

body.theme-light .btn-cloud-drive-open:hover {
  background: #e9d5ff;
  color: #581c87;
}

.btn-bundle-deck {
  padding: 6px 11px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(30, 41, 59, 0.75);
  color: #e2e8f0;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-bundle-deck:hover {
  background: rgba(59, 130, 246, 0.22);
  border-color: #60a5fa;
  color: #ffffff;
}

body.theme-light .btn-bundle-deck {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #1e293b;
}

body.theme-light .btn-bundle-deck:hover {
  background: #dbeafe;
  border-color: #60a5fa;
  color: #1d4ed8;
}

.cloud-deck-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(99, 102, 241, 0.35);
  margin-right: 4px;
}

.share-deck-hub-group {
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.28);
  border-radius: 10px;
  padding: 10px 12px;
}

body.theme-light .share-deck-hub-group {
  background: #f5f3ff;
  border-color: #ddd6fe;
}

.share-deck-btn-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.share-deck-btn {
  flex: 1;
  min-width: 130px;
  padding: 7px 10px !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  border-radius: 8px !important;
  cursor: pointer;
}

.btn-cloud-import-lib,
.btn-cloud-pub-item,
.btn-cloud-export-item {
  padding: 5px 9px;
  border-radius: 7px;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: rgba(255, 255, 255, 0.06);
  color: #e2e8f0;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-cloud-import-lib:hover,
.btn-cloud-pub-item:hover,
.btn-cloud-export-item:hover {
  background: rgba(59, 130, 246, 0.22);
  border-color: #60a5fa;
  color: #ffffff;
}

body.theme-light .btn-cloud-import-lib,
body.theme-light .btn-cloud-pub-item,
body.theme-light .btn-cloud-export-item {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #334155;
}

body.theme-light .btn-cloud-import-lib:hover,
body.theme-light .btn-cloud-pub-item:hover,
body.theme-light .btn-cloud-export-item:hover {
  background: #e0f2fe;
  border-color: #38bdf8;
  color: #0369a1;
}



/* =====================================================================
   [💊 액정타블렛 전용 초직관 세로형 직사각형 리모컨 (Quick Pill Remote)]
   ===================================================================== */
.quick-pill-remote {
  position: fixed;
  left: 605px;
  top: 76px;
  z-index: 465 !important;
  width: 98px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 5px;
  padding: 6px 6.5px 7.5px 6.5px;
  border-radius: 15px;
  background: rgba(15, 23, 42, 0.93);
  border: 1.3px solid rgba(148, 163, 184, 0.28);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.33), 0 2px 6px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

body.theme-light .quick-pill-remote {
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(15, 23, 42, 0.14);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.13), 0 2px 5px rgba(15, 23, 42, 0.08);
}

.pill-remote-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 3px;
  margin-bottom: -1px;
}

.pill-remote-drag-handle {
  flex: 1;
  cursor: grab;
  color: #94a3b8;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.4px;
  padding: 2.5px 3.5px;
  border-radius: 5.5px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease, background 0.15s ease;
}

.pill-remote-drag-handle:hover {
  color: #f8fafc;
  background: rgba(255, 255, 255, 0.08);
}

body.theme-light .pill-remote-drag-handle {
  color: #64748b;
}

body.theme-light .pill-remote-drag-handle:hover {
  color: #0f172a;
  background: rgba(15, 23, 42, 0.06);
}

.pill-remote-drag-handle:active {
  cursor: grabbing;
}

/* 0단: 전폭 초대형 메인 [✒️ 필기 ⇄ ↖ 이동] 원버튼 (80% 컴팩트 스케일) */
.pill-remote-swap-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 100%;
  height: 35px;
  padding: 0 6px;
  border-radius: 10px;
  border: 1.3px solid transparent;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.15s ease, background 0.15s ease;
  white-space: nowrap;
}

.pill-remote-swap-btn.mode-pen {
  background: linear-gradient(135deg, #2563eb, #0284c7);
  color: #ffffff;
  border-color: rgba(125, 211, 252, 0.45);
  box-shadow: 0 3px 10px rgba(37, 99, 235, 0.32);
}

.pill-remote-swap-btn.mode-select {
  background: linear-gradient(135deg, #059669, #0d9488);
  color: #ffffff;
  border-color: rgba(110, 231, 183, 0.45);
  box-shadow: 0 3px 10px rgba(5, 150, 105, 0.32);
}

.pill-remote-swap-btn.mode-subtool {
  background: rgba(51, 65, 85, 0.85);
  color: #e2e8f0;
  border-color: rgba(148, 163, 184, 0.35);
}

body.theme-light .pill-remote-swap-btn.mode-subtool {
  background: #f1f5f9;
  color: #1e293b;
  border-color: #cbd5e1;
}

.pill-remote-swap-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
}

.pill-remote-swap-btn:active {
  transform: scale(0.96);
}

.pill-swap-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.pill-swap-badge {
  font-size: 9.5px;
  opacity: 0.85;
  font-weight: 700;
}

.pill-remote-section {
  display: flex;
  flex-direction: column;
  gap: 4.5px;
  width: 100%;
}

.pill-remote-sep {
  width: 100%;
  height: 1px;
  background: rgba(148, 163, 184, 0.20);
  margin: 0;
}

body.theme-light .pill-remote-sep {
  background: rgba(15, 23, 42, 0.10);
}

/* 2열 그리드 (지우개 · 올가미 / 형광펜 · 레이저 / 축소 · 확대 / 스티커 · 비우기) */
.pill-remote-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4.5px;
  width: 100%;
}

.pill-remote-btn {
  width: 100%;
  height: 31px;
  border-radius: 9px;
  border: 1.3px solid rgba(148, 163, 184, 0.22);
  background: rgba(255, 255, 255, 0.06);
  color: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.12s ease;
  padding: 0;
}

body.theme-light .pill-remote-btn {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #1e293b;
}

.pill-remote-btn:hover {
  background: rgba(56, 189, 248, 0.18);
  border-color: #38bdf8;
  color: #ffffff;
  transform: translateY(-1px);
}

body.theme-light .pill-remote-btn:hover {
  background: #e0f2fe;
  border-color: #0284c7;
  color: #0369a1;
}

.pill-remote-btn:active {
  transform: scale(0.93);
}

.pill-remote-btn.active {
  background: linear-gradient(135deg, #f43f5e, #e11d48) !important;
  border-color: #fda4af !important;
  color: #ffffff !important;
  box-shadow: 0 3px 9px rgba(244, 63, 94, 0.32);
}

#btnPillLasso.pill-remote-btn.active {
  background: linear-gradient(135deg, #8b5cf6, #6d28d9) !important;
  border-color: #c4b5fd !important;
  color: #ffffff !important;
  box-shadow: 0 3px 9px rgba(139, 92, 246, 0.32);
}

#btnPillHighlighter.pill-remote-btn.active {
  background: linear-gradient(135deg, #eab308, #ca8a04) !important;
  border-color: #fef08a !important;
  color: #ffffff !important;
  box-shadow: 0 3px 9px rgba(234, 179, 8, 0.32);
}

/* 5색 컬러 도트 줄 */
.pill-color-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2.5px;
  padding: 1.5px 0;
}

.pill-color-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1.6px solid transparent;
  cursor: pointer;
  padding: 0;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.pill-color-dot:hover {
  transform: scale(1.15);
}

.pill-color-dot.active {
  transform: scale(1.18);
  border-color: #38bdf8;
  box-shadow: 0 0 0 1.5px rgba(56, 189, 248, 0.35);
}

body.theme-light .pill-color-dot.active {
  border-color: #0284c7;
  box-shadow: 0 0 0 1.5px rgba(2, 132, 199, 0.28);
}

/* 상단 고정 레고형 4모듈 스위치 바 ([도구] · [줌] · [색상] · [기타]) */
.pill-module-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2.2px;
  width: 100%;
  margin-top: 0px;
}

.pill-mod-chip {
  height: 18px;
  border-radius: 5px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(255, 255, 255, 0.04);
  color: #94a3b8;
  font-size: 8.5px;
  letter-spacing: -0.35px;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  transition: all 0.12s ease;
}

body.theme-light .pill-mod-chip {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #64748b;
}

.pill-mod-chip:hover {
  color: #f8fafc;
  border-color: rgba(148, 163, 184, 0.45);
}

body.theme-light .pill-mod-chip:hover {
  color: #0f172a;
  border-color: #94a3b8;
}

.pill-mod-chip.active {
  background: rgba(56, 189, 248, 0.20);
  border-color: rgba(56, 189, 248, 0.65);
  color: #38bdf8;
}

body.theme-light .pill-mod-chip.active {
  background: #e0f2fe;
  border-color: #38bdf8;
  color: #0284c7;
}

.pill-remote-close-btn {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: none;
  background: transparent;
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: all 0.15s ease;
}

.pill-remote-close-btn:hover {
  background: rgba(244, 63, 94, 0.18);
  color: #f43f5e;
}

#btnQuickCenter {
  display: none !important;
}

/* 🌟 [대표님 피드백: 필기 바 굵기 조절을 팝업·원·pt 없이 깔끔한 ◀ 숫자 ▶ 0.2 스텝으로 슬림화] 🌟 */
#inkSizeFlyout {
  display: none !important;
}

.ink-size-stepper .ink-size-val {
  min-width: 26px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: #f1f5f9;
  padding: 0 3px;
  font-variant-numeric: tabular-nums;
  user-select: none;
}

body.theme-light .ink-size-stepper .ink-size-val,
body.light-ui-theme .ink-size-stepper .ink-size-val {
  color: #0f172a !important;
}


/* ==========================================================================
   🪢 [올가미(Lasso) 고도화: 선택 영역 상단 플로팅 미니 액션 바 & 칠판 속지 칩]
   ========================================================================== */
.lasso-action-floating-bar {
  position: absolute;
  z-index: 195;
  display: flex;
  flex-wrap: nowrap;
  width: max-content;
  white-space: nowrap;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.95);
  border: 1.5px solid rgba(56, 189, 248, 0.45);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28), 0 2px 6px rgba(0, 0, 0, 0.16);
  transform: translate(0, -100%);
  pointer-events: auto;
  user-select: none;
  touch-action: none;
}

body.theme-light .lasso-action-floating-bar {
  background: rgba(255, 255, 255, 0.98);
  border: 1.5px solid rgba(2, 132, 199, 0.38);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.14), 0 2px 6px rgba(15, 23, 42, 0.08);
}

.lasso-color-group {
  display: flex;
  align-items: center;
  gap: 5px;
}

.lasso-color-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.78);
  cursor: pointer;
  padding: 0;
  transition: transform 0.14s ease, box-shadow 0.14s ease;
}

body.theme-light .lasso-color-dot {
  border-color: rgba(15, 23, 42, 0.18);
}

.lasso-color-dot:hover {
  transform: scale(1.18);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.55);
}

.lasso-bar-sep {
  width: 1px;
  height: 16px;
  background: rgba(255, 255, 255, 0.18);
  margin: 0 2px;
}

body.theme-light .lasso-bar-sep {
  background: rgba(15, 23, 42, 0.14);
}

.lasso-action-btn {
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  color: #f8fafc;
  font-size: 11.5px;
  font-weight: 700;
  display: inline-flex;
  flex-shrink: 0;
  white-space: nowrap;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: all 0.14s ease;
}

.lasso-action-btn>* {
  pointer-events: none;
}

.lasso-action-btn:hover {
  background: rgba(56, 189, 248, 0.22);
  border-color: #38bdf8;
  color: #38bdf8;
}

body.theme-light .lasso-action-btn {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #1e293b;
}

body.theme-light .lasso-action-btn:hover {
  background: #e0f2fe;
  border-color: #0284c7;
  color: #0284c7;
}

.lasso-action-btn.lasso-action-del:hover {
  background: rgba(244, 63, 94, 0.20);
  border-color: #f43f5e;
  color: #f43f5e;
}

body.theme-light .lasso-action-btn.lasso-action-del:hover {
  background: #ffe4e6;
  border-color: #e11d48;
  color: #e11d48;
}

.board-paper-chip {
  font-size: 12px !important;
  font-weight: 700 !important;
  padding: 6px 4px !important;
}

/* ==========================================================================
   🎯 [초슬림 통합 슬라이드 바 (문제 캡처 · PDF 통째 · 그래프 캔버스 묶음) & 감추기 마이크로 탭]
   ========================================================================== */
.slim-slide-nav-bar {
  padding: 4px 7px !important;
  gap: 4px !important;
  max-width: calc(100vw - 160px);
}

.slim-nav-arrow {
  width: 26px !important;
  height: 26px !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 50% !important;
  flex-shrink: 0;
}

.slim-next-btn {
  height: 26px !important;
  padding: 0 9px !important;
  font-size: 11.5px !important;
  gap: 3px !important;
  flex-shrink: 0;
}

.slim-page-pill {
  height: 26px !important;
  padding: 0 8px !important;
  font-size: 11.5px !important;
  gap: 4px !important;
  flex-shrink: 0;
}

.slide-chips-strip {
  display: flex;
  align-items: center;
  gap: 4px;
  max-width: 48vw;
  overflow: visible;
  padding: 1px 2px;
}

.slide-chip-item {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 25px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(255, 255, 255, 0.07);
  color: #cbd5e1;
  font-size: 11.5px;
  font-weight: 700;
  padding: 0 8px;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.14s ease, color 0.14s ease, border-color 0.14s ease;
  user-select: none;
}

.slide-chip-item:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  border-color: rgba(56, 189, 248, 0.5);
}

.slide-chip-item.active {
  background: linear-gradient(135deg, #2563eb, #4f46e5);
  border-color: #60a5fa;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
}

body.theme-light .slide-chip-item {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #334155;
}

body.theme-light .slide-chip-item:hover {
  background: #e2e8f0;
  color: #0f172a;
  border-color: #94a3b8;
}

body.theme-light .slide-chip-item.active {
  background: linear-gradient(135deg, #2563eb, #4f46e5);
  border-color: #2563eb;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

.slide-chip-label {
  line-height: 1;
  pointer-events: none;
}

/* 🌟 평소에는 숫자만 보여 가로 폭이 100% 고정되고, 현재(파란색) 슬라이드를 한 번 더 눌렀을 때만 아래쪽에 ✕ 버튼 팝업! */
.slide-chip-del {
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.9);
  background: #ef4444;
  color: #ffffff;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  padding: 0;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(239, 68, 68, 0.45);
  z-index: 465;
  transition: transform 0.12s ease, background 0.12s ease;
}

.slide-chip-item.del-open .slide-chip-del {
  display: inline-flex;
}

.slide-chip-del:hover {
  background: #dc2626 !important;
  color: #ffffff !important;
  transform: translateX(-50%) scale(1.12);
}

/* 🌟 그래프 모드(모달 스튜디오) 진입 시 상단 슬라이드 바 & 미니 탭 100% 자동 숨김 (단, 학생용 다중 슬라이드 영상 플레이어에서는 슬라이드 이동 허용) */
body.workspace-graph-mode:not(.student-audio-video-only) #lessonPlaylistNavBar,
body.workspace-graph-mode #pdfBoardNavBar,
body.workspace-graph-mode:not(.student-audio-video-only) #topSlideBarMiniTab {
  display: none !important;
}

.slim-icon-btn {
  width: 26px !important;
  height: 26px !important;
  border-radius: 50% !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0;
}

.slim-add-slide-btn {
  color: #38bdf8 !important;
  border-color: rgba(56, 189, 248, 0.35) !important;
  background: rgba(56, 189, 248, 0.12) !important;
}

.slim-add-slide-btn:hover {
  background: rgba(56, 189, 248, 0.24) !important;
  color: #ffffff !important;
}

body.theme-light .slim-add-slide-btn {
  color: #0284c7 !important;
  border-color: rgba(2, 132, 199, 0.35) !important;
  background: rgba(2, 132, 199, 0.08) !important;
}

body.theme-light .slim-add-slide-btn:hover {
  background: rgba(2, 132, 199, 0.18) !important;
  color: #0369a1 !important;
}

.slim-danger-btn:hover {
  background: rgba(239, 68, 68, 0.2) !important;
  border-color: #ef4444 !important;
  color: #ef4444 !important;
}

/* 🙈 상단 슬라이드 바 감추기 상태일 때 천장 베젤 끝에 붙는 초박형 미니 탭 */
.top-slide-bar-mini-tab {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 446;
  height: 18px;
  padding: 0 11px;
  border-radius: 0 0 10px 10px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-top: none;
  background: rgba(15, 23, 42, 0.75);
  color: #e2e8f0;
  font-size: 10.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0.42;
  transition: all 0.16s ease;
  user-select: none;
}

.top-slide-bar-mini-tab:hover {
  opacity: 1;
  height: 22px;
  background: rgba(37, 99, 235, 0.95);
  color: #ffffff;
  border-color: #60a5fa;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

body.theme-light .top-slide-bar-mini-tab {
  background: rgba(255, 255, 255, 0.88);
  color: #334155;
  border-color: rgba(15, 23, 42, 0.18);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.06);
}

body.theme-light .top-slide-bar-mini-tab:hover {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
}



/* ============================================================================
   📤 통합 내보내기 & 공유 모달 (범위 × 문제/그래프/필기 필터 × 이미지·링크·파일)
   ============================================================================ */
.unified-export-modal-card {
  max-width: 416px !important;
  width: 92vw !important;
}

.unified-export-body {
  display: flex;
  flex-direction: column;
  gap: 10px !important;
  padding: 14px 16px 16px !important;
}

.export-filter-box {
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

body.theme-light .export-filter-box {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.export-filter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.export-step-label {
  font-size: 12px;
  font-weight: 700;
  color: #e2e8f0;
  min-width: 34px;
}

body.theme-light .export-step-label {
  color: #1e293b;
}

.export-scope-group,
.export-layer-group {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.export-scope-chip {
  height: 28px;
  padding: 0 11px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(30, 41, 59, 0.65);
  color: #cbd5e1;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.14s ease;
}

body.theme-light .export-scope-chip {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #475569;
}

.export-scope-chip.active {
  background: linear-gradient(135deg, #2563eb, #1d4ed8) !important;
  border-color: #60a5fa !important;
  color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
}

.export-layer-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(30, 41, 59, 0.6);
  color: #94a3b8;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
  transition: all 0.14s ease;
}

body.theme-light .export-layer-chip {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #64748b;
}

.export-layer-chip input[type="checkbox"] {
  accent-color: #2563eb;
  width: 13px;
  height: 13px;
  margin: 0;
  cursor: pointer;
}

.export-layer-chip.active {
  background: rgba(37, 99, 235, 0.22);
  border-color: rgba(96, 165, 250, 0.72);
  color: #f8fafc;
}

body.theme-light .export-layer-chip.active {
  background: #eff6ff;
  border-color: #3b82f6;
  color: #1d4ed8;
}

.export-filter-hint {
  font-size: 11.5px;
  color: #94a3b8;
  padding-top: 2px;
  border-top: 1px dashed rgba(148, 163, 184, 0.18);
}

body.theme-light .export-filter-hint {
  color: #64748b;
  border-top-color: #e2e8f0;
}

.export-img-btn-row,
.export-action-2x2-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.export-action-big-btn {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  font-size: 12px !important;
  font-weight: 700 !important;
  border-radius: 8px !important;
  padding: 0 10px !important;
}

.export-btn-share-link {
  background: linear-gradient(135deg, #2563eb, #1d4ed8) !important;
  border-color: #60a5fa !important;
  color: #ffffff !important;
}

.export-btn-share-link:hover {
  filter: brightness(1.06);
}

.share-deck-hub-group {
  padding: 9px 11px !important;
}

.share-deck-btn {
  height: 34px !important;
  padding: 0 10px !important;
  font-size: 12px !important;
  border-radius: 8px !important;
  min-width: 0 !important;
}

/* ============================================================================
   🖼️ 스마트 판서 이미지 뷰어 오버레이 (#smartNoteViewerOverlay)
   - 모바일·갤럭시 폴드·아이패드·PC 100% 깨짐 없는 직사각형 스캔 뷰어
   - 이미지 속 그래프(#1, #2) 터치 시 즉시 실시간 그래프 조작 모드 진입
   ============================================================================ */
.smart-note-viewer-overlay {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  z-index: 9500;
  background: #0b0f19;
  display: flex;
  flex-direction: column;
  user-select: none;
  overflow: hidden;
  overscroll-behavior: none;
}

body.theme-light .smart-note-viewer-overlay {
  background: #0f172a;
}

.smart-viewer-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  min-height: 48px;
  padding: 6px 14px;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(148, 163, 184, 0.22);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: nowrap;
  z-index: 30;
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.18s ease;
}

body.theme-light .smart-viewer-header {
  background: rgba(255, 255, 255, 0.94);
  border-bottom-color: rgba(15, 23, 42, 0.12);
}

.smart-note-viewer-overlay.viewer-immersive-fullscreen .smart-viewer-header {
  transform: translateY(-115%);
  opacity: 0;
  pointer-events: none;
}

.smart-viewer-left,
.smart-viewer-right {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
}

.viewer-slide-nav-group {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: rgba(30, 41, 59, 0.85);
  padding: 3px 5px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.28);
}

body.theme-light .viewer-slide-nav-group {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.viewer-nav-arrow {
  width: 28px;
  height: 26px;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: #e2e8f0;
  font-size: 11px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.14s ease, opacity 0.14s ease;
}

.viewer-nav-arrow:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
}

.viewer-nav-arrow:disabled {
  opacity: 0.32;
  cursor: default;
}

body.theme-light .viewer-nav-arrow {
  color: #1e293b;
}

body.theme-light .viewer-nav-arrow:hover:not(:disabled) {
  background: rgba(15, 23, 42, 0.08);
}

.viewer-page-counter-btn {
  height: 26px;
  min-width: 58px;
  padding: 0 10px;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: #f8fafc;
  font-size: 12.5px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

body.theme-light .viewer-page-counter-btn {
  color: #0f172a;
}

.viewer-slide-grid-popover {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 236px;
  padding: 10px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(148, 163, 184, 0.32);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.48);
  z-index: 60;
}

body.theme-light .viewer-slide-grid-popover {
  background: rgba(255, 255, 255, 0.98);
  border-color: rgba(15, 23, 42, 0.15);
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.16);
}

.viewer-slide-chips {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  max-height: 210px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.viewer-slide-chip {
  width: 100%;
  height: 30px;
  padding: 0 4px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(30, 41, 59, 0.75);
  color: #cbd5e1;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

body.theme-light .viewer-slide-chip {
  background: #f8fafc;
  color: #334155;
  border-color: #cbd5e1;
}

.viewer-slide-chip.active {
  background: #2563eb !important;
  border-color: #60a5fa !important;
  color: #ffffff !important;
}

.viewer-title-badge {
  display: none !important;
}

.viewer-zoom-group {
  display: inline-flex;
  align-items: center;
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 999px;
  padding: 2px;
}

body.theme-light .viewer-zoom-group {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.viewer-zoom-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: #e2e8f0;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

body.theme-light .viewer-zoom-btn {
  color: #1e293b;
}

.viewer-zoom-label {
  height: 26px;
  min-width: 48px;
  padding: 0 6px;
  border: none;
  background: transparent;
  color: #93c5fd;
  font-size: 11.5px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}

body.theme-light .viewer-zoom-label {
  color: #2563eb;
}

.viewer-top-btn {
  height: 30px;
  padding: 0 11px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: rgba(30, 41, 59, 0.85);
  color: #f8fafc;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  transition: all 0.14s ease;
  white-space: nowrap;
}

body.theme-light .viewer-top-btn {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #1e293b;
}

.viewer-top-btn-edit {
  background: linear-gradient(135deg, #2563eb, #1d4ed8) !important;
  border-color: #60a5fa !important;
  color: #ffffff !important;
}

.viewer-top-btn-fullscreen {
  width: 32px;
  padding: 0;
}

.smart-viewer-viewport {
  position: relative;
  flex: 1;
  width: 100%;
  height: 100%;
  overflow: hidden;
  display: block;
  touch-action: none;
  cursor: grab;
}

.smart-viewer-viewport:active {
  cursor: grabbing;
}

.smart-viewer-stage {
  position: absolute;
  left: 50%;
  top: 50%;
  display: inline-block;
  transform-origin: center center;
  transform: translate3d(-50%, -50%, 0);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.6);
  border-radius: 6px;
  overflow: hidden;
  background: #1e293b;
  z-index: 2;
  will-change: transform;
}

.smart-viewer-neighbor-stage {
  z-index: 1;
  pointer-events: none;
}

.smart-viewer-stage.swipe-animating {
  transition: transform var(--viewer-swipe-dur, 400ms) cubic-bezier(0.16, 1, 0.3, 1), width 0.18s ease, height 0.18s ease;
}

.smart-note-viewer-overlay.viewer-immersive-fullscreen .smart-viewer-stage {
  border-radius: 4px;
}

.viewer-edge-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 64px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #f8fafc;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 26;
  opacity: 0.28;
  transition: opacity 0.16s ease, background 0.16s ease, transform 0.14s ease;
}

.viewer-edge-nav-btn:hover:not(:disabled) {
  opacity: 0.95;
  background: rgba(37, 99, 235, 0.85);
  border-color: rgba(96, 165, 250, 0.65);
  transform: translateY(-50%) scale(1.04);
}

.viewer-edge-nav-btn:active:not(:disabled) {
  transform: translateY(-50%) scale(0.96);
}

.viewer-edge-nav-btn:disabled {
  opacity: 0 !important;
  pointer-events: none;
}

.viewer-edge-prev {
  left: 12px;
}

.viewer-edge-next {
  right: 12px;
}

.viewer-floating-page-toast {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  padding: 5px 14px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.86);
  border: 1px solid rgba(148, 163, 184, 0.32);
  color: #f8fafc;
  font-size: 12.5px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
  z-index: 25;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.38);
  transition: opacity 0.2s ease;
}

.smart-viewer-img {
  display: block;
  max-width: none;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

.smart-viewer-hotspots {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.viewer-graph-hotspot {
  position: absolute;
  pointer-events: auto;
  border: none;
  background: transparent;
  border-radius: 8px;
  cursor: pointer;
  transition: box-shadow 0.15s ease, background 0.15s ease;
}

.viewer-graph-hotspot:hover {
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.38);
  background: rgba(37, 99, 235, 0.03);
}

.viewer-hotspot-badge {
  display: none !important;
}

.smart-viewer-bottom-hint {
  display: none !important;
}

/* 🌟 [초기 진입 전체화면 게이트 (#viewerFullscreenGate)]:
   - 뒷배경 노트 이미지를 살짝 흐리게(blur 4.5px) 보여주어 자연스럽게 중앙 버튼 클릭 유도
   - 클릭 즉시 filter가 해제되어 렉 0%, 네이티브 전체화면 + 몰입 모드(상단바 숨김)로 꽉 차게 시작 */
.smart-note-viewer-overlay.viewer-entry-gate-active .smart-viewer-stage {
  filter: blur(4.5px) brightness(0.78);
  pointer-events: none !important;
}

.smart-note-viewer-overlay.viewer-entry-gate-active .smart-viewer-header,
.smart-note-viewer-overlay.viewer-entry-gate-active .viewer-edge-nav-btn {
  opacity: 0 !important;
  pointer-events: none !important;
}

.viewer-fullscreen-gate {
  position: absolute;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(11, 15, 25, 0.26);
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.viewer-fullscreen-gate-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  height: 66px;
  padding: 0 36px;
  border-radius: 999px;
  border: 2px solid rgba(147, 197, 253, 0.85);
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.98), rgba(29, 78, 216, 0.98));
  color: #ffffff;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.3px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.6), 0 0 0 5px rgba(37, 99, 235, 0.28);
  cursor: pointer;
  transition: transform 0.15s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.15s ease;
}

.viewer-fullscreen-gate-btn:hover {
  transform: scale(1.04);
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.65), 0 0 0 6px rgba(59, 130, 246, 0.32);
}

.viewer-fullscreen-gate-btn:active {
  transform: scale(0.97);
}

/* 📱 [모바일/스마트폰 전용 뷰어 최적화]:
   - 모바일에서는 핀치 줌·더블탭 줌을 사용하므로 상단 배율(- 100% +) 및 [편집] 버튼 숨김
   - 양옆 가장자리 화살표(.viewer-edge-nav-btn)가 엄지 스와이프를 가로채지 않도록 숨김
   - 노트가 여백 없이 화면 100%에 꽉 차도록 설정 */
@media (max-width: 768px),
(max-height: 500px) {
  .smart-viewer-header {
    min-height: 42px;
    padding: 4px 10px;
  }

  .smart-viewer-header .viewer-zoom-group,
  .smart-viewer-header #btnViewerEnterEdit {
    display: none !important;
  }

  .smart-note-viewer-overlay .viewer-edge-nav-btn {
    display: none !important;
  }

  .smart-note-viewer-overlay .smart-viewer-stage {
    border-radius: 0;
    box-shadow: none;
  }

  .viewer-top-btn {
    height: 28px;
    padding: 0 9px;
    font-size: 11.5px;
  }
}

/* ============================================================================
   📈 뷰어에서 그래프 클릭 시 열리는 클린 터치 조작 모드 (body.viewer-graph-touch-mode)
   ============================================================================ */
.viewer-graph-touch-bar {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9400;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(96, 165, 250, 0.45);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.42);
  max-width: 95vw;
  flex-wrap: wrap;
}

body.theme-light .viewer-graph-touch-bar {
  background: rgba(255, 255, 255, 0.95);
  border-color: #93c5fd;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.14);
}

.viewer-graph-touch-left,
.viewer-graph-touch-right {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.viewer-graph-touch-title {
  font-size: 12.5px;
  font-weight: 800;
  color: #f8fafc;
  padding: 0 6px;
}

body.theme-light .viewer-graph-touch-title {
  color: #0f172a;
}

.viewer-graph-curve-chips {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.viewer-curve-chip {
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(30, 41, 59, 0.8);
  color: #e2e8f0;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
}

body.theme-light .viewer-curve-chip {
  background: #f1f5f9;
  color: #1e293b;
  border-color: #cbd5e1;
}

.viewer-curve-chip.active {
  background: #2563eb !important;
  border-color: #60a5fa !important;
  color: #ffffff !important;
}

.viewer-touch-btn {
  height: 28px;
  padding: 0 11px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.32);
  background: rgba(30, 41, 59, 0.85);
  color: #e2e8f0;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
}

body.theme-light .viewer-touch-btn {
  background: #f8fafc;
  color: #1e293b;
  border-color: #cbd5e1;
}

.viewer-touch-btn-primary {
  background: linear-gradient(135deg, #2563eb, #1d4ed8) !important;
  border-color: #60a5fa !important;
  color: #ffffff !important;
}

body.viewer-graph-touch-mode #sidebarRail,
body.viewer-graph-touch-mode #rightActionToolbar,
body.viewer-graph-touch-mode #floatingInkBar,
body.viewer-graph-touch-mode #quickPillRemote,
body.viewer-graph-touch-mode #graphSnapFloatingBar,
body.viewer-graph-touch-mode #curveContextBar,
body.viewer-graph-touch-mode #problemCardWidget,
body.viewer-graph-touch-mode #graphCardWidget,
body.viewer-graph-touch-mode .extra-problem-card-widget,
body.viewer-graph-touch-mode .extra-graph-card-widget,
body.viewer-graph-touch-mode #lessonPlaylistNavBar,
body.viewer-graph-touch-mode #pdfBoardNavBar,
body.viewer-graph-touch-mode #topSlideBarMiniTab,
body.viewer-graph-touch-mode #sharedResetBar {
  display: none !important;
}

@media (max-width: 640px) {
  .export-img-btn-row {
    grid-template-columns: 1fr;
  }

  .share-link-qr-split {
    flex-direction: column;
  }

  .viewer-title-badge {
    display: none;
  }
}


/* 🌟 [대표님 피드백 반영: 클라우드 보관함(#modalCloudHub) 미니멀·클린 리디자인] 🌟 */
.cloud-hub-modal-card {
  max-width: 640px !important;
  width: 92vw !important;
}

.btn-cloud-header-file {
  height: 32px;
  padding: 0 11px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(148, 163, 184, 0.10);
  color: #334155;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  transition: all 0.15s ease;
}

body:not(.theme-light) .btn-cloud-header-file {
  color: #e2e8f0;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.16);
}

.btn-cloud-header-file:hover {
  border-color: #2563eb;
  color: #2563eb;
  background: rgba(37, 99, 235, 0.08);
}

.cloud-hub-body {
  gap: 12px !important;
  padding: 16px 20px 20px !important;
}

.cloud-save-box {
  background: rgba(148, 163, 184, 0.07) !important;
  border: 1px solid rgba(148, 163, 184, 0.22) !important;
  border-radius: 10px !important;
  padding: 10px 12px !important;
}

.cloud-save-inputs {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

.cloud-input-title {
  flex: 1;
  min-width: 0;
  height: 36px;
}

.btn-cloud-drive-file {
  height: 36px;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 700;
  border: 1px solid rgba(148, 163, 184, 0.38) !important;
  background: #ffffff !important;
  color: #334155 !important;
}

body:not(.theme-light) .btn-cloud-drive-file {
  background: rgba(30, 41, 59, 0.9) !important;
  color: #e2e8f0 !important;
  border-color: rgba(255, 255, 255, 0.16) !important;
}

.btn-cloud-drive-file:hover {
  border-color: #2563eb !important;
  color: #2563eb !important;
}

.cloud-playlist-toolbar {
  margin-bottom: 6px !important;
  padding: 8px 12px !important;
  border-radius: 9px !important;
  background: rgba(148, 163, 184, 0.07) !important;
}

.cloud-count-sub {
  font-weight: 600;
  color: #64748b;
  font-size: 12px;
}

.cloud-item-list {
  gap: 6px !important;
  max-height: 360px !important;
}

.cloud-item-row {
  padding: 9px 12px !important;
  border-radius: 9px !important;
  gap: 10px !important;
}

.cloud-item-info {
  flex-direction: row !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 10px !important;
  flex: 1;
  min-width: 0;
}

.cloud-item-title {
  font-size: 13.5px !important;
  font-weight: 600 !important;
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 1;
  cursor: pointer;
}

.cloud-item-title:hover {
  color: #2563eb !important;
}

.cloud-deck-badge {
  font-size: 11px !important;
  padding: 2px 7px !important;
  border-radius: 6px !important;
  background: rgba(37, 99, 235, 0.10) !important;
  color: #2563eb !important;
  border: 1px solid rgba(37, 99, 235, 0.22) !important;
  box-shadow: none !important;
  margin-right: 0 !important;
  flex-shrink: 0;
}

.cloud-item-date {
  font-size: 11.5px;
  color: #94a3b8;
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-cloud-export-item {
  height: 28px;
  padding: 0 9px;
  border-radius: 6px;
  border: 1px solid rgba(148, 163, 184, 0.32);
  background: transparent;
  color: #64748b;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
}

.btn-cloud-export-item:hover {
  border-color: #2563eb;
  color: #2563eb;
}

.btn-cloud-load {
  height: 28px !important;
  padding: 0 11px !important;
  border-radius: 6px !important;
  font-size: 12px !important;
}

.btn-cloud-del-item {
  height: 28px !important;
  width: 28px !important;
  padding: 0 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px !important;
}


/* 🌟 [대표님 기획: 좌상단 '불러오기(#modalCloudHub)' 단일 파일 열기 버튼 & 수업 모드 확정 후 잠금 스타일] 🌟 */
.cloud-import-source-box {
  display: flex;
  flex-direction: column;
}

.btn-import-single-hero {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px 18px;
  border-radius: 12px;
  border: 1.5px solid rgba(37, 99, 235, 0.38);
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(29, 78, 216, 0.03));
  color: #0f172a;
  cursor: pointer;
  text-align: left;
  transition: all 0.16s ease;
}

body:not(.theme-light) .btn-import-single-hero {
  background: rgba(30, 41, 59, 0.85);
  border-color: rgba(96, 165, 250, 0.38);
  color: #f8fafc;
}

.btn-import-single-hero:hover {
  border-color: #2563eb;
  background: #eff6ff;
  transform: translateY(-1.5px);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.14);
}

body:not(.theme-light) .btn-import-single-hero:hover {
  border-color: #60a5fa;
  background: rgba(37, 99, 235, 0.22);
}

.mode-card-icon-wrap {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 21px;
  flex-shrink: 0;
  background: rgba(37, 99, 235, 0.12);
  border: 1px solid rgba(37, 99, 235, 0.28);
}

body:not(.theme-light) .mode-card-icon-wrap {
  background: rgba(37, 99, 235, 0.22);
  border-color: rgba(96, 165, 250, 0.35);
}

.mode-card-text-wrap {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.mode-card-title {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: inherit;
}

.mode-card-desc {
  font-size: 12px;
  font-weight: 500;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body:not(.theme-light) .mode-card-desc {
  color: #94a3b8;
}

.rail-btn.rail-btn-locked-disabled {
  opacity: 0.36 !important;
  filter: grayscale(1);
  cursor: not-allowed !important;
}

/* ============================================================================
   🎯 [우측 상단 고정폭 슬라이드 캡슐 & 5열 바둑판 그리드 팝오버 + 좌측 [+] 바로 옆 2지선다]
   - 아이패드 상단 중앙(•••) · PC 전체화면 상단 중앙(✕) · 좌상단 문제카드(left:72px) 겹침 0%!
   - 캔버스를 100개 추가해도 상단 바 가로 길이는 절대 늘어나지 않음!
   ============================================================================ */
.pdf-board-nav-bar,
.lesson-playlist-nav-bar {
  position: fixed !important;
  top: 14px !important;
  right: 64px !important;
  left: auto !important;
  transform: none !important;
  z-index: 220 !important;
}

.slide-counter-pill {
  min-width: 64px;
  padding: 0 9px !important;
  justify-content: center;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.slim-add-slide-btn {
  width: 28px !important;
  height: 28px !important;
  min-width: 28px !important;
  padding: 0 !important;
  border-radius: 999px !important;
  border: 1px solid rgba(59, 130, 246, 0.45) !important;
  background: rgba(37, 99, 235, 0.16) !important;
  color: #60a5fa !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: all 0.14s ease !important;
}

.slim-add-slide-btn:hover {
  background: #2563eb !important;
  border-color: #60a5fa !important;
  color: #ffffff !important;
  transform: scale(1.05);
}

body.theme-light .slim-add-slide-btn {
  background: rgba(37, 99, 235, 0.10) !important;
  border-color: rgba(37, 99, 235, 0.35) !important;
  color: #2563eb !important;
}

body.theme-light .slim-add-slide-btn:hover {
  background: #2563eb !important;
  border-color: #1d4ed8 !important;
  color: #ffffff !important;
}

.slide-grid-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 268px;
  padding: 10px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(148, 163, 184, 0.32);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.45), 0 4px 12px rgba(0, 0, 0, 0.25);
  z-index: 480;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

body.theme-light .slide-grid-popover {
  background: rgba(255, 255, 255, 0.98);
  border-color: rgba(15, 23, 42, 0.15);
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.16), 0 4px 10px rgba(15, 23, 42, 0.08);
}

.slide-add-menu-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 148px;
  padding: 5px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(148, 163, 184, 0.32);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.42), 0 4px 10px rgba(0, 0, 0, 0.22);
  z-index: 485;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

body.theme-light .slide-add-menu-popover {
  background: rgba(255, 255, 255, 0.98);
  border-color: rgba(15, 23, 42, 0.14);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.15), 0 4px 10px rgba(15, 23, 42, 0.07);
}

.slide-add-menu-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: #f1f5f9;
  font-size: 12.5px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s ease, color 0.12s ease;
}

.slide-add-menu-item:hover {
  background: rgba(59, 130, 246, 0.24);
  color: #ffffff;
}

body.theme-light .slide-add-menu-item {
  color: #1e293b;
}

body.theme-light .slide-add-menu-item:hover {
  background: #eff6ff;
  color: #1d4ed8;
}

.slide-add-menu-icon {
  font-size: 13px;
  line-height: 1;
  width: 16px;
  text-align: center;
  flex-shrink: 0;
}

.slide-grid-popover-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 0 2px 6px 2px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.slide-grid-popover-title {
  font-size: 11.5px;
  font-weight: 700;
  color: #94a3b8;
  white-space: nowrap;
}

body.theme-light .slide-grid-popover-title {
  color: #475569;
}

.slide-grid-popover-actions {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.slide-grid-select-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  height: 24px;
  padding: 0 9px;
  border-radius: 6px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(148, 163, 184, 0.12);
  color: #e2e8f0;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: all 0.14s ease;
  white-space: nowrap;
}

.slide-grid-select-btn:hover {
  background: rgba(59, 130, 246, 0.22);
  border-color: #60a5fa;
  color: #ffffff;
}

.slide-grid-select-btn.is-select-mode {
  background: rgba(148, 163, 184, 0.22);
  border-color: rgba(148, 163, 184, 0.5);
  color: #f8fafc;
}

body.theme-light .slide-grid-select-btn {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #334155;
}

body.theme-light .slide-grid-select-btn:hover {
  background: #dbeafe;
  border-color: #60a5fa;
  color: #1d4ed8;
}

.slide-grid-del-current-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  height: 24px;
  padding: 0 8px;
  border-radius: 6px;
  border: 1px solid rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.12);
  color: #fca5a5;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: all 0.14s ease;
  white-space: nowrap;
}

.slide-grid-del-current-btn:hover:not(:disabled) {
  background: #ef4444;
  border-color: #ef4444;
  color: #ffffff;
}

.slide-grid-del-current-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.slide-grid-confirm-del-btn:not(:disabled) {
  background: #ef4444;
  border-color: #f87171;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.35);
}

body.theme-light .slide-grid-del-current-btn {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.3);
  color: #dc2626;
}

body.theme-light .slide-grid-del-current-btn:hover:not(:disabled),
body.theme-light .slide-grid-confirm-del-btn:not(:disabled) {
  background: #ef4444;
  border-color: #dc2626;
  color: #ffffff;
}

.slide-chips-grid {
  display: grid !important;
  grid-template-columns: repeat(5, 1fr) !important;
  gap: 6px !important;
  max-width: 100% !important;
  max-height: 210px !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  padding: 2px !important;
}

.slide-chips-grid .slide-chip-item {
  width: 100% !important;
  min-width: 0 !important;
  height: 30px !important;
  border-radius: 8px !important;
  padding: 0 4px !important;
  font-size: 12px !important;
  position: relative;
  user-select: none;
}

/* 바둑판 맨 끝 [ + ] 빈 캔버스 추가 점선 타일 */
.slide-chips-grid .slide-chip-item.slide-chip-add-blank {
  border: 1.5px dashed rgba(96, 165, 250, 0.55) !important;
  background: rgba(37, 99, 235, 0.10) !important;
  color: #60a5fa !important;
  font-size: 16px !important;
  font-weight: 800 !important;
}

.slide-chips-grid .slide-chip-item.slide-chip-add-blank:hover {
  background: #2563eb !important;
  border-style: solid !important;
  border-color: #60a5fa !important;
  color: #ffffff !important;
}

body.theme-light .slide-chips-grid .slide-chip-item.slide-chip-add-blank {
  border-color: rgba(37, 99, 235, 0.45) !important;
  background: rgba(37, 99, 235, 0.06) !important;
  color: #2563eb !important;
}

body.theme-light .slide-chips-grid .slide-chip-item.slide-chip-add-blank:hover {
  background: #2563eb !important;
  border-color: #1d4ed8 !important;
  color: #ffffff !important;
}

/* [선택] 모드에서 삭제 대상으로 체크된 슬라이드 타일 스타일 */
.slide-chips-grid .slide-chip-item.selected-for-delete {
  background: rgba(239, 68, 68, 0.24) !important;
  border: 1.5px solid #ef4444 !important;
  color: #fecaca !important;
  box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.28) !important;
}

body.theme-light .slide-chips-grid .slide-chip-item.selected-for-delete {
  background: #fee2e2 !important;
  border: 1.5px solid #ef4444 !important;
  color: #b91c1c !important;
}

/* 🙈 우측 상단(✕ 옆)으로 이동한 접힌 슬라이드 알약 탭 */
.top-slide-bar-mini-tab {
  position: fixed !important;
  top: 14px !important;
  right: 64px !important;
  left: auto !important;
  transform: none !important;
  z-index: 446 !important;
  height: 32px !important;
  padding: 0 13px !important;
  border-radius: 999px !important;
  border: 1px solid rgba(148, 163, 184, 0.35) !important;
  background: rgba(15, 23, 42, 0.9) !important;
  color: #f8fafc !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  opacity: 0.94 !important;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3) !important;
}

.top-slide-bar-mini-tab:hover {
  opacity: 1 !important;
  height: 32px !important;
  background: #2563eb !important;
  color: #ffffff !important;
  border-color: #60a5fa !important;
}

body.theme-light .top-slide-bar-mini-tab {
  background: rgba(255, 255, 255, 0.95) !important;
  color: #1e293b !important;
  border-color: rgba(15, 23, 42, 0.18) !important;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.12) !important;
}

body.theme-light .top-slide-bar-mini-tab:hover {
  background: #2563eb !important;
  color: #ffffff !important;
}

/* ✂️ 좌측 [+] 그래프 추가 버튼 바로 옆에 뜨는 2지선다(캡처 후 이동 / 바로 이동) 팝업 바 */
.pdf-to-graph-crop-bar {
  position: fixed !important;
  top: 96px !important;
  left: 64px !important;
  right: auto !important;
  z-index: 460 !important;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(96, 165, 250, 0.45);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.42);
}

body.theme-light .pdf-to-graph-crop-bar {
  background: rgba(255, 255, 255, 0.98);
  border-color: rgba(37, 99, 235, 0.35);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.16);
}

.pdf-crop-choice-btn.active-crop-wait {
  background: linear-gradient(135deg, #f59e0b, #d97706) !important;
  border-color: #fbbf24 !important;
  color: #ffffff !important;
}

.pdf-skip-choice-btn {
  background: linear-gradient(135deg, #10b981, #059669) !important;
  border-color: rgba(52, 211, 153, 0.6) !important;
  color: #ffffff !important;
}

.pdf-cancel-choice-btn {
  min-width: 30px !important;
  padding: 0 8px !important;
}

/* ✋ PDF 모달 상단 [이동] 버튼 활성화 스타일 및 드래그 이동 커서 */
.pdf-pan-mode-btn.active {
  background: #3b82f6 !important;
  border-color: #60a5fa !important;
  color: #ffffff !important;
  box-shadow: 0 0 16px rgba(59, 130, 246, 0.5) !important;
  animation: none !important;
}

.pdf-viewport:not(.crop-mode),
.pdf-viewport:not(.crop-mode) .pdf-page-wrapper,
.pdf-viewport:not(.crop-mode) .pdf-page-canvas {
  cursor: grab;
}

.pdf-viewport.panning-active,
.pdf-viewport.panning-active .pdf-page-wrapper,
.pdf-viewport.panning-active .pdf-page-canvas {
  cursor: grabbing !important;
}

/* ✂️ 좌측 [+] 바로 옆 위아래 2단 균형 배치 팝업 & 캡처 시 상단 미니 캡처 버튼 */
.pdf-to-graph-crop-bar {
  position: fixed !important;
  top: 86px !important;
  left: 64px !important;
  right: auto !important;
  z-index: 460 !important;
  display: flex;
  flex-direction: column !important;
  align-items: stretch !important;
  gap: 6px !important;
  width: 134px !important;
  padding: 7px !important;
  border-radius: 13px !important;
  background: rgba(15, 23, 42, 0.96) !important;
  border: 1px solid rgba(96, 165, 250, 0.45) !important;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.42) !important;
}

.pdf-to-graph-crop-bar .pdf-crop-choice-btn,
.pdf-to-graph-crop-bar .pdf-skip-choice-btn {
  width: 100% !important;
  height: 34px !important;
  padding: 0 10px !important;
  justify-content: center !important;
  border-radius: 9px !important;
  font-size: 12.5px !important;
  font-weight: 700 !important;
  white-space: nowrap !important;
}

.pdf-crop-active-pill {
  position: fixed !important;
  top: 14px !important;
  left: 64px !important;
  z-index: 465 !important;
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1.5px solid #00cec9;
  background: rgba(15, 23, 42, 0.92);
  color: #00cec9;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 206, 201, 0.3);
  user-select: none;
}

.pdf-crop-active-pill:hover {
  background: #ef4444;
  border-color: #f87171;
  color: #ffffff;
}

.pdf-crop-active-cancel-x {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  font-size: 10.5px;
  color: #ffffff;
}

body.theme-light .pdf-crop-active-pill {
  background: rgba(255, 255, 255, 0.96);
  color: #0f766e;
  border-color: #0d9488;
  box-shadow: 0 6px 18px rgba(13, 148, 136, 0.22);
}

body.theme-light .pdf-crop-active-pill .pdf-crop-active-cancel-x {
  background: rgba(15, 23, 42, 0.1);
  color: #0f172a;
}

/* 📌 카드 더블클릭 좌측 차곡차곡 자동 정렬 애니메이션 (드래그 중에는 즉시 반응, 정렬 시에는 스르륵 이동) */
.problem-card-widget.dock-animating {
  transition: left 0.22s cubic-bezier(0.22, 1, 0.36, 1), top 0.22s cubic-bezier(0.22, 1, 0.36, 1) !important;
}


/* ✒️ 굿노트 스타일 3종 필기 펜 촉 선택 칩 (#panelStyle) */
.ink-pen-style-grid .ink-pen-style-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 6px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 8px;
  transition: all 0.15s ease;
}

.ink-pen-style-grid .ink-pen-style-chip.active {
  background: rgba(0, 210, 211, 0.16);
  border-color: #00d2d3;
  color: #00d2d3;
  box-shadow: 0 0 0 1px rgba(0, 210, 211, 0.28);
}


/* ==========================================================================
   🎙️ 실시간 음성·필기·펜포인터·그래프 동기화 녹음 & 리플레이 스튜디오
   ========================================================================== */
#btnAudioRecordToggle.is-recording {
  background: linear-gradient(135deg, #ef4444, #dc2626) !important;
  border-color: #f87171 !important;
  color: #ffffff !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.35), 0 6px 16px rgba(239, 68, 68, 0.45) !important;
  animation: audioFabPulse 1.4s infinite ease-in-out;
}

#btnAudioRecordToggle.is-recording.is-paused {
  background: linear-gradient(135deg, #f59e0b, #d97706) !important;
  border-color: #fbbf24 !important;
  color: #ffffff !important;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.35), 0 6px 16px rgba(245, 158, 11, 0.4) !important;
  animation: none !important;
}

/* 녹음 중 우측 녹화 버튼 클릭 시 바로 옆(좌측)에 세로 2단(위: 일시정지 / 아래: 종료)으로 뜨는 컴팩트 메뉴 */
.audio-rec-side-menu {
  position: absolute;
  top: 50%;
  right: calc(100% + 9px);
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 5px;
  padding: 6px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid rgba(148, 163, 184, 0.32);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  white-space: nowrap;
  z-index: 495 !important;
  user-select: none;
  animation: flyoutSlideIn 0.14s cubic-bezier(0.16, 1, 0.3, 1);
}

body.theme-light .audio-rec-side-menu {
  background: rgba(255, 255, 255, 0.98);
  border-color: rgba(15, 23, 42, 0.18);
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.18);
}

.audio-rec-side-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-width: 82px;
  gap: 5px;
  height: 28px;
  padding: 0 11px;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.12s ease, filter 0.12s ease, box-shadow 0.12s ease;
}

.audio-rec-side-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
}

.audio-rec-side-btn:active {
  transform: scale(0.96);
}

body.student-audio-video-only #panelAudioRecordActions,
body.audio-replay-active #panelAudioRecordActions {
  display: none !important;
}

@keyframes audioFabPulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.07);
  }
}

.audio-sync-floating-bar {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2550;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.94);
  border: 1.5px solid rgba(148, 163, 184, 0.28);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: #f8fafc;
  user-select: none;
  max-width: calc(100vw - 140px);
  overflow-x: auto;
}

body.theme-light .audio-sync-floating-bar {
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(15, 23, 42, 0.16);
  color: #0f172a;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.16);
}

.audio-sync-group {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.audio-rec-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(239, 68, 68, 0.18);
  border: 1px solid rgba(239, 68, 68, 0.55);
  color: #f87171;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

body.theme-light .audio-rec-badge {
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
}

.audio-rec-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 8px #ef4444;
  animation: audioDotBlink 1s infinite ease-in-out;
}

@keyframes audioDotBlink {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.3;
    transform: scale(0.82);
  }
}

.audio-sync-time {
  font-family: 'JetBrains Mono', 'Pretendard', monospace;
  font-size: 12.5px;
  font-weight: 700;
  color: #e2e8f0;
  min-width: 44px;
  text-align: center;
}

body.theme-light .audio-sync-time {
  color: #1e293b;
}

.audio-rec-hint {
  font-size: 12px;
  font-weight: 500;
  color: #94a3b8;
  padding: 0 4px;
}

body.theme-light .audio-rec-hint {
  color: #475569;
}

@media (max-width: 900px) {
  .audio-rec-hint {
    display: none;
  }
}

.audio-sync-scrubber {
  width: clamp(160px, 34vw, 320px);
  height: 6px;
  accent-color: #00d2d3;
  cursor: pointer;
}

/* ==========================================================================
   🎬 [4단계: 문제+그래프+풀이+음성 전용 통 영상 플레이어 모드 (상시 노출 · 렉 0%)]
   재생 중에도 메뉴바/서랍/필기바를 투명도 트랜지션 없이 상시 노출(정적 GPU 레이어 고정)하여
   합성 부하(렉)를 0%로 만들고, 실제 화면 녹화 동영상과 100% 동일한 화면을 재현합니다!
   ========================================================================== */
body.student-audio-video-only #sharedResetBar,
body.student-audio-video-only #pdfBoardNavBar,
body.student-audio-video-only #smartNoteViewerOverlay,
body.student-audio-video-only #viewerGraphTouchBar,
body.student-audio-video-only .problem-card-resize-handle,
body.student-audio-video-only .card-sticker-del-btn,
body.student-audio-video-only #btnAudioReRecord,
body.student-audio-video-only #btnAudioSyncDelete,
body.student-audio-video-only #btnAudioSyncCloseBar,
body.student-audio-video-only #btnAudioShowFinalNote,
body.audio-replay-active #btnAudioShowFinalNote,
body.student-audio-video-only #btnPlaylistAddSlide,
body.student-audio-video-only #playlistAddSlideMenu,
body.student-audio-video-only #btnPlaylistNextPdfPage,
body.student-audio-video-only #btnPlaylistOpenPdf,
body.student-audio-video-only #btnPlaylistDeleteCurrent,
body.student-audio-video-only #btnPlaylistHideBar,
body.student-audio-video-only #btnPlaylistClose,
body.student-audio-video-only #btnPlaylistClearAll,
body.student-audio-video-only #btnPlaylistToggleSelectMode,
body.student-audio-video-only #btnPlaylistConfirmSelectedDelete,
body.student-audio-video-only .slide-chip-add-blank,
body.student-audio-video-only #lessonPlaylistNavBar .pdf-board-nav-divider,
body.student-audio-video-only .slide-chip-del-x {
  display: none !important;
}

/* 상시 노출 메뉴바/서랍: 투명도 애니메이션 없이 그대로 띄워두고 시청자 오클릭만 자식 버튼(*)까지 100% 원천 차단 */
body.student-audio-video-only #railDrawer,
body.audio-replay-active #railDrawer {
  transition: none !important;
}

body.student-audio-video-only #sidebarRail,
body.student-audio-video-only #sidebarRail *,
body.student-audio-video-only #railDrawer,
body.student-audio-video-only #railDrawer *,
body.student-audio-video-only #inkFloatingToolbar,
body.student-audio-video-only #inkFloatingToolbar *,
body.student-audio-video-only #rightActionToolbar,
body.student-audio-video-only #rightActionToolbar *,
body.student-audio-video-only #quickPillRemote,
body.student-audio-video-only #quickPillRemote *,
body.student-audio-video-only #graphSnapFloatingBar,
body.student-audio-video-only #graphSnapFloatingBar *,
body.student-audio-video-only #pdfToGraphCropFloatingBar,
body.student-audio-video-only #pdfToGraphCropFloatingBar *,
body.student-audio-video-only #curveContextBar,
body.student-audio-video-only #curveContextBar *,
body.student-audio-video-only #ctxSymmetryPopover,
body.student-audio-video-only #ctxSymmetryPopover *,
body.student-audio-video-only #ctxAbsPopover,
body.student-audio-video-only #ctxAbsPopover *,
body.student-audio-video-only #lassoActionFloatingBar,
body.student-audio-video-only #lassoActionFloatingBar *,
body.student-audio-video-only #pwRegionPopover,
body.student-audio-video-only #pwRegionPopover *,
body.audio-replay-active #sidebarRail,
body.audio-replay-active #sidebarRail *,
body.audio-replay-active #railDrawer,
body.audio-replay-active #railDrawer *,
body.audio-replay-active #inkFloatingToolbar,
body.audio-replay-active #inkFloatingToolbar *,
body.audio-replay-active #rightActionToolbar,
body.audio-replay-active #rightActionToolbar *,
body.audio-replay-active #quickPillRemote,
body.audio-replay-active #quickPillRemote *,
body.audio-replay-active #graphSnapFloatingBar,
body.audio-replay-active #graphSnapFloatingBar *,
body.audio-replay-active #pdfToGraphCropFloatingBar,
body.audio-replay-active #pdfToGraphCropFloatingBar *,
body.audio-replay-active #curveContextBar,
body.audio-replay-active #curveContextBar *,
body.audio-replay-active #ctxSymmetryPopover,
body.audio-replay-active #ctxSymmetryPopover *,
body.audio-replay-active #ctxAbsPopover,
body.audio-replay-active #ctxAbsPopover *,
body.audio-replay-active #lassoActionFloatingBar,
body.audio-replay-active #lassoActionFloatingBar *,
body.audio-replay-active #pwRegionPopover,
body.audio-replay-active #pwRegionPopover *,
body.audio-replay-active #problemCardWidget,
body.audio-replay-active #problemCardWidget *,
body.audio-replay-active #graphCardWidget,
body.audio-replay-active #graphCardWidget *,
body.audio-replay-active .extra-problem-card-widget,
body.audio-replay-active .extra-problem-card-widget *,
body.audio-replay-active .extra-graph-card-widget,
body.audio-replay-active .extra-graph-card-widget *,
body.audio-replay-active #workspaceStickerOverlay,
body.audio-replay-active #workspaceStickerOverlay * {
  pointer-events: none !important;
}

/* 리플레이 중 포인터가 가리키는 버튼 호버 하이라이트 & 클릭 피드백 */
.replay-ui-btn-hover {
  outline: 2px solid #00d2d3 !important;
  outline-offset: 2px !important;
  box-shadow: 0 0 14px rgba(0, 210, 211, 0.55) !important;
  transform: translateY(-1px) scale(1.05) !important;
  transition: transform 0.12s ease, box-shadow 0.12s ease !important;
  z-index: 5 !important;
}

.replay-ui-btn-active {
  outline: 2.5px solid #38bdf8 !important;
  outline-offset: 2px !important;
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.85) !important;
  transform: scale(0.94) !important;
  transition: transform 0.08s ease, box-shadow 0.08s ease !important;
  z-index: 6 !important;
}

body.student-audio-video-only #graphCanvas,
body.student-audio-video-only #problemCardWidget,
body.student-audio-video-only #problemCardWidget *,
body.student-audio-video-only #graphCardWidget,
body.student-audio-video-only #graphCardWidget *,
body.student-audio-video-only .extra-problem-card-widget,
body.student-audio-video-only .extra-problem-card-widget *,
body.student-audio-video-only .extra-graph-card-widget,
body.student-audio-video-only .extra-graph-card-widget *,
body.student-audio-video-only #workspaceStickerOverlay,
body.student-audio-video-only #workspaceStickerOverlay * {
  pointer-events: none !important;
}

body.student-audio-video-only #audioSyncFloatingBar {
  top: auto !important;
  bottom: 22px !important;
  padding: 8px 16px !important;
  max-width: calc(100vw - 24px) !important;
  z-index: 2680 !important;
}

body.student-audio-video-only .audio-sync-scrubber {
  width: clamp(180px, 52vw, 460px) !important;
  height: 7px !important;
}

.audio-sync-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(30, 41, 59, 0.85);
  color: #f1f5f9;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

body.theme-light .audio-sync-btn {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #1e293b;
}

.audio-sync-btn:hover {
  border-color: #00d2d3;
  color: #00d2d3;
}

.audio-btn-stop {
  background: linear-gradient(135deg, #ef4444, #dc2626) !important;
  border-color: #f87171 !important;
  color: #ffffff !important;
  font-weight: 700;
}

.audio-btn-play {
  width: 30px;
  height: 30px;
  padding: 0;
  background: linear-gradient(135deg, #00d2d3, #0ea5e9) !important;
  border-color: #38bdf8 !important;
  color: #0f172a !important;
  font-weight: 800;
}

.audio-btn-mode.active-video,
.audio-btn-final-note {
  background: rgba(0, 210, 211, 0.18);
  border-color: #00d2d3;
  color: #00d2d3;
}

body.theme-light .audio-btn-final-note {
  background: rgba(14, 165, 233, 0.14);
  border-color: #0284c7;
  color: #0369a1;
}

.audio-btn-mode.active-note {
  background: rgba(245, 158, 11, 0.18);
  border-color: #f59e0b;
  color: #fbbf24;
}

body.theme-light .audio-btn-mode.active-note {
  color: #d97706;
  border-color: #d97706;
}

.audio-btn-viewer-back {
  background: rgba(59, 130, 246, 0.2);
  border-color: #60a5fa;
  color: #93c5fd;
}

body.theme-light .audio-btn-viewer-back {
  color: #2563eb;
  border-color: #3b82f6;
}

.viewer-top-btn-audio {
  background: linear-gradient(135deg, #00d2d3, #0284c7) !important;
  border-color: #38bdf8 !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.35);
}

.viewer-top-btn-note-audio {
  background: rgba(245, 158, 11, 0.18) !important;
  border-color: #f59e0b !important;
  color: #fde68a !important;
  font-weight: 700 !important;
}

/* 가상 펜 포인터 리플레이 시 카드/메뉴/서랍 위에서도 항상 최상단에 표시 */
body.audio-replay-active #virtualStylusPen {
  position: fixed !important;
  z-index: 2147483640 !important;
  pointer-events: none !important;
}

/* 녹음 중 일시정지 / 이어녹음 배지 및 버튼 스타일 */
.audio-rec-badge.is-paused {
  background: rgba(245, 158, 11, 0.2) !important;
  border-color: rgba(245, 158, 11, 0.65) !important;
  color: #fbbf24 !important;
}

body.theme-light .audio-rec-badge.is-paused {
  background: rgba(245, 158, 11, 0.14) !important;
  color: #d97706 !important;
}

.audio-rec-badge.is-paused .audio-rec-dot {
  background: #f59e0b !important;
  box-shadow: 0 0 6px #f59e0b !important;
  animation: none !important;
}

.audio-btn-pause-rec {
  background: rgba(245, 158, 11, 0.16) !important;
  border-color: rgba(245, 158, 11, 0.55) !important;
  color: #fde68a !important;
  font-weight: 700;
}

body.theme-light .audio-btn-pause-rec {
  background: rgba(245, 158, 11, 0.12) !important;
  border-color: #d97706 !important;
  color: #b45309 !important;
}

.audio-btn-pause-rec.is-paused {
  background: linear-gradient(135deg, #00d2d3, #0ea5e9) !important;
  border-color: #38bdf8 !important;
  color: #0f172a !important;
  box-shadow: 0 0 12px rgba(0, 210, 211, 0.45);
}


/* 1차·2차·3차 단계별 저장 원클릭 프리셋 칩 */
.export-stage-preset-row {
  padding-top: 4px;
  border-top: 1px dashed rgba(148, 163, 184, 0.18);
}

.export-stage-preset-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.export-stage-preset-chip {
  height: 28px;
  padding: 0 11px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(30, 41, 59, 0.55);
  color: #cbd5e1;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.14s ease;
}

body.theme-light .export-stage-preset-chip {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #475569;
}

.export-stage-preset-chip:hover {
  border-color: #60a5fa;
  color: #ffffff;
}

body.theme-light .export-stage-preset-chip:hover {
  border-color: #3b82f6;
  color: #1d4ed8;
}

.export-stage-preset-chip.active {
  background: linear-gradient(135deg, #0ea5e9, #2563eb) !important;
  border-color: #60a5fa !important;
  color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}


/* 마이크 ON/OFF 토글 및 실시간 음성 입력 레벨 표시등 */
.audio-btn-mic-toggle {
  background: rgba(16, 185, 129, 0.16) !important;
  border-color: rgba(16, 185, 129, 0.55) !important;
  color: #a7f3d0 !important;
  font-weight: 700;
}

body.theme-light .audio-btn-mic-toggle {
  background: rgba(16, 185, 129, 0.12) !important;
  border-color: #059669 !important;
  color: #047857 !important;
}

.audio-btn-mic-toggle.is-muted {
  background: rgba(100, 116, 139, 0.25) !important;
  border-color: rgba(148, 163, 184, 0.45) !important;
  color: #cbd5e1 !important;
}

body.theme-light .audio-btn-mic-toggle.is-muted {
  background: #e2e8f0 !important;
  border-color: #94a3b8 !important;
  color: #475569 !important;
}

.audio-mic-level-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 6px #10b981;
  display: inline-block;
  transition: transform 0.08s ease, opacity 0.12s ease, background 0.12s ease;
}

.audio-btn-mic-toggle.is-muted .audio-mic-level-dot {
  background: #94a3b8;
  box-shadow: none;
  opacity: 0.5;
}


/* 리플레이 포인터 클릭/잡기 파동(Click Ripple) 이펙트 */
.stylus-click-ripple {
  position: absolute;
  left: 0;
  top: 0;
  width: 24px;
  height: 24px;
  margin-left: -12px;
  margin-top: -12px;
  border-radius: 50%;
  border: 2.2px solid #38bdf8;
  background: rgba(56, 189, 248, 0.22);
  pointer-events: none;
  opacity: 0;
  transform: scale(0.3);
}

.stylus-click-ripple.pulse-active {
  animation: stylusClickPulse 0.38s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes stylusClickPulse {
  0% {
    opacity: 0.95;
    transform: scale(0.35);
  }

  100% {
    opacity: 0;
    transform: scale(1.65);
  }
}


/* ⭐ [자주 쓰는 내 그래프 보관함 (Custom Graph Presets) 전용 스타일] */
.cat-tab-btn.cat-tab-my-graphs {
  color: #fbbf24;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.cat-tab-btn.cat-tab-my-graphs.active {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #ffffff;
}

body.theme-light .cat-tab-btn.cat-tab-my-graphs {
  color: #d97706;
}

body.theme-light .cat-tab-btn.cat-tab-my-graphs.active {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #ffffff;
}

.custom-graph-register-wrap {
  grid-column: span 2;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 1px;
}

.custom-graph-add-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 8px;
  border-radius: 6px;
  border: 1.2px dashed rgba(251, 191, 36, 0.55);
  background: rgba(245, 158, 11, 0.10);
  color: #fde68a;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.custom-graph-add-btn:hover {
  background: rgba(245, 158, 11, 0.18);
  border-color: #fbbf24;
  transform: translateY(-1px);
}

body.theme-light .custom-graph-add-btn {
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(217, 119, 6, 0.45);
  color: #b45309;
}

body.theme-light .custom-graph-add-btn:hover {
  background: rgba(245, 158, 11, 0.15);
  border-color: #d97706;
}

.custom-graph-quota-badge {
  font-size: 9.5px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.35);
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.35);
}

body.theme-light .custom-graph-quota-badge {
  background: #fef3c7;
  color: #b45309;
  border-color: #fde68a;
}

.custom-graph-card {
  grid-column: span 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 4px 7px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--panel-border);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.custom-graph-card:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(251, 191, 36, 0.5);
  transform: translateY(-1px);
}

body.theme-light .custom-graph-card {
  background: #ffffff;
  border-color: #e2e8f0;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

body.theme-light .custom-graph-card:hover {
  background: #fffbeb;
  border-color: #f59e0b;
}

.custom-graph-card-left {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 1;
}

.custom-graph-thumb-box {
  width: 34px;
  height: 22px;
  border-radius: 5px;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

body.theme-light .custom-graph-thumb-box {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.custom-graph-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  flex: 1;
}

.custom-graph-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.theme-light .custom-graph-title {
  color: #0f172a;
}

.custom-graph-meta {
  font-size: 9.5px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.theme-light .custom-graph-meta {
  color: #64748b;
}

.custom-graph-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.custom-graph-act-btn {
  width: 21px;
  height: 21px;
  border-radius: 4px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 10.5px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.12s ease;
}

.custom-graph-act-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.custom-graph-act-btn.del:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
}

body.theme-light .custom-graph-act-btn:hover {
  background: rgba(15, 23, 42, 0.08);
  color: #0f172a;
}

body.theme-light .custom-graph-act-btn.del:hover {
  background: #fee2e2;
  color: #dc2626;
}

.custom-graph-empty {
  grid-column: span 2;
  padding: 6px 8px;
  text-align: center;
  font-size: 10.5px;
  line-height: 1.35;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed rgba(255, 255, 255, 0.1);
  border-radius: 6px;
}

body.theme-light .custom-graph-empty {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #64748b;
}


/* ==========================================================================
   🟨 [가림막 포스트잇 '스티커' 도구 (#btnInkSticker · #btnPillSticker · 카드/뷰어 스티커)]
   ========================================================================== */
.ink-tool-btn.ink-sticker-btn.active,
.pill-remote-btn.pill-sticker-btn.active {
  background: linear-gradient(135deg, rgba(250, 204, 21, 0.28), rgba(234, 179, 8, 0.22)) !important;
  border-color: #eab308 !important;
  color: #fde047 !important;
  box-shadow: 0 0 12px rgba(234, 179, 8, 0.32) !important;
}

body.theme-light .ink-tool-btn.ink-sticker-btn.active,
body.theme-light .pill-remote-btn.pill-sticker-btn.active {
  background: linear-gradient(135deg, #fef08a, #fde047) !important;
  border-color: #ca8a04 !important;
  color: #854d0e !important;
  box-shadow: 0 2px 8px rgba(202, 138, 4, 0.25) !important;
}

body.ink-sticker-tool-active #graphCanvas,
body.ink-sticker-tool-active .problem-card-body,
body.ink-sticker-tool-active .problem-card-img,
body.ink-sticker-tool-active .problem-card-widget.card-ink-active .problem-card-body,
body.ink-sticker-tool-active .problem-card-widget.card-ink-active .problem-card-img {
  cursor: crosshair !important;
}

.workspace-sticker-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 210 !important;
  overflow: hidden;
}

body.ink-sticker-tool-active .workspace-sticker-overlay .workspace-sticker-item {
  pointer-events: none !important;
}

body.ink-sticker-tool-active .workspace-sticker-overlay .workspace-sticker-item .card-sticker-del-btn {
  pointer-events: auto !important;
}

.card-stickers-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 25 !important;
  overflow: hidden;
  border-radius: inherit;
}

.card-sticker-item,
.viewer-sticker-hotspot {
  position: absolute;
  pointer-events: auto;
  cursor: pointer !important;
  user-select: none;
  touch-action: none;
  box-sizing: border-box;
  border-radius: 7px;
  background: linear-gradient(135deg, #fef08a 0%, #fde047 68%, #facc15 100%);
  border: 1.5px solid #eab308;
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, transform 0.12s ease;
  overflow: hidden;
  z-index: 7;
}

.card-sticker-item::after,
.viewer-sticker-hotspot::after {
  content: '';
  position: absolute;
  right: 0;
  bottom: 0;
  width: 10px;
  height: 10px;
  background: linear-gradient(135deg, transparent 50%, rgba(202, 138, 4, 0.38) 50%);
  pointer-events: none;
}

.card-sticker-item:hover,
.viewer-sticker-hotspot:hover {
  border-color: #ca8a04;
  box-shadow: 0 5px 14px rgba(15, 23, 42, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.card-sticker-item.revealed,
.viewer-sticker-hotspot.revealed {
  background: rgba(250, 204, 21, 0.06) !important;
  border: 1.5px dashed rgba(202, 138, 4, 0.65) !important;
  box-shadow: none !important;
}

.card-sticker-item.revealed::after,
.viewer-sticker-hotspot.revealed::after {
  display: none;
}

.card-sticker-badge {
  font-size: 11px;
  font-weight: 800;
  color: #854d0e;
  background: rgba(255, 255, 255, 0.62);
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid rgba(202, 138, 4, 0.28);
  pointer-events: none;
  white-space: nowrap;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.card-sticker-item.revealed .card-sticker-badge,
.viewer-sticker-hotspot.revealed .card-sticker-badge {
  position: absolute;
  top: 2px;
  left: 3px;
  font-size: 9.5px;
  padding: 1px 4px;
  opacity: 0.68;
  background: rgba(254, 240, 138, 0.85);
}

.card-sticker-del-btn {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: none;
  background: rgba(15, 23, 42, 0.68);
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer !important;
  opacity: 0;
  transition: opacity 0.14s ease, background 0.14s ease;
  padding: 0;
  z-index: 2;
}

.card-sticker-item:hover .card-sticker-del-btn,
body.ink-sticker-tool-active .card-sticker-del-btn,
.card-sticker-del-btn:hover {
  opacity: 1;
}

@media (hover: none),
(pointer: coarse) {
  .card-sticker-del-btn {
    opacity: 0.85;
  }
}

.card-sticker-del-btn:hover {
  background: #dc2626;
}

.card-sticker-draft,
.workspace-sticker-draft {
  position: absolute;
  pointer-events: none;
  border-radius: 7px;
  background: rgba(250, 204, 21, 0.68);
  border: 2px solid #ca8a04;
  box-shadow: 0 4px 12px rgba(202, 138, 4, 0.25);
  z-index: 26 !important;
}

/* ============================================================================
   💡 [설정창 하단 사용법·공지·버그제보 링크 & 단방향 안내 모달 (#modalGuideNotice)]
   ============================================================================ */
.settings-support-btn {
  width: 100%;
  padding: 9px 11px;
  border-radius: 9px;
  border: 1px solid rgba(148, 163, 184, 0.32);
  background: rgba(15, 23, 42, 0.04);
  color: var(--text-main, #0f172a);
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
  box-sizing: border-box;
}

body:not(.theme-light) .settings-support-btn {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.14);
  color: #f8fafc;
}

.settings-support-btn:hover {
  border-color: #2563eb;
  background: rgba(37, 99, 235, 0.09);
  color: #2563eb;
}

body:not(.theme-light) .settings-support-btn:hover {
  border-color: #60a5fa;
  background: rgba(37, 99, 235, 0.2);
  color: #93c5fd;
}

.settings-support-left {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-support-arrow {
  font-size: 15px;
  font-weight: 800;
  opacity: 0.7;
}

.settings-support-badge {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.12);
  color: #2563eb;
  flex-shrink: 0;
}

body:not(.theme-light) .settings-support-badge {
  background: rgba(96, 165, 250, 0.22);
  color: #93c5fd;
}

.guide-notice-modal-card {
  width: min(680px, 94vw) !important;
  max-height: 85vh !important;
  display: flex !important;
  flex-direction: column !important;
}

.guide-notice-tab-bar {
  display: flex;
  gap: 6px;
  padding: 10px 18px 0 18px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.22);
}

.guide-tab-btn {
  padding: 9px 14px;
  border: none;
  border-bottom: 2.5px solid transparent;
  background: transparent;
  color: #64748b;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

body:not(.theme-light) .guide-tab-btn {
  color: #94a3b8;
}

.guide-tab-btn:hover {
  color: #2563eb;
}

.guide-tab-btn.active {
  color: #2563eb;
  border-bottom-color: #2563eb;
}

body:not(.theme-light) .guide-tab-btn.active {
  color: #60a5fa;
  border-bottom-color: #60a5fa;
}

.guide-notice-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px !important;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.guide-section-card {
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(248, 250, 252, 0.85);
  margin-bottom: 10px;
}

body:not(.theme-light) .guide-section-card {
  background: rgba(30, 41, 59, 0.65);
  border-color: rgba(255, 255, 255, 0.1);
}

.guide-card-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.12);
  color: #2563eb;
  margin-bottom: 6px;
}

body:not(.theme-light) .guide-card-badge {
  background: rgba(96, 165, 250, 0.2);
  color: #93c5fd;
}

.guide-card-title {
  margin: 0 0 8px 0;
  font-size: 14.5px;
  font-weight: 800;
  color: inherit;
}

.guide-bullet-list {
  margin: 0;
  padding-left: 18px;
  font-size: 12.8px;
  line-height: 1.65;
  color: #334155;
}

body:not(.theme-light) .guide-bullet-list {
  color: #cbd5e1;
}

.guide-bullet-list li {
  margin-bottom: 5px;
}

.guide-shortcut-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.guide-shortcut-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: rgba(248, 250, 252, 0.85);
}

body:not(.theme-light) .guide-shortcut-item {
  background: rgba(30, 41, 59, 0.65);
  border-color: rgba(255, 255, 255, 0.1);
}

.guide-kbd {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 6px;
  background: #e2e8f0;
  color: #0f172a;
  border: 1px solid #cbd5e1;
  white-space: nowrap;
  flex-shrink: 0;
}

body:not(.theme-light) .guide-kbd {
  background: #1e293b;
  color: #f8fafc;
  border-color: #475569;
}

.guide-shortcut-desc {
  font-size: 12.8px;
  font-weight: 600;
  color: #334155;
  text-align: right;
}

body:not(.theme-light) .guide-shortcut-desc {
  color: #cbd5e1;
}

.guide-notice-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.guide-notice-item {
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(248, 250, 252, 0.85);
}

body:not(.theme-light) .guide-notice-item {
  background: rgba(30, 41, 59, 0.65);
  border-color: rgba(255, 255, 255, 0.1);
}

.guide-notice-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.guide-notice-tag {
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
}

.guide-notice-tag.tag-new {
  background: rgba(220, 38, 38, 0.12);
  color: #dc2626;
}

.guide-notice-tag.tag-tip {
  background: rgba(37, 99, 235, 0.12);
  color: #2563eb;
}

.guide-notice-tag.tag-info {
  background: rgba(22, 163, 74, 0.12);
  color: #16a34a;
}

.guide-notice-date {
  font-size: 11.5px;
  color: #64748b;
}

.guide-notice-title {
  margin: 0 0 6px 0;
  font-size: 14px;
  font-weight: 800;
}

.guide-notice-text {
  margin: 0;
  font-size: 12.8px;
  line-height: 1.6;
  color: #475569;
}

body:not(.theme-light) .guide-notice-text {
  color: #cbd5e1;
}

.guide-notice-modal-footer {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 10px !important;
  flex-wrap: wrap;
}

.guide-footer-bug-info {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
}

.guide-bug-email {
  color: #2563eb;
  user-select: all;
}

body:not(.theme-light) .guide-bug-email {
  color: #60a5fa;
}

.guide-footer-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.guide-footer-btn {
  padding: 7px 12px !important;
  font-size: 12px !important;
  border-radius: 8px !important;
}

/* =========================================================================
   🎬 [유튜브형 고정 프레임 영상 스테이지 (Fixed-Aspect Recorded Video Stage)]
   - 촬영 당시의 화면(stageW × stageH) 전체를 하나의 고정 프레임으로 묶어
     모바일·태블릿·PC·와이드 모니터 어디서든 비율 왜곡 0%로 균일 스케일링(Contain)
   - 와이드 모니터에서는 좌우 필러박스, 모바일 가로/세로에서는 상하 레터박스 자동 형성
   - 상단 슬라이드 네비게이션 바(#lessonPlaylistNavBar)와 하단 재생 컨트롤러(#audioSyncFloatingBar)는
     스테이지 바깥(뷰포트 1.0x)에 또렷하게 고정되어 언제나 쾌적하게 조작 가능
   ========================================================================= */
html:has(body.replay-fixed-stage),
body.replay-fixed-stage {
  background-color: #0b0f19 !important;
  overflow: hidden !important;
  touch-action: none !important;
  user-select: none !important;
  -webkit-user-select: none !important;
}

body.replay-fixed-stage .main-workspace {
  position: fixed !important;
  left: 0 !important;
  top: 0 !important;
  width: var(--replay-stage-w, 1440px) !important;
  height: var(--replay-stage-h, 900px) !important;
  max-width: none !important;
  max-height: none !important;
  transform-origin: 0 0 !important;
  overflow: hidden !important;
  background-color: var(--bg-canvas, #ffffff) !important;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14), 0 24px 64px rgba(0, 0, 0, 0.65) !important;
  z-index: 100 !important;
}

body.replay-fixed-stage:not(.theme-light) .main-workspace {
  background-color: #0f172a !important;
}

body.replay-fixed-stage .canvas-quick-toolbar {
  max-height: calc(100% - 28px) !important;
}

body.replay-fixed-stage .problem-card-widget {
  max-width: none !important;
}

body.replay-fixed-stage #graphSnapFloatingBar,
body.replay-fixed-stage #pdfToGraphCropFloatingBar,
body.replay-fixed-stage #btnCancelPdfCropToGraph,
body.replay-fixed-stage #graphSnapDragBox {
  position: absolute !important;
}

body.replay-fixed-stage #audioSyncFloatingBar,
body.audio-replay-active #audioSyncFloatingBar,
body.student-audio-video-only #audioSyncFloatingBar {
  position: fixed !important;
  top: auto !important;
  bottom: 18px !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  padding: 7px 14px !important;
  max-width: calc(100vw - 16px) !important;
  z-index: 9500 !important;
  opacity: 1;
  transition: opacity 0.26s cubic-bezier(0.22, 1, 0.36, 1), transform 0.26s cubic-bezier(0.22, 1, 0.36, 1) !important;
}

#audioSyncFloatingBar.player-bar-auto-hidden,
body.replay-fixed-stage #audioSyncFloatingBar.player-bar-auto-hidden,
body.audio-replay-active #audioSyncFloatingBar.player-bar-auto-hidden,
body.student-audio-video-only #audioSyncFloatingBar.player-bar-auto-hidden {
  opacity: 0 !important;
  transform: translate(-50%, 20px) !important;
  pointer-events: none !important;
}

body.replay-fixed-stage #lessonPlaylistNavBar,
body.replay-fixed-stage #topSlideBarMiniTab {
  z-index: 9500 !important;
}

.audio-btn-zoom {
  font-variant-numeric: tabular-nums;
  min-width: 48px;
}

.audio-btn-zoom.is-zoomed {
  background: rgba(14, 165, 233, 0.22) !important;
  border-color: #38bdf8 !important;
  color: #0284c7 !important;
  font-weight: 800 !important;
}

body:not(.theme-light) .audio-btn-zoom.is-zoomed {
  color: #38bdf8 !important;
}

@media (max-width: 640px) {

  body.replay-fixed-stage #audioSyncFloatingBar,
  body.audio-replay-active #audioSyncFloatingBar,
  body.student-audio-video-only #audioSyncFloatingBar {
    bottom: 12px !important;
    padding: 6px 10px !important;
    gap: 6px !important;
  }

  body.replay-fixed-stage .audio-sync-scrubber,
  body.audio-replay-active .audio-sync-scrubber,
  body.student-audio-video-only .audio-sync-scrubber {
    width: clamp(110px, 38vw, 260px) !important;
  }

  body.replay-fixed-stage .audio-sync-time {
    font-size: 11px !important;
    min-width: 70px !important;
  }

  body.replay-fixed-stage .audio-sync-btn {
    padding: 4px 8px !important;
    font-size: 11px !important;
  }
}

/* 👁️⇄✏️ [작업 화면 ⇄ 표준 뷰어 일원화: 상단 슬라이드 번호 탭과 겹치던 구버전 공유 리셋바 영구 숨김] */
#sharedResetBar {
  display: none !important;
}

/* =========================================================================
   ☁️🪟 [윈도우 파일 탐색기 100% 동일 클라우드 보관함 (#modalCloudHub)]
   - 상단: 상위 폴더(⬆️) + 주소 표시줄(Breadcrumb) + 새 폴더 + 검색
   - 중단: 좌측 폴더 트리 + 우측 폴더/파일 탐색기 (더블클릭 열기 & 드래그 앤 드롭 이동)
   - 하단: 윈도우 '다른 이름으로 저장' 표준 바 (파일 이름 + 현재 폴더에 저장)
   ========================================================================= */
.cloud-hub-modal-card.cloud-explorer-modal-card {
  width: 80vw !important;
  max-width: 600px !important;
  height: min(560px, 82vh) !important;
  max-height: 85vh !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}

.cloud-hub-body.cloud-explorer-body {
  padding: 0 !important;
  flex: 1 !important;
  min-height: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}

.cloud-count-sub {
  font-weight: 700;
  color: #64748b;
  font-size: 12.5px;
}

/* 🧭 상단 윈도우 탐색기 툴바 (위로 버튼 + 경로 주소창 + 새 폴더 + 검색) */
.win-explorer-toolbar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  background: rgba(248, 250, 252, 0.92);
  border-bottom: 1px solid rgba(148, 163, 184, 0.25);
  flex-shrink: 0;
}

body:not(.theme-light) .win-explorer-toolbar {
  background: rgba(15, 23, 42, 0.65);
  border-bottom-color: rgba(148, 163, 184, 0.18);
}

.win-explorer-up-btn {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: #ffffff;
  color: #334155;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
  transition: all 0.12s ease;
}

.win-explorer-up-btn:hover:not(:disabled) {
  background: rgba(37, 99, 235, 0.08);
  border-color: #2563eb;
  color: #2563eb;
}

.win-explorer-up-btn:disabled {
  opacity: 0.38;
  cursor: default;
}

body:not(.theme-light) .win-explorer-up-btn {
  background: rgba(30, 41, 59, 0.8);
  border-color: rgba(148, 163, 184, 0.25);
  color: #cbd5e1;
}

.win-explorer-address-bar {
  flex: 1;
  min-width: 0;
  height: 30px;
  padding: 0 8px;
  border-radius: 7px;
  border: 1px solid rgba(148, 163, 184, 0.38);
  background: #ffffff;
  display: flex;
  align-items: center;
  gap: 2px;
  overflow-x: auto;
  white-space: nowrap;
  box-sizing: border-box;
}

.win-explorer-address-bar::-webkit-scrollbar {
  height: 0;
}

body:not(.theme-light) .win-explorer-address-bar {
  background: rgba(15, 23, 42, 0.85);
  border-color: rgba(148, 163, 184, 0.26);
}

.win-crumb-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 7px;
  border-radius: 5px;
  border: 1px solid transparent;
  background: transparent;
  color: #334155;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.12s ease;
}

.win-crumb-item:hover {
  background: rgba(37, 99, 235, 0.08);
  color: #1d4ed8;
}

.win-crumb-item.active {
  color: #0f172a;
  font-weight: 800;
}

body:not(.theme-light) .win-crumb-item {
  color: #cbd5e1;
}

body:not(.theme-light) .win-crumb-item.active {
  color: #f8fafc;
}

.win-crumb-sep {
  color: #94a3b8;
  font-size: 11px;
  padding: 0 1px;
  user-select: none;
}

.win-explorer-action-group {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.win-explorer-cmd-btn {
  height: 30px;
  padding: 0 9px;
  border-radius: 7px;
  border: 1px solid rgba(148, 163, 184, 0.38);
  background: #ffffff;
  color: #334155;
  font-size: 11.5px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.12s ease;
}

.win-explorer-cmd-btn:hover {
  background: rgba(37, 99, 235, 0.08);
  border-color: #2563eb;
  color: #1d4ed8;
}

.win-explorer-cmd-btn.primary-cmd {
  border-color: rgba(37, 99, 235, 0.42);
  background: rgba(37, 99, 235, 0.09);
  color: #1d4ed8;
}

.win-explorer-cmd-btn.primary-cmd:hover {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
}

.win-explorer-cmd-btn.danger-cmd:hover {
  background: rgba(239, 68, 68, 0.12);
  border-color: #ef4444;
  color: #dc2626;
}

body:not(.theme-light) .win-explorer-cmd-btn {
  background: rgba(30, 41, 59, 0.85);
  border-color: rgba(148, 163, 184, 0.28);
  color: #e2e8f0;
}

body:not(.theme-light) .win-explorer-cmd-btn.primary-cmd {
  background: rgba(59, 130, 246, 0.2);
  border-color: rgba(96, 165, 250, 0.45);
  color: #93c5fd;
}

.win-explorer-move-wrap {
  position: relative;
  display: inline-flex;
}

.win-explorer-move-menu {
  position: absolute;
  bottom: calc(100% + 8px);
  right: -52px;
  width: min(340px, 76vw);
  min-width: 290px;
  max-width: 370px;
  max-height: min(380px, 60vh);
  overflow: hidden;
  background: #ffffff;
  border: 1px solid rgba(148, 163, 184, 0.45);
  border-radius: 12px;
  box-shadow: 0 -10px 32px rgba(15, 23, 42, 0.22);
  padding: 8px;
  z-index: 2500;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-sizing: border-box;
}

body:not(.theme-light) .win-explorer-move-menu {
  background: #1e293b;
  border-color: rgba(148, 163, 184, 0.32);
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.5);
}

.win-move-menu-top {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex-shrink: 0;
  padding-bottom: 5px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.win-move-menu-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 2px 4px 0 4px;
}

.win-move-menu-header {
  font-size: 11.5px;
  font-weight: 800;
  color: #475569;
  padding: 0;
  margin: 0;
  border: none;
}

body:not(.theme-light) .win-move-menu-header {
  color: #cbd5e1;
}

.win-move-menu-fold-all-btn {
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(248, 250, 252, 0.9);
  color: #475569;
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 5px;
  cursor: pointer;
  line-height: 1.3;
  transition: all 0.12s ease;
}

.win-move-menu-fold-all-btn:hover {
  border-color: #2563eb;
  color: #1d4ed8;
  background: rgba(37, 99, 235, 0.08);
}

body:not(.theme-light) .win-move-menu-fold-all-btn {
  background: rgba(15, 23, 42, 0.7);
  border-color: rgba(148, 163, 184, 0.28);
  color: #cbd5e1;
}

.win-move-menu-search-input {
  width: 100%;
  height: 27px;
  padding: 0 9px;
  border-radius: 6px;
  border: 1px solid rgba(148, 163, 184, 0.38);
  background: #f8fafc;
  color: #0f172a;
  font-size: 11.5px;
  font-weight: 600;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.12s ease, background 0.12s ease;
}

.win-move-menu-search-input:focus {
  background: #ffffff;
  border-color: #2563eb;
}

body:not(.theme-light) .win-move-menu-search-input {
  background: rgba(15, 23, 42, 0.8);
  border-color: rgba(148, 163, 184, 0.28);
  color: #f8fafc;
}

.win-move-menu-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: auto;
  display: flex;
  flex-direction: column;
  gap: 0px !important;
  padding-right: 2px;
}

.win-move-menu-list::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

.win-move-menu-list::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.4);
  border-radius: 4px;
}

.win-move-menu-item {
  width: max-content;
  min-width: 100%;
  box-sizing: border-box;
  flex-shrink: 0 !important;
  min-height: 23px !important;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  text-align: left;
  padding: 1.5px 6px !important;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: #1e293b;
  font-size: 12px;
  line-height: 1.25;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.1s ease;
}

.win-move-menu-item:hover:not(.is-disabled-target) {
  background: rgba(37, 99, 235, 0.11);
  color: #1d4ed8;
}

.win-move-menu-item.is-disabled-target {
  opacity: 0.48;
  cursor: default;
}

body:not(.theme-light) .win-move-menu-item {
  color: #f1f5f9;
}

body:not(.theme-light) .win-move-menu-item:hover:not(.is-disabled-target) {
  background: rgba(59, 130, 246, 0.22);
  color: #93c5fd;
}

.win-move-item-left {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-width: max-content;
}

.win-move-item-right {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 8px;
  flex-shrink: 0;
}

.win-move-cur-badge {
  font-size: 10px;
  font-weight: 700;
  color: #64748b;
  background: rgba(148, 163, 184, 0.18);
  padding: 1px 5px;
  border-radius: 4px;
}

.win-move-sub-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: #64748b;
  background: rgba(148, 163, 184, 0.14);
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 4px;
  padding: 1px 5px;
  cursor: pointer;
  line-height: 1.1;
  transition: all 0.1s ease;
}

.win-move-sub-toggle:hover {
  background: rgba(37, 99, 235, 0.15);
  border-color: #2563eb;
  color: #1d4ed8;
}

body:not(.theme-light) .win-move-sub-toggle {
  color: #94a3b8;
  background: rgba(15, 23, 42, 0.55);
  border-color: rgba(148, 163, 184, 0.25);
}

.win-move-menu-empty {
  padding: 18px 8px;
  text-align: center;
  font-size: 11.5px;
  font-weight: 600;
  color: #94a3b8;
}

.cloud-library-search-wrap {
  width: 118px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.cloud-library-search-input {
  width: 100%;
  height: 30px;
  padding: 0 10px;
  border-radius: 7px;
  border: 1px solid rgba(148, 163, 184, 0.38);
  background: #ffffff;
  color: #0f172a;
  font-size: 12px;
  font-weight: 600;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.15s ease;
}

body:not(.theme-light) .cloud-library-search-input {
  background: rgba(15, 23, 42, 0.85);
  border-color: rgba(148, 163, 184, 0.26);
  color: #f8fafc;
}

.cloud-library-search-input:focus {
  border-color: #2563eb;
}

/* 중단 2단 레이아웃 (좌측 폴더 트리 + 우측 폴더/파일 뷰) */
#panelCloudMyLibrary.cloud-explorer-layout {
  flex: 1;
  min-height: 0;
  width: 100%;
  display: flex;
  flex-direction: row;
  gap: 0;
  padding: 0;
  border-top: none;
  overflow: hidden;
}

/* 좌측 폴더 트리 사이드바 */
.cloud-explorer-sidebar {
  width: 168px;
  min-width: 115px;
  max-width: 360px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  padding: 4px 4px;
  background: rgba(248, 250, 252, 0.65);
  overflow: hidden;
}

body:not(.theme-light) .cloud-explorer-sidebar {
  background: rgba(15, 23, 42, 0.42);
}

/* ↔️ 좌측 폴더 트리와 우측 파일 목록 사이 폭 조절선 (Splitter) */
.cloud-explorer-splitter {
  width: 9px;
  margin: 0 -4px;
  flex-shrink: 0;
  cursor: col-resize;
  position: relative;
  z-index: 12;
  touch-action: none;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cloud-explorer-splitter::before {
  content: '';
  width: 1px;
  height: 100%;
  background: rgba(148, 163, 184, 0.28);
  transition: background 0.12s ease, width 0.12s ease;
}

body:not(.theme-light) .cloud-explorer-splitter::before {
  background: rgba(148, 163, 184, 0.18);
}

.cloud-explorer-splitter::after {
  content: '⋮';
  position: absolute;
  font-size: 11px;
  line-height: 1;
  color: #94a3b8;
  background: rgba(248, 250, 252, 0.95);
  padding: 3px 1px;
  border-radius: 3px;
  pointer-events: none;
  opacity: 0.75;
  transition: color 0.12s ease, opacity 0.12s ease;
}

body:not(.theme-light) .cloud-explorer-splitter::after {
  background: rgba(15, 23, 42, 0.9);
  color: #64748b;
}

.cloud-explorer-splitter:hover::before,
.cloud-explorer-splitter.is-dragging::before {
  width: 2px;
  background: #2563eb;
}

.cloud-explorer-splitter:hover::after,
.cloud-explorer-splitter.is-dragging::after {
  color: #2563eb;
  opacity: 1;
}

.cloud-folder-tree-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  gap: 0px !important;
  padding-right: 2px;
  padding-bottom: 2px;
}

.cloud-folder-tree-list::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}

.cloud-folder-tree-list::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.35);
  border-radius: 4px;
}

.cloud-tree-node {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 3px;
  padding-top: 1.5px !important;
  padding-bottom: 1.5px !important;
  padding-left: 4px;
  padding-right: 6px;
  border-radius: 5px;
  border: 1px solid transparent;
  background: transparent;
  color: #334155;
  font-size: 11.5px;
  line-height: 1.2;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  transition: background 0.1s ease, border-color 0.1s ease;
  min-height: 21px !important;
  width: max-content;
  min-width: 100%;
  box-sizing: border-box;
}

body:not(.theme-light) .cloud-tree-node {
  color: #cbd5e1;
}

.cloud-tree-node:hover {
  background: rgba(148, 163, 184, 0.14);
}

.cloud-tree-node.active {
  background: rgba(37, 99, 235, 0.12);
  border-color: rgba(37, 99, 235, 0.28);
  color: #1d4ed8;
  font-weight: 800;
}

body:not(.theme-light) .cloud-tree-node.active {
  background: rgba(59, 130, 246, 0.22);
  border-color: rgba(96, 165, 250, 0.4);
  color: #93c5fd;
}

.cloud-tree-node-left {
  display: flex;
  align-items: center;
  gap: 3px;
  min-width: max-content;
  flex: 1;
}

/* 🌲 윈도우 탐색기식 점선(dotted) 트리 가이드 (⋮ · ├ · └, 단계당 7px 초슬림 들여쓰기) */
.cloud-tree-indent-group {
  display: inline-flex;
  align-items: center;
  margin-left: 5px;
  margin-right: 0px;
  flex-shrink: 0;
}

.cloud-tree-indent-guide {
  display: inline-block;
  width: 7px;
  height: 21px;
  margin-top: -2px;
  margin-bottom: -2px;
  flex-shrink: 0;
  position: relative;
  box-sizing: border-box;
}

.cloud-tree-indent-guide.has-vline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  border-left: 1px dotted #94a3b8;
}

.cloud-tree-indent-guide.is-branch::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  border-left: 1px dotted #94a3b8;
}

.cloud-tree-indent-guide.is-branch.is-last-branch::before {
  bottom: 50%;
}

.cloud-tree-indent-guide.is-branch::after {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  width: 6px;
  border-top: 1px dotted #94a3b8;
}

body:not(.theme-light) .cloud-tree-indent-guide.has-vline::before,
body:not(.theme-light) .cloud-tree-indent-guide.is-branch::before {
  border-left-color: rgba(148, 163, 184, 0.55);
}

body:not(.theme-light) .cloud-tree-indent-guide.is-branch::after {
  border-top-color: rgba(148, 163, 184, 0.55);
}

.cloud-tree-chevron {
  display: none !important;
}

.cloud-tree-icon {
  font-size: 12px;
  line-height: 1;
  flex-shrink: 0;
}

.cloud-tree-name {
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
}

.cloud-tree-count {
  font-size: 10px;
  font-weight: 700;
  color: #94a3b8;
  flex-shrink: 0;
}

.cloud-tree-divider {
  height: 1px;
  background: rgba(148, 163, 184, 0.22);
  margin: 3px 4px;
  flex-shrink: 0;
}

/* 우측 메인 파일/폴더 탐색기 영역 */
.cloud-explorer-main {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  overflow: hidden;
}

body:not(.theme-light) .cloud-explorer-main {
  background: rgba(15, 23, 42, 0.3);
}

/* 윈도우 탐색기 상단 컬럼 헤더 (이름 | 수정한 날짜 | 분량 | 관리) */
.win-explorer-col-header {
  display: flex;
  align-items: center;
  padding: 6px 12px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(248, 250, 252, 0.8);
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  user-select: none;
  flex-shrink: 0;
}

body:not(.theme-light) .win-explorer-col-header {
  background: rgba(30, 41, 59, 0.5);
  border-bottom-color: rgba(148, 163, 184, 0.16);
  color: #94a3b8;
}

.col-chk-wrap,
.win-row-chk-wrap {
  width: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-right: 3px;
  cursor: pointer;
}

.win-explorer-checkbox {
  width: 13px;
  height: 13px;
  accent-color: #2563eb;
  cursor: pointer;
  margin: 0;
}

.win-explorer-col-header .col-name {
  flex: 1;
  min-width: 0;
}

.win-explorer-col-header .col-name small {
  font-weight: 600;
  color: #94a3b8;
  margin-left: 4px;
}

.win-explorer-col-header .col-date {
  width: 92px;
  text-align: left;
  flex-shrink: 0;
}

.win-explorer-col-header .col-size {
  width: 58px;
  text-align: center;
  flex-shrink: 0;
}

.win-explorer-col-header .col-act {
  width: 56px;
  text-align: right;
  flex-shrink: 0;
}

/* ➕ 새 폴더 인라인 생성 행 */
.win-inline-new-folder-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(37, 99, 235, 0.07);
  border-bottom: 1px solid rgba(37, 99, 235, 0.25);
  flex-shrink: 0;
}

.win-folder-icon {
  font-size: 15px;
  flex-shrink: 0;
}

.win-new-folder-target-badge {
  font-size: 11px;
  font-weight: 800;
  color: #1d4ed8;
  background: rgba(37, 99, 235, 0.12);
  padding: 2px 7px;
  border-radius: 5px;
  max-width: 140px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 0;
}

body:not(.theme-light) .win-new-folder-target-badge {
  color: #93c5fd;
  background: rgba(59, 130, 246, 0.22);
}

.win-new-folder-input {
  flex: 1;
  min-width: 0;
  height: 28px;
  padding: 0 8px;
  border-radius: 6px;
  border: 1.5px solid #2563eb;
  background: #ffffff;
  color: #0f172a;
  font-size: 12px;
  font-weight: 700;
  outline: none;
}

body:not(.theme-light) .win-new-folder-input {
  background: rgba(15, 23, 42, 0.92);
  color: #f8fafc;
}

.win-new-folder-btn {
  padding: 4px 10px !important;
  font-size: 11.5px !important;
  font-weight: 700 !important;
  border-radius: 6px !important;
  cursor: pointer;
}

/* 우측 폴더 + 파일 리스트 컨테이너 */
.cloud-item-list.cloud-explorer-file-list {
  flex: 1 !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow-y: auto !important;
  display: flex;
  flex-direction: column;
  gap: 0px !important;
  padding: 4px 8px !important;
}

/* 행 공통 스타일 (폴더 행 & 파일 행 — 고밀도 초슬림 리스트) */
.win-explorer-row {
  display: flex;
  align-items: center;
  padding: 1.5px 8px !important;
  border-radius: 5px;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  user-select: none;
  transition: background 0.1s ease, border-color 0.1s ease;
  min-height: 23px !important;
  box-sizing: border-box;
}

.win-explorer-row:hover {
  background: rgba(37, 99, 235, 0.06);
}

.win-explorer-row.selected {
  background: rgba(37, 99, 235, 0.11);
  border-color: rgba(37, 99, 235, 0.32);
}

body:not(.theme-light) .win-explorer-row:hover {
  background: rgba(59, 130, 246, 0.1);
}

body:not(.theme-light) .win-explorer-row.selected {
  background: rgba(59, 130, 246, 0.22);
  border-color: rgba(96, 165, 250, 0.42);
}

/* 드래그 앤 드롭 하이라이트 (폴더 위나 트리 노드, 주소창 위에 드래그했을 때) */
.drop-target-hover {
  background: rgba(37, 99, 235, 0.18) !important;
  border-color: #2563eb !important;
  box-shadow: 0 0 0 1.5px rgba(37, 99, 235, 0.35);
}

.win-explorer-row.dragging-source {
  opacity: 0.45;
}

.win-row-name-col {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  padding-right: 6px;
}

.win-row-icon {
  font-size: 13.5px;
  line-height: 1;
  flex-shrink: 0;
}

.win-row-slide-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1px 6px;
  border-radius: 5px;
  background: rgba(37, 99, 235, 0.1);
  color: #2563eb;
  font-size: 10.5px;
  font-weight: 800;
  flex-shrink: 0;
}

body:not(.theme-light) .win-row-slide-badge {
  background: rgba(59, 130, 246, 0.22);
  color: #93c5fd;
}

.win-row-title {
  font-size: 12.5px;
  line-height: 1.2;
  font-weight: 600;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.win-explorer-row.is-folder-row .win-row-title {
  font-weight: 700;
}

body:not(.theme-light) .win-row-title {
  color: #f1f5f9;
}

.win-row-meta-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.win-row-date-col,
.win-row-size-col,
.win-row-open-pill,
.btn-cloud-move-item,
.btn-cloud-dl-item,
.btn-cloud-del-item,
.cloud-tree-count {
  display: none !important;
}

.win-row-act-col {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 3px;
  flex-shrink: 0;
  margin-left: 8px;
}

.win-footer-open-btn {
  height: 32px;
  padding: 0 12px !important;
  font-size: 12px !important;
  font-weight: 800 !important;
  border-radius: 7px !important;
  border: 1px solid rgba(37, 99, 235, 0.38) !important;
  background: rgba(37, 99, 235, 0.08) !important;
  color: #1d4ed8 !important;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  cursor: pointer;
}

.win-footer-open-btn:hover {
  background: #2563eb !important;
  color: #ffffff !important;
}

body:not(.theme-light) .win-footer-open-btn {
  background: rgba(59, 130, 246, 0.2) !important;
  border-color: rgba(96, 165, 250, 0.45) !important;
  color: #93c5fd !important;
}

.win-row-open-pill {
  padding: 3px 8px;
  border-radius: 5px;
  border: 1px solid rgba(37, 99, 235, 0.32);
  background: rgba(37, 99, 235, 0.08);
  color: #2563eb;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  opacity: 0.92;
  transition: opacity 0.12s ease, background 0.12s ease, color 0.12s ease;
  white-space: nowrap;
}

.win-explorer-row:hover .win-row-open-pill,
.win-explorer-row.selected .win-row-open-pill {
  opacity: 1;
}

.win-row-open-pill:hover {
  background: #2563eb;
  color: #ffffff;
}

body:not(.theme-light) .win-row-open-pill {
  color: #93c5fd;
  border-color: rgba(96, 165, 250, 0.35);
  background: rgba(59, 130, 246, 0.15);
}

.cloud-item-folder-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(148, 163, 184, 0.16);
  color: #475569;
  font-size: 10px;
  font-weight: 700;
  flex-shrink: 0;
}

body:not(.theme-light) .cloud-item-folder-badge {
  background: rgba(148, 163, 184, 0.2);
  color: #cbd5e1;
}

.btn-cloud-dl-item,
.btn-cloud-move-item,
.btn-cloud-edit-item,
.btn-cloud-del-item {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  border: 1px solid transparent;
  background: transparent;
  color: #64748b;
  font-size: 11px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  opacity: 0.85;
  transition: all 0.12s ease;
}

.win-explorer-row:hover .btn-cloud-dl-item,
.win-explorer-row:hover .btn-cloud-move-item,
.win-explorer-row:hover .btn-cloud-edit-item,
.win-explorer-row:hover .btn-cloud-del-item,
.win-explorer-row.selected .btn-cloud-dl-item,
.win-explorer-row.selected .btn-cloud-move-item,
.win-explorer-row.selected .btn-cloud-edit-item,
.win-explorer-row.selected .btn-cloud-del-item {
  opacity: 1;
}

.btn-cloud-dl-item:hover,
.btn-cloud-move-item:hover,
.btn-cloud-edit-item:hover {
  background: rgba(37, 99, 235, 0.12);
  color: #2563eb;
}

.btn-cloud-del-item:hover {
  background: rgba(239, 68, 68, 0.14);
  color: #ef4444;
}

/* 💾 하단 스마트 전환 바: 기본은 [여기에 저장], 체크 시에만 [열기 · 이동 · 삭제] */
.win-explorer-save-footer {
  display: flex;
  align-items: center;
  padding: 9px 14px;
  background: rgba(248, 250, 252, 0.96);
  border-top: 1px solid rgba(148, 163, 184, 0.28);
  flex-shrink: 0;
  min-height: 52px;
  box-sizing: border-box;
}

body:not(.theme-light) .win-explorer-save-footer {
  background: rgba(15, 23, 42, 0.85);
  border-top-color: rgba(148, 163, 184, 0.2);
}

.win-footer-mode-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.win-selection-footer-left {
  display: none !important;
}

.win-selection-footer-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-left: auto;
  gap: 7px;
  flex-shrink: 0;
}

.win-selection-all-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 800;
  color: #334155;
  cursor: pointer;
  user-select: none;
}

body:not(.theme-light) .win-selection-all-label {
  color: #e2e8f0;
}

.win-selection-count-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.12);
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 800;
}

body:not(.theme-light) .win-selection-count-badge {
  background: rgba(59, 130, 246, 0.24);
  color: #93c5fd;
}

.win-selection-clear-btn {
  border: none;
  background: transparent;
  color: #64748b;
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 6px;
  border-radius: 5px;
  cursor: pointer;
}

.win-selection-clear-btn:hover {
  background: rgba(148, 163, 184, 0.16);
  color: #0f172a;
}

body:not(.theme-light) .win-selection-clear-btn:hover {
  color: #f8fafc;
}

.win-selection-footer-right {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
}

.win-save-footer-left {
  flex: 1;
  min-width: 220px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.win-save-label {
  font-size: 12px;
  font-weight: 800;
  color: #334155;
  white-space: nowrap;
}

body:not(.theme-light) .win-save-label {
  color: #cbd5e1;
}

.win-save-title-input {
  flex: 1;
  min-width: 0;
  height: 32px;
  padding: 0 10px;
  border-radius: 7px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: #ffffff;
  color: #0f172a;
  font-size: 12px;
  font-weight: 600;
  outline: none;
  box-sizing: border-box;
}

body:not(.theme-light) .win-save-title-input {
  background: rgba(30, 41, 59, 0.9);
  border-color: rgba(148, 163, 184, 0.32);
  color: #f8fafc;
}

.win-save-title-input:focus {
  border-color: #2563eb;
}

.win-save-footer-right {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
}

.cloud-save-scope-group {
  display: none !important;
}

.cloud-scope-pill {
  border: none;
  background: transparent;
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.12s ease;
}

.cloud-scope-pill.active {
  background: #ffffff;
  color: #1d4ed8;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

body:not(.theme-light) .cloud-scope-pill.active {
  background: #2563eb;
  color: #ffffff;
}

.win-save-submit-btn {
  height: 32px;
  padding: 0 13px !important;
  font-size: 12px !important;
  font-weight: 800 !important;
  border-radius: 7px !important;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  cursor: pointer;
}

.win-save-submit-btn small {
  font-size: 10.5px;
  font-weight: 700;
  opacity: 0.88;
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-cloud-go-settings-login {
  margin-top: 8px;
  padding: 7px 14px;
  border-radius: 8px;
  border: 1px solid rgba(37, 99, 235, 0.35);
  background: rgba(37, 99, 235, 0.08);
  color: #2563eb;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.14s ease;
}

.btn-cloud-go-settings-login:hover {
  background: #2563eb;
  color: #ffffff;
}

/* ==========================================================================
   🎨 [?v=20261103_45]: 스타일 & 배경 초슬림 2탭 플로팅 카드 + 1줄 ◀ ━━●━━ ▶ 스텝 슬라이더
   ========================================================================== */
.style-panel-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 3px;
  border-radius: 9px;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 2px;
}

body.theme-light .style-panel-tabs {
  background: #f1f5f9;
  border-color: rgba(15, 23, 42, 0.08);
}

.style-tab-btn {
  padding: 5px 6px;
  border-radius: 7px;
  border: none;
  background: transparent;
  color: #94a3b8;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.14s ease;
  text-align: center;
  white-space: nowrap;
}

body.theme-light .style-tab-btn {
  color: #64748b;
}

.style-tab-btn:hover {
  color: #f8fafc;
}

body.theme-light .style-tab-btn:hover {
  color: #0f172a;
}

.style-tab-btn.active {
  background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
  color: #ffffff !important;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3);
}

.style-tab-pane {
  display: none;
  flex-direction: column;
  gap: 10px;
}

.style-tab-pane.active {
  display: flex;
}

/* 1줄 5칸 초슬림 배경 색상 칩 */
.compact-theme-row {
  display: grid !important;
  grid-template-columns: repeat(5, 1fr) !important;
  gap: 4px !important;
  margin-top: 0 !important;
}

.compact-theme-row .theme-chip {
  padding: 5px 2px !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 3px !important;
  border-radius: 8px !important;
  cursor: pointer;
  grid-column: span 1 !important;
}

.compact-theme-row .theme-color-preview {
  width: 15px !important;
  height: 15px !important;
  border-radius: 50% !important;
  display: inline-block;
  flex-shrink: 0;
}

.compact-theme-row .theme-name {
  font-size: 10.5px !important;
  font-weight: 700 !important;
  line-height: 1.1;
  white-space: nowrap;
}

/* 1줄 일체형 [라벨] [◀] ━━●━━ [▶] [수치] 스텝 슬라이더 */
.single-line-slider-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.single-line-slider-row {
  display: flex;
  align-items: center;
  gap: 5px;
  min-height: 26px;
}

.single-line-slider-label {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-main);
  width: 50px;
  flex-shrink: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.theme-light .single-line-slider-label {
  color: #334155;
}

.single-line-step-btn {
  width: 22px;
  height: 22px;
  padding: 0;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: #cbd5e1;
  font-size: 9px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  user-select: none;
  transition: all 0.12s ease;
}

.single-line-step-btn:hover {
  background: rgba(0, 210, 211, 0.18);
  border-color: rgba(0, 210, 211, 0.45);
  color: #ffffff;
}

.single-line-step-btn:active {
  transform: scale(0.93);
}

body.theme-light .single-line-step-btn {
  background: #f8fafc;
  border-color: rgba(15, 23, 42, 0.14);
  color: #334155;
}

body.theme-light .single-line-step-btn:hover {
  background: #eff6ff;
  border-color: rgba(37, 99, 235, 0.45);
  color: #1d4ed8;
}

.single-line-slider-track {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  margin: 0 !important;
}

.single-line-slider-track .slider-bar {
  width: 100%;
  margin: 0;
}

.single-line-slider-val {
  min-width: 26px;
  text-align: right;
  font-size: 11.5px;
  font-weight: 800;
  color: #38bdf8;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

body.theme-light .single-line-slider-val {
  color: #2563eb;
}

.style-compact-inline-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.style-compact-select {
  flex: 1;
  min-width: 0;
  padding: 4px 8px !important;
  border-radius: 6px !important;
  font-size: 11.5px !important;
  margin-top: 0 !important;
}

/* ==========================================================================
   ✍️ [?v=20261103_46]: 필기 플로팅 툴바 3방향 도킹 (왼쪽 세로 / 아래 가로 / 오른쪽 세로)
   ========================================================================== */
.ink-floating-toolbar[data-dock-pos="bottom"] {
  bottom: 24px;
  left: 50%;
  right: auto;
  top: auto;
  transform: translateX(-50%);
  flex-direction: row;
}

.ink-floating-toolbar[data-dock-pos="left"],
.ink-floating-toolbar[data-dock-pos="right"] {
  top: 50%;
  bottom: auto;
  transform: translateY(-50%);
  flex-direction: column;
  padding: 8px 6px;
  gap: 5px;
  width: 48px;
  max-height: calc(100% - 28px);
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  animation: none;
}

.ink-floating-toolbar[data-dock-pos="left"]::-webkit-scrollbar,
.ink-floating-toolbar[data-dock-pos="right"]::-webkit-scrollbar {
  display: none;
}

.ink-floating-toolbar[data-dock-pos="left"] {
  left: 64px;
  right: auto;
}

.ink-floating-toolbar[data-dock-pos="right"] {
  right: 64px;
  left: auto;
  top: calc(50% + 18px);
  max-height: calc(100% - 68px);
}

/* 좌측 서랍이 열려 있을 때 왼쪽 도킹 필기 바와 겹치지 않도록 자동 페이드 처리 */
.sidebar-rail:not(.drawer-collapsed)~.canvas-container .ink-floating-toolbar[data-dock-pos="left"] {
  opacity: 0 !important;
  pointer-events: none !important;
}

.ink-floating-toolbar[data-dock-pos="left"] .ink-dock-drag-handle,
.ink-floating-toolbar[data-dock-pos="right"] .ink-dock-drag-handle {
  transform: rotate(90deg);
  padding: 0;
  margin: -2px 0;
}

.ink-floating-toolbar[data-dock-pos="left"] .ink-tool-group,
.ink-floating-toolbar[data-dock-pos="right"] .ink-tool-group {
  flex-direction: column;
  gap: 3px;
}

.ink-floating-toolbar[data-dock-pos="left"] .ink-tool-btn,
.ink-floating-toolbar[data-dock-pos="right"] .ink-tool-btn {
  width: 32px;
  height: 30px;
  border-radius: 8px;
}

.ink-floating-toolbar[data-dock-pos="left"] .ink-divider,
.ink-floating-toolbar[data-dock-pos="right"] .ink-divider {
  width: 24px;
  height: 1px;
  margin: 1px 0;
}

.ink-floating-toolbar[data-dock-pos="left"] .ink-color-group,
.ink-floating-toolbar[data-dock-pos="right"] .ink-color-group {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
  justify-items: center;
}

.ink-floating-toolbar[data-dock-pos="left"] .ink-color-dot,
.ink-floating-toolbar[data-dock-pos="right"] .ink-color-dot {
  width: 15px;
  height: 15px;
}

.ink-floating-toolbar[data-dock-pos="left"] .ink-zoom-group,
.ink-floating-toolbar[data-dock-pos="right"] .ink-zoom-group {
  flex-direction: column;
  gap: 3px;
}

/* 🪟 윈도우 탐색기 표준 파일 이름 중복 해결 모달 (덮어쓰기 / 번호 붙이기 / 취소) */
.cloud-dup-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100050;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.cloud-dup-modal-card {
  width: 100%;
  max-width: 410px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 16px;
  box-shadow: 0 22px 48px rgba(15, 23, 42, 0.28);
  padding: 20px 20px 16px;
  color: #0f172a;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cloud-dup-modal-title {
  font-size: 15px;
  font-weight: 800;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 7px;
}

.cloud-dup-modal-desc {
  font-size: 12.5px;
  line-height: 1.55;
  color: #334155;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 12px;
  word-break: break-all;
}

.cloud-dup-modal-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cloud-dup-choice-btn {
  width: 100%;
  text-align: left;
  padding: 10px 13px;
  border-radius: 11px;
  border: 1.5px solid #cbd5e1;
  background: #ffffff;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: background 0.14s ease, border-color 0.14s ease, transform 0.1s ease;
}

.cloud-dup-choice-btn:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}

.cloud-dup-choice-btn:active {
  transform: scale(0.99);
}

.cloud-dup-choice-btn.is-overwrite {
  background: #eff6ff;
  border-color: #3b82f6;
}

.cloud-dup-choice-btn.is-overwrite:hover {
  background: #dbeafe;
  border-color: #2563eb;
}

.cloud-dup-choice-main {
  font-size: 13px;
  font-weight: 800;
  color: #0f172a;
}

.cloud-dup-choice-btn.is-overwrite .cloud-dup-choice-main {
  color: #1d4ed8;
}

.cloud-dup-choice-sub {
  font-size: 11.5px;
  color: #64748b;
  font-weight: 500;
}

.cloud-dup-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 4px;
}

.cloud-dup-apply-all-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  user-select: none;
}

.cloud-dup-cancel-btn {
  margin-left: auto;
  padding: 7px 14px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.cloud-dup-cancel-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
}

/* ============================================================================
   ⌨️ [단축키 커스터마이징 모달 & 환경설정 진입 버튼 스타일]
   ============================================================================ */
.settings-shortcut-open-btn {
  width: 100%;
  padding: 9px 12px;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  border: 1px solid rgba(59, 130, 246, 0.38);
  background: rgba(37, 99, 235, 0.06);
  color: #1e40af;
  transition: all 0.15s ease;
}

.settings-shortcut-open-btn:hover {
  background: rgba(37, 99, 235, 0.13);
  border-color: rgba(37, 99, 235, 0.6);
  transform: translateY(-1px);
}

body:not(.theme-light) .settings-shortcut-open-btn {
  background: rgba(59, 130, 246, 0.14);
  border-color: rgba(96, 165, 250, 0.4);
  color: #93c5fd;
}

body:not(.theme-light) .settings-shortcut-open-btn:hover {
  background: rgba(59, 130, 246, 0.24);
  border-color: rgba(147, 197, 253, 0.65);
}

.settings-shortcut-open-left {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.settings-shortcut-badge {
  font-size: 10.5px;
  font-weight: 800;
  padding: 2.5px 8px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.14);
  color: #2563eb;
}

body:not(.theme-light) .settings-shortcut-badge {
  background: rgba(96, 165, 250, 0.22);
  color: #bfdbfe;
}

.shortcut-settings-modal-card {
  width: min(760px, 95vw) !important;
  max-width: 760px !important;
  max-height: 86vh !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}

.shortcut-account-sync-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.14);
  color: #059669;
  margin-left: 8px;
}

body:not(.theme-light) .shortcut-account-sync-badge {
  background: rgba(16, 185, 129, 0.22);
  color: #6ee7b7;
}

.shortcut-account-sync-badge.is-guest {
  background: rgba(100, 116, 139, 0.14);
  color: #475569;
}

body:not(.theme-light) .shortcut-account-sync-badge.is-guest {
  background: rgba(148, 163, 184, 0.18);
  color: #cbd5e1;
}

.shortcut-settings-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 18px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(248, 250, 252, 0.65);
  flex-wrap: wrap;
}

body:not(.theme-light) .shortcut-settings-toolbar {
  background: rgba(15, 23, 42, 0.45);
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

.shortcut-cat-tabs {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.shortcut-cat-tab {
  padding: 6px 11px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.32);
  background: #ffffff;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.14s ease;
}

body:not(.theme-light) .shortcut-cat-tab {
  background: rgba(30, 41, 59, 0.8);
  border-color: rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
}

.shortcut-cat-tab:hover {
  border-color: #3b82f6;
  color: #2563eb;
}

.shortcut-cat-tab.active {
  background: #2563eb;
  border-color: #2563eb;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

.shortcut-search-wrap {
  flex: 0 1 210px;
  min-width: 160px;
}

.shortcut-search-input {
  width: 100%;
  box-sizing: border-box;
  padding: 6.5px 10px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: #ffffff;
  color: #0f172a;
  font-size: 12px;
  font-weight: 600;
  outline: none;
}

body:not(.theme-light) .shortcut-search-input {
  background: rgba(15, 23, 42, 0.8);
  border-color: rgba(255, 255, 255, 0.16);
  color: #f8fafc;
}

.shortcut-search-input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.16);
}

.shortcut-notice-banner {
  padding: 8.5px 18px;
  font-size: 12px;
  font-weight: 600;
  color: #334155;
  background: rgba(37, 99, 235, 0.06);
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
  line-height: 1.45;
}

body:not(.theme-light) .shortcut-notice-banner {
  color: #cbd5e1;
  background: rgba(37, 99, 235, 0.14);
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

.shortcut-notice-banner.is-warning {
  background: rgba(245, 158, 11, 0.14);
  color: #b45309;
  border-bottom-color: rgba(245, 158, 11, 0.35);
}

body:not(.theme-light) .shortcut-notice-banner.is-warning {
  background: rgba(245, 158, 11, 0.22);
  color: #fde68a;
}

.shortcut-notice-banner.is-recording {
  background: rgba(37, 99, 235, 0.15);
  color: #1d4ed8;
  border-bottom-color: rgba(37, 99, 235, 0.4);
}

body:not(.theme-light) .shortcut-notice-banner.is-recording {
  background: rgba(59, 130, 246, 0.25);
  color: #93c5fd;
}

.shortcut-settings-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px 18px !important;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.shortcut-cat-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.shortcut-cat-section-header {
  font-size: 12px;
  font-weight: 800;
  color: #2563eb;
  padding: 4px 2px;
  border-bottom: 1px solid rgba(37, 99, 235, 0.18);
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

body:not(.theme-light) .shortcut-cat-section-header {
  color: #60a5fa;
  border-bottom-color: rgba(96, 165, 250, 0.22);
}

.shortcut-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: rgba(248, 250, 252, 0.9);
  transition: all 0.12s ease;
}

body:not(.theme-light) .shortcut-row {
  background: rgba(30, 41, 59, 0.65);
  border-color: rgba(255, 255, 255, 0.09);
}

.shortcut-row:hover {
  border-color: rgba(59, 130, 246, 0.45);
  background: #ffffff;
}

body:not(.theme-light) .shortcut-row:hover {
  background: rgba(30, 41, 59, 0.92);
  border-color: rgba(96, 165, 250, 0.4);
}

.shortcut-row.is-recording-row {
  border-color: #2563eb;
  background: rgba(37, 99, 235, 0.06);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.shortcut-row-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.shortcut-row-title {
  font-size: 13px;
  font-weight: 800;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 6px;
}

body:not(.theme-light) .shortcut-row-title {
  color: #f8fafc;
}

.shortcut-custom-dot {
  font-size: 10px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.14);
  color: #2563eb;
}

body:not(.theme-light) .shortcut-custom-dot {
  background: rgba(96, 165, 250, 0.22);
  color: #93c5fd;
}

.shortcut-row-desc {
  font-size: 11.5px;
  font-weight: 500;
  color: #64748b;
}

body:not(.theme-light) .shortcut-row-desc {
  color: #94a3b8;
}

.shortcut-row-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.shortcut-bind-btn {
  min-width: 126px;
  padding: 6.5px 12px;
  border-radius: 8px;
  border: 1.5px solid #cbd5e1;
  background: #ffffff;
  color: #0f172a;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12.5px;
  font-weight: 800;
  text-align: center;
  cursor: pointer;
  transition: all 0.14s ease;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

body:not(.theme-light) .shortcut-bind-btn {
  background: #0f172a;
  border-color: #475569;
  color: #f8fafc;
}

.shortcut-bind-btn:hover {
  border-color: #2563eb;
  color: #2563eb;
  background: #eff6ff;
}

body:not(.theme-light) .shortcut-bind-btn:hover {
  border-color: #60a5fa;
  color: #93c5fd;
  background: rgba(37, 99, 235, 0.18);
}

.shortcut-bind-btn.is-unassigned {
  border-style: dashed;
  border-color: #cbd5e1;
  background: rgba(241, 245, 249, 0.7);
  color: #94a3b8;
  font-family: inherit;
  font-weight: 700;
}

body:not(.theme-light) .shortcut-bind-btn.is-unassigned {
  border-color: #475569;
  background: rgba(15, 23, 42, 0.45);
  color: #64748b;
}

.shortcut-bind-btn.is-customized {
  border-color: rgba(37, 99, 235, 0.55);
  background: rgba(37, 99, 235, 0.07);
  color: #1d4ed8;
}

body:not(.theme-light) .shortcut-bind-btn.is-customized {
  border-color: rgba(96, 165, 250, 0.6);
  background: rgba(37, 99, 235, 0.2);
  color: #93c5fd;
}

.shortcut-bind-btn.is-recording {
  border-style: solid;
  border-color: #2563eb;
  background: #2563eb;
  color: #ffffff;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 800;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.28);
  animation: shortcutRecPulse 1.2s infinite ease-in-out;
}

@keyframes shortcutRecPulse {

  0%,
  100% {
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.22);
  }

  50% {
    box-shadow: 0 0 0 5px rgba(37, 99, 235, 0.36);
  }
}

.shortcut-mini-icon-btn {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  border: 1px solid rgba(148, 163, 184, 0.32);
  background: transparent;
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.12s ease;
}

body:not(.theme-light) .shortcut-mini-icon-btn {
  border-color: rgba(255, 255, 255, 0.14);
  color: #94a3b8;
}

.shortcut-mini-icon-btn:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.4);
  color: #dc2626;
}

.shortcut-mini-icon-btn.is-reset-btn:hover:not(:disabled) {
  background: rgba(37, 99, 235, 0.1);
  border-color: rgba(37, 99, 235, 0.4);
  color: #2563eb;
}

.shortcut-mini-icon-btn:disabled {
  opacity: 0.3;
  cursor: default;
}

.shortcut-settings-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 18px !important;
  border-top: 1px solid rgba(148, 163, 184, 0.22);
}

.shortcut-footer-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.shortcut-reset-all-btn,
.shortcut-cancel-btn,
.shortcut-save-btn {
  padding: 8px 15px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 800;
  cursor: pointer;
}

.shortcut-save-btn.has-unsaved-changes {
  background: linear-gradient(135deg, #2563eb, #4f46e5);
  box-shadow: 0 3px 12px rgba(37, 99, 235, 0.35);
}

/* ============================================================================
   👁️ [화면 아이콘 모두 숨기기 모드 (UI All Hidden Mode) & 우측 상단 초슬림·초투명 손잡이 탭]
   - 판서 ↔ 그래프 모드 전환 시에도 전체 아이콘을 깨우지 않고 오직 필수 그래프 창(#panelPresets, #pdfToGraphCropFloatingBar)과
     그래프 모드 우상단 [필기 복귀 · 카드 추가](#graphSnapFloatingBar)만 깔끔하게 노출
   ============================================================================ */
body.ui-all-hidden-mode #railDock,
body.ui-all-hidden-mode #railDrawer:not([data-active-panel="panelPresets"]),
body.ui-all-hidden-mode #rightActionToolbar,
body.ui-all-hidden-mode #inkFloatingToolbar,
body.ui-all-hidden-mode #lessonPlaylistNavBar,
body.ui-all-hidden-mode #pdfBoardNavBar,
body.ui-all-hidden-mode #topSlideBarMiniTab,
body.ui-all-hidden-mode #curveContextBar,
body.ui-all-hidden-mode #lassoActionFloatingBar,
body.ui-all-hidden-mode #quickPillRemote,
body.ui-all-hidden-mode #pwRegionPopover {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

body.ui-all-hidden-mode #sidebarRail:not(.drawer-collapsed) #railDrawer[data-active-panel="panelPresets"] {
  left: 18px !important;
}

body.ui-all-hidden-mode #pdfToGraphCropFloatingBar {
  top: 18px !important;
  left: 18px !important;
}

body.ui-all-hidden-mode #graphSnapFloatingBar {
  top: 18px !important;
  right: 20px !important;
}

.ui-hidden-edge-pull-tab {
  position: fixed;
  top: 18px;
  right: 0;
  width: 9px;
  height: 44px;
  padding: 0;
  border-radius: 7px 0 0 7px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-right: none;
  background: rgba(148, 163, 184, 0.12);
  color: rgba(100, 116, 139, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 620;
  opacity: 0.18;
  transition: width 0.42s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.45s ease, background 0.38s ease, border-color 0.38s ease, color 0.38s ease, box-shadow 0.38s ease;
}

/* 시각적으로는 9px로 거의 안 보일 만큼 얇지만, 터치/펜 클릭 판정 영역은 여유 있게 확보 */
.ui-hidden-edge-pull-tab::before {
  content: '';
  position: absolute;
  top: -8px;
  bottom: -8px;
  left: -12px;
  right: 0;
}

body:not(.theme-light) .ui-hidden-edge-pull-tab {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(226, 232, 240, 0.65);
}

/* 숨기는 순간 1.2초 동안 손잡이가 선명하게 쏙 나왔다가 스르륵 연해지며 우측으로 은폐 */
.ui-hidden-edge-pull-tab.peek-highlight {
  width: 28px;
  opacity: 0.96;
  background: rgba(37, 99, 235, 0.18);
  border-color: rgba(59, 130, 246, 0.72);
  color: #2563eb;
  box-shadow: -3px 4px 14px rgba(37, 99, 235, 0.24);
  transition: width 0.24s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

body:not(.theme-light) .ui-hidden-edge-pull-tab.peek-highlight {
  background: rgba(59, 130, 246, 0.34);
  border-color: rgba(147, 197, 253, 0.85);
  color: #bfdbfe;
  box-shadow: -3px 4px 16px rgba(59, 130, 246, 0.35);
}

.ui-hidden-edge-pull-tab:hover,
.ui-hidden-edge-pull-tab:active {
  width: 24px;
  opacity: 0.94;
  background: rgba(37, 99, 235, 0.15);
  border-color: rgba(59, 130, 246, 0.55);
  color: #2563eb;
  transition: width 0.16s ease, opacity 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

body:not(.theme-light) .ui-hidden-edge-pull-tab:hover,
body:not(.theme-light) .ui-hidden-edge-pull-tab:active {
  background: rgba(59, 130, 246, 0.28);
  border-color: rgba(147, 197, 253, 0.65);
  color: #93c5fd;
}

/* ============================================================================
   ⚙️ [전 메뉴 100% 설정창(#panelSettings) 컨셉 통일 디자인]
   - 적용 대상: 환경설정(#panelSettings), 구간분할(#panelPiecewise), 스타일(#panelStyle), 개형선택(#panelPresets), 내보내기(#modalShare)
   ============================================================================ */
#railDrawer .settings-clean-subtitle,
#modalShare .settings-clean-subtitle,
#railResetBoardPopover .settings-clean-subtitle {
  margin-bottom: 4px !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  letter-spacing: -0.01em !important;
  color: #64748b !important;
}

body:not(.theme-light) #railDrawer .settings-clean-subtitle,
body:not(.theme-light) #modalShare .settings-clean-subtitle,
body:not(.theme-light) #railResetBoardPopover .settings-clean-subtitle {
  color: #94a3b8 !important;
}

/* 선택 칩 (.vf-chip, .style-tab-btn, .export-scope-chip, .export-layer-chip) — 설정창 '필기 바 위치'와 100% 동일 */
#railDrawer .vf-chip,
#railDrawer .style-tab-btn,
#modalShare .vf-chip {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
  padding: 5px 6px !important;
  min-height: 28px !important;
  font-size: 11.5px !important;
  font-weight: 600 !important;
  border-radius: 6px !important;
  background: #f8fafc !important;
  border: 1px solid #cbd5e1 !important;
  color: #475569 !important;
  cursor: pointer !important;
  user-select: none !important;
  box-shadow: none !important;
  transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease !important;
}

#railDrawer .vf-chip:hover,
#railDrawer .style-tab-btn:hover,
#modalShare .vf-chip:hover {
  background: #e2e8f0 !important;
  color: #0f172a !important;
}

#railDrawer .vf-chip.active,
#railDrawer .style-tab-btn.active,
#modalShare .vf-chip.active {
  background: rgba(37, 99, 235, 0.12) !important;
  border-color: #2563eb !important;
  color: #1d4ed8 !important;
  box-shadow: none !important;
}

#modalShare .export-layer-chip {
  gap: 3px !important;
  padding: 5px 4px !important;
}

#modalShare .export-layer-chip .export-layer-check-icon {
  flex-shrink: 0;
  color: #cbd5e1;
  opacity: 0.55;
  transition: color 0.14s ease, opacity 0.14s ease;
}

#modalShare .export-layer-chip.active .export-layer-check-icon {
  color: #2563eb;
  opacity: 1;
}

body:not(.theme-light) #modalShare .export-layer-chip.active .export-layer-check-icon {
  color: #60a5fa;
}

body:not(.theme-light) #railDrawer .vf-chip,
body:not(.theme-light) #railDrawer .style-tab-btn,
body:not(.theme-light) #modalShare .vf-chip {
  background: rgba(255, 255, 255, 0.04) !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  color: #cbd5e1 !important;
}

body:not(.theme-light) #railDrawer .vf-chip:hover,
body:not(.theme-light) #railDrawer .style-tab-btn:hover,
body:not(.theme-light) #modalShare .vf-chip:hover {
  background: rgba(255, 255, 255, 0.09) !important;
  color: #ffffff !important;
}

body:not(.theme-light) #railDrawer .vf-chip.active,
body:not(.theme-light) #railDrawer .style-tab-btn.active,
body:not(.theme-light) #modalShare .vf-chip.active {
  background: rgba(59, 130, 246, 0.22) !important;
  border-color: #60a5fa !important;
  color: #eff6ff !important;
}

/* 스타일 창 상단 2탭 바 (필기·배경 | 그래프) 외곽 박스 제거 — 설정창 상단 칩 그리드와 동일하게 */
#panelStyle .style-panel-tabs {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 4px !important;
  padding: 0 !important;
  background: transparent !important;
  border: none !important;
  margin-bottom: 8px !important;
}

/* 스타일 창 배경 색상 5칸 칩도 설정창 칩과 동일한 톤앤매너 적용 */
#panelStyle .compact-theme-row .theme-chip {
  background: #f8fafc !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 6px !important;
  padding: 5px 2px !important;
  box-shadow: none !important;
}

#panelStyle .compact-theme-row .theme-chip .theme-name {
  color: #475569 !important;
  font-weight: 600 !important;
}

#panelStyle .compact-theme-row .theme-chip:hover {
  background: #e2e8f0 !important;
}

#panelStyle .compact-theme-row .theme-chip.active {
  background: rgba(37, 99, 235, 0.12) !important;
  border-color: #2563eb !important;
  box-shadow: none !important;
}

#panelStyle .compact-theme-row .theme-chip.active .theme-name {
  color: #1d4ed8 !important;
  font-weight: 700 !important;
}

/* 배경 색상 프리뷰 원형 도트 고유 색상 선명하게 유지 */
#panelStyle .theme-chip[data-theme="white_paper"] .theme-color-preview {
  background: #ffffff !important;
  border: 1.5px solid #94a3b8 !important;
}

#panelStyle .theme-chip[data-theme="chalkboard"] .theme-color-preview {
  background: #047857 !important;
  border: 1.5px solid #10b981 !important;
}

#panelStyle .theme-chip[data-theme="dark_charcoal"] .theme-color-preview {
  background: #334155 !important;
  border: 1.5px solid #64748b !important;
}

#panelStyle .theme-chip[data-theme="deep_black"] .theme-color-preview {
  background: #09090b !important;
  border: 1.5px solid #475569 !important;
}

#panelStyle .theme-chip[data-theme="postit"] .theme-color-preview {
  background: #fef08a !important;
  border: 1.5px solid #f59e0b !important;
}

body:not(.theme-light) #panelStyle .compact-theme-row .theme-chip {
  background: rgba(255, 255, 255, 0.04) !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
}

body:not(.theme-light) #panelStyle .compact-theme-row .theme-chip .theme-name {
  color: #cbd5e1 !important;
}

body:not(.theme-light) #panelStyle .compact-theme-row .theme-chip.active {
  background: rgba(59, 130, 246, 0.22) !important;
  border-color: #60a5fa !important;
}

body:not(.theme-light) #panelStyle .compact-theme-row .theme-chip.active .theme-name {
  color: #eff6ff !important;
}

/* 토글 리스트 & 슬라이더 리스트 — 설정창의 3px 간격 행 리스트와 100% 동일 */
#railDrawer .settings-toggle-list,
#railDrawer .single-line-slider-list {
  display: flex;
  flex-direction: column;
  gap: 3px !important;
  margin-top: 3px !important;
}

#railDrawer .setting-toggle-item,
#railDrawer .single-line-slider-row {
  padding: 5px 9px !important;
  min-height: 29px !important;
  border-radius: 7px !important;
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  box-sizing: border-box !important;
  transition: background 0.14s ease, border-color 0.14s ease;
}

#railDrawer .setting-toggle-item:hover {
  background: #f1f5f9 !important;
  border-color: #cbd5e1 !important;
}

body:not(.theme-light) #railDrawer .setting-toggle-item,
body:not(.theme-light) #railDrawer .single-line-slider-row {
  background: rgba(255, 255, 255, 0.035) !important;
  border: 1px solid rgba(255, 255, 255, 0.075) !important;
}

body:not(.theme-light) #railDrawer .setting-toggle-item:hover {
  background: rgba(255, 255, 255, 0.065) !important;
  border-color: rgba(255, 255, 255, 0.14) !important;
}

#railDrawer .setting-name,
#railDrawer .single-line-slider-label {
  font-size: 11.5px !important;
  font-weight: 600 !important;
  color: #334155 !important;
}

#railDrawer .single-line-slider-label {
  width: 44px !important;
}

body:not(.theme-light) #railDrawer .setting-name,
body:not(.theme-light) #railDrawer .single-line-slider-label {
  color: #e2e8f0 !important;
}

/* 슬라이더 스텝 버튼 및 바 — 설정창 슬레이트 톤 통일 */
#railDrawer .single-line-step-btn {
  width: 20px !important;
  height: 20px !important;
  border-radius: 5px !important;
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  color: #475569 !important;
}

#railDrawer .single-line-step-btn:hover {
  background: #e2e8f0 !important;
  border-color: #94a3b8 !important;
  color: #0f172a !important;
}

body:not(.theme-light) #railDrawer .single-line-step-btn {
  background: rgba(255, 255, 255, 0.05) !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  color: #cbd5e1 !important;
}

#railDrawer .single-line-slider-val {
  font-size: 11px !important;
  font-weight: 700 !important;
  color: #334155 !important;
  min-width: 24px !important;
}

body:not(.theme-light) #railDrawer .single-line-slider-val {
  color: #e2e8f0 !important;
}

#railDrawer .slider-bar {
  height: 4px !important;
  border-radius: 999px !important;
  background: #cbd5e1 !important;
  accent-color: #334155 !important;
}

#railDrawer .slider-bar::-webkit-slider-thumb {
  width: 13px !important;
  height: 13px !important;
  border-radius: 50% !important;
  background: #334155 !important;
  border: 2px solid #ffffff !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.25) !important;
}

/* 스위치(토글) — 차분한 슬레이트 다크/그레이 톤 통일 */
#railDrawer .vf-toggle-wrap {
  width: 32px !important;
  height: 18px !important;
}

#railDrawer .vf-toggle-slider {
  background-color: #cbd5e1 !important;
}

#railDrawer .vf-toggle-slider::before {
  height: 14px !important;
  width: 14px !important;
  left: 2px !important;
  bottom: 2px !important;
}

#railDrawer .vf-toggle-wrap input:checked+.vf-toggle-slider {
  background-color: #334155 !important;
}

#railDrawer .vf-toggle-wrap input:checked+.vf-toggle-slider::before {
  transform: translateX(14px) !important;
}

body:not(.theme-light) #railDrawer .vf-toggle-slider {
  background-color: rgba(255, 255, 255, 0.16) !important;
}

body:not(.theme-light) #railDrawer .vf-toggle-wrap input:checked+.vf-toggle-slider {
  background-color: #64748b !important;
}

/* 섹션 구분선 (.settings-clean-divider-block) */
#railDrawer .settings-clean-divider-block,
#modalShare .settings-clean-divider-block {
  margin-top: 9px !important;
  padding-top: 9px !important;
  border-top: 1px solid rgba(148, 163, 184, 0.22) !important;
}

/* 액션 버튼 (.settings-clean-btn) — 설정창의 Google 로그인 / 이용권 구매 / 사용법 / 문의 버튼과 100% 동일 */
#railDrawer .settings-clean-btn,
#modalShare .settings-clean-btn,
#railResetBoardPopover .settings-clean-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
  height: 30px;
  padding: 0 10px;
  border-radius: 7px !important;
  font-size: 11.5px;
  font-weight: 600 !important;
  color: #334155 !important;
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  cursor: pointer;
  transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease;
  transform: none !important;
  box-shadow: none !important;
}

#railDrawer .settings-clean-btn:hover,
#modalShare .settings-clean-btn:hover,
#railResetBoardPopover .settings-clean-btn:hover {
  background: #f1f5f9 !important;
  border-color: #cbd5e1 !important;
  color: #0f172a !important;
}

#railDrawer .settings-clean-btn.active,
#railDrawer .settings-clean-btn-solid,
#modalShare .settings-clean-btn.active,
#modalShare .settings-clean-btn-solid,
#railResetBoardPopover .settings-clean-btn.active,
#railResetBoardPopover .settings-clean-btn-solid {
  background: #334155 !important;
  border-color: #334155 !important;
  color: #ffffff !important;
}

#railDrawer .settings-clean-btn.active:hover,
#railDrawer .settings-clean-btn-solid:hover,
#modalShare .settings-clean-btn.active:hover,
#modalShare .settings-clean-btn-solid:hover,
#railResetBoardPopover .settings-clean-btn.active:hover,
#railResetBoardPopover .settings-clean-btn-solid:hover {
  background: #1e293b !important;
  border-color: #1e293b !important;
  color: #ffffff !important;
}

body:not(.theme-light) #railDrawer .settings-clean-btn,
body:not(.theme-light) #modalShare .settings-clean-btn,
body:not(.theme-light) #railResetBoardPopover .settings-clean-btn {
  color: #e2e8f0 !important;
  background: rgba(255, 255, 255, 0.045) !important;
  border: 1px solid rgba(255, 255, 255, 0.09) !important;
}

body:not(.theme-light) #railDrawer .settings-clean-btn:hover,
body:not(.theme-light) #modalShare .settings-clean-btn:hover,
body:not(.theme-light) #railResetBoardPopover .settings-clean-btn:hover {
  background: rgba(255, 255, 255, 0.09) !important;
  border-color: rgba(255, 255, 255, 0.18) !important;
  color: #ffffff !important;
}

body:not(.theme-light) #railDrawer .settings-clean-btn.active,
body:not(.theme-light) #railDrawer .settings-clean-btn-solid,
body:not(.theme-light) #modalShare .settings-clean-btn.active,
body:not(.theme-light) #modalShare .settings-clean-btn-solid,
body:not(.theme-light) #railResetBoardPopover .settings-clean-btn.active,
body:not(.theme-light) #railResetBoardPopover .settings-clean-btn-solid {
  background: rgba(255, 255, 255, 0.16) !important;
  border-color: rgba(255, 255, 255, 0.24) !important;
  color: #ffffff !important;
}

#panelSettings .settings-shortcut-open-btn {
  width: 100%;
  justify-content: space-between !important;
}

#panelSettings .settings-shortcut-badge {
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  color: #64748b !important;
}

body:not(.theme-light) #panelSettings .settings-shortcut-badge {
  color: #94a3b8 !important;
}

#panelSettings .settings-account-id-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 600;
  padding: 5px 8px;
  border-radius: 7px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #334155;
  margin-bottom: 5px;
  line-height: 1.35;
}

#panelSettings .settings-account-id-text {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#panelSettings .settings-account-plan-badge {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

#panelSettings .settings-account-plan-badge.is-free {
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  color: #4338ca;
}

#panelSettings .settings-account-plan-badge.is-pro {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #047857;
}

body:not(.theme-light) #panelSettings .settings-account-id-box {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.075);
  color: #e2e8f0;
}

body:not(.theme-light) #panelSettings .settings-account-plan-badge.is-free {
  background: rgba(129, 140, 248, 0.15);
  border: 1px solid rgba(129, 140, 248, 0.3);
  color: #c7d2fe;
}

body:not(.theme-light) #panelSettings .settings-account-plan-badge.is-pro {
  background: rgba(52, 211, 153, 0.15);
  border: 1px solid rgba(52, 211, 153, 0.3);
  color: #a7f3d0;
}

#railDrawer .settings-email-auth-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 8px;
  margin-top: 6px;
}

body:not(.theme-light) #railDrawer .settings-email-auth-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

#railDrawer .settings-clean-input,
#modalShare .settings-clean-input {
  width: 100%;
  box-sizing: border-box;
  height: 30px;
  padding: 0 8px;
  border-radius: 7px !important;
  border: 1px solid #e2e8f0 !important;
  background: #f8fafc !important;
  color: #0f172a !important;
  font-size: 11.5px !important;
  font-weight: 500;
  outline: none;
}

#railDrawer .settings-clean-input:focus,
#modalShare .settings-clean-input:focus {
  border-color: #94a3b8 !important;
  background: #ffffff !important;
}

body:not(.theme-light) #railDrawer .settings-clean-input,
body:not(.theme-light) #modalShare .settings-clean-input {
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  background: rgba(255, 255, 255, 0.04) !important;
  color: #f8fafc !important;
}

/* 📤 내보내기 모달(#modalShare) 카드 외형 — 환경설정 서랍(#panelSettings)과 100% 동일한 크기·여백·헤더 */
#modalShare .unified-export-modal-card {
  max-width: 300px !important;
  width: 90vw !important;
  border-radius: 14px !important;
  overflow: hidden;
}

body.theme-light #modalShare .unified-export-modal-card {
  background: rgba(255, 255, 255, 0.98) !important;
  border: 1px solid #cbd5e1 !important;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.14) !important;
}

#modalShare .smart-modal-header {
  padding: 9px 12px !important;
  background: transparent !important;
  border-bottom: 1px solid rgba(148, 163, 184, 0.22) !important;
}

#modalShare .modal-title-text {
  font-size: 13px !important;
  font-weight: 700 !important;
  color: #0f172a !important;
}

body:not(.theme-light) #modalShare .modal-title-text {
  color: #f8fafc !important;
}

#modalShare .btn-modal-close {
  width: 24px !important;
  height: 24px !important;
  border-radius: 6px !important;
  background: transparent !important;
  border: none !important;
  color: #64748b !important;
}

#modalShare .btn-modal-close:hover {
  background: #f1f5f9 !important;
  color: #0f172a !important;
}

#modalShare .unified-export-body {
  display: flex !important;
  flex-direction: column !important;
  gap: 0 !important;
  padding: 10px 12px 12px !important;
}

/* ↺ 캔버스 초기화 미니 선택 팝오버 (#railResetBoardPopover) */
.rail-reset-board-popover {
  position: absolute;
  left: 68px;
  top: 90px;
  width: 148px;
  padding: 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid #cbd5e1;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.14);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 4200;
  user-select: none;
}

body:not(.theme-light) .rail-reset-board-popover {
  background: rgba(15, 23, 42, 0.96);
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}

#railResetBoardPopover .settings-clean-btn {
  width: 100%;
  height: 29px;
  font-size: 11.5px;
}

body.ui-all-hidden-mode #railResetBoardPopover {
  display: none !important;
}
