/* ============================================================
   유자보드 — 수업 도구 화면 (P4)
   도구 판 · 칸 · 도구 15가지 · 도구 고르기 창 · 내 도구 모음 · 설정 「도구」 칸
   칸 안의 글자는 칸 크기(container query)에 맞춰 커지고 작아진다.
   ============================================================ */

/* ── 도구 판 ─────────────────────────────────────── */
.cb-toolstage { top: var(--cb-bar-h, 56px); display: flex; flex-direction: column; background: var(--yj-canvas); }
.cb-toolstage[hidden] { display: none; }
.cb-toolstage__bar { height: 56px; flex: none; display: flex; align-items: center; justify-content: space-between; gap: var(--yj-s3); padding: 0 var(--yj-s5); border-bottom: 1px solid var(--yj-line); background: var(--yj-card); }
.cb-toolstage__open { display: flex; gap: var(--yj-s1); min-width: 0; overflow: hidden; }
.cb-toolstage__hint { font-size: var(--yj-t-small); color: var(--yj-sub); }
.cb-toolstage__acts { display: flex; gap: var(--yj-s2); flex: none; }
.cb-toolstage__acts .cb-ic { width: 18px; height: 18px; margin-right: 4px; }
.cb-ts-pill { height: 36px; padding: 0 var(--yj-s3); display: inline-flex; align-items: center; gap: 6px; border: 0; border-radius: var(--yj-r-full); background: transparent; font: inherit; font-size: var(--yj-t-small); font-weight: 600; color: var(--yj-sub); cursor: pointer; white-space: nowrap; }
.cb-ts-pill .cb-ic { width: 16px; height: 16px; }
.cb-ts-pill.is-on { background: var(--yj-yuja-100); color: var(--yj-ink-deep); }
.cb-toolstage__panes { flex: 1; min-height: 0; display: grid; gap: var(--yj-s4); padding: var(--yj-s4) var(--yj-s5) var(--yj-s5); }
.cb-toolstage__panes.n1 { grid-template-columns: 1fr; }
.cb-toolstage__panes.n2 { grid-template-columns: 1fr 1fr; }
.cb-toolstage__panes.n3 { grid-template-columns: 1fr 1fr 1fr; }
.cb-toolstage__panes.n4 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.has-big .cb-toolstage__panes { grid-template-columns: 1fr; grid-template-rows: 1fr; }
.has-big .cb-pane:not(.is-big) { display: none; }

.cb-pane { min-width: 0; min-height: 0; display: flex; flex-direction: column; background: var(--yj-card); border: 1px solid var(--yj-line); border-radius: var(--yj-r-lg); box-shadow: var(--yj-sh-1); overflow: hidden; }
.cb-pane.is-flash { animation: cb-flash 600ms var(--yj-ease); }
@keyframes cb-flash { 0%, 100% { box-shadow: var(--yj-sh-1); } 40% { box-shadow: 0 0 0 4px var(--yj-yuja-300); } }
.cb-pane__head { height: 48px; flex: none; display: flex; align-items: center; gap: var(--yj-s3); padding: 0 var(--yj-s2) 0 var(--yj-s4); border-bottom: 1px solid var(--yj-line); }
.cb-pane__title { flex: 1; display: inline-flex; align-items: center; gap: 8px; font-size: var(--yj-t-body); font-weight: 700; color: var(--yj-ink-deep); }
.cb-pane__title .cb-ic { width: 20px; height: 20px; color: var(--yj-sub); }
.cb-pane__body { flex: 1; min-height: 0; container-type: size; display: flex; flex-direction: column; gap: var(--yj-s3); padding: var(--yj-s4); overflow: hidden; }
.cb-pane__body .cb-chip.is-static { cursor: default; }
.cb-tm__presets, .cb-tm__ctrl { flex: none; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: var(--yj-s2); }
.cb-tm__presets > b, .cb-tm__lbl { font-size: var(--yj-t-small); color: var(--yj-sub); font-weight: 700; margin-right: 4px; }
.cb-tm__presets .cb-chip { font-size: var(--yj-t-small); }

