/* ============================================================
   유자보드 — 학급경영 탭 (js/manage.js · manage-print.js · manage-kinds.js · W02 · 2026-11-18 봉 주임)
   디자인 v4: 캔버스 위 미색 카드 · 2차 상단바 56 · 지금 칸 = 유자 100 알약 · 화면당 primary 하나
   인쇄물: mm 단위 · 선과 면만 · html.cb-mg-printing 일 때만(평가의 cb-printing 과 따로)
   ============================================================ */

/* 출력물 종이 토큰(W02-2-01) — 화면이 어두운 모드여도 미리 보기 · 인쇄는 흰 종이 · 먹 글자 · 회색 선.
   값은 공용 규격(ds/v3 yuja.css)의 밝은 모드 값과 같다. 종이 안(.cb-mg-sheet)에서 --yj-* 를 이 값으로 다시 정해 모든 출력물이 한 곳을 따른다 */
:root {
  --cb-mg-paper: #FFFFFF; --cb-mg-ink-deep: #16181A; --cb-mg-ink: #333333; --cb-mg-sub: #66655F;
  --cb-mg-line: #E8E2D3; --cb-mg-line-strong: #D7CFBC; --cb-mg-tint: #FEF7E0; --cb-mg-off: #E8E2D3;
}
.cb-mgp__paper, .cb-mg-sheet, .cb-mg-print {
  --yj-ink-deep: var(--cb-mg-ink-deep); --yj-ink: var(--cb-mg-ink); --yj-sub: var(--cb-mg-sub);
  --yj-line: var(--cb-mg-line); --yj-line-strong: var(--cb-mg-line-strong); --yj-card-hi: var(--cb-mg-paper); --yj-card: var(--cb-mg-paper);
  --yj-yuja-50: var(--cb-mg-tint); color-scheme: light; color: var(--cb-mg-ink-deep);
}
.cb-mgp__paper { background: var(--cb-mg-paper); }
.cb-mgpage { top: var(--cb-bar-h, 56px); z-index: 19; }

/* ── 2차 상단바 ── */
.cb-mgpage__bar { flex: none; height: 56px; display: flex; align-items: center; gap: var(--yj-s4); padding: 0 var(--yj-s6); background: var(--yj-card); border-bottom: 1px solid var(--yj-line); }
.cb-mgpage__h { margin: 0; font-size: 20px; font-weight: 800; color: var(--yj-ink-deep); white-space: nowrap; }
.cb-mgpage__nav { display: flex; align-items: center; gap: var(--yj-s1); }
.cb-mgpage__p { min-height: 44px; padding: 0 var(--yj-s4); border: 0; border-radius: var(--yj-r-full); background: transparent; color: var(--yj-sub); font: inherit; font-size: var(--yj-t-body); font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: background var(--yj-m-fast) var(--yj-ease), color var(--yj-m-fast) var(--yj-ease); }
.cb-mgpage__p:hover { color: var(--yj-ink-deep); background: var(--yj-yuja-50); }
.cb-mgpage__p[aria-current="page"] { background: var(--yj-yuja-100); color: var(--yj-ink-deep); font-weight: 700; }
.cb-mgpage__p:focus-visible { outline: 2px solid var(--yj-yuja-600); outline-offset: 2px; }
.cb-mgpage__cur { margin-left: auto; font-weight: 700; color: var(--yj-ink-deep); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cb-mgpage__back { flex: none; }
.cb-mgpage__body { flex: 1; min-height: 0; overflow: auto; padding: var(--yj-s5) var(--yj-s6) var(--yj-s8); }
.cb-mgpage__body > .cb-state { margin: var(--yj-s6) 0; }

/* ── 카드 목록 ── */
.cb-mg-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--yj-s4); }
.cb-mg-card { display: flex; flex-direction: column; align-items: flex-start; gap: var(--yj-s2); min-height: 150px; padding: var(--yj-s5); text-align: left; font: inherit; color: var(--yj-ink); cursor: pointer;
  background: var(--yj-card); border: 1px solid var(--yj-line); border-radius: var(--yj-r-lg); box-shadow: var(--yj-sh-1);
  transition: box-shadow var(--yj-m-fast) var(--yj-ease), transform var(--yj-m-fast) var(--yj-ease), border-color var(--yj-m-fast) var(--yj-ease); }
.cb-mg-card:hover { box-shadow: var(--yj-sh-2); transform: translateY(-2px); }
.cb-mg-card:focus-visible { outline: none; border-color: var(--yj-yuja-600); box-shadow: var(--yj-sh-2); }
.cb-mg-card__badges { display: flex; gap: var(--yj-s1); flex-wrap: wrap; }
.cb-mg-badge { display: inline-flex; align-items: center; height: 26px; padding: 0 var(--yj-s3); border: 1px solid var(--yj-line-strong); border-radius: var(--yj-r-full); color: var(--yj-sub); font-size: var(--yj-t-cap); font-weight: 700; }
.cb-mg-card__t { font-size: var(--yj-t-body); font-weight: 800; color: var(--yj-ink-deep); }
.cb-mg-card__d { font-size: var(--yj-t-small); color: var(--yj-sub); line-height: 1.5; }
.cb-mg-card__go { margin-top: auto; display: inline-flex; align-items: center; gap: 4px; min-height: 36px; padding: 0 var(--yj-s3); border-radius: var(--yj-r-md); background: var(--yj-yuja-100); color: var(--yj-ink-deep); font-size: var(--yj-t-small); font-weight: 700; }
.cb-mg-card__go .cb-ic { width: 16px; height: 16px; }

