/* ==========================================================================
   workbook.css — 워크북 페이지 (test-ui 프로토타입)
   고객 문제: 치료사가 연령에 안 맞는 단어로 가르침 + 단조로운 활동
   해결: 검증된 단어 풀에서 직접 고름 + 25종 다양한 활동
   ========================================================================== */

/* ── 디자인 토큰 (wordlist와 동일) ── */
:root {
  --teal: #0891B2;
  --teal-dark: #155E75;
  --teal-mid: #0E7490;
  --teal-light: #CFFAFE;
  --emerald: #059669;
  --emerald-dark: #065F46;
  --emerald-light: #D1FAE5;
  --sand: #FBF9F6;
  --sand-dark: #F5F0E8;
  --warm-border: #E8E2D9;
  --text-dark: #1E293B;
  --text-mid: #64748B;
  --text-light: #94A3B8;
  --text-white: #FFFFFF;
  --priority-1: #D84848;
  --priority-2: #E8A020;
  --priority-3: #7AB5A8;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 18px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.10);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: 'Pretendard Variable', 'Pretendard', sans-serif;
  background: var(--sand);
  color: var(--text-dark);
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; }

/* ==========================================================================
   연령 가로 탭 바
   ========================================================================== */
.wbk-age-bar {
  background: #fff;
  border-bottom: 1px solid var(--warm-border);
  position: sticky;
  top: 56px;
  z-index: 150;
}
.wbk-age-bar-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.wbk-age-tabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.wbk-age-tab {
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-mid);
  background: var(--sand-dark);
  cursor: pointer;
  transition: all 0.15s;
  border: 1.5px solid transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.3;
  gap: 1px;
}
.wbk-age-tab:hover {
  background: var(--teal-light);
  color: var(--teal-dark);
}
.wbk-age-tab.active {
  background: var(--teal-dark);
  color: #fff;
  border-color: var(--teal-dark);
}
.wbk-age-tab-months {
  font-size: 11px;
  font-weight: 500;
  opacity: 0.75;
}

/* 선택 카운트 + 진행률 바 (단어 풀 헤더 내부) */
.wbk-select-count {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}
.wbk-count-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.wbk-count-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-dark);
  white-space: nowrap;
}
.wbk-count-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.wbk-count-num {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-mid);
  letter-spacing: -0.3px;
}
.wbk-count-num strong {
  font-size: 22px;
  font-weight: 800;
  color: var(--teal-dark);
  letter-spacing: -0.5px;
}
.wbk-count-slash {
  color: var(--text-light);
  margin: 0 2px;
}

/* 초기화(휴지통) 버튼 — 빨강으로 명확히 표시 (큰 사이즈 + 항상 빨강) */
.wbk-count-reset {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #FEF2F2;
  color: var(--priority-1);
  border-radius: 10px;
  cursor: pointer;
  border: 1.5px solid #FCA5A5;
  transition: all 0.15s;
  font-family: inherit;
}
.wbk-count-reset svg {
  width: 18px;
  height: 18px;
  stroke-width: 2.2;
}
.wbk-count-reset:hover:not(:disabled) {
  background: var(--priority-1);
  color: #fff;
  border-color: var(--priority-1);
}
.wbk-count-reset:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* 진행률 바 */
.wbk-count-bar {
  width: 100%;
  height: 8px;
  background: #fff;
  border: 1px solid var(--warm-border);
  border-radius: 999px;
  overflow: hidden;
}
.wbk-count-fill {
  height: 100%;
  background: var(--teal);
  border-radius: 999px;
  transition: width 0.25s ease, background 0.2s;
}

/* 목표 근접 (80~99%) — 목표 기울기 효과 */
.wbk-select-count.level-near .wbk-count-num strong {
  color: #EA8A16;
}
.wbk-select-count.level-near .wbk-count-fill {
  background: #F59E0B;
}

/* 가득참 (100%) */
.wbk-select-count.level-full .wbk-count-num strong {
  color: var(--priority-1);
}
.wbk-select-count.level-full .wbk-count-fill {
  background: var(--priority-1);
}

/* ==========================================================================
   메인 레이아웃
   ========================================================================== */
.wbk-main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px 20px 60px;
  display: grid;
  grid-template-columns: 52% 48%;
  gap: 24px;
  align-items: start;
}

/* ==========================================================================
   좌측: 단어 풀
   ========================================================================== */