/* ── 타이머 ──────────────────────────────────────── */
.cb-tm { flex: 1; min-height: 0; position: relative; display: grid; place-items: center; container-type: size; }
.cb-tm__ring { position: absolute; height: 100%; max-width: 100%; aspect-ratio: 1; transform: rotate(-90deg); }
.cb-tm__track { fill: none; stroke: var(--yj-line); stroke-width: 7; }
.cb-tm__arc { fill: none; stroke: var(--yj-yuja-500); stroke-width: 7; stroke-linecap: round; transition: stroke-dasharray 200ms linear; }
.is-low .cb-tm__arc { stroke: var(--yj-orange); }
.cb-tm__face { position: relative; text-align: center; }
/* R03-04 — 숫자는 동그라미 지름(= 칸의 짧은 변)의 70% 를 넘지 않게. 「00:00」은 글자 크기의 2.9배 폭 → 24cqmin */
.cb-tm__time { font-family: var(--yj-font-disp); font-size: 24cqmin; line-height: 1; color: var(--yj-ink-deep); font-variant-numeric: tabular-nums; }
.cb-tm__msg { min-height: 1.4em; font-size: max(17px, 4cqh); font-weight: 700; color: var(--yj-orange-ink); }
.is-done .cb-tm__time { color: var(--yj-orange-ink); animation: cb-blink 900ms steps(2) 4; }
@keyframes cb-blink { 50% { opacity: 0.25; } }

/* ── 스톱워치 ────────────────────────────────────── */
.cb-sw { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--yj-s3); }
.cb-sw__time { font-family: var(--yj-font-disp); font-size: min(18cqw, 30cqh); line-height: 1; color: var(--yj-ink-deep); font-variant-numeric: tabular-nums; }
.cb-sw__time small { font-size: 0.45em; color: var(--yj-sub); }
.cb-sw__laps { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: var(--yj-s2); max-height: 30cqh; overflow: auto; }
.cb-sw__laps li { padding: 4px 12px; border-radius: var(--yj-r-full); background: var(--yj-canvas); font-size: var(--yj-t-small); font-variant-numeric: tabular-nums; }
.cb-sw__laps span { color: var(--yj-sub); margin-right: 6px; }

/* ── 집중 종 ─────────────────────────────────────── */
.cb-bell { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--yj-s4); }
.cb-bell__msg { font-family: var(--yj-font-disp); font-size: min(9cqw, 14cqh); color: var(--yj-ink-deep); text-align: center; }
.cb-bell__msg.is-ring { animation: cb-ring 900ms var(--yj-ease); }
@keyframes cb-ring { 0% { transform: scale(1); } 20% { transform: scale(1.12); color: var(--yj-orange-ink); } 100% { transform: scale(1); } }
.cb-bell__btns { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--yj-s3); }
.cb-bell__btn { width: min(26cqw, 200px); aspect-ratio: 1.3; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--yj-yuja-200); border-radius: var(--yj-r-lg); background: var(--yj-yuja-50); font: inherit; color: var(--yj-ink-deep); cursor: pointer; }
.cb-bell__btn .cb-ic { width: 36px; height: 36px; }
.cb-bell__btn b { font-size: max(15px, 2.6cqw); }
.cb-bell__btn:active { transform: scale(.96); background: var(--yj-yuja-200); }

/* ── 목소리 크기 ─────────────────────────────────── */
.cb-voice { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: var(--yj-s3); }
.cb-voice__now { text-align: center; }
.cb-voice__label { display: block; font-family: var(--yj-font-disp); font-size: min(8cqw, 12cqh); color: var(--yj-ink-deep); }
.is-loud .cb-voice__label { color: var(--yj-error-ink); }
.cb-voice__hint { font-size: var(--yj-t-cap); color: var(--yj-sub); }
.cb-voice__bars { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: var(--yj-s2); align-items: end; }
.cb-voice__bar { height: 100%; display: flex; flex-direction: column; justify-content: flex-end; gap: 6px; }
.cb-voice__bar i { display: block; border-radius: var(--yj-r-sm); background: var(--yj-line); }
.cb-voice__bar[data-lv="0"] i { height: 20%; }
.cb-voice__bar[data-lv="1"] i { height: 36%; }
.cb-voice__bar[data-lv="2"] i { height: 52%; }
.cb-voice__bar[data-lv="3"] i { height: 70%; }
.cb-voice__bar[data-lv="4"] i { height: 88%; }
.cb-voice__bar.is-on i { background: var(--yj-leaf); }
.cb-voice__bar.is-over i { background: var(--yj-orange); }
.is-loud .cb-voice__bar.is-over i { background: var(--yj-error); }
.cb-voice__bar span { font-size: var(--yj-t-cap); text-align: center; color: var(--yj-sub); }
.cb-voice__opts { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: var(--yj-s2); font-size: var(--yj-t-small); }
.cb-voice__opts > b { color: var(--yj-sub); }
.cb-voice__sens { display: inline-flex; align-items: center; gap: 6px; color: var(--yj-sub); }

