/* 학습지 번들 페이지 */
@font-face { font-family: 'AriClass Print'; src: url('../fonts/AriClassPrint-Latin.woff2') format('woff2'); font-display: swap; }

.bd-page { max-width: 1100px; margin: 0 auto; padding: 0 1rem 3rem; }
.bd-page > h1 { text-align: center; margin: 1.2rem 0 .3rem; }
.bd-lead { text-align: center; color: #555; margin: 0 0 1.6rem; }
.bd-step { background: #fff; border-radius: 16px; padding: 1.3rem 1.4rem; margin: 0 0 1.1rem; box-shadow: 0 2px 14px rgba(0,0,0,.06); }
.bd-step > h2 { font-size: 1.1rem; margin: 0 0 .9rem; display: flex; align-items: center; gap: .6rem; }
.bd-step > h2 .no { display: inline-flex; width: 1.7rem; height: 1.7rem; border-radius: 50%; background: #FFD700; color: #333; align-items: center; justify-content: center; font-size: .95rem; font-weight: 700; }

.bd-topics { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: .7rem; }
.bd-topic { display: flex; flex-direction: column; align-items: center; gap: .3rem; padding: .9rem .4rem; border: 2px solid #eee; border-radius: 14px; background: #fff; cursor: pointer; font-family: inherit; font-size: 1rem; font-weight: 600; color: #333; transition: transform .15s, border-color .15s, background .15s; }
.bd-topic .ic { width: 68px; height: 68px; object-fit: contain; display: block; }
.bd-topic:hover { transform: translateY(-2px); border-color: #ffe27a; }
.bd-topic.on { border-color: #FFD700; background: #FFF8D6; box-shadow: 0 3px 10px rgba(255,200,0,.3); }

.bd-modes { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.bd-mode { display: flex; flex-direction: column; align-items: center; gap: .3rem; padding: 1.1rem .8rem; border: 2px solid #eee; border-radius: 16px; background: #fff; cursor: pointer; font-family: inherit; color: #333; text-align: center; transition: transform .15s, border-color .15s, background .15s; }
.bd-mode i { font-size: 1.6rem; color: #e0a800; }
.bd-mode[data-m="ai"] i { color: #4A90E2; }
.bd-mode b { font-size: 1.05rem; display: inline-flex; align-items: center; gap: .45rem; flex-wrap: wrap; justify-content: center; }
.bd-mode small { color: #777; font-size: .85rem; }
.bd-mode:hover { transform: translateY(-2px); border-color: #ffe27a; }
.bd-mode.on { border-color: #FFD700; background: #FFF8D6; box-shadow: 0 3px 10px rgba(255,200,0,.3); }
.bd-mode.on[data-m="ai"] { border-color: #4A90E2; background: #eaf3ff; box-shadow: 0 3px 10px rgba(74,144,226,.28); }
.bd-pro { display: inline-block; background: linear-gradient(135deg, #4A90E2, #1a5fc8); color: #fff; font-size: .68rem; font-weight: 800; letter-spacing: .06em; padding: .12rem .45rem; border-radius: 6px; line-height: 1.3; }
/* 직접 입력 칸: 다른 학습지의 AI 입력칸과 같은 모양 */
.bd-ai-input { width: 100%; box-sizing: border-box; padding: .7rem 1rem; border: 1px solid #d0e4fa; border-radius: 8px; font-size: 1rem; font-family: inherit; outline: none; transition: border-color .15s; background: #fff; }
.bd-ai-input:focus { border-color: #4A90E2; }
.bd-ai-input::placeholder { color: #8aa4c8; opacity: 1; }
.bd-aipro { margin: .8rem auto 0; max-width: 560px; text-align: center; background: #eaf3ff; border: 1px solid #cfe2fb; border-radius: 12px; padding: .8rem 1rem; color: #1a4a8a; }
.bd-aipro[hidden] { display: none; }
.bd-aipro a { color: #1a5fc8; font-weight: 700; }
.bd-step[hidden], .bd-make-wrap[hidden], #bd-pane-preset[hidden], #bd-pane-ai[hidden] { display: none; }

.bd-levels { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .7rem; }
.bd-level { display: flex; flex-direction: column; align-items: center; gap: .15rem; border: 2px solid #eee; border-radius: 14px; background: #fff; padding: .8rem .6rem; cursor: pointer; font-family: inherit; color: #333; text-align: center; transition: transform .15s, border-color .15s, background .15s; }
.bd-level .st { color: #ffb800; font-size: .8rem; letter-spacing: 2px; }
.bd-level .st i { font-style: normal; color: #e6e6e6; }
.bd-level b { font-size: 1.05rem; }
.bd-level small { color: #777; font-size: .8rem; line-height: 1.35; }
.bd-level:hover { transform: translateY(-2px); border-color: #ffe27a; }
.bd-level.on { border-color: #FFD700; background: #FFF8D6; }

.bd-kinds { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .8rem; }
.bd-kcard { position: relative; display: flex; flex-direction: column; align-items: center; gap: .45rem; border: 2px solid #eee; border-radius: 14px; padding: .6rem .6rem .7rem; background: #fff; cursor: pointer; opacity: .55; transition: opacity .15s, border-color .15s, transform .15s; }
.bd-kcard img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; background: #f5f5f5; display: block; }
.bd-kcard .nm { font-weight: 700; font-size: .95rem; text-align: center; }
.bd-kcard .tick { position: absolute; top: .9rem; left: .9rem; width: 1.6rem; height: 1.6rem; border-radius: 50%; background: rgba(255,255,255,.9); border: 2px solid #ccc; display: flex; align-items: center; justify-content: center; color: transparent; font-size: .8rem; }
.bd-kcard.on { opacity: 1; border-color: #FFD700; box-shadow: 0 3px 10px rgba(255,200,0,.28); }
.bd-kcard.on .tick { background: #FFD700; border-color: #FFD700; color: #333; }
.bd-kcard .cnt { display: inline-flex; align-items: center; gap: .4rem; visibility: hidden; }
.bd-kcard.on .cnt { visibility: visible; }
.bd-kcard .cnt button { width: 1.7rem; height: 1.7rem; border: 1px solid #ddd; background: #fff; border-radius: 50%; cursor: pointer; font-size: 1rem; line-height: 1; padding: 0; }
.bd-kcard .cnt b { min-width: 1.2rem; text-align: center; }
.bd-kcard:hover { transform: translateY(-2px); opacity: .9; }
.bd-kcard.on:hover { opacity: 1; }
.bd-opts { margin-top: .9rem; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .6rem; }
.bd-opts label { display: inline-flex; align-items: center; gap: .5rem; cursor: pointer; }
.bd-plan { color: #555; font-weight: 600; }

.bd-make-wrap { text-align: center; margin: 1.3rem 0 .4rem; }
.bd-make { background: #FFD700; border: 0; border-radius: 14px; padding: .95rem 2.6rem; font-size: 1.1rem; font-weight: 700; color: #222; cursor: pointer; font-family: inherit; box-shadow: 0 4px 14px rgba(255,200,0,.45); transition: transform .15s; }
.bd-make:hover { transform: translateY(-2px); }

.bd-result { margin-top: 1.6rem; }
.bd-result[hidden] { display: none; }
.bd-rhead { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: .5rem; margin-bottom: .8rem; }
.bd-rhead h2 { margin: 0; font-size: 1.25rem; }
.bd-rhead .tot { color: #555; font-weight: 600; }
.bd-words { background: #fff; border-radius: 14px; padding: 1rem 1.1rem; margin-bottom: 1rem; box-shadow: 0 2px 14px rgba(0,0,0,.06); }
.bd-words h3 { margin: 0 0 .6rem; font-size: 1rem; display: flex; justify-content: space-between; align-items: center; gap: .6rem; flex-wrap: wrap; }
.bd-words h3 button { border: 0; background: transparent; color: #8a6d00; font-weight: 600; cursor: pointer; font-family: inherit; text-decoration: underline; }
.bd-chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.bd-chip { display: inline-flex; align-items: center; gap: .35rem; border: 1px solid #e5e5e5; background: #fafafa; border-radius: 999px; padding: .3rem .7rem; font-family: inherit; font-size: .9rem; cursor: pointer; color: #333; }
.bd-chip small { color: #888; }
.bd-chip i { font-size: .75rem; color: #999; }
.bd-chip.off { opacity: .45; text-decoration: line-through; }
.bd-chip:hover { border-color: #ffd700; }

/* 결과 카드 */
#puzzle-preview.bd-root { width: 100% !important; height: auto !important; min-height: 0 !important; padding: 0 !important; margin: 0 !important; background: transparent !important; box-shadow: none !important; border: 0 !important; transform: none !important; display: grid !important; grid-template-columns: repeat(auto-fill, minmax(212px, 1fr)); gap: 1rem; overflow: visible !important; }
.bd-none { grid-column: 1 / -1; text-align: center; color: #888; padding: 2rem; background: #fff; border-radius: 12px; }
.bd-card { background: #fff; border-radius: 12px; padding: .6rem; box-shadow: 0 2px 12px rgba(0,0,0,.08); display: flex; flex-direction: column; gap: .5rem; }
.bd-card.is-ans { background: #fffbea; }
.bd-thumb { position: relative; width: 200px; height: 283px; overflow: hidden; padding: 0; border: 1px solid #e8e8e8; background: #fff; cursor: zoom-in; display: block; margin: 0 auto; border-radius: 4px; text-align: left; font: inherit; }
.bd-thumb .bd-sheet { transform: scale(.252); transform-origin: 0 0; pointer-events: none; }
.bd-cap { display: flex; align-items: center; justify-content: space-between; gap: .4rem; font-size: .88rem; font-weight: 600; }
.bd-btns { display: inline-flex; gap: .3rem; }
.bd-btns button { border: 0; background: #f2f2f2; width: 1.9rem; height: 1.9rem; border-radius: 8px; cursor: pointer; color: #555; }
.bd-btns button:hover { background: #ffe27a; }
.bd-actions { text-align: center; margin: 1.4rem 0 .4rem; }

/* 학습지 한 장 (A4) */
.bd-sheet { position: relative; box-sizing: border-box; width: 210mm; height: 297mm; padding: 20mm; background: #fff; overflow: hidden; }
.bd-hd { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4mm; }
.bd-logo { height: 12mm; width: auto; display: block; }
.bd-fields { display: flex; gap: 6mm; font-size: 9pt; }
.bd-fields span { display: inline-flex; align-items: flex-end; gap: 2px; }
.bd-fields i { display: inline-block; width: 30mm; border-bottom: 1px solid #333; height: 14px; }
.bd-title { text-align: center; font-size: 20pt; margin: 6mm 0 3mm; font-weight: 700; color: #222; }
.bd-ins { text-align: center; color: #555; font-size: 10.5pt; margin: 0 0 6mm; }
.bd-lbl { text-align: center; font-weight: 700; margin: 6mm 0 2mm; font-size: 11pt; }
.bd-sheet.bd-ans .bd-title { color: #b00020; }

.bd-ws { display: grid; grid-template-columns: repeat(var(--n), 1fr); width: calc(var(--n) * var(--cs, 11.5mm)); max-width: 100%; margin: 0 auto; border: 2px solid #222; }
.bd-ws b { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; font-size: calc(var(--cs, 11.5mm) * .42); font-weight: 700; border: .5px solid #bbb; }
.bd-ws b.hit { background: #ffe27a; color: #b00020; }
.bd-wl { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2mm 4mm; max-width: 150mm; margin: 0 auto; text-align: center; }
.bd-wl span { font-weight: 700; letter-spacing: .5px; font-size: 11pt; }

.bd-cw { display: grid; grid-template-columns: repeat(var(--cols), 9mm); grid-auto-rows: 9mm; width: max-content; max-width: 100%; margin: 0 auto 6mm; }
.bd-cw > div { position: relative; }
.bd-cw > div.on { border: 1px solid #222; background: #fff; display: flex; align-items: center; justify-content: center; margin: -.5px; }
.bd-cw small { position: absolute; top: 0; left: 1px; font-size: 6.5pt; line-height: 1; font-weight: 700; }
.bd-cw b { font-size: 13pt; color: #b00020; }
.bd-clues { display: grid; grid-template-columns: 1fr 1fr; gap: 6mm; font-size: 10.5pt; }
.bd-clues h3 { margin: 0 0 2mm; font-size: 12pt; border-bottom: 1px solid #ccc; padding-bottom: 1mm; }
.bd-clues p { margin: 0 0 2mm; line-height: 1.35; }
.bd-clues em { color: #777; font-style: normal; font-size: 9pt; }

.bd-us { display: flex; flex-direction: column; gap: 6.5mm; }
.bd-usrow { display: flex; align-items: flex-end; gap: 3mm; flex-wrap: wrap; }
.bd-usrow .n { font-weight: 700; width: 8mm; }
.bd-usrow .q { font-weight: 700; letter-spacing: 2px; font-size: 14pt; min-width: 60mm; }
.bd-usrow.s .q { font-size: 11.5pt; letter-spacing: 0; flex: 1 1 100%; margin-left: 11mm; }
.bd-usrow .line { flex: 1; min-width: 50mm; border-bottom: 1px solid #333; height: 8mm; font-size: 13pt; color: #b00020; font-weight: 700; display: flex; align-items: flex-end; }
.bd-usrow.s .line { margin-left: 11mm; flex: 1 1 100%; }

.bd-mt { display: grid; grid-template-columns: 1fr 1.25fr; gap: 14mm; padding: 0 2mm; }
.bd-mt .col { display: flex; flex-direction: column; gap: 6mm; }
.bd-mt .col > div { display: flex; align-items: center; gap: 3mm; height: 11mm; }
.bd-mt .l > div { justify-content: flex-end; }
.bd-mt .n { font-weight: 700; width: 7mm; color: #777; }
.bd-mt .t { font-size: 14pt; font-weight: 600; }
.bd-mt .r .t { font-size: 10.5pt; font-weight: 500; line-height: 1.25; }
.bd-mt .col > div { min-height: 11mm; height: auto; }
.bd-mt .dot { display: inline-block; width: 4mm; height: 4mm; border: 1.5px solid #333; border-radius: 50%; }
.bd-mtans p { font-size: 12.5pt; margin: 0 0 4mm; }

.bd-wr { display: flex; flex-direction: column; gap: 5mm; }
.bd-wrow { position: relative; height: 24mm; display: flex; align-items: flex-end; gap: 10mm; padding: 0 0 3.5mm; font-family: 'AriClass Print', 'Andika', 'Comic Sans MS', sans-serif; font-size: 26pt; line-height: 1;
  background-image: linear-gradient(#999, #999), repeating-linear-gradient(90deg, #bbb 0 5px, transparent 5px 9px), linear-gradient(#999, #999);
  background-size: 100% 1px, 100% 1px, 100% 1px; background-position: 0 0, 0 50%, 0 100%; background-repeat: no-repeat; }
.bd-wrow .m { color: #111; }
.bd-wrow .t { color: rgba(0,0,0,.28); }
.bd-wrow small { margin-left: auto; font-size: 10pt; color: #777; font-family: 'Segoe UI', 'Noto Sans KR', 'Noto Sans JP', sans-serif; }

/* 크게 보기 */
.bd-modal { position: fixed; inset: 0; z-index: 9999; background: rgba(0,0,0,.6); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .7rem; padding: 1rem; }
.bd-modal[hidden] { display: none; }
body.bd-lock { overflow: hidden; }
.bd-modal-body { position: relative; background: #fff; box-shadow: 0 10px 40px rgba(0,0,0,.4); overflow: hidden; }
.bd-modal-body .bd-sheet { transform-origin: 0 0; }
.bd-modal-bar { display: flex; align-items: center; gap: .8rem; color: #fff; font-weight: 600; }
.bd-modal-bar button { border: 0; background: #FFD700; border-radius: 10px; width: 2.6rem; height: 2.4rem; font-size: 1.2rem; cursor: pointer; }
.bd-modal-bar button:disabled { opacity: .4; cursor: default; }
.bd-x { position: absolute; top: .8rem; right: 1rem; border: 0; background: rgba(255,255,255,.9); width: 2.4rem; height: 2.4rem; border-radius: 50%; font-size: 1.3rem; cursor: pointer; }

@media screen and (max-width: 600px) {
  .bd-step { padding: 1rem; }
  #puzzle-preview.bd-root { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
  .bd-card { min-width: 0; }
  .bd-thumb { width: 100%; height: auto; aspect-ratio: 210 / 297; }
  .bd-thumb .bd-sheet { transform: scale(calc(var(--bd-w, 160) / 793.7)); }
  .bd-topics { grid-template-columns: repeat(2, 1fr); }
  .bd-modes { grid-template-columns: 1fr; }
  .bd-levels { grid-template-columns: 1fr 1fr; }
  .bd-kinds { grid-template-columns: repeat(2, 1fr); }
}


/* 끌어서 순서 바꾸기 */
.bd-hint2 { margin: -.3rem 0 .8rem; color: #888; font-size: .88rem; }
.bd-hint2 i { margin-right: .3rem; color: #c9a100; }
.bd-kcard, .bd-card { cursor: grab; touch-action: pan-y; }
.bd-kcard.dragging, .bd-card.dragging { opacity: .45; outline: 2px dashed #FFD700; outline-offset: 2px; transform: scale(1.02); }
body.bd-dragging, body.bd-dragging * { cursor: grabbing !important; user-select: none !important; }
.bd-checks { display: inline-flex; gap: 1.2rem; flex-wrap: wrap; }
.bd-tools { display: inline-flex; gap: .8rem; flex-wrap: wrap; }
.bd-words h3 .bd-tools button { border: 1px solid #e5d28a; background: #FFF8D6; border-radius: 999px; padding: .25rem .8rem; color: #6d5600; text-decoration: none; font-weight: 700; }
.bd-words h3 .bd-tools button#bd-restore { border-color: transparent; background: transparent; text-decoration: underline; font-weight: 600; }

/* 표지 */
.bd-cover { display: flex; flex-direction: column; align-items: center; text-align: center; background: #fff; padding: 0; }
.bd-cover .cv-logo { position: absolute; top: 12mm; left: 14mm; height: 15mm; width: auto; background: #fff; border-radius: 3mm; padding: 1.5mm 2.5mm; box-sizing: content-box; }
.bd-cover .cv-band { width: 100%; height: 118mm; background: none; display: flex; align-items: flex-end; justify-content: center; border-radius: 0 0 50% 50% / 0 0 22mm 22mm; margin-bottom: 22mm; }
.bd-cover .cv-img { width: 66mm; height: 66mm; object-fit: contain; display: block; }
.bd-cover .cv-icon { font-size: 62mm; line-height: 1; transform: translateY(14mm); }
.bd-cover .cv-title { font-size: 34pt; line-height: 1.2; font-weight: 800; color: var(--cv3); margin: 0 14mm 4mm; }
.bd-cover .cv-sub { font-size: 19pt; color: #666; margin: 0 14mm 10mm; }
.bd-cover .cv-list { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 3mm; padding: 0 14mm; margin: 0; }
.bd-cover .cv-list li { background: var(--cvl, var(--cv2)); color: var(--cv3); border-radius: 999px; padding: 1.6mm 5mm; font-weight: 700; font-size: 11pt; }
.bd-cover .cv-name { position: absolute; bottom: 24mm; left: 40mm; right: 40mm; display: flex; align-items: flex-end; gap: 3mm; font-size: 13pt; color: #444; }
.bd-cover .cv-name i { flex: 1; border-bottom: 1.5px solid #444; min-height: 8mm; font-style: normal; font-weight: 700; text-align: left; padding-left: 2mm; }
.bd-cover .copyright-footer { }
.bd-card.is-cover { background: #fffbea; }

/* 표지 편집 창 */
.bd-cvmodal { overflow: auto; align-items: center; justify-content: center; padding: 1rem; }
.bd-cvbox { background: #fff; border-radius: 16px; padding: 1.2rem; max-width: 900px; width: 100%; display: grid; grid-template-columns: 1fr 300px; gap: 1.2rem; box-shadow: 0 12px 40px rgba(0,0,0,.35); max-height: 94vh; overflow: auto; }
.bd-cvform h2 { margin: 0 0 .8rem; font-size: 1.2rem; }
.bd-cvform label { display: flex; flex-direction: column; gap: .3rem; font-weight: 600; font-size: .92rem; margin-bottom: .7rem; }
.bd-cvform input[type=text] { padding: .6rem .8rem; border: 2px solid #eee; border-radius: 10px; font-size: 1rem; font-family: inherit; }
.bd-cvform input[type=text]:focus { outline: none; border-color: #FFD700; }
.bd-cvrow { margin-bottom: .8rem; }
.bd-cvrow > span { display: block; font-weight: 600; font-size: .92rem; margin-bottom: .35rem; }
.bd-swatches, .bd-icons { display: flex; flex-wrap: wrap; gap: .4rem; }
.bd-sw { width: 2rem; height: 2rem; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1px #ccc; cursor: pointer; padding: 0; }
.bd-sw.on { box-shadow: 0 0 0 3px #333; }
.bd-ic img { width: 100%; height: 100%; object-fit: contain; display: block; }
.bd-ic { width: 3.6rem; height: 3.6rem; border: 2px solid #eee; background: #fff; border-radius: 12px; cursor: pointer; padding: .25rem; line-height: 1; display: inline-flex; align-items: center; justify-content: center; }
.bd-ic.on { border-color: #FFD700; background: #FFF8D6; }
.bd-cvform label.bd-cvcheck { flex-direction: row; align-items: center; font-weight: 500; }
.bd-cvbtns { display: flex; justify-content: flex-end; gap: .6rem; margin-top: 1rem; }
.bd-cvbtns button { border: 1px solid #ddd; background: #fff; border-radius: 10px; padding: .6rem 1.4rem; font-size: 1rem; font-family: inherit; font-weight: 700; cursor: pointer; }
.bd-cvbtns button.primary { background: #FFD700; border-color: #FFD700; color: #222; }
.bd-cvprev { display: flex; justify-content: center; align-items: flex-start; background: #f3f3f3; border-radius: 10px; padding: .5rem; min-width: 0; box-sizing: border-box; }
.bd-cvsheet { position: relative; overflow: hidden; background: #fff; box-shadow: 0 4px 16px rgba(0,0,0,.2); }
@media screen and (max-width: 720px) { .bd-cvbox { grid-template-columns: minmax(0, 1fr); } .bd-cvprev { order: -1; } }

/* 인쇄: 카드 장식은 빼고 학습지만 A4 한 장씩 */
@media print {
  .bd-card, .bd-thumb { all: unset; display: block; }
  .bd-cap { display: none !important; }
  #puzzle-preview.bd-root { display: block !important; }
  .bd-thumb .bd-sheet { transform: none !important; }
  .bd-sheet { break-after: page; page-break-after: always; box-shadow: none !important; }
  .bd-card:last-child .bd-sheet { break-after: auto; page-break-after: auto; }
  .bd-modal, .bd-cvmodal { display: none !important; }
  .bd-page, .bd-result, #puzzle-preview.bd-root { margin: 0 !important; padding: 0 !important; max-width: none !important; width: auto !important; }
}

.bd-picbtns { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: .55rem; }
.bd-picbtns button { border: 1px solid #ddd; background: #fff; border-radius: 999px; padding: .4rem .9rem; font-family: inherit; font-size: .88rem; font-weight: 600; cursor: pointer; color: #444; }
.bd-picbtns button:hover, .bd-picbtns button.on { border-color: #FFD700; background: #FFF8D6; }
.bd-icons { max-height: 15.5rem; overflow: auto; padding: .15rem; }
/* 그림을 넣지 않은 표지: 위쪽 색 띠를 낮게 */
.bd-cover.no-pic .cv-band { height: 70mm; margin-bottom: 26mm; border-radius: 0 0 50% 50% / 0 0 14mm 14mm; }

/* 학습지 카드: 표지(맨 앞) · 학습지들 · 정답지(맨 뒤) */
.bd-kwrap { display: grid; grid-template-columns: repeat(auto-fill, minmax(136px, 1fr)); gap: .8rem; }
.bd-kgroup { display: contents; }
.bd-kcard.fixed { cursor: pointer; }
.bd-kcard.fixed .cnt { visibility: hidden; height: 1.7rem; }
.bd-kinds { display: contents; }
.bd-pageno { position: absolute; left: 0; right: 0; bottom: 11mm; text-align: center; font-size: 10pt; color: #555; }
.bd-sheet.bd-ans .puzzle-title { color: #b00020; }
.bd-mtans p { font-size: 13pt; margin: 0 0 4mm; }
.bd-sheet .puzzle-title { margin-top: 0; }
@media screen and (max-width: 600px) { .bd-kwrap { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.bd-sheet .matching-list { max-width: 150mm; margin: 6mm auto 0; }
.bd-sheet .matching-list .list-item { font-size: 13pt; }
.bd-sheet .crossword-table { margin: 1rem auto; }
.bd-sheet .clue-lists { margin: 1rem auto; }

/* 표지 편집: 그림 칸(첫 칸 = 내 컴퓨터, 마지막 칸 = 그림 없애기), 이름 줄 */
.bd-icons { display: grid; grid-template-columns: repeat(8, 1fr); gap: .4rem; max-height: none; overflow: visible; }
.bd-ic { width: 100%; height: auto; aspect-ratio: 1; }
.bd-ic.up, .bd-ic.none { color: #666; font-size: 1.15rem; background: #fafafa; }
.bd-ic.up:hover, .bd-ic.none:hover { border-color: #FFD700; color: #333; }
.bd-ic.none.on { color: #b00020; }
.bd-cvnamebox { margin-bottom: .7rem; }
.bd-cvnamehead { display: flex; justify-content: space-between; align-items: center; gap: .6rem; margin-bottom: .3rem; font-weight: 600; font-size: .92rem; }
.bd-cvnamehead .bd-cvshow { display: inline-flex; flex-direction: row; align-items: center; gap: .35rem; margin: 0; font-weight: 500; font-size: .85rem; color: #555; cursor: pointer; }
.bd-cvnamebox input[type=text] { width: 100%; box-sizing: border-box; padding: .6rem .8rem; border: 2px solid #eee; border-radius: 10px; font-size: 1rem; font-family: inherit; }
.bd-cvnamebox input[type=text]:focus { outline: none; border-color: #FFD700; }
.bd-cvnamebox input[type=text]:disabled { background: #f6f6f6; color: #aaa; }
.bd-cover .cv-name i { text-align: center; padding-left: 0; }
@media screen and (max-width: 720px) { .bd-icons { grid-template-columns: repeat(6, 1fr); } }

/* 학습지 목록 색 고르기 */
.bd-cover .cv-list.plain { gap: 2mm 6mm; }
.bd-cover .cv-list.plain li { background: none; padding: 0; }
.bd-listcolors { display: flex; gap: .4rem; flex-wrap: wrap; }
.bd-lc { width: 2.2rem; height: 2.2rem; border-radius: 50%; border: 2px solid #ddd; cursor: pointer; padding: 0; font-size: .8rem; font-weight: 700; color: #555; background: #fff; box-sizing: border-box; transition: none; }
.bd-lc.on { border-color: #333; }
.bd-lc.none { color: #666; }

/* 영어판: 오른쪽이 문장(뜻풀이)이라 길 때 */
.bd-sheet .matching-list.mt-long { max-width: 176mm; gap: 0; padding: 2rem 0; }
.bd-sheet .matching-list.mt-long .list-item { font-size: 12pt; min-height: 2.6rem; }
.bd-sheet .matching-list.mt-long .list-column.right .list-item { width: 78mm; justify-content: flex-start; padding-left: 1.2rem; line-height: 1.3; text-align: left; }
.bd-sheet .matching-list.mt-long .list-column.right .connection-point { left: 0; }
.bd-sheet .matching-list.mt-long .list-column.left .connection-point { right: -3rem; }

.bd-sheet .bd-wrsvg { display: block; width: 100%; height: auto; margin-top: 6mm; overflow: hidden; }

/* 크게 보기: 화살표는 양옆 고정, 글자는 가운데 아래 */
.bd-modal-bar { pointer-events: none; }
.bd-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 3rem; height: 3rem; border: 0; border-radius: 50%; background: rgba(255,215,0,.92); color: #222; font-size: 1.8rem; line-height: 1; padding: 0 0 .2rem; cursor: pointer; z-index: 2; box-shadow: 0 2px 8px rgba(0,0,0,.3); }
.bd-nav-l { left: .8rem; } .bd-nav-r { right: .8rem; }
.bd-nav:disabled { opacity: .25; cursor: default; }
.bd-modal-body.slide-r { animation: bdSlideR .28s ease; } .bd-modal-body.slide-l { animation: bdSlideL .28s ease; }
@keyframes bdSlideR { from { transform: translateX(60px); opacity: .2; } to { transform: none; opacity: 1; } }
@keyframes bdSlideL { from { transform: translateX(-60px); opacity: .2; } to { transform: none; opacity: 1; } }

/* ───── 수학·쓰기 번들 ───── */
#puzzle-preview .bd-sheet.bd-ans .answer-slot { opacity: 1 !important; }
.bd-sheet .bd-time-ans { color: #cc0000; font-weight: 700; text-align: center; font-size: 13pt; margin-top: 1mm; }
#puzzle-preview .bd-sheet .mo-grid.bd-mo { flex: 1 1 auto; min-height: 0; align-items: start; align-content: space-between; display: grid; grid-template-columns: repeat(3, 1fr); gap: 4mm 5mm; margin-top: 8mm; margin-bottom: 6mm; }
.bd-sheet:has(.mo-grid.bd-mo) { display: flex; flex-direction: column; }
#puzzle-preview .bd-sheet .problems-grid { margin-top: 4mm; }
.bd-topic .ic.txt { display: flex; align-items: center; justify-content: center; width: 68px; height: 68px; font-size: 2.4rem; font-weight: 700; color: #333; background: #fff8d6; border-radius: 16px; }
.bd-sheet .bd-wsvg { display: block; width: 100%; height: auto; margin-top: 6mm; }

/* 맨 아래 가운데 큰 인쇄·PDF 버튼: 크고 부드럽게 */
.bd-actions { text-align: center; margin: 2.2rem 0 1.2rem; }
.bd-actions .print-btn, #print-btn-top { display: inline-flex; align-items: center; justify-content: center; gap: .7rem; min-width: 18rem; padding: 1.15rem 3rem; font-size: 1.2rem; font-weight: 700; font-family: inherit; color: #6b4a00; background: linear-gradient(135deg, #ffe38a, #ffd24d); border: 0; border-radius: 999px; cursor: pointer; box-shadow: 0 8px 22px rgba(255, 190, 50, .38); transition: transform .2s, box-shadow .2s; }
.bd-actions .print-btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(255, 190, 50, .48); }
.bd-actions .print-btn:disabled { opacity: .5; cursor: default; box-shadow: none; }
.bd-actions .print-btn i { font-size: 1.15rem; }
@media screen and (max-width: 520px) { .bd-actions .print-btn, #print-btn-top { min-width: 0; width: 100%; padding: 1.1rem 1.5rem; } }

/* 수학 카드: 난이도 · 문제 개수 (둥글고 부드러운 목록) */
.bd-kcard .kopt { display: flex; flex-direction: column; gap: .35rem; width: 100%; margin-top: .15rem; visibility: hidden; }
.bd-kcard.on .kopt { visibility: visible; }
.ksel { position: relative; display: block; width: 100%; }
.ksel-btn { position: relative; width: 100%; padding: .38rem 1.6rem .38rem .7rem; border: 1px solid #f0e2b4; border-radius: 999px; background: #fffbea; color: #6b4a00; font: inherit; font-size: .82rem; text-align: center; cursor: pointer; transition: background .15s, border-color .15s; }
.ksel-btn::after { content: ""; position: absolute; right: .75rem; top: 50%; width: .38rem; height: .38rem; border-right: 1.5px solid #b98a1a; border-bottom: 1.5px solid #b98a1a; transform: translateY(-70%) rotate(45deg); }
.ksel-btn:hover { background: #fff4c9; border-color: #ffd24d; }
.ksel-btn:focus-visible { outline: 2px solid #FFD700; outline-offset: 1px; }
.ksel-list { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 30; margin: 0; padding: .3rem; list-style: none; background: #fff; border: 1px solid #f0e2b4; border-radius: 16px; box-shadow: 0 10px 26px rgba(120, 90, 10, .18); }
.ksel-list[hidden] { display: none; }
.ksel-list li { padding: .42rem .5rem; border-radius: 12px; font-size: .82rem; color: #5a4300; text-align: center; cursor: pointer; }
.ksel-list li:hover { background: #fff4c9; }
.ksel-list li.cur { background: #ffe58a; font-weight: 700; }
.bd-kcard:has(.ksel-list:not([hidden])) { z-index: 40; }

/* 따라 쓰기 글자 목록 편집 */
.bd-we-box { background: #fff; border-radius: 18px; padding: 1.3rem 1.3rem 1.1rem; width: min(560px, 100%); box-shadow: 0 12px 40px rgba(0,0,0,.35); color: #333; }
.bd-we-box h2 { margin: 0 0 .4rem; font-size: 1.15rem; }
.bd-we-box p { margin: 0 0 .7rem; color: #666; font-size: .88rem; line-height: 1.5; }
.bd-we-box textarea { width: 100%; box-sizing: border-box; height: 220px; max-height: 50vh; overflow-y: auto; resize: vertical; padding: .7rem; border: 2px solid #eee; border-radius: 12px; font: 1rem/1.7 inherit; font-family: inherit; }
.bd-we-box textarea:focus { outline: none; border-color: #FFD700; }
.bd-we-btns { display: flex; gap: .5rem; margin-top: .8rem; } .bd-we-btns span { flex: 1; }
.bd-we-btns button { border: 0; border-radius: 999px; padding: .6rem 1.2rem; font: 700 .92rem inherit; font-family: inherit; background: #f1f1f1; color: #555; cursor: pointer; }
.bd-we-btns button.primary { background: linear-gradient(135deg, #ffe38a, #ffd24d); color: #5a4300; }
@media print { #bd-we-ov { display: none !important; } }

/* 제목을 뺀 수학 학습지: 한 줄이 더 들어가도록 간격을 조금 줄이고 아래 여백을 남깁니다 */
#puzzle-preview .bd-sheet.bd-notitle .problems-grid, #bd-modal-body .bd-sheet.bd-notitle .problems-grid { margin-top: 0; margin-bottom: 0; row-gap: .75rem; }
#puzzle-preview .bd-sheet.bd-notitle .mo-grid.bd-mo { margin-top: 5mm; }