.wbk-word-panel {
  background: #fff;
  border: 1px solid var(--warm-border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

/* 단어 풀 헤더 — 진행률 바 (게슈탈트 근접성 + sticky 고정) */
.wbk-word-panel-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--sand-dark);
  background: var(--sand);
  border-top-left-radius: var(--r-lg);
  border-top-right-radius: var(--r-lg);
  position: sticky;
  top: 114px; /* 네비바 56 + 연령바 58 */
  z-index: 100;
}
.wbk-word-panel-body {
  padding: 24px;
}

.wbk-word-empty {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-light);
}
.wbk-word-empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
}
.wbk-word-empty-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-mid);
  margin-bottom: 8px;
}
.wbk-word-empty-sub {
  font-size: 14px;
  color: var(--text-light);
}

.wbk-cat {
  margin-bottom: 32px;
}
.wbk-cat:last-child { margin-bottom: 0; }

.wbk-cat-header {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--sand-dark);
}
.wbk-cat-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-dark);
}
.wbk-cat-count {
  font-size: 13px;
  color: var(--text-light);
  font-weight: 500;
}

.wbk-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px;
}

/* 단어 미니 카드 */
.wbk-word-card {
  position: relative;
  background: #fff;
  border: 1.5px solid var(--warm-border);
  border-radius: 10px;
  padding: 8px;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  user-select: none;
}
.wbk-word-card:hover {
  border-color: var(--teal-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}
.wbk-word-card.checked {
  border: 2.5px solid var(--teal);
  background: var(--teal-light);
  padding: 7px;
}
.wbk-word-card.checked:hover {
  transform: translateY(-2px);
}

.wbk-word-img {
  width: 70px;
  height: 70px;
  object-fit: contain;
  background: #fff;
  border-radius: 6px;
}
.wbk-word-card.checked .wbk-word-img {
  background: rgba(255,255,255,0.7);
}

.wbk-word-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dark);
  text-align: center;
  line-height: 1.2;
}
.wbk-word-card.checked .wbk-word-name {
  color: var(--teal-dark);
  font-weight: 700;
}

/* 우선순위 배지 */
.wbk-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  padding: 2px 6px;
  border-radius: 8px;
  letter-spacing: -0.2px;
}
.wbk-badge.priority-1 { background: var(--priority-1); }
.wbk-badge.priority-2 { background: var(--priority-2); }
.wbk-badge.priority-3 { background: var(--priority-3); }

/* 체크 마크 (좌상단) */
.wbk-check-mark {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--teal);
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
}
.wbk-word-card.checked .wbk-check-mark {
  display: flex;
}
.wbk-check-mark svg {
  width: 12px;
  height: 12px;
  stroke: #fff;
}

/* ==========================================================================
   우측: 워크북 패널
   ========================================================================== */
.wbk-workbook-panel {
  background: #fff;
  border: 1px solid var(--warm-border);
  border-radius: var(--r-lg);
  padding: 0;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 130px;
  height: calc(100vh - 150px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
/* 미리보기 페이지들 컨테이너 — sand 배경으로 흰 페이지가 더 떠보이게 */
.wbk-mock-pages {
  background: var(--sand-dark);
  padding: 14px;
  border-radius: 10px;
}
/* 패널 내부 본문 영역에 padding 적용 (sticky 상세바를 위해 panel padding은 0) */
.wbk-workbook-panel > .wbk-wb-section,
.wbk-workbook-panel > .wbk-wb-detail-info,
.wbk-workbook-panel > .wbk-blank-notice,
.wbk-workbook-panel > .wbk-mock-pages,
.wbk-workbook-panel > .wbk-wb-empty-state {
  margin-left: 24px;
  margin-right: 24px;
}
.wbk-workbook-panel > .wbk-wb-section:first-child {
  margin-top: 24px;
}
.wbk-workbook-panel > .wbk-wb-section:last-child {
  margin-bottom: 24px;
}
.wbk-workbook-panel > .wbk-wb-detail-info:first-of-type,
.wbk-workbook-panel > .wbk-wb-empty-state:first-of-type {
  margin-top: 16px;
}
.wbk-workbook-panel > .wbk-mock-pages:last-child {
  margin-bottom: 24px;
}

.wbk-wb-section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}
.wbk-wb-section {
  margin-bottom: 24px;
}
.wbk-wb-section:last-child {
  margin-bottom: 0;
}

/* ==========================================================================
   워크북 목록 (리스트 형식)
   ========================================================================== */
.wbk-wb-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  background: transparent;
}