/* ── 뽑기 ────────────────────────────────────────── */
.cb-pk { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--yj-s3); }
.cb-pk__stage { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--yj-s3); }
.cb-pk__name { font-family: var(--yj-font-disp); font-size: min(10cqw, 15cqh); color: var(--yj-ink-deep); padding: 0.1em 0.4em; border-radius: var(--yj-r-lg); background: var(--yj-yuja-100); }
.cb-pk__name.is-rolling { background: transparent; color: var(--yj-sub); }
.cb-pk__wait { font-size: var(--yj-t-body); color: var(--yj-sub); }
/* R03-08 — 기다리는 화면: 「남은 친구 28명」 무대 40px + 남은 번호 흐린 격자 */
.cb-pk__waitbox { display: flex; flex-direction: column; align-items: center; gap: var(--yj-s4); max-width: 100%; }
.cb-pk__waitbox .cb-pk__wait { font-size: 40px; font-weight: 800; color: var(--yj-ink); }
.cb-pk__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 6px; width: min(100%, 560px); }
.cb-pk__grid span { display: grid; place-items: center; height: 40px; border: 1px solid var(--yj-line); border-radius: var(--yj-r-sm); color: var(--yj-sub); font-size: var(--yj-t-small); font-variant-numeric: tabular-nums; }
/* 작은 위젯처럼 칸이 낮으면 격자는 접고 글자만 */
/* 재수선 2 — 기본 크기 위젯에서도 격자가 보이게: 낮은 칸은 칸을 작게, 아주 낮을 때(190 밑)만 접는다 */
@container (max-height: 360px) { .cb-pk__grid { grid-template-columns: repeat(auto-fill, minmax(30px, 1fr)); gap: 3px; } .cb-pk__grid span { height: 24px; font-size: var(--yj-t-cap); } .cb-pk__waitbox { gap: var(--yj-s2); } .cb-pk__waitbox .cb-pk__wait { font-size: var(--yj-t-h2); } }
@container (max-height: 190px) { .cb-pk__grid { display: none; } }
.cb-pk__out { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px; font-size: var(--yj-t-small); max-height: 22cqh; overflow: auto; }
.cb-pk__out b { color: var(--yj-sub); margin-right: 4px; }

/* ── 목록 고르기(돌림판 · 순서) ───────────────────── */
.cb-src { flex: none; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: var(--yj-s3); font-size: var(--yj-t-small); }
.cb-src__ta { width: 100%; font-family: var(--yj-font-ui); }
.cb-src__ta[hidden] { display: none; }

/* ── 돌림판 ──────────────────────────────────────── */
.cb-wh { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; gap: var(--yj-s4); }
.cb-wh__wrap { position: relative; height: 100%; aspect-ratio: 1; max-width: 70%; display: grid; place-items: center; }
.cb-wh__pin { position: absolute; top: -2px; left: 50%; transform: translateX(-50%); width: 0; height: 0; border-left: 12px solid transparent; border-right: 12px solid transparent; border-top: 22px solid var(--yj-orange); }
.cb-wh__numnote { position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); white-space: nowrap; padding: 2px var(--yj-s2); border-radius: var(--yj-r-sm); background: var(--yj-card-hi); font-size: var(--yj-t-cap); color: var(--yj-sub); }
.cb-wh__numnote[hidden] { display: none; }
.cb-wh__res { font-family: var(--yj-font-disp); font-size: min(6cqw, 10cqh); color: var(--yj-ink-deep); max-width: 30%; text-align: center; }

/* ── 사다리 ──────────────────────────────────────── */
.cb-ld { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 4px; }
.cb-ld__row { display: grid; gap: 4px; }
.cb-ld__tops > input { grid-row: 1; }
.cb-ld__tops > .cb-ld__go { grid-row: 2; justify-self: center; width: 32px; height: 28px; border: 0; border-radius: var(--yj-r-full); background: var(--yj-yuja-300); color: var(--yj-ink-deep); cursor: pointer; display: grid; place-items: center; transform: rotate(90deg); }
.cb-ld__go .cb-ic { width: 16px; height: 16px; }
.cb-ld__in { width: 100%; box-sizing: border-box; text-align: center; height: 36px; padding: 0 4px; font-size: var(--yj-t-small); }
.cb-ld__svg { flex: 1; min-height: 0; width: 100%; }
.cb-ld__pole, .cb-ld__rung { stroke: var(--yj-line-strong); stroke-width: 3; }
.cb-ld__path { fill: none; stroke: var(--yj-orange); stroke-width: 5; stroke-linejoin: round; stroke-linecap: round; }
.cb-ld__bot { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.cb-ld__bot span { font-size: var(--yj-t-cap); font-weight: 700; color: var(--yj-orange-ink); }
.cb-ld__bot.is-hit input { border-color: var(--yj-orange); }

/* ── 순서 정하기 ─────────────────────────────────── */
.cb-ord { flex: 1; min-height: 0; margin: 0; padding: 0; list-style: none; counter-reset: ord; display: flex; flex-wrap: wrap; align-content: flex-start; gap: 0.4em; overflow: hidden; font-size: 28px; }
.cb-ord li { counter-increment: ord; padding: 0.2em 0.6em; border-radius: var(--yj-r-sm); background: var(--yj-canvas); font-weight: 700; color: var(--yj-ink-deep); }
.cb-ord li::before { content: counter(ord) ". "; color: var(--yj-yuja-ink); }

/* ── 주사위 · 동전 ───────────────────────────────── */
.cb-dc { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--yj-s3); }
.cb-dc__show { display: flex; gap: var(--yj-s4); }
.cb-die { width: min(22cqw, 40cqh); height: min(22cqw, 40cqh); }
.cb-die rect { fill: var(--yj-card-hi); stroke: var(--yj-ink-deep); stroke-width: 3; }
.cb-die circle { fill: var(--yj-ink-deep); }
.cb-dc__sum { font-family: var(--yj-font-disp); font-size: min(6cqw, 9cqh); color: var(--yj-ink-deep); min-height: 1.2em; }
.cb-coin { width: min(30cqw, 42cqh); aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; background: var(--yj-yuja-300); border: 6px solid var(--yj-yuja-600); font-family: var(--yj-font-disp); font-size: min(10cqw, 14cqh); color: var(--yj-ink-deep); }
.cb-coin.is-back { background: var(--yj-canvas); border-color: var(--yj-line-strong); }