/* ── 도구 페이지 틀 ── */
.cb-mgp { display: grid; grid-template-columns: minmax(320px, 400px) 1fr; gap: var(--yj-s5); align-items: start; }
.cb-mgp > .cb-state { grid-column: 1 / -1; }
.cb-mgp__side { display: flex; flex-direction: column; gap: var(--yj-s4); }
.cb-mgp__step { padding: var(--yj-s4) var(--yj-s5); background: var(--yj-card); border: 1px solid var(--yj-line); border-radius: var(--yj-r-lg); box-shadow: var(--yj-sh-1); display: flex; flex-direction: column; gap: var(--yj-s3); }
.cb-mgp__h { margin: 0; font-size: var(--yj-t-body); font-weight: 800; color: var(--yj-ink-deep); }
.cb-mgp__vers { display: flex; flex-wrap: wrap; gap: var(--yj-s2); }
.cb-mgp__ver { min-height: 44px; padding: 0 var(--yj-s4); display: inline-flex; flex-direction: column; justify-content: center; border: 1px solid var(--yj-line-strong); border-radius: var(--yj-r-full); background: var(--yj-card-hi); color: var(--yj-ink); font: inherit; font-size: var(--yj-t-small); font-weight: 600; cursor: pointer; }
.cb-mgp__ver small { font-size: var(--yj-t-cap); color: var(--yj-sub); font-weight: 500; }
.cb-mgp__ver:hover:not([disabled]) { background: var(--yj-yuja-50); }
.cb-mgp__ver[aria-checked="true"] { background: var(--yj-yuja-200); border-color: var(--yj-yuja-600); color: var(--yj-ink-deep); }
.cb-mgp__ver[disabled] { cursor: default; opacity: 0.6; }
.cb-mgp__row { display: flex; align-items: center; gap: var(--yj-s3); flex-wrap: wrap; }
.cb-mgp__lb { flex: none; min-width: 4.5em; font-size: var(--yj-t-small); font-weight: 700; color: var(--yj-ink); }
.cb-mgp__seg { display: inline-flex; border: 1px solid var(--yj-line-strong); border-radius: var(--yj-r-full); overflow: hidden; background: var(--yj-card-hi); }
.cb-mgp__seg > button { min-height: 44px; padding: 0 var(--yj-s3); border: 0; border-right: 1px solid var(--yj-line); background: transparent; color: var(--yj-ink); font: inherit; font-size: var(--yj-t-small); font-weight: 600; cursor: pointer; }
.cb-mgp__seg > button:last-child { border-right: 0; }
.cb-mgp__seg > button:hover { background: var(--yj-yuja-50); }
.cb-mgp__seg > button[aria-checked="true"] { background: var(--yj-yuja-200); color: var(--yj-ink-deep); box-shadow: inset 0 0 0 1px var(--yj-yuja-600); }
.cb-mgp__mm { display: inline-flex; align-items: center; gap: var(--yj-s1); font-size: var(--yj-t-small); color: var(--yj-sub); }
.cb-mgp__mm[hidden] { display: none; }
.cb-mgp__mm input { width: 6em; }
.cb-mgp__info { margin: 0; font-size: var(--yj-t-small); color: var(--yj-ink); font-weight: 700; }
.cb-mgp__f { margin: 0; }
/* [인쇄]는 고르는 칸을 내려도 늘 보이게 — 아래에 붙인다 */
.cb-mgp__foot { position: sticky; bottom: calc(-1 * var(--yj-s8)); z-index: 1; display: flex; flex-direction: column; align-items: stretch; gap: var(--yj-s2); padding: var(--yj-s3) 0 var(--yj-s8); margin-bottom: calc(-1 * var(--yj-s8)); background: var(--yj-canvas); }
.cb-mgp__guide { margin: 0; font-size: var(--yj-t-cap); color: var(--yj-sub); line-height: 1.6; }

/* 미리 보기 — 종이를 실제 mm 로 그린 뒤 칸에 맞게 줄인다 */
.cb-mgp__view { position: sticky; top: 0; min-width: 0; padding: var(--yj-s4); background: var(--yj-canvas); border: 1px solid var(--yj-line); border-radius: var(--yj-r-lg); overflow: hidden; }
.cb-mgp__fit { transform-origin: top left; display: flex; flex-direction: column; gap: 8mm; }
.cb-mgp__paper { box-sizing: border-box; background: var(--yj-card-hi); box-shadow: var(--yj-sh-2); flex: none; }

/* ── 종이 안쪽(미리 보기 · 인쇄 같은 모양) ── */
.cb-mg-sheet { box-sizing: border-box; overflow: hidden; color: var(--yj-ink-deep); font-family: var(--yj-font-ui); font-size: 11pt; line-height: 1.3; }
.cb-mgs { height: 100%; display: flex; flex-direction: column; }
.cb-mgs-head { flex: none; height: 14mm; margin-bottom: 2mm; display: flex; align-items: flex-end; justify-content: space-between; gap: 6mm; border-bottom: 0.4mm solid var(--yj-ink-deep); padding-bottom: 1.5mm; box-sizing: border-box; }
.cb-mgs-title { font-size: 16pt; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cb-mgs-sub { font-weight: 600; }
.cb-mgs-date { flex: none; font-size: 11pt; white-space: nowrap; }
.cb-mgs-date i { display: inline-block; width: 12mm; border-bottom: 0.2mm solid var(--yj-ink); margin: 0 1mm; }
.cb-mgs-cols { flex: 1; min-height: 0; display: flex; gap: 6mm; align-items: flex-start; }
.cb-mgs-col { flex: 1; min-width: 0; }
.cb-mgs-foot { flex: none; height: 8mm; display: flex; align-items: center; justify-content: space-between; font-size: 10pt; color: var(--yj-ink); }
.cb-mgs-t { width: 100%; border-collapse: collapse; table-layout: fixed; }
.cb-mgs-t caption { text-align: left; font-weight: 800; font-size: 11pt; padding: 0 0 1mm; }
.cb-mgs-t th, .cb-mgs-t td { height: var(--row, 8mm); border: 0.2mm solid var(--yj-ink); padding: 0 1.5mm; box-sizing: border-box; overflow: hidden; white-space: nowrap; text-overflow: clip; }
.cb-mgs-t th { font-size: 9pt; font-weight: 700; background: var(--yj-yuja-50); text-align: center; }
.cb-mgs-t td { font-size: 11pt; }
.cb-mgs-t .cb-mgs-no { width: 10mm; text-align: center; font-variant-numeric: tabular-nums; }
.cb-mgs-t .cb-mgs-nm { width: 26mm; }
.cb-mgs-t .cb-mgs-g { width: 10mm; text-align: center; }
.cb-mgs-t .cb-mgs-memo { width: auto; }
.cb-mgs-t th.cb-mgs-c { padding: 0 0.5mm; font-size: 8pt; line-height: 1.1; white-space: normal; }
.cb-mgs-t th.cb-mgs-c b { display: block; font-size: 9pt; }
.cb-mgs-t th.cb-mgs-c small { display: block; font-size: 7pt; font-weight: 500; }
.cb-mgs-t.is-dense td { font-size: 10pt; }
.cb-mgs-t.is-dense .cb-mgs-nm { width: 22mm; }
.cb-mgs-t.is-big td { font-size: 14pt; }
.cb-mgs-t.is-big .cb-mgs-nm { width: auto; }
.cb-mgs-t.is-big .cb-mgs-c { width: 12mm; }
.cb-mgs-t tr.is-gone td { background: var(--yj-line); }

/* 인쇄 — 학급경영 인쇄 중에는 붙인 종이만 */
.cb-mg-print { display: none; }
@media print {
  html.cb-mg-printing body > *:not(.cb-mg-print) { display: none !important; }
  html.cb-mg-printing, html.cb-mg-printing body { background: transparent; margin: 0; padding: 0; }
  html.cb-mg-printing .cb-mg-print { display: block; }
  html.cb-mg-printing .cb-mg-print .cb-mg-sheet { break-after: page; }
  html.cb-mg-printing .cb-mg-print .cb-mg-sheet:last-child { break-after: auto; }
  html.cb-mg-printing .cb-mg-print, html.cb-mg-printing .cb-mg-print * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }   /* 「휴」 · 머리 줄의 옅은 면도 찍히게 */
}