.wbk-wb-list-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 9px 14px;
  cursor: pointer;
  border: 1px solid var(--warm-border);
  border-radius: 10px;
  background: #fff;
  transition: background 0.12s, border-color 0.12s, box-shadow 0.12s;
  position: relative;
}
.wbk-wb-list-row:hover {
  background: var(--teal-light);
  border-color: var(--teal-dark);
}
.wbk-wb-list-row::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 0;
  background: var(--teal-dark);
  border-radius: 10px 0 0 10px;
  transition: width 0.12s;
}
.wbk-wb-list-row:hover::before {
  width: 3px;
}

.wbk-wb-list-emoji {
  font-size: 20px;
  opacity: 0.85;
  flex-shrink: 0;
  width: 24px;
  text-align: center;
  line-height: 1.4;
}

.wbk-wb-list-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.wbk-wb-list-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-dark);
  letter-spacing: -0.2px;
  line-height: 1.35;
}

.wbk-wb-list-desc {
  font-size: 13px;
  font-weight: 400;
  color: var(--text-mid);
  line-height: 1.4;
  letter-spacing: -0.1px;
}

.wbk-wb-list-arrow {
  color: var(--text-light);
  font-size: 16px;
  font-weight: 600;
  flex-shrink: 0;
  align-self: center;
  margin-left: 4px;
}
.wbk-wb-list-row:hover .wbk-wb-list-arrow {
  color: var(--teal-dark);
}

/* 좁은 패널일 때 1열 회귀 */
@media (max-width: 520px) {
  .wbk-wb-list { grid-template-columns: 1fr; }
}

/* ==========================================================================
   워크북 상세 (오른쪽 패널 상태 B)
   ========================================================================== */
/* 워크북 상세 바 — sticky로 패널 내부 스크롤 시에도 상단 고정 */
.wbk-wb-detail-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--warm-border);
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 10;
  border-top-left-radius: var(--r-lg);
  border-top-right-radius: var(--r-lg);
}
.wbk-wb-back {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 6px 9px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-mid);
  background: var(--sand-dark);
  transition: all 0.15s;
  flex-shrink: 0;
}
.wbk-wb-back:hover {
  background: var(--warm-border);
  color: var(--text-dark);
}
.wbk-wb-detail-title {
  flex: 1;
  min-width: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-dark);
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wbk-wb-print {
  padding: 6px 11px;
  background: var(--teal-dark);
  color: #fff;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.wbk-wb-print:hover {
  background: var(--teal);
}

/* 순서 섞기 버튼 — 보조 액션 (인쇄와 동일 폼팩터, 인디고 톤으로 색 분리) */
.wbk-wb-shuffle {
  padding: 6px 11px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  transition: all 0.15s;
  cursor: pointer;
}
.wbk-wb-shuffle:hover:not(:disabled) {
  filter: brightness(1.08);
}
.wbk-wb-shuffle:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.wbk-wb-detail-info {
  font-size: 13px;
  color: var(--text-mid);
  margin-bottom: 16px;
  padding: 10px 14px;
  background: var(--teal-light);
  border-radius: 10px;
  border-left: 3px solid var(--teal);
}

.wbk-wb-detail-info strong { color: var(--teal-dark); font-weight: 700; }

/* ==========================================================================
   빈 슬롯 공통 — 점진 채움 시그널 (cell 단위)
   기존 .xxx-cell / .xxx-card / .ref-box / .choice-box / .match-img 등에
   .wbk-cell-blank 를 추가하면 점선 + 회색 배경 + 중앙 번호로 전환
   ========================================================================== */
.wbk-cell-blank {
  border: 3px dashed #D4CCBE !important;
  background: #fafafa !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 12px !important;
}
.wbk-cell-num {
  font-size: 100px;
  font-weight: 800;
  color: #C9BFAD;
  line-height: 1;
  letter-spacing: -3px;
}

/* 1단어/장 활동 (puzzle, maze 등) 공통 대형 빈 양식 */
.wbk-generic-blank {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px dashed #D4CCBE;
  border-radius: 28px;
  background: #fafafa;
  margin: 20px 16px;
}
.wbk-generic-blank-num {
  font-size: 260px;
  font-weight: 800;
  color: #C9BFAD;
  line-height: 1;
  letter-spacing: -8px;
}