/* ── 모둠 나누기 ─────────────────────────────────── */
.cb-gr { flex: 1; min-height: 0; display: grid; gap: var(--yj-s3); align-content: start; overflow: hidden; font-size: 22px; }
.cb-gr__card { padding: 0.5em 0.7em; border: 1px solid var(--yj-yuja-200); border-radius: var(--yj-r-lg); background: var(--yj-yuja-50); }
.cb-gr__card b { display: block; font-size: 0.8em; color: var(--yj-yuja-ink); margin-bottom: 0.2em; }
.cb-gr__card ul { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 0.2em 0.6em; }
.cb-gr__card li { font-weight: 700; color: var(--yj-ink-deep); }
.cb-gr__num { width: 80px; }
/* R03-07 — 나눈 뒤에는 카드가 남은 높이를 채운다 */
.cb-gr.is-done { align-content: stretch; grid-auto-rows: minmax(0, 1fr); }
.cb-sc__mem { max-width: 92%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: max(15px, min(8cqh, 7cqw)); color: var(--yj-sub); }

/* ── 모둠 점수판 ─────────────────────────────────── */
.cb-sc { flex: 1; min-height: 0; display: grid; gap: var(--yj-s3); grid-auto-rows: 1fr; }
.cb-sc__team { min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: var(--yj-s2); border: 1px solid var(--yj-line); border-radius: var(--yj-r-lg); background: var(--yj-card); container-type: size; }
.cb-sc__team.is-lead { background: var(--yj-yuja-100); border: 2px solid var(--yj-yuja-600); }
.cb-sc__name { width: 90%; border: 0; border-bottom: 1px dashed var(--yj-line-strong); background: transparent; text-align: center; font: inherit; font-size: max(15px, min(14cqh, 12cqw)); font-weight: 700; color: var(--yj-ink-deep); }
.cb-sc__pts { font-family: var(--yj-font-disp); font-size: min(38cqh, 34cqw); line-height: 1; color: var(--yj-ink-deep); font-variant-numeric: tabular-nums; }
.cb-sc__btns { display: flex; gap: 6px; }

/* ── 자리 뽑기 ───────────────────────────────────── */
.cb-se { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: var(--yj-s2); }
.cb-se.is-student { flex-direction: column-reverse; }
.cb-se__front { flex: none; align-self: center; padding: 4px 28px; border-radius: var(--yj-r-sm); background: var(--yj-forest); color: var(--yj-on-forest); font-size: var(--yj-t-small); font-weight: 700; }
.cb-se__grid { flex: 1; min-height: 0; display: grid; gap: 6px; }
.cb-se__seat { min-width: 0; min-height: 0; display: grid; place-items: center; border: 1px solid var(--yj-line); border-radius: var(--yj-r-sm); background: var(--yj-card); font-weight: 700; color: var(--yj-ink-deep); font-size: max(12px, min(2.2cqw, 3.4cqh)); white-space: nowrap; overflow: hidden; }
.cb-se__seat.is-empty { background: transparent; border-style: dashed; }
.cb-se__n { display: inline-flex; align-items: center; gap: 6px; font-size: var(--yj-t-small); color: var(--yj-sub); }
.cb-se__n input { width: 64px; }