/* 좁은 화면 — 고르는 칸을 위로 */
@media (max-width: 1100px) {
  .cb-mgp { grid-template-columns: 1fr; }
  .cb-mgpage__h { display: none; }
}

/* ── 사진(W03 · M2) — 칸 안 자르기는 넘치는 그림을 숨겨서(배경 그림이 아니라 <img> — 인쇄에 빠지지 않게) ── */
.cb-ph { position: relative; display: inline-block; overflow: hidden; flex: none; background: var(--yj-card-hi); vertical-align: top; }
.cb-ph img { position: absolute; max-width: none; user-select: none; -webkit-user-drag: none; }
.cb-ph.is-empty { border: 0.3mm dashed var(--yj-line-strong); box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; }

/* 학생 사진 칸 */
.cb-mgph { display: block; }
.cb-mgph__note { padding: var(--yj-s3) var(--yj-s4); margin-bottom: var(--yj-s3); background: var(--yj-yuja-50); border-left: 2px solid var(--yj-yuja-500); border-radius: var(--yj-r-lg); font-size: var(--yj-t-small); color: var(--yj-ink); line-height: 1.6; }
.cb-mgph__note b { color: var(--yj-ink-deep); }
.cb-mgph__band { display: flex; align-items: center; gap: var(--yj-s2); flex-wrap: wrap; padding: var(--yj-s2) var(--yj-s4); margin-bottom: var(--yj-s3); background: var(--yj-card); border: 1px solid var(--yj-line-strong); border-radius: var(--yj-r-md); font-size: var(--yj-t-small); }
.cb-mgph__band span { flex: 1; min-width: 14em; }
.cb-mgph__bar { display: flex; align-items: center; gap: var(--yj-s2); flex-wrap: wrap; margin-bottom: var(--yj-s2); }
.cb-mgph__count { font-weight: 700; color: var(--yj-ink); font-variant-numeric: tabular-nums; }
.cb-mgph__grow { flex: 1; }
.cb-mgph__hint { margin: 0 0 var(--yj-s4); font-size: var(--yj-t-cap); color: var(--yj-sub); }
.cb-mgph__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--yj-s3); }
.cb-mgph__cell { display: flex; flex-direction: column; align-items: center; gap: var(--yj-s1); padding: var(--yj-s3) var(--yj-s2); background: var(--yj-card); border: 1px solid var(--yj-line); border-radius: var(--yj-r-lg); box-shadow: var(--yj-sh-1); }
.cb-mgph__cell.is-over { border-color: var(--yj-yuja-600); background: var(--yj-yuja-50); }
.cb-mgph__cell.is-edit { border-color: var(--yj-yuja-600); box-shadow: inset 0 0 0 1px var(--yj-yuja-600); }
.cb-mgph__pic { padding: 0; border: 0; background: none; cursor: pointer; border-radius: var(--yj-r-sm); }
.cb-mgph__pic:focus-visible { outline: 2px solid var(--yj-yuja-600); outline-offset: 2px; }
.cb-mgph__pic .cb-ph { width: 113px; height: 136px; border-radius: var(--yj-r-sm); }
.cb-mgph__pic .cb-ph.is-empty span { font-size: var(--yj-t-cap); color: var(--yj-sub); text-align: center; line-height: 1.5; }
.cb-mgph__nm { font-weight: 700; color: var(--yj-ink-deep); display: inline-flex; align-items: baseline; gap: 6px; }
.cb-mgph__nm small { color: var(--yj-sub); font-weight: 600; font-size: var(--yj-t-cap); font-variant-numeric: tabular-nums; }
.cb-mgph__acts { display: flex; gap: 2px; }
.cb-mgph__ed { display: flex; gap: var(--yj-s5); align-items: flex-start; padding: var(--yj-s4); margin-bottom: var(--yj-s4); background: var(--yj-card); border: 1px solid var(--yj-line); border-radius: var(--yj-r-lg); box-shadow: var(--yj-sh-2); }
.cb-mgph__edbox { flex: none; cursor: grab; touch-action: none; border-radius: var(--yj-r-sm); }
.cb-mgph__edbox:active { cursor: grabbing; }
.cb-mgph__edbox:focus-visible { outline: 2px solid var(--yj-yuja-600); outline-offset: 2px; }
.cb-mgph__edside { display: flex; flex-direction: column; gap: var(--yj-s2); align-items: flex-start; }
.cb-mgph__edside p { margin: 0; font-size: var(--yj-t-small); color: var(--yj-sub); }
.cb-mgph__edbtns { display: flex; gap: var(--yj-s2); flex-wrap: wrap; }
.cb-mgph-plan__card { width: min(720px, 94%); max-height: 86%; display: flex; flex-direction: column; }
.cb-mgph-plan__list { list-style: none; margin: 0 0 var(--yj-s3); padding: 0; overflow: auto; flex: 1; min-height: 0; border-top: 1px solid var(--yj-line); }
.cb-mgph-plan__list li { display: flex; align-items: center; gap: var(--yj-s3); padding: var(--yj-s2) 0; border-bottom: 1px solid var(--yj-line); }
.cb-mgph-plan__thumb { flex: none; width: 40px; height: 48px; overflow: hidden; border-radius: var(--yj-r-xs); background: var(--yj-canvas); }
.cb-mgph-plan__thumb img { width: 100%; height: 100%; object-fit: cover; }
.cb-mgph-plan__name { flex: 1; min-width: 0; font-size: var(--yj-t-small); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cb-mgph-plan__name em { display: block; font-style: normal; color: var(--yj-sub); font-size: var(--yj-t-cap); }
.cb-mgph-plan__list select { width: 12em; }
.cb-mgph-plan__swap { width: 3em; font-size: var(--yj-t-cap); font-weight: 700; color: var(--yj-ink); }
.cb-mgp__pinfo { margin: 0; font-size: var(--yj-t-small); color: var(--yj-ink); }

/* 사진 명렬표 — 종이 안쪽 */
.cb-mgs-grid { flex: 1; min-height: 0; display: grid; align-content: start; column-gap: 0; }
.cb-mgs-pc { display: flex; flex-direction: column; align-items: center; padding-top: 1.5mm; box-sizing: border-box; overflow: hidden; }
.cb-mgs-pc .cb-ph { border-radius: 1mm; }
.cb-mgs-pn { margin-top: 1mm; display: flex; align-items: baseline; gap: 1.2mm; white-space: nowrap; }
.cb-mgs-pn small { font-size: 8pt; color: var(--yj-sub); }
.cb-mgs-pn b { font-size: 12pt; font-weight: 800; }
.cb-mgs-memo2 { align-self: stretch; margin: 1mm 2mm 0; }
.cb-mgs-memo2 i { display: block; height: 6mm; border-bottom: 0.2mm solid var(--yj-ink); }
@media print {
  html.cb-mg-printing .cb-ph.is-empty { border-color: var(--yj-ink); }
}

/* ── W02 써 보기 1 (2026-11-18) ── */
/* 달력형 쉬는 날 — 회색 + 「휴」 · 미리 보기에서 날짜 칸을 눌러 바꾼다 */
.cb-mgs-t th.is-off, .cb-mgs-t td.is-off { background: var(--yj-line); }
.cb-mgs-t th.is-off small { font-weight: 800; color: var(--yj-ink-deep); }
.cb-mgp__paper [data-day] { cursor: pointer; }
.cb-mgp__paper [data-day]:hover { outline: 0.4mm solid var(--yj-yuja-600); outline-offset: -0.4mm; }
/* 이름 칸 · 체크 칸 너비 직접(mm) */
.cb-mgs-t.is-nmw .cb-mgs-nm { width: var(--nm); }
.cb-mgs-t.is-cw { width: auto; }
.cb-mgs-t.is-cw .cb-mgs-c { width: var(--cw); }
/* 비운 번호 줄의 「—」 */
.cb-mgs-t tr.is-gone .cb-mgs-nm { color: var(--yj-sub); text-align: center; }
.cb-mgs-out { font-size: 8pt; }
/* 「이렇게 넣어요」 — 확실하지 않은 줄(W02-2-02) · 명단에 없는 사진 줄(W02-2-05) */
.cb-mgph-plan__list li.is-unsure { background: var(--yj-yuja-50); box-shadow: inset 2px 0 0 var(--yj-yuja-600); padding-left: var(--yj-s2); }
.cb-mgph-plan__list li.is-unsure em { color: var(--yj-ink); font-weight: 700; }
.cb-mgph__orph { display: flex; flex-wrap: wrap; gap: var(--yj-s3); margin: calc(-1 * var(--yj-s2)) 0 var(--yj-s3); padding: var(--yj-s3); background: var(--yj-card); border: 1px solid var(--yj-line); border-radius: var(--yj-r-md); }
.cb-mgph__ocell { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: var(--yj-t-cap); color: var(--yj-sub); }
/* 전출 기록 띠 — 미리 보기 위(인쇄되지 않음) */
.cb-mgp__band { display: flex; align-items: center; gap: var(--yj-s3); flex-wrap: wrap; margin-bottom: var(--yj-s3); padding: var(--yj-s2) var(--yj-s4); background: var(--yj-yuja-50); border-left: 2px solid var(--yj-yuja-500); border-radius: var(--yj-r-md); }
.cb-mgp__band[hidden] { display: none; }
.cb-mgp__bandt { flex: 1; min-width: 16em; margin: 0; font-size: var(--yj-t-small); color: var(--yj-ink); }
/* 좁은 화면(900px 아래) — 학급경영은 PC 에서(W02-1-05) */
.cb-mgpage__narrow { display: none; }
@media (max-width: 899px) {
  .cb-mgpage__narrow { display: flex; flex: 1; flex-direction: column; align-items: flex-start; justify-content: center; gap: var(--yj-s3); padding: var(--yj-s6); }
  .cb-mgpage__narrow h2 { margin: 0; font-size: var(--yj-t-h2); color: var(--yj-ink-deep); }
  .cb-mgpage__narrow p { margin: 0; color: var(--yj-ink); line-height: 1.7; }
  .cb-mgpage__bar, .cb-mgpage__body { display: none; }
}

/* ── M3 이름표 · 자리표 (2026-11-18) — 같은 칸 깔기 ── */
.cb-mgt { display: grid; justify-content: center; align-content: start; }
.cb-mgt__c { position: relative; box-sizing: border-box; overflow: hidden; }
.cb-mgt.is-cut .cb-mgt__c { outline: 0.2mm dashed var(--yj-sub); outline-offset: -0.1mm; }
.cb-mgt__ph { flex: none; border-radius: 0.8mm; }
.cb-mgt__txt { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 0.6mm; line-height: 1.15; }
.cb-mgt__txt.is-center { align-items: center; text-align: center; }
.cb-mgt__cls { color: var(--yj-sub); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cb-mgt__no { color: var(--yj-sub); font-weight: 700; }
.cb-mgt__nm { font-weight: 800; color: var(--yj-ink-deep); white-space: nowrap; overflow: hidden; text-overflow: clip; }
.cb-mgt__line { display: block; margin-top: 1mm; padding-bottom: 0.6mm; border-bottom: 0.2mm solid var(--yj-ink); font-size: 2.6mm; color: var(--yj-sub); }
.cb-mgt__badge, .cb-mgt__lock, .cb-mgt__shoe { height: 100%; box-sizing: border-box; display: flex; align-items: center; gap: 3mm; }
.cb-mgt__lock { gap: 2mm; }
.cb-mgt__shoe { gap: 1.5mm; justify-content: center; }
.cb-mgt__big { flex: none; font-weight: 800; color: var(--yj-ink-deep); line-height: 1; font-variant-numeric: tabular-nums; }
/* 삼각 명패 — 뒷면은 거꾸로(접으면 친구 쪽에서 바로 읽힘) · 접는 선 두 줄 · 풀칠 칸 */
.cb-mgt__tent { height: 100%; display: flex; flex-direction: column; }
.cb-mgt__face { box-sizing: border-box; display: flex; align-items: center; justify-content: center; gap: 4mm; padding: 2mm 5mm; border-bottom: 0.25mm dashed var(--yj-ink); }
.cb-mgt__face.is-back { transform: rotate(180deg); border-bottom: 0; border-top: 0.25mm dashed var(--yj-ink); }
.cb-mgt__glue { box-sizing: border-box; display: flex; align-items: center; justify-content: center; font-size: 3mm; color: var(--yj-sub); background: var(--yj-line); }
/* 자리표 */
.cb-mgs--seat { gap: 2mm; }
.cb-mgt__front { flex: none; height: 9mm; margin: 0 25%; display: flex; align-items: center; justify-content: center; border: 0.3mm solid var(--yj-ink); border-radius: 1mm; font-size: 3.6mm; font-weight: 700; }
.cb-mgt__room { flex: 1; min-height: 0; display: grid; gap: 1.5mm 0; }
.cb-mgt__seat { box-sizing: border-box; min-width: 0; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.6mm; border: 0.3mm solid var(--yj-ink); margin: 0 0.8mm; border-radius: 1mm; overflow: hidden; }
.cb-mgt__seat.is-empty { border-style: dashed; border-color: var(--yj-sub); }
.cb-mgt__seatno { font-size: 3mm; color: var(--yj-sub); font-weight: 700; line-height: 1; }
.cb-mgt__seatnm { font-size: 5.5mm; font-weight: 800; line-height: 1.1; white-space: nowrap; }
.cb-mgs--seat.has-ph .cb-mgt__seatnm { font-size: 4mm; }
.cb-mgt__grp { align-self: end; font-size: 3.2mm; font-weight: 800; padding-left: 1mm; }
.cb-mgs-empty, .cb-mgs--msg p { margin: 10mm 0; font-size: 12pt; color: var(--yj-ink); }

/* ── M4 프롬프트 생성기 (2026-11-18) — 왼쪽 네 걸음 · 오른쪽 만들어진 프롬프트 ── */
.cb-mgg { display: grid; grid-template-columns: minmax(360px, 520px) 1fr; gap: var(--yj-s5); align-items: start; }
.cb-mgg > .cb-state { grid-column: 1 / -1; }
.cb-mgg__side { display: flex; flex-direction: column; gap: var(--yj-s4); }
.cb-mgg__hint { margin: 0; font-size: var(--yj-t-cap); color: var(--yj-sub); line-height: 1.6; }
.cb-mgg__reads { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.cb-mgg__read { display: flex; align-items: center; gap: var(--yj-s2); flex-wrap: wrap; padding: var(--yj-s2) 0; border-bottom: 1px solid var(--yj-line); }
.cb-mgg__read:last-child { border-bottom: 0; }
.cb-mgg__read.is-off .cb-mgg__rv { text-decoration: line-through; color: var(--yj-sub); }
.cb-mgg__read textarea { flex: 1 1 100%; }
.cb-mgg__rv { flex: 1; min-width: 10em; font-size: var(--yj-t-small); color: var(--yj-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cb-mgg__rv em { color: var(--yj-sub); font-style: normal; }
.cb-mgg__pick { display: flex; align-items: center; gap: var(--yj-s2) var(--yj-s3); flex-wrap: wrap; }
.cb-mgg__chips { display: flex; flex-wrap: wrap; gap: var(--yj-s2); }
.cb-mgg__chip { min-height: 40px; padding: 0 var(--yj-s3); border: 1px solid var(--yj-line-strong); border-radius: var(--yj-r-full); background: var(--yj-card-hi); color: var(--yj-ink); font: inherit; font-size: var(--yj-t-small); font-weight: 600; cursor: pointer; }
.cb-mgg__chip:hover { background: var(--yj-yuja-50); }
.cb-mgg__chip[aria-pressed="true"] { background: var(--yj-yuja-300); border-color: var(--yj-yuja-300); color: var(--yj-ink-deep); }
.cb-mgg__note { flex-basis: 100%; font-size: var(--yj-t-cap); color: var(--yj-sub); font-weight: 500; }
.cb-mgg__need { font-style: normal; font-size: var(--yj-t-cap); color: var(--yj-yuja-ink); font-weight: 700; }
.cb-mgg__w { margin: 0; }
.cb-mgg__outs { display: flex; flex-wrap: wrap; gap: var(--yj-s2); }
.cb-mgg__rec { margin-left: 4px; height: 22px; background: var(--yj-yuja-100); border-color: var(--yj-yuja-100); color: var(--yj-ink-deep); }
.cb-mgg__sites { display: flex; flex-wrap: wrap; gap: var(--yj-s2); }
.cb-mgg__sites small { font-weight: 500; color: var(--yj-sub); }
.cb-mgg__steps { margin: 0; padding-left: 1.4em; display: flex; flex-direction: column; gap: 4px; font-size: var(--yj-t-small); color: var(--yj-ink); line-height: 1.6; }
.cb-mgg__copynote { margin: 0; padding: var(--yj-s2) var(--yj-s3); background: var(--yj-yuja-50); border-left: 2px solid var(--yj-yuja-500); border-radius: var(--yj-r-sm); font-size: var(--yj-t-small); font-weight: 700; color: var(--yj-ink-deep); }
.cb-mgg__leak { padding: var(--yj-s3); background: var(--yj-card); border: 1px solid var(--yj-line-strong); border-radius: var(--yj-r-md); font-size: var(--yj-t-small); }
.cb-mgg__leak[hidden] { display: none; }
.cb-mgg__leak ul { margin: var(--yj-s2) 0; padding-left: 1.2em; }
.cb-mgg__leak mark { background: var(--yj-yuja-200); color: var(--yj-ink-deep); }
.cb-mgg__view { position: sticky; top: 0; min-width: 0; display: flex; flex-direction: column; max-height: calc(100dvh - 180px); background: var(--yj-card); border: 1px solid var(--yj-line); border-radius: var(--yj-r-lg); box-shadow: var(--yj-sh-1); }
.cb-mgg__vh { flex: none; display: flex; align-items: center; justify-content: space-between; padding: var(--yj-s3) var(--yj-s4); border-bottom: 1px solid var(--yj-line); }
.cb-mgg__vh span { font-size: var(--yj-t-cap); color: var(--yj-sub); }
.cb-mgg__pre { flex: 1; min-height: 0; overflow: auto; margin: 0; padding: var(--yj-s4); white-space: pre-wrap; word-break: keep-all; font-family: var(--yj-font-ui); font-size: var(--yj-t-small); line-height: 1.7; color: var(--yj-ink); }
@media (max-width: 1100px) { .cb-mgg { grid-template-columns: 1fr; } .cb-mgg__view { position: static; max-height: none; } }

/* ── W02 써 보기 3 — 라벨지 · 삼각 명패 바닥 면 · 숫자 칸 ── */
.cb-mg-sheet { position: relative; }
.cb-mgt--label { position: absolute; justify-content: start; }
.cb-mgt--label.is-cut .cb-mgt__c.is-skip { outline-style: dotted; }
.cb-mgt__face.is-base { transform: none; border-top: 0; border-bottom: 0.25mm dashed var(--yj-ink); }
.cb-mgp__num { display: inline-flex; align-items: center; gap: var(--yj-s2); margin-right: var(--yj-s3); font-size: var(--yj-t-small); font-weight: 700; color: var(--yj-ink); }
.cb-mgp__num input { width: 6.5em; }
.cb-mgp__num em { font-style: normal; font-weight: 500; color: var(--yj-sub); }
.cb-mgp__savename { flex: 1; min-width: 10em; }

/* ── M5 시간표 인쇄 (2026-11-18) — 과목 색은 옅은 여덟 가지(이름은 manage-read SUBJ_NAMES 와 같은 차례) · 테마는 색 · 테두리만 ── */
:root {
  --cb-mg-subj-0: #FBE1E6; --cb-mg-subj-1: #FFF3C4; --cb-mg-subj-2: #DDF1D6; --cb-mg-subj-3: #DCEEFA;
  --cb-mg-subj-4: #E9E1F6; --cb-mg-subj-5: #FCE3CF; --cb-mg-subj-6: #D7F2EC; --cb-mg-subj-7: #EAE8E2;
}
.cb-mgtt__page { display: flex; flex-direction: column; align-items: center; gap: 4mm; }
.cb-mgtt { position: relative; box-sizing: border-box; overflow: hidden; background: var(--cb-mg-paper); }
.cb-mgtt__bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cb-mgtt__in { position: relative; box-sizing: border-box; height: 100%; display: flex; flex-direction: column; }
.cb-mgtt__title { flex: none; display: flex; align-items: center; justify-content: center; font-weight: 800; color: var(--yj-ink-deep); }
.cb-mgtt__t { flex: 1; width: 100%; border-collapse: collapse; table-layout: fixed; }
.cb-mgtt__t th, .cb-mgtt__t td { height: var(--rh); border: 0.3mm solid var(--yj-ink); text-align: center; vertical-align: middle; font-weight: 700; color: var(--yj-ink-deep); padding: 0 1mm; overflow: hidden; }
.cb-mgtt__t thead th { background: var(--yj-yuja-50); }
.cb-mgtt__p { width: 19%; font-size: 0.85em; }
.cb-mgtt__p small { display: block; font-size: 0.62em; font-weight: 500; color: var(--yj-sub); white-space: nowrap; letter-spacing: -0.02em; }
.cb-mgtt__t tr.is-lunch td, .cb-mgtt__t tr.is-lunch th { font-weight: 600; color: var(--yj-sub); background: var(--cb-mg-subj-7); }
.cb-mgtt__c0 { background: var(--cb-mg-subj-0); } .cb-mgtt__c1 { background: var(--cb-mg-subj-1); } .cb-mgtt__c2 { background: var(--cb-mg-subj-2); } .cb-mgtt__c3 { background: var(--cb-mg-subj-3); }
.cb-mgtt__c4 { background: var(--cb-mg-subj-4); } .cb-mgtt__c5 { background: var(--cb-mg-subj-5); } .cb-mgtt__c6 { background: var(--cb-mg-subj-6); } .cb-mgtt__c7 { background: var(--cb-mg-subj-7); }
.cb-mgtt.is-yuja { border: 1.2mm solid var(--yj-yuja-300); border-radius: 3mm; }
.cb-mgtt.is-yuja .cb-mgtt__t thead th { background: var(--yj-yuja-300); }
.cb-mgtt.is-leaf { border: 1.2mm solid var(--yj-leaf); border-radius: 3mm; }
.cb-mgtt.is-leaf .cb-mgtt__t thead th { background: var(--yj-leaf-tint); }
.cb-mgtt.is-bold .cb-mgtt__t th, .cb-mgtt.is-bold .cb-mgtt__t td { border-width: 0.6mm; }
.cb-mgtt.is-bold { border: 1.5mm solid var(--yj-ink-deep); }
/* 바탕 그림 — 칸은 종이 색을 조금 비치게(글자가 읽히게) · 글자 「밝게」는 짙은 바탕 그림일 때 */
.cb-mgtt.has-bg .cb-mgtt__t td:not([class]), .cb-mgtt.has-bg .cb-mgtt__t tbody th { background-color: color-mix(in srgb, var(--cb-mg-paper) 78%, transparent); }   /* 과목 색 칸 · 머리 줄은 그 색 그대로 */
.cb-mgtt.is-lightink .cb-mgtt__title { color: var(--cb-mg-paper); }

/* ── M5 ② ~ ⑤ — 체크리스트 인쇄 · 우리 반 한 장 · 상담 일정표 · 학급 통계 ── */
.cb-mgs-t td.is-todo { background: var(--cb-mg-tint); }
.cb-mgcs__info { flex: none; display: flex; flex-wrap: wrap; gap: 2mm 6mm; margin: 0 0 3mm; font-size: 10pt; }
.cb-mgcs__info span { display: inline-flex; align-items: flex-end; gap: 1mm; }
.cb-mgcs__info span.is-wide { flex-basis: 100%; }
.cb-mgcs__info i { display: inline-block; min-width: 38mm; flex: 1; border-bottom: 0.2mm solid var(--yj-ink); height: 5mm; }
.cb-mgcs__room { flex: none; margin-bottom: 3mm; }
.cb-mgcs__room .cb-mgs-head { display: none; }
.cb-mgct td, .cb-mgct th { text-align: center; }
.cb-mgct th:nth-child(1) { width: 22mm; } .cb-mgct th:nth-child(2) { width: 26mm; } .cb-mgct th:nth-child(3) { width: 13mm; } .cb-mgct th:nth-child(5) { width: 24mm; }
.cb-mgct tr.is-day td { border-top-width: 0.5mm; }
.cb-mgst__cards { display: flex; flex-wrap: wrap; gap: 4mm; margin: 2mm 0 6mm; }
.cb-mgst__card { flex: 1 1 38mm; display: flex; flex-direction: column; gap: 1mm; padding: 4mm; border: 0.3mm solid var(--yj-ink); border-radius: 2mm; }
.cb-mgst__card small { font-size: 9pt; color: var(--yj-sub); font-weight: 700; }
.cb-mgst__card b { font-size: 20pt; font-weight: 800; line-height: 1.1; }
.cb-mgst__card em { font-style: normal; font-size: 9pt; color: var(--yj-sub); }
.cb-mgst__h { margin: 0 0 2mm; font-size: 12pt; font-weight: 800; }
.cb-mgst__t td { text-align: center; }
.cb-mgst__barh { width: 40%; }
.cb-mgst__bar { display: block; height: 3mm; background: var(--cb-mg-line); border-radius: 1.5mm; overflow: hidden; }
.cb-mgst__bar i { display: block; height: 100%; background: var(--yj-leaf); }

/* ── W02 써 보기 5 — 칸 면은 SVG(배경 그래픽이 꺼져도 찍힘) · 과목 색 열여섯 ── */
:root {
  --cb-mg-subj-8: #FDE8C8; --cb-mg-subj-9: #EAF5C9; --cb-mg-subj-10: #CFEDEF; --cb-mg-subj-11: #F3DDF0;
  --cb-mg-subj-12: #F1E9D6; --cb-mg-subj-13: #D9E2F7; --cb-mg-subj-14: #F8D9E8; --cb-mg-subj-15: #E5EDD3;
}
.cb-mgtt__t td { position: relative; }
.cb-mgtt__t td > span { position: relative; }
.cb-mgtt__fill { position: absolute; top: 0.35mm; left: 0.35mm; width: calc(100% - 0.7mm); height: calc(100% - 0.7mm); display: block; }   /* 칸 테두리를 덮지 않게 */
.cb-mgtt__fill.is-film rect { fill: var(--cb-mg-paper); fill-opacity: 0.8; }
.cb-mgtt__fill.is-c0 rect { fill: var(--cb-mg-subj-0); } .cb-mgtt__fill.is-c1 rect { fill: var(--cb-mg-subj-1); } .cb-mgtt__fill.is-c2 rect { fill: var(--cb-mg-subj-2); } .cb-mgtt__fill.is-c3 rect { fill: var(--cb-mg-subj-3); }
.cb-mgtt__fill.is-c4 rect { fill: var(--cb-mg-subj-4); } .cb-mgtt__fill.is-c5 rect { fill: var(--cb-mg-subj-5); } .cb-mgtt__fill.is-c6 rect { fill: var(--cb-mg-subj-6); } .cb-mgtt__fill.is-c7 rect { fill: var(--cb-mg-subj-7); }
.cb-mgtt__fill.is-c8 rect { fill: var(--cb-mg-subj-8); } .cb-mgtt__fill.is-c9 rect { fill: var(--cb-mg-subj-9); } .cb-mgtt__fill.is-c10 rect { fill: var(--cb-mg-subj-10); } .cb-mgtt__fill.is-c11 rect { fill: var(--cb-mg-subj-11); }
.cb-mgtt__fill.is-c12 rect { fill: var(--cb-mg-subj-12); } .cb-mgtt__fill.is-c13 rect { fill: var(--cb-mg-subj-13); } .cb-mgtt__fill.is-c14 rect { fill: var(--cb-mg-subj-14); } .cb-mgtt__fill.is-c15 rect { fill: var(--cb-mg-subj-15); }
.cb-mgtt.has-bg .cb-mgtt__fill[class*="is-c"] rect { fill-opacity: 0.92; }
/* 모든 출력물의 색 면 — 미리 보기에서도 인쇄에서도 같은 규칙(배경 그래픽을 켜지 않아도 되게) */
.cb-mg-sheet, .cb-mg-sheet * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }

/* ── W02 써 보기 6 — 통계 막대는 SVG 면(배경 그래픽이 꺼져도 찍힘) · 회수표 결석 · 조퇴 칸 · 상담 일정표 「휴」 ── */
svg.cb-mgst__bar { display: block; width: 100%; height: 3mm; background: none; border-radius: 0; overflow: visible; }
.cb-mgst__bar-bg { fill: var(--cb-mg-line); }
.cb-mgst__bar-fg { fill: var(--yj-leaf); }
.cb-mgs-t td.is-away { background: none; color: var(--yj-sub); }
.cb-mgct tr.is-off td { text-align: center; font-weight: 800; color: var(--yj-ink-deep); }

/* ── W05-가 사진 배치 — 사진이 글을 밀어내지 않게 · 사진 자리(위 / 왼쪽) · 사진 없는 칸 ── */
.cb-ph.is-empty svg { width: 62%; height: 62%; fill: none; stroke: var(--yj-line-strong); stroke-width: 1.4; stroke-linecap: round; }
html.cb-mg-printing .cb-mgt__ph.is-empty, html.cb-mg-printing .cb-mgs-pc .cb-ph.is-empty { border: 0.25mm solid var(--yj-line-strong); }
.cb-mgt__seat { padding: 0.6mm; }
.cb-mgt__seattx { min-width: 0; max-width: 100%; display: flex; flex-direction: column; align-items: center; gap: 0.6mm; }
.cb-mgs--seat .cb-mgt__seatno { font-size: var(--seat-no, 3mm); }
.cb-mgs--seat .cb-mgt__seatnm, .cb-mgs--seat.has-ph .cb-mgt__seatnm { font-size: var(--seat-nm, 5.5mm); max-width: 100%; overflow: hidden; }
.cb-mgs--seat.is-left .cb-mgt__seat { flex-direction: row; gap: 1.5mm; }
.cb-mgs--seat.is-left .cb-mgt__seattx { align-items: flex-start; }
.cb-mgt__badge.is-top { flex-direction: column; justify-content: center; gap: 1.5mm; }
.cb-mgt__badge.is-top .cb-mgt__txt { flex: none; width: 100%; }
.cb-mgs-pc.is-left { flex-direction: row; align-items: center; gap: 2mm; padding: 1.5mm 1mm 0; }
.cb-mgs-ptx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1mm; }
.cb-mgs-pc.is-left .cb-mgs-pn { margin-top: 0; }
.cb-mgs-pn b { overflow: hidden; }

/* ── W05-시 시간표 한 장에 몇 개 · 자르는 선 ── */
.cb-mgtt__grid { display: grid; justify-content: center; align-content: start; }
.cb-mgtt__grid .cb-mgtt__slot, .cb-mgtt__page .cb-mgtt__slot { position: relative; }
.cb-mgtt__grid.is-cut .cb-mgtt__slot::after { content: ""; position: absolute; inset: -3mm; border: 0.2mm dashed var(--yj-sub); pointer-events: none; }
.cb-mgtt__page.is-cut .cb-mgtt__slot + .cb-mgtt__slot::before { content: ""; position: absolute; left: 0; right: 0; top: -2mm; border-top: 0.2mm dashed var(--yj-sub); }

/* ── W05-명 맞추기 — 머리 줄 높이를 셈과 같게(달력형 날짜 + 요일 두 줄 · 칸 머리 글자) ── */
.cb-mgs-t thead th { height: var(--thh, var(--row, 8mm)); }

/* ── W05-한-1 담임 · 연락 · 알아 둘 것을 적은 글 ── */
.cb-mgcs__info i.is-filled { font-style: normal; font-weight: 700; color: var(--yj-ink-deep); padding: 0 1mm; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── W05-통 기간 줄 · 아래 메모 줄 ── */
.cb-mgst__range { margin: 0 0 2mm; font-size: 10pt; font-weight: 700; }
.cb-mgst__none { margin: 2mm 0; font-size: 10pt; color: var(--yj-sub); }
.cb-mgst { min-height: 0; }
.cb-mgst__memo { flex: 1; min-height: 0; overflow: hidden; margin-top: 4mm; display: flex; flex-direction: column; }
.cb-mgst__memo b { font-size: 10pt; }
.cb-mgst__memo i { flex: none; height: 9mm; border-bottom: 0.2mm solid var(--yj-line-strong); }

/* ── W05-명-4 글자 크기 ── */
.cb-mgs-t.is-fs-s td { font-size: 9pt; }
.cb-mgs-t.is-fs-l td { font-size: 13pt; }
.cb-mgs-t.is-big.is-fs-s td { font-size: 11pt; }
.cb-mgs-t.is-big.is-fs-l td { font-size: 17pt; }
.cb-mgs-t.is-dense.is-fs-l td { font-size: 12pt; }

/* ── W05 판정 — 목걸이 담임 · 연락 값 ── */
.cb-mgt__line .cb-mgt__lv { font-weight: 700; color: var(--yj-ink-deep); margin-left: 1mm; }