/* ==========================================================================
   인쇄 규칙
   (1) wbk-blank-notice — 화면 전용 안내, 인쇄 완전 제외 (display: none)
   (2) 빈 슬롯 일체 — visibility: hidden (공간 유지, 시각만 투명)
       → 단어 부분 채움 시 실 단어는 원 위치 그대로, 빈 자리는 여백으로 출력
   ========================================================================== */
@media print {
  .wbk-blank-notice { display: none !important; }

  .wbk-cell-blank,
  .wbk-generic-blank,
  .bank-word.blank,
  .write-row.blank,
  .write-box.blank,
  .char-box.blank,
  .choice-box.blank,
  .match-img.blank,
  .select-card.blank,
  .select-img.blank,
  .select-label.blank,
  .memory-img-wrap.blank,
  .memory-label.blank,
  .s-cell.blank,
  .p-cell.blank {
    visibility: hidden !important;
  }

  /* 행 전체가 비어있으면 행 테두리·중간 점까지 통째로 숨김 */
  .find-row.blank,
  .match-row.blank {
    visibility: hidden !important;
  }

  /* 빙고는 예외 — 빈 칸도 인쇄에 유지 (아이가 직접 채우는 학습 도구 성격) */
  /* 번호만 숨기고 테두리는 실선+흰 배경으로 전환 → 양식 속 "빈 자리" */
  .bingo-cell.wbk-cell-blank {
    visibility: visible !important;
    border: 2px solid #d0c8c0 !important;
    background: white !important;
  }
  .bingo-cell.wbk-cell-blank .wbk-cell-num { display: none !important; }
}

/* 단어 0개 + 빈 미리보기가 있는 활동지일 때 상단 안내 */
.wbk-blank-notice {
  font-size: 15px;
  font-weight: 600;
  color: #3538a0;
  text-align: center;
  padding: 14px 18px;
  background: #eef0ff;
  border: 1px solid #d8d5f0;
  border-radius: 12px;
  margin-top: 16px;
  margin-bottom: 14px;
  letter-spacing: -0.2px;
}

/* 단어 0개일 때 안내 */
.wbk-wb-empty-state {
  text-align: center;
  padding: 60px 24px;
  background: var(--sand-dark);
  border-radius: var(--r-md);
  color: var(--text-mid);
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}
.wbk-wb-empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
}
.wbk-wb-empty-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-mid);
  margin-bottom: 8px;
}
.wbk-wb-empty-sub {
  font-size: 14px;
  color: var(--text-light);
}
/* 기존 msg 스타일 (라이브러리 로드 실패 등에서 사용) */
.wbk-wb-empty-msg {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-mid);
}

/* ==========================================================================
   가짜 미리보기 페이지 공통
   ========================================================================== */