/* ── 화면 칠판 ───────────────────────────────────── */
.cb-pane--board .cb-pane__body { padding: 0; gap: 0; }
.cb-bd__bar { flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: var(--yj-s2) var(--yj-s3); border-bottom: 1px solid var(--yj-line); }
.cb-bd__pen { width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--yj-card); box-shadow: 0 0 0 1px var(--yj-line-strong); background: var(--pen); cursor: pointer; }
.cb-bd__pen[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--yj-yuja-600); }
.cb-bd__sep { width: 1px; height: 24px; background: var(--yj-line); margin: 0 4px; }
.cb-bd__grow { flex: 1; }
.cb-bd__wrap { flex: 1; min-height: 0; position: relative; }
.cb-bd__cv { position: absolute; inset: 0; touch-action: none; cursor: crosshair; }
/* 칠판 메모 — 이름 · 새 메모 · 메모함 · 저장 */
.cb-bd__memobar { flex: none; display: flex; align-items: center; justify-content: flex-end; gap: 6px; padding: 6px var(--yj-s3); border-bottom: 1px solid var(--yj-line); }
.cb-bd__memobar [data-memo-name] { margin-right: auto; }
.cb-bd__memos {
  position: absolute; top: var(--yj-s2); right: var(--yj-s2); width: min(360px, calc(100% - 16px)); max-height: calc(100% - 16px); overflow: auto;
  background: var(--yj-card-hi); border: 1px solid var(--yj-line); border-radius: var(--yj-r-lg); box-shadow: var(--yj-sh-2); padding: var(--yj-s3);
}
.cb-bd__memos-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--yj-s2); color: var(--yj-ink-deep); }
.cb-bd__memos ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.cb-bd__memos li { display: flex; align-items: center; gap: 6px; padding: 6px var(--yj-s2); border: 1px solid var(--yj-line); border-radius: var(--yj-r-sm); }
.cb-bd__memos li[aria-current="true"] { background: var(--yj-yuja-200); border-color: var(--yj-yuja-600); }
.cb-bd__memos li span { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: var(--yj-t-small); color: var(--yj-ink); }
.cb-bd__memos li small { font-size: var(--yj-t-cap); color: var(--yj-sub); }

/* ── QR ──────────────────────────────────────────── */
.cb-qr { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--yj-s2); }
.cb-qr__code { height: calc(100% - 2em); aspect-ratio: 1; max-width: 100%; display: grid; place-items: center; }
.cb-qr__code svg { width: 100%; height: 100%; }
.cb-qr__bg { fill: var(--yj-card-hi); }
.cb-qr__fg { fill: var(--yj-ink-deep); }
.cb-qr__text { font-size: var(--yj-t-cap); color: var(--yj-sub); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cb-qr__in input { flex: 1; min-width: 200px; }

/* ── 도구 고르기 창 ──────────────────────────────── */
.cb-tpick__box { width: 1100px; max-height: calc(100% - 64px); overflow: auto; }
.cb-tpick__combos { display: flex; flex-wrap: wrap; align-items: center; gap: var(--yj-s2); margin-bottom: var(--yj-s4); }
.cb-tpick__combos > b, .cb-tpick__group > b { width: 100%; display: block; font-size: var(--yj-t-small); color: var(--yj-sub); }
.cb-tpick__combos .cb-chip { height: 40px; font-size: var(--yj-t-small); }
.cb-tpick__combos .cb-chip span { font-weight: 400; color: var(--yj-sub); }
.cb-tpick__group { margin-top: var(--yj-s3); }
.cb-tpick__grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: var(--yj-s2); margin-top: var(--yj-s2); }
.cb-tpick__grid .cb-tool { min-height: 96px; cursor: pointer; font: inherit; font-size: var(--yj-t-small); }
.cb-tool.is-open { background: var(--yj-yuja-100); border-color: var(--yj-yuja-600); }

/* ── 내 도구 모음 위젯 ───────────────────────────── */
.cb-tools { grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr)); }
button.cb-tool { font: inherit; font-size: var(--yj-t-cap); font-weight: 600; cursor: pointer; }
button.cb-tool:active { transform: scale(.97); }