.wbk-mock-pages {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.wbk-mock-page {
  background: #fff;
  border: 1px solid var(--warm-border);
  border-radius: 8px;
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
.wbk-mock-page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 8px;
  border-bottom: 1px solid #eee;
  margin-bottom: 16px;
  font-size: 13px;
  font-weight: 600;
}
.wbk-mock-page-title { color: var(--text-dark); }
.wbk-mock-page-num { color: var(--text-light); }

/* ── 1. 색칠하기 ── */
.wbk-mock-coloring {
  text-align: center;
  padding: 12px 8px;
}
.wbk-mock-coloring img {
  width: 200px;
  height: 200px;
  object-fit: contain;
  filter: grayscale(1) contrast(1.6) brightness(1.05);
  margin-bottom: 14px;
}
.wbk-mock-coloring-name {
  font-size: 24px;
  font-weight: 700;
  color: #333;
}

/* ── 2. 미로 ── */
.wbk-mock-maze {
  text-align: center;
}
.wbk-mock-maze-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-dark);
}
.wbk-mock-maze-grid {
  display: inline-grid;
  grid-template-columns: repeat(4, 60px);
  grid-template-rows: repeat(4, 60px);
  gap: 0;
  border: 2px solid #333;
}
.wbk-mock-maze-cell {
  border: 1px solid #aaa;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-mid);
  background: #fff;
}
.wbk-mock-maze-cell.start { background: #FEF3C7; color: #92400E; }
.wbk-mock-maze-cell.end { background: #D1FAE5; color: #065F46; }
.wbk-mock-maze-cell.target {
  background: #fff;
}
.wbk-mock-maze-cell.target img {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

/* ── 3. 빙고 ── */
.wbk-mock-bingo {
  text-align: center;
}
.wbk-mock-bingo-grid {
  display: inline-grid;
  grid-template-columns: repeat(3, 90px);
  gap: 0;
  background: #333;
  padding: 2px;
  border: 2px solid #333;
}
.wbk-mock-bingo-cell {
  background: #fff;
  padding: 8px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  height: 90px;
  justify-content: center;
}
.wbk-mock-bingo-cell img {
  width: 50px;
  height: 50px;
  object-fit: contain;
}
.wbk-mock-bingo-cell span {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dark);
}

/* ── 4. 글씨 쓰기 ── */
.wbk-mock-tracing {
  text-align: center;
}
.wbk-mock-tracing img {
  width: 80px;
  height: 80px;
  object-fit: contain;
  margin-bottom: 12px;
}
.wbk-mock-tracing-rows {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
}
.wbk-mock-tracing-row {
  display: flex;
  gap: 6px;
}
.wbk-mock-tracing-cell {
  width: 50px;
  height: 50px;
  border: 1.5px dashed #aaa;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: 800;
  background: #fff;
}
.wbk-mock-tracing-cell.guide {
  color: #ddd;
}
.wbk-mock-tracing-cell.empty {
  color: transparent;
  border-style: solid;
  border-color: #ccc;
}

/* ── 5. 같은 그림 찾기 ── */
.wbk-mock-finding {
  text-align: center;
}
.wbk-mock-finding-target {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 16px;
  padding: 12px 16px;
  background: var(--teal-light);
  border-radius: 10px;
}
.wbk-mock-finding-target img {
  width: 70px;
  height: 70px;
  object-fit: contain;
}
.wbk-mock-finding-target-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--teal-dark);
  margin-top: 4px;
}
.wbk-mock-finding-target-label {
  font-size: 12px;
  color: var(--text-mid);
  margin-bottom: 4px;
}
.wbk-mock-finding-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}
.wbk-mock-finding-cell {
  background: #fff;
  border: 1.5px solid var(--warm-border);
  border-radius: 8px;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.wbk-mock-finding-cell img {
  width: 50px;
  height: 50px;
  object-fit: contain;
}

/* ==========================================================================
   기존 워크북 통합 — wb-page를 패널 폭에 맞게 축소 (화면 미리보기만)
   인쇄 시에는 워크북 원본 CSS(@media print)가 작동하도록 @media screen 분리
   ========================================================================== */
/* 화면 미리보기: A4 비율 유지 + transform scale로 패널 폭에 맞춤 (WYSIWYG)
   인쇄 시에는 워크북 원본 CSS(@media print)가 그대로 작동 */
@media screen {
  /* Wrapper — aspect-ratio 제거, JS가 wb-page 자연 content height에 맞춰 동적 설정
     (빙고·미로처럼 콘텐츠 297mm 근접/초과 워크북도 자연스럽게 fit) */
  .wbk-workbook-panel .wb-page-wrap {
    width: 100%;
    overflow: hidden;
    margin-bottom: 32px;
    position: relative;
    background: #fff;
    border: 1px solid var(--warm-border);
    border-radius: 8px;
    box-shadow: var(--shadow-md);
  }
  /* 화면 미리보기에서만: wb-page 자연 content 높이로 자라게 (인쇄 CSS는 영향 없음) */
  .wbk-workbook-panel .wb-page-wrap .wb-page {
    height: auto;
    min-height: 297mm;
    overflow: visible;
    left: 50%;
    transform-origin: top center;
    transform: translateX(-50%) scale(var(--wb-scale, 0.7));
  }
  .wbk-workbook-panel .wb-page-wrap:last-child {
    margin-bottom: 0;
  }
  /* 페이지 사이에 번호 표시 (n장 중 현재 위치) */
  .wbk-workbook-panel .wb-page-wrap + .wb-page-wrap {
    margin-top: 0;
  }
  /* wb-page — 원본 A4 사이즈 유지 + scale로 축소 */
  .wbk-workbook-panel .wb-page-wrap .wb-page {
    position: absolute;
    top: 0;
    left: 0;
    width: 210mm;
    height: 297mm;
    margin: 0;
    padding: 12mm 15mm;
    box-shadow: none;
    border-radius: 0;
    transform-origin: top left;
    transform: scale(var(--wb-scale, 0.7));
  }
}

/* ── 6. 같은 그림 연결 ── */
.wbk-mock-matching {
  display: flex;
  justify-content: space-around;
  align-items: stretch;
  gap: 20px;
}
.wbk-mock-matching-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.wbk-mock-matching-cell {
  background: #fff;
  border: 1.5px solid var(--warm-border);
  border-radius: 8px;
  padding: 8px;
  width: 70px;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.wbk-mock-matching-cell img {
  width: 50px;
  height: 50px;
  object-fit: contain;
}
.wbk-mock-matching-mid {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  font-size: 12px;
}

/* ── 7. 기억하기 ── */
.wbk-mock-memory {
  text-align: center;
}
.wbk-mock-memory-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 12px;
  color: #8E44AD;
}
.wbk-mock-memory-grid {
  display: inline-grid;
  grid-template-columns: repeat(3, 80px);
  grid-template-rows: repeat(3, 80px);
  gap: 4px;
}
.wbk-mock-memory-cell {
  background: #F5F5F5;
  border: 1.5px solid #ddd;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.wbk-mock-memory-cell.target {
  background: #fff;
  border: 3px solid #8E44AD;
}
.wbk-mock-memory-cell.target img {
  width: 60px;
  height: 60px;
  object-fit: contain;
}

/* ── 8. 오려서 붙이기 ── */
.wbk-mock-cutting {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.wbk-mock-cutting-area {
  border: 2.5px dashed #888;
  padding: 16px 24px;
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: #fff;
}
.wbk-mock-cutting-area img {
  width: 100px;
  height: 100px;
  object-fit: contain;
}
.wbk-mock-cutting-area-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-dark);
}
.wbk-mock-cutting-arrow {
  font-size: 24px;
  color: var(--text-light);
}
.wbk-mock-cutting-target {
  text-align: center;
}
.wbk-mock-cutting-target-label {
  font-size: 12px;
  color: var(--text-mid);
  margin-bottom: 6px;
}
.wbk-mock-cutting-target-box {
  width: 110px;
  height: 110px;
  border: 2px solid #aaa;
  border-radius: 6px;
  background: #fafafa;
}

/* ==========================================================================
   반응형 (작은 화면에서 한 줄 배치)
   ========================================================================== */
@media (max-width: 1100px) {
  .wbk-main {
    grid-template-columns: 1fr;
  }
  .wbk-workbook-panel {
    position: static;
    max-height: none;
  }
}

/* ==========================================================================
   인쇄 — 워크북 페이지만 A4로 출력 (헤더/단어풀/상세바 모두 숨김)
   workbook-page.css의 @media print가 .wb-page를 210x297mm 보장
   ========================================================================== */
@media print {
  /* 화면 UI 전부 숨김 */
  .nav-bar,
  .wbk-age-bar,
  .wbk-word-panel,
  .wbk-wb-detail-bar,
  .wbk-wb-detail-info,
  .wbk-wb-empty-state {
    display: none !important;
  }

  /* 메인 컨테이너를 단순 블록으로 (grid 레이아웃 해제) */
  .wbk-main {
    display: block !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  .wbk-workbook-panel {
    display: block !important;
    position: static !important;
    max-height: none !important;
    overflow: visible !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
    background: white !important;
  }
  .wbk-mock-pages {
    display: block !important;
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  /* wb-page-wrap의 화면용 transform/aspect-ratio 해제 — 원본 A4 사이즈로 인쇄 */
  .wbk-workbook-panel .wb-page-wrap {
    aspect-ratio: auto !important;
    overflow: visible !important;
    border: none !important;
    box-shadow: none !important;
    margin: 0 !important;
    background: transparent !important;
    width: auto !important;
    height: auto !important;
  }
  .wbk-workbook-panel .wb-page-wrap .wb-page {
    position: static !important;
    transform: none !important;
    /* width/height/padding은 workbook-page.css의 @media print 룰 적용됨 */
  }

  /* 본 앱 background 색상 흰색으로 (인쇄 잉크 절약) */
  body {
    background: white !important;
    margin: 0 !important;
    padding: 0 !important;
  }
}