/* ── 설정 「도구」 칸 ─────────────────────────────── */
.cb-dock-edit, .cb-combo-edit { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
.cb-dock-edit li { display: flex; align-items: center; gap: 4px; min-height: 44px; padding: 0 4px 0 var(--yj-s3); border: 1px solid var(--yj-line); border-radius: var(--yj-r-sm); }
.cb-dock-edit li.is-on { background: var(--yj-yuja-50); border-color: var(--yj-yuja-200); }
.cb-dock-edit .cb-check { flex: 1; }
.cb-dock-edit__no { font-size: var(--yj-t-cap); font-weight: 800; color: var(--yj-yuja-ink); }
.cb-combo-edit { grid-template-columns: 1fr 1fr; }
.cb-combo-edit li { display: flex; align-items: center; gap: var(--yj-s2); padding: 4px 4px 4px var(--yj-s3); border: 1px solid var(--yj-line); border-radius: var(--yj-r-sm); font-size: var(--yj-t-small); }
.cb-combo-edit li span { flex: 1; color: var(--yj-sub); font-size: var(--yj-t-cap); }
.cb-combo-new { display: flex; flex-direction: column; gap: var(--yj-s2); padding: var(--yj-s3); border: 1px dashed var(--yj-line-strong); border-radius: var(--yj-r-sm); }
.cb-combo-new .cb-inline { gap: var(--yj-s3); }
.cb-combo-new .yj-btn { align-self: flex-start; }

/* ── 도구 화면 — 아래 테두리에 붙은 「도구 모음」 막대 (2026-10-29) ── */
.cb-toolstage { position: absolute; }
.cb-toolstage__panes { padding-bottom: 64px; position: relative; }
.cb-toolstage.is-tray-pinned .cb-toolstage__panes { padding-bottom: 240px; }
.cb-toolstage__empty { grid-column: 1 / -1; align-self: center; justify-self: center; display: flex; flex-direction: column; align-items: center; gap: var(--yj-s2); text-align: center; color: var(--yj-sub); max-width: 520px; }
.cb-toolstage__empty .cb-ic { width: 48px; height: 48px; color: var(--yj-faint); }
.cb-toolstage__empty b { font-size: var(--yj-t-h2); color: var(--yj-ink-deep); }
.cb-toolstage__empty p { margin: 0; font-size: var(--yj-t-small); line-height: 1.6; }
.cb-tray {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 3;
  display: flex; flex-direction: column; align-items: center;
  transform: translateY(calc(100% - 44px)); transition: transform var(--yj-m-slow) var(--yj-ease);
}
.is-tray-open .cb-tray { transform: none; }
.cb-tray__ear {
  height: 44px; padding: 0 var(--yj-s5); display: inline-flex; align-items: center; gap: var(--yj-s2);
  border: 1px solid var(--yj-line-strong); border-bottom: 0; border-radius: var(--yj-r-lg) var(--yj-r-lg) 0 0;
  background: var(--yj-yuja-100); color: var(--yj-ink-deep); font: inherit; font-size: var(--yj-t-small); font-weight: 800; cursor: pointer;
}
.cb-tray__ear .cb-ic { width: 20px; height: 20px; }
.cb-tray__ear .cb-ic:last-child { transform: rotate(180deg); transition: transform var(--yj-m-mid) var(--yj-ease); }
.is-tray-open .cb-tray__ear .cb-ic:last-child { transform: none; }
.cb-tray__body {
  align-self: stretch; max-height: 480px; overflow: auto; display: flex; flex-direction: column; gap: var(--yj-s2);
  padding: var(--yj-s3) var(--yj-s5) var(--yj-s3); background: var(--yj-card-hi); border-top: 2px solid var(--yj-yuja-600); box-shadow: var(--yj-sh-3);
}
.cb-tray__top { display: flex; align-items: center; gap: var(--yj-s3); }
.cb-tray__top b, .cb-tray__group b { font-size: var(--yj-t-cap); font-weight: 700; color: var(--yj-sub); white-space: nowrap; }
.cb-tray__combos { flex: 1; display: flex; gap: var(--yj-s2); flex-wrap: wrap; }
.cb-tray__pin[aria-pressed="true"] { background: var(--yj-yuja-200); border-color: var(--yj-yuja-600); }
.cb-tray__groups { display: flex; gap: var(--yj-s5); flex-wrap: wrap; }
.cb-tray__group { display: flex; flex-direction: column; gap: 6px; }
.cb-tray__grid { display: flex; gap: var(--yj-s2); }
.cb-tray__grid .cb-tool { width: 104px; height: 84px; }
.cb-tray__grid .cb-tool.is-open { background: var(--yj-yuja-200); border-color: var(--yj-yuja-600); }
/* 바탕화면 위젯 안의 도구 */
.cb-wtool { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.cb-wtool > .cb-pane__body { padding: 0; }
/* ── 타이머 위젯 — 시간 단추는 오른쪽 테두리를 따라 한 줄로, 시간 글자를 크게 (+10초 없음) ── */
.cb-wtool.cb-pane--timer:not(.cb-wtool--full) > .cb-pane__body { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: minmax(0, 1fr) auto; gap: var(--yj-s2); }
.cb-wtool.cb-pane--timer:not(.cb-wtool--full) .cb-tm { grid-column: 1; grid-row: 1; }
.cb-wtool.cb-pane--timer:not(.cb-wtool--full) .cb-tm__presets { grid-column: 2; grid-row: 1 / 3; flex-direction: column; flex-wrap: nowrap; justify-content: center; gap: 4px; overflow: auto; }
.cb-wtool.cb-pane--timer:not(.cb-wtool--full) .cb-tm__presets .cb-chip { width: 64px; height: 30px; padding: 0; justify-content: center; font-size: var(--yj-t-cap); }
.cb-wtool.cb-pane--timer:not(.cb-wtool--full) .cb-tm__ctrl { grid-column: 1; grid-row: 2; }
.cb-wtool.cb-pane--timer [data-add="10"] { display: none; }
/* 크게 보기(모달) 안의 도구 */
.cb-wtool--full > .cb-pane__body { padding: var(--yj-s4); }
/* 도구 모음 — 가운데 정렬 */
.cb-tray__top { justify-content: center; position: relative; }
.cb-tray__combos { flex: none; justify-content: center; }
.cb-tray__top .cb-tray__pin { position: absolute; right: 0; }
.cb-tray__groups { justify-content: center; }

/* ── 수업 시작 알림 (설정 → 시간표 · 2026-11-03) ── */
.cb-ca { width: min(560px, calc(100vw - 32px)); text-align: center; }
.cb-ca__kicker { margin: 0 0 var(--yj-s2); font-size: var(--yj-t-small); font-weight: 700; color: var(--yj-sub); }
.cb-ca h2 { font-size: var(--yj-t-disp, var(--yj-t-h2)); }
.cb-ca__lead { margin: var(--yj-s2) 0 var(--yj-s5); font-size: var(--yj-t-body); color: var(--yj-ink); }
.cb-ca .cb-dialog__foot { justify-content: center; }
.cb-ca__timer { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--yj-s3); margin: 0 auto var(--yj-s5); }
.cb-ca__time { font-size: 64px; font-weight: 800; line-height: 1; color: var(--yj-ink-deep); font-variant-numeric: tabular-nums; }
/* 동그라미 — 숫자가 고리 안에 */
.cb-ca__timer--ring { width: 240px; height: 240px; }
.cb-ca__timer--ring .cb-ca__time { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 52px; }
.cb-ca__ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.cb-ca__track { fill: none; stroke: var(--yj-line); stroke-width: 9; }
.cb-ca__arc { fill: none; stroke: var(--yj-yuja-500); stroke-width: 9; stroke-linecap: round; transition: stroke-dasharray 200ms linear; }
/* 모래시계 */
.cb-ca__sand { width: 150px; height: 210px; }
.cb-ca__glass { fill: none; stroke: var(--yj-ink-deep); stroke-width: 2.4; stroke-linejoin: round; }
.cb-ca__cap { fill: none; stroke: var(--yj-ink-deep); stroke-width: 5; stroke-linecap: round; }
.cb-ca__grain { fill: var(--yj-yuja-500); transition: y 200ms linear, height 200ms linear; }
.cb-ca__stream { stroke: var(--yj-yuja-600); stroke-width: 1.6; stroke-dasharray: 3 3; }
/* 막대 */
.cb-ca__timer--bar { width: 100%; }
.cb-ca__bar { width: 100%; height: 28px; border-radius: var(--yj-r-full); background: var(--yj-line); overflow: hidden; }
.cb-ca__bar i { display: block; height: 100%; border-radius: inherit; background: var(--yj-yuja-500); transition: width 200ms linear; }
.cb-ca__timer--num .cb-ca__time { font-size: 120px; }

/* 설정의 모양 고르기 — 작은 그림 */
.cb-ca-picks { display: flex; flex-wrap: wrap; gap: var(--yj-s3); }
.cb-ca-pick { width: 140px; display: flex; flex-direction: column; align-items: center; gap: var(--yj-s2); padding: var(--yj-s3); border: 1px solid var(--yj-line); border-radius: var(--yj-r-sm); background: var(--yj-card); cursor: pointer; font-size: var(--yj-t-small); color: var(--yj-ink-deep); }
.cb-ca-pick:has(input:checked) { background: var(--yj-yuja-200); border-color: var(--yj-yuja-600); }
.cb-ca-pick input { position: absolute; opacity: 0; pointer-events: none; }
.cb-ca-pick:has(input:focus-visible) { outline: 2px solid var(--yj-ink-deep); outline-offset: 2px; }
.cb-ca-pick__art { margin: 0; height: 96px; width: 100%; gap: var(--yj-s1); }
.cb-ca-pick__art.cb-ca__timer--ring { width: 96px; }
.cb-ca-pick__art .cb-ca__time { font-size: 18px; }
.cb-ca-pick__art.cb-ca__timer--num .cb-ca__time { font-size: 36px; }
.cb-ca-pick__art .cb-ca__sand { width: 48px; height: 68px; }
.cb-ca-pick__art .cb-ca__bar { height: 12px; }

/* ── 2026-11-11 · 머리띠의 타이머 표시(tools-time.js — 돌고 있는 동안 남은 시간, 누르면 타이머가 열린다) ── */
/* 머리띠는 이미 꽉 차 있다(1920 무대에서 메뉴 13칸 + 날짜) — 작게: 아이콘 없이 시간만, 남는 폭을 먹지 않게 */
.cb-tmchip { flex: none; gap: 3px; padding: 0 var(--yj-s2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.cb-tmchip[hidden] { display: none; }
/* 타이머 표시가 뜰 때 반 이름을 접던 임시방편은 S8 의 [업무] 묶기로 걷었다 — 넓이가 모자라면 app.js fitBar 가 순서대로 접는다 */
.cb-tmchip .cb-ic { width: 16px; height: 16px; }
.cb-tmchip.is-low { background: var(--yj-orange-tint); color: var(--yj-orange-ink); }
.cb-tmchip.is-done { background: var(--yj-yuja-300); color: var(--yj-ink-deep); font-weight: 800; animation: cb-tmpulse 1.2s var(--yj-ease) 3; }
/* R03-01 — 끝난 칩은 천천히 밝았다 어두워지기 3번(움직임 줄이기면 없음) · 가운데 큰 「시간 끝」 */
@keyframes cb-tmpulse { 0%, 100% { box-shadow: none; } 50% { box-shadow: 0 0 0 6px var(--yj-yuja-200); } }
@media (prefers-reduced-motion: reduce) { .cb-tmchip.is-done { animation: none; } }
.cb-tmbig { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 90; display: flex; flex-direction: column; align-items: center; gap: var(--yj-s2); padding: var(--yj-s6) var(--yj-s7); background: var(--yj-card-hi); border: 3px solid var(--yj-yuja-500); border-radius: var(--yj-r-lg); box-shadow: var(--yj-sh-3); cursor: pointer; }
.cb-tmbig[hidden] { display: none; }
.cb-tmbig__t { font-family: var(--yj-font-disp); font-size: 120px; line-height: 1; color: var(--yj-ink-deep); }
.cb-tmbig__s { font-size: var(--yj-t-body); color: var(--yj-sub); }

/* ── R03-03 — 수업 도구의 누르는 것은 무대 52px 이상(1366 무대 0.85 에서 실제 44 · 전자칠판 한 손) ──
   프리셋 · 인원 · 줄 수 · 주사위 수 · 시작 · 멈춤 · 체크 · 동그라미(글자까지 누르는 자리) · 「n번 타기」 · 「이것만 크게」.
   위젯 안 작은 도구(.cb-wtool:not(.cb-wtool--full))는 칸이 좁아 그대로 */
.cb-toolstage .cb-pane__body .cb-tm__presets .cb-chip,
.cb-wtool--full .cb-pane__body .cb-tm__presets .cb-chip { min-height: 52px; min-width: 52px; padding: 0 var(--yj-s3); font-size: var(--yj-t-body); justify-content: center; }
.cb-toolstage .cb-pane__body .cb-tm__ctrl .yj-btn,
.cb-wtool--full .cb-pane__body .cb-tm__ctrl .yj-btn { min-height: 52px; min-width: 52px; }
.cb-toolstage .cb-pane__body .cb-check,
.cb-wtool--full .cb-pane__body .cb-check { min-height: 52px; display: inline-flex; align-items: center; gap: var(--yj-s2); padding: 0 var(--yj-s2); cursor: pointer; }
.cb-toolstage .cb-pane__body .cb-check input,
.cb-wtool--full .cb-pane__body .cb-check input { width: 24px; height: 24px; }
.cb-toolstage .cb-ld__tops > .cb-ld__go,
.cb-wtool--full .cb-ld__tops > .cb-ld__go { width: 52px; height: 52px; }
.cb-toolstage .cb-ld__go .cb-ic { width: 24px; height: 24px; }
.cb-toolstage [data-pane-big] { min-height: 52px; padding: 0 var(--yj-s3); display: inline-flex; align-items: center; }
/* 점수판 — −1 은 +1 과 떼고(16px) 작게 · 테두리만, +1 은 부드러운 유자 채움 크게(아이 점수가 잘못 깎이지 않게) */
.cb-sc__btns { gap: var(--yj-s4); align-items: center; }
.cb-sc__btns [data-v="-1"] { min-width: 52px; min-height: 52px; padding: 0 var(--yj-s2); background: transparent; border: 1px solid var(--yj-line-strong); color: var(--yj-sub); font-weight: 600; }
.cb-sc__btns [data-v="1"] { min-width: 88px; min-height: 64px; font-size: var(--yj-t-h2); font-weight: 800; }

/* R03-10 재수선 2 — 도구가 하나면 숨긴 [이것만 크게]가 .cb-link 의 display 에 밀려 보였다 */
.cb-pane__head [data-pane-big][hidden] { display: none; }
