:root {
  /* 게시글 본문 색 — CLAUDE.md 규칙 그대로 */
  --sec-blue: rgb(0, 179, 242);
  --sec-red: rgb(255, 0, 16);
  --sec-teal: rgb(0, 157, 145);

  /* 피드백 색 — 패들렛에서 쓰던 네 가지. 성취도가 아니라 대화의 표시다. */
  --red-bg: #fdecec; --red-fg: #a32d2d; --red-bd: #f09595; --red-dot: #e24b4a;
  --pur-bg: #eeedfe; --pur-fg: #3c3489; --pur-bd: #afa9ec; --pur-dot: #7f77dd;
  --grn-bg: #eaf3de; --grn-fg: #3b6d11; --grn-bd: #97c459; --grn-dot: #639922;
  --blu-bg: #e6f1fb; --blu-fg: #185fa5; --blu-bd: #85b7eb; --blu-dot: #378add;

  --line: #e3e2dd;
  --ink: #1a1a18;
  --dim: #6b6a65;
  --paper: #fff;
  --bg: #f7f6f2;
}

* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.7 "나눔고딕", NanumGothic, -apple-system, BlinkMacSystemFont, "Malgun Gothic", sans-serif;
}
main { max-width: 940px; margin: 0 auto; padding: 20px 16px 80px; }
h1 { font-size: 20px; font-weight: 700; margin: 0; }
button {
  font: inherit; font-size: 14px; padding: 7px 14px; border: 1px solid #cfcec9;
  background: var(--paper); border-radius: 8px; cursor: pointer; color: var(--ink);
  word-break: keep-all; /* 한국어는 띄어쓰기(공백)에서만 줄바꿈 — 단어 중간에서 안 끊기게 */
}
button:hover { background: #f2f1ec; }
button.primary { background: var(--ink); color: #fff; border-color: var(--ink); }
input[type=text], input[type=password], input[type=date], textarea, select {
  font: inherit; font-size: 15px; padding: 8px 10px; border: 1px solid var(--line);
  border-radius: 8px; background: var(--paper); color: var(--ink); width: 100%;
}
textarea { min-height: 64px; resize: vertical; line-height: 1.6; }
.row { display: flex; gap: 8px; align-items: center; }
.dim { color: var(--dim); font-size: 13px; }
.topbar {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 10px 16px; background: var(--paper); border-bottom: 1px solid var(--line);
}
.topbar .row { gap: 10px; }
.tb-side { min-width: 0; }
#who.tb-side { justify-self: end; }
.tb-title { text-align: center; line-height: 1.1; }
.tb-title.tb-home { cursor: pointer; border-radius: 8px; transition: opacity .12s; }
.tb-title.tb-home:hover { opacity: .7; }
.tb-h1row { display: flex; align-items: center; justify-content: center; gap: 8px; }
.tb-emoji { width: 30px; height: 30px; object-fit: contain; flex: none; }
.tb-title h1 { margin: 0; font-size: 20px; }

/* ── 하단 제작자 표기 ── */
.site-foot {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 24px 16px 34px; margin-top: 20px;
  color: var(--dim); font-size: 13px; text-align: center;
}
.foot-credit { display: flex; align-items: center; justify-content: center; gap: 8px; }
.foot-emoji { width: 22px; height: 22px; object-fit: contain; flex: none; }
.foot-contact a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.foot-contact a:hover { color: var(--sec-blue); }
.tb-sub { display: block; margin-top: 2px; font-size: 12px; font-weight: 400; color: var(--dim); }

/* ── 로그인 ── */
.login { max-width: 340px; margin: 12vh auto; text-align: center; }
.login input { text-align: center; letter-spacing: 3px; font-size: 20px; margin: 18px 0 12px; }
.err { color: var(--red-fg); font-size: 14px; min-height: 20px; }

/* ── 수업 목록 ── */
/* 과목 탭 — 먼저 과목을 고른다 */
.subject-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.subtab { font-size: 15px; padding: 8px 16px; border-radius: 999px; }
.subtab .cnt { font-size: 12px; color: var(--dim); }
.subtab.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.subtab.on .cnt { color: #cfcfca; }
.subtab { display: inline-flex; align-items: center; gap: 6px; }
.subtab-drag { cursor: grab; color: var(--dim); font-size: 12px; margin-right: -2px; line-height: 1; }
.subtab-drag:active { cursor: grabbing; }
.subtab.dragging { opacity: .5; }
/* 오늘 수업 탭 — 파랑 강조 */
.subtab.today-tab { border-color: var(--blu-bd); color: var(--blu-fg); }
.subtab.today-tab.on { background: var(--blu-dot); border-color: var(--blu-dot); color: #fff; }
.subtab.today-tab.on .cnt { color: #e6f1fb; }
/* 「전체」 탭에서 과목 제목 */
.subj-h { font-size: 20px; font-weight: 800; margin: 28px 0 4px; color: var(--ink); }
.subj-h:first-of-type { margin-top: 14px; }
/* 단원 헤더 */
.unit-h { display: flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 700;
  margin: 22px 0 10px; padding-bottom: 6px; border-bottom: 2px solid var(--line); }
.unit-ctl { display: flex; gap: 4px; margin-left: auto; }
.unit-h .u-name { flex: 0 0 auto; }
/* 드래그 순서변경 손잡이 */
.drag-h { cursor: grab; color: var(--dim); user-select: none; line-height: 1; padding: 2px 3px; border-radius: 6px; }
.drag-h:hover { color: var(--ink); background: var(--line); }
.drag-h:active { cursor: grabbing; }
.u-drag { font-size: 15px; }
.lcard { position: relative; }
.l-drag { position: absolute; top: 8px; right: 10px; font-size: 15px; z-index: 2; }

/* 드래그 중: 집어 든 항목은 파란 점선 테두리로 또렷하게(놓일 자리에 실시간으로 옮겨 다닌다) */
.lcard.dragging, .unit-block.dragging {
  opacity: .7; outline: 2px dashed var(--sec-blue); outline-offset: 2px; background: #eaf7fe; border-radius: 12px;
}
.unit-block.dragging .unit-h { border-bottom-color: var(--sec-blue); }
/* 놓을 수 있는 영역임을 옅게 표시 */
.cards.drop-active, .units-wrap.drop-active { outline: 2px dashed #bfe6f8; outline-offset: 8px; border-radius: 14px; }
/* 드래그로 들어갈 자리를 파란 선으로 표시(모든 목록·그리드 공용 오버레이) */
#dropLine { position: fixed; z-index: 1100; display: none; pointer-events: none;
  background: var(--sec-blue); border-radius: 3px; box-shadow: 0 0 5px rgba(0, 179, 242, .6); }

/* 놓은 뒤: 옮겨진 항목이 잠깐 파랗게 반짝여 "여기로 이동했다"를 확실히 보여준다 */
@keyframes justMoved {
  0%   { box-shadow: 0 0 0 3px var(--sec-blue), 0 8px 22px rgba(0,179,242,.45); background: #d6f0fd; }
  55%  { box-shadow: 0 0 0 3px var(--sec-blue); background: #eaf7fe; }
  100% { box-shadow: 0 0 0 0 transparent; background: var(--paper); }
}
.lcard.just-moved { animation: justMoved 1.4s ease-out; }
@keyframes justMovedH {
  0%   { background: #d6f0fd; box-shadow: inset 4px 0 0 var(--sec-blue); }
  55%  { background: #eaf7fe; box-shadow: inset 4px 0 0 var(--sec-blue); }
  100% { background: transparent; box-shadow: inset 4px 0 0 transparent; }
}
.unit-block.just-moved .unit-h { animation: justMovedH 1.4s ease-out; border-radius: 6px; }

/* 이동 알림 토스트 */
#toast {
  position: fixed; left: 50%; bottom: 32px; transform: translateX(-50%) translateY(16px);
  background: var(--ink); color: #fff; padding: 10px 20px; border-radius: 999px; font-size: 14px; font-weight: 600;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 9999; box-shadow: 0 10px 30px rgba(0,0,0,.3);
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* 목록 화면: 왼쪽 사이트 사이드바 + 수업. 오른쪽에 고정 위젯(.addwidget)이 뜨므로 오른쪽에 ~200px 비워 겹침을 막는다. */
/* 공용 셸: 자주 가는 사이트(왼쪽 #sitesFixed=.sidelinks)와 버튼 위젯(오른쪽 #navFixed=.addwidget)을
   둘 다 세로 중앙에 고정하고, 본문(main.shell)은 그 사이에 둔다. 모든 화면 공통. */
main.shell { max-width: none; margin: 0 200px 0 244px; }
.sidelinks { position: fixed; left: 18px; top: 50%; transform: translateY(-50%);
  width: 210px; max-height: 92vh; overflow-y: auto; }
.listlayout { display: flex; gap: 26px; align-items: flex-start; }
.listbody { flex: 1 1 auto; min-width: 0; }
.sl-head { font-size: 13px; font-weight: 700; color: var(--dim); margin: 2px 4px 8px; }
.sl-list { display: flex; flex-direction: column; gap: 1px; }
.sl-item { display: flex; align-items: center; gap: 2px; border-radius: 8px; padding: 1px 2px; }
.sl-item:hover { background: #efeee9; }
.sl-link { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 6px; padding: 7px 8px;
  color: var(--ink); text-decoration: none; font-size: 14px; border-radius: 6px; }
.sl-link span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 사이트 파비콘 */
.favicon { width: 18px; height: 18px; flex: 0 0 auto; border-radius: 4px; object-fit: contain; }
/* 수업 카드 삭제 버튼 */
.card-del { color: var(--red-fg); border-color: var(--red-bd); }
.card-del:hover { background: var(--red-bg); }
/* 수업 카드 버튼 — 아이콘만, 한 줄 */
.icard-row { display: flex; gap: 6px; margin-top: 10px; flex-wrap: nowrap; }
.icard-btn { flex: 1 1 0; min-width: 0; height: 38px; padding: 0; display: inline-flex;
  align-items: center; justify-content: center; font-size: 17px; line-height: 1; }
.icard-btn svg { display: block; }
.icard-btn .ico-play { font-size: 13px; }
.icard-btn.primary { background: var(--ink); color: #fff; border-color: var(--ink); }
.icard-btn.primary:hover { background: #333; }
.icard-btn.card-del { color: var(--red-fg); border-color: var(--red-bd); font-size: 15px; }
.icard-btn.card-del:hover { background: var(--red-bg); }
.icard-btn.share-btn { color: #1f9d55; border-color: #b7e4c7; }
.icard-btn.share-btn:hover { background: #eafaf0; }
.icard-btn.share-on { color: #fff; background: #21a35a; border-color: #21a35a; }
.icard-btn.share-on:hover { background: #1c8f4e; }
/* 노션에 기록을 보낸 수업 — 버튼을 초록으로 채워 보냈음을 표시(공유 버튼과 같은 초록). */
.icard-btn.notion-on { background: #21a35a; border-color: #21a35a; }
.icard-btn.notion-on:hover { background: #1c8f4e; }
.icard-btn.busy { opacity: .55; }

/* 아이콘 버튼에 마우스를 올리면 즉시 뜨는 설명 말풍선 */
.icard-btn { position: relative; }
.icard-btn[data-tip]::after {
  content: attr(data-tip); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  background: var(--ink, #222); color: #fff; font-size: 12px; line-height: 1; white-space: nowrap;
  padding: 5px 8px; border-radius: 6px; opacity: 0; pointer-events: none; transition: opacity .12s; z-index: 40;
}
.icard-btn[data-tip]::before {
  content: ""; position: absolute; bottom: calc(100% + 1px); left: 50%; transform: translateX(-50%);
  border: 5px solid transparent; border-top-color: var(--ink, #222); opacity: 0; pointer-events: none; transition: opacity .12s; z-index: 40;
}
.icard-btn[data-tip]:hover::after, .icard-btn[data-tip]:hover::before { opacity: 1; }

/* 공유 모음에서 가져오기 — 오버레이 */
.gpick-ov { position: fixed; inset: 0; background: rgba(0,0,0,.4); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 16px; }
.gpick-box { background: var(--card, #fff); border-radius: 14px; width: 100%; max-width: 560px; max-height: 82vh; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 18px 50px rgba(0,0,0,.28); }
.gpick-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line, #eee); font-size: 16px; }
.gpick-x { border: none; background: transparent; font-size: 18px; cursor: pointer; color: var(--dim, #888); padding: 2px 6px; }
.gpick-body { padding: 12px 16px 18px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
.gpick-card { display: flex; align-items: center; gap: 12px; border: 1px solid var(--line, #eee); border-radius: 10px; padding: 12px 14px; }
.gpick-info { flex: 1 1 auto; min-width: 0; }
.gpick-info h4 { margin: 0 0 3px; font-size: 15px; }
.gpick-by { font-size: 12px; color: var(--dim, #999); margin-top: 3px; }
.gpick-take { flex: none; }

/* 자주 가는 사이트 — 앱 안 모달(iframe) */
.site-ov { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 120; display: flex; align-items: center; justify-content: center; padding: 2vh 2vw; }
.site-box { width: 96vw; height: 94vh; max-width: 1400px; background: var(--paper); border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,.4); }
.site-head { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--line); background: var(--bg); }
.site-name { font-weight: 700; font-size: 14px; flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.site-tab { font-size: 12.5px; font-weight: 600; padding: 5px 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); text-decoration: none; color: var(--ink); flex: none; }
.site-tab:hover { background: var(--sec-blue); color: #fff; border-color: var(--sec-blue); }
.site-x { border: none; background: transparent; font-size: 18px; cursor: pointer; color: var(--dim); padding: 2px 8px; flex: none; }
.site-frame { flex: 1 1 auto; width: 100%; border: none; background: #fff; }
.site-hint { font-size: 11px; color: var(--dim); text-align: center; padding: 4px 8px; border-top: 1px solid var(--line); background: var(--bg); }

/* 설정 모달 */
.set-sec { margin-bottom: 8px; }
.set-sec + .set-sec { margin-top: 14px; padding-top: 16px; border-top: 1px solid var(--line); }
.set-label { display: block; font-size: 14px; font-weight: 700; margin-bottom: 8px; }
.set-label .dim { font-weight: 400; font-size: 12px; }
.set-row { display: flex; gap: 8px; }
.set-inp { flex: 1 1 auto; min-width: 0; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; font-size: 14px; }
.set-save { flex: none; }
.set-note { font-size: 12px; color: var(--dim); margin: 0 0 10px; line-height: 1.5; }
.set-copy { font-size: 12px; padding: 5px 10px; margin-bottom: 10px; }
.code-list { display: flex; flex-direction: column; gap: 6px; max-height: 46vh; overflow-y: auto; padding-right: 2px; }
.code-row { display: flex; align-items: center; gap: 7px; }
.code-no { flex: none; width: 38px; font-size: 13px; font-weight: 700; color: var(--dim); }
.code-no.custom { color: var(--sec-blue); }
.code-inp { flex: 1 1 auto; min-width: 0; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px;
  font: 600 14px/1.2 ui-monospace, "SF Mono", Consolas, monospace; letter-spacing: .04em; text-transform: uppercase; }
.code-row .mini { flex: none; }

/* AI 튜터(챗봇) 플로팅 위젯 */
#tutorFab {
  position: fixed; right: 16px; bottom: 16px; z-index: 95;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 0; border: none; background: transparent; cursor: grab;
  touch-action: none; user-select: none; -webkit-user-select: none;
}
#tutorFab * { pointer-events: none; }
#tutorFab .fab-tile {
  width: 62px; height: 62px; border-radius: 16px; overflow: hidden; padding: 4px;
  background: #fff; border: 2px solid var(--sec-blue, rgb(0,179,242));
  box-shadow: 0 4px 12px rgba(0,0,0,.22), 0 0 0 3px rgba(0,179,242,.10);
  display: flex; align-items: center; justify-content: center;
  transition: transform .12s, box-shadow .12s;
}
#tutorFab .fab-tile img { width: 100%; height: 100%; object-fit: contain; display: block; }
#tutorFab .fab-label {
  font-size: 12px; font-weight: 800; color: var(--ink, #1a1a18); line-height: 1.4;
  background: rgba(255,255,255,.9); border-radius: 8px; padding: 0 7px; white-space: nowrap;
  box-shadow: 0 1px 3px rgba(0,0,0,.12);
}
#tutorFab:hover .fab-tile { transform: scale(1.06); }
#tutorFab:active { cursor: grabbing; }
#tutorFab.open .fab-tile { border-color: #888; box-shadow: 0 4px 12px rgba(0,0,0,.22); }
.tutor-title { display: flex; align-items: center; gap: 8px; }
.tutor-ava { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.tutor-hero { display: block; width: 150px; max-width: 60%; margin: 4px auto 8px; }
#tutorPanel {
  position: fixed; right: 18px; bottom: 84px; z-index: 91;
  width: min(380px, calc(100vw - 32px)); height: min(560px, calc(100vh - 130px));
  background: var(--card, #fff); border: 1px solid var(--line, #e6e6e6); border-radius: 16px;
  display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 16px 44px rgba(0,0,0,.26);
}
#tutorPanel[hidden] { display: none; }
.tutor-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--line, #eee); font-size: 15px; }
.tutor-x { border: none; background: transparent; font-size: 17px; cursor: pointer; color: var(--dim, #999); padding: 2px 6px; }
.tutor-log { flex: 1 1 auto; overflow-y: auto; padding: 14px 14px 6px; display: flex; flex-direction: column; gap: 9px; }
.tmsg { max-width: 82%; padding: 9px 12px; border-radius: 14px; font-size: 14px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
.tmsg.bot { align-self: flex-start; background: var(--soft, #f1f2f5); color: var(--ink, #222); border-bottom-left-radius: 5px; }
.tmsg.me { align-self: flex-end; background: rgb(0,179,242); color: #fff; border-bottom-right-radius: 5px; }
.tmsg.wait { opacity: .6; font-style: italic; }
/* 공유 수업 아이콘 통일: 카드 공유(위 화살표)·목록 가져오기(아래 화살표)를 같은 트레이+화살표 초록 SVG로 */
.imp-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.imp-btn .btn-ico { color: #1f9d55; flex: none; }
/* 교사 수업 화면 상단: 단원·차시 + 수업 주제(가운데, 크게) */
.teach-head { text-align: center; margin-bottom: 16px; }
.teach-title { margin: 0 0 5px; font-size: 22px; font-weight: 800; line-height: 1.32; text-wrap: balance; }
.teach-title .th-unit { color: var(--dim); font-weight: 700; }
.teach-title .th-topic { color: var(--ink); }
.teach-title .th-topic::before { content: " · "; color: var(--dim); font-weight: 400; }
.teach-state { margin: 0; font-size: 12.5px; color: var(--dim); }
/* 읽기 도움(학생 접근성) — 글자 크기 조절 바 · 발문 읽어주기 버튼 */
.readbar { display: flex; align-items: center; gap: 8px; margin: 2px 0 14px; }
.readbar-lb { font-size: 12.5px; color: var(--dim); }
.rb-btn { font-size: 13px; font-weight: 700; padding: 4px 13px; }
.ask-q { display: flex; align-items: flex-start; gap: 8px; }
.tts-btn { flex: none; font-size: 15px; line-height: 1.4; padding: 2px 9px; }
/* 학생 진행 표시(발문 N/전체 완료) */
.stu-prog { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 12px; }
.stu-prog:empty { display: none; }
.sp-lb { font-size: 13px; font-weight: 700; color: var(--ink); white-space: nowrap; }
.sp-dots { display: flex; gap: 8px; flex-wrap: wrap; }
.sp-dot { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--line); display: inline-flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 800; color: var(--dim); background: var(--paper); transition: background .2s, border-color .2s; }
.sp-dot.done { background: #2f9d5b; border-color: #2f9d5b; color: #fff; }
/* O·X 선택형 발문 */
.ox-fmt { font-size: 13px; padding: 5px 8px; width: auto; flex: none; }
.audio-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.audio-line .audio-name { white-space: nowrap; }
.audio-line .audio-player { height: 38px; max-width: 100%; vertical-align: middle; }
.audio-line .audio-dl { font-size: 12px; white-space: nowrap; }
/* 사진 그리드 — 여러 장을 한 장처럼 배열해 보여 준다 */
/* 사진 그리드 — 각 칸 너비에 맞추고 세로는 비율대로(크롭 없음). align-items:start 로 이미지가 행 높이에 늘어나지 않게 한다. */
.photo-grid { display: grid; gap: 4px; margin: 8px 0; align-items: start; }
.photo-grid:not(.edit) { max-width: min(600px, 100%); }
.photo-grid .pg-cell { width: 100%; height: auto; display: block; border-radius: 4px; }
.photo-grid .pg-empty { aspect-ratio: 1 / 1; background: var(--line); }
.photo-grid.edit { gap: 4px; }
.photo-grid.edit .pg-cell { position: relative; border-radius: 6px; overflow: hidden; border: 1px solid var(--line); background: #f0efe9; }
.photo-grid.edit .pg-cell img { width: 100%; height: auto; display: block; }
.photo-grid.edit .pg-add { display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 26px; color: var(--dim); border: 1px dashed #bbb; background: #faf9f5; aspect-ratio: 1 / 1; }
.photo-grid.edit .pg-x { position: absolute; top: 3px; right: 3px; width: 22px; height: 22px; border: none; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; cursor: pointer; font-size: 14px; line-height: 1; padding: 0; }
.grid-head { align-items: center; gap: 6px; flex-wrap: wrap; }
.grid-dim { width: 54px; flex: none; text-align: center; }

/* 과제(task) — 수업과 나란한 별도 종류 */
.add-task { color: var(--blu-fg); border-color: var(--blu-bd); }
.tcard { position: relative; }
.tbadge { display: inline-block; font-size: 12px; font-weight: 700; color: var(--blu-fg); background: var(--blu-bg); border: 1px solid var(--blu-bd); border-radius: 999px; padding: 1px 8px; margin-bottom: 4px; }
.task-title { margin: 6px 0 10px; font-size: 20px; }
.in-file { display: inline-flex; }
.file-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--blu-bg); border: 1px solid var(--blu-bd); border-radius: 8px; padding: 4px 8px; font-size: 13px; margin: 4px 0; }
.file-chip a { color: var(--blu-fg); text-decoration: none; }
.file-chip .chip-x { border: none; background: transparent; color: var(--blu-fg); cursor: pointer; font-size: 15px; line-height: 1; padding: 0; }
.subfile { display: inline-block; margin-top: 4px; color: var(--blu-fg); font-size: 13px; text-decoration: none; }
.subfile:hover { text-decoration: underline; }
/* 학생 제출 상태 배너 */
.task-status { border-radius: 10px; padding: 10px 12px; margin: 12px 0; font-size: 15px; border: 1px solid var(--line); }
.task-status.red { background: var(--red-bg); color: var(--red-fg); border-color: var(--red-bd); }
.task-status.purple { background: var(--pur-bg); color: var(--pur-fg); border-color: var(--pur-bd); }
.task-status.green { background: var(--grn-bg); color: var(--grn-fg); border-color: var(--grn-bd); }
.task-status.blue { background: var(--blu-bg); color: var(--blu-fg); border-color: var(--blu-bd); }
/* 교사 평가 화면 */
.eval-bar { gap: 10px; flex-wrap: wrap; align-items: center; margin: 4px 0 12px; }
.eval-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; align-items: start; }
.eval-card { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: var(--paper); }
.eval-card.red { border-color: var(--red-bd); }
.eval-card.purple { border-color: var(--pur-bd); }
.eval-card.green { border-color: var(--grn-bd); }
.eval-card.blue { border-color: var(--blu-bd); }
.ec-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.ec-no { font-weight: 700; }
.ec-rev { font-size: 12px; color: var(--blu-fg); }
.ec-fix { font-size: 12px; color: var(--red-fg); font-weight: 700; }
.eval-card .picker { margin: 8px 0 2px; }
.fb-wrap { position: relative; margin-top: 6px; }

/* 제출물 크게 보기 슬라이드 */
.sub-open { cursor: zoom-in; }
.slide-modal { width: 100%; max-width: 780px; }
.slide-body { display: flex; align-items: center; gap: 8px; }
.slide-nav { flex: none; width: 46px; height: 46px; border-radius: 50%; font-size: 26px; line-height: 1; padding: 0; }
.slide-nav:disabled { opacity: .25; cursor: default; }
.slide-content { flex: 1 1 auto; min-width: 0; text-align: center; max-height: 80vh; overflow-y: auto; padding: 4px; }
.slide-no { font-weight: 700; font-size: 16px; margin-bottom: 8px; }
.slide-badge { font-size: 12px; padding: 1px 9px; border-radius: 999px; color: #fff; margin-left: 4px; vertical-align: middle; }
.slide-badge.purple { background: var(--pur-dot); } .slide-badge.green { background: var(--grn-dot); }
.slide-badge.red { background: var(--red-dot); } .slide-badge.blue { background: var(--blu-dot); }
.slide-text { font-size: 18px; line-height: 1.6; margin: 8px 0; white-space: pre-wrap; text-align: left; }
.slide-img { max-width: 100%; max-height: 68vh; height: auto; border-radius: 10px; border: 1px solid var(--line); }
.slide-fb { margin-top: 10px; font-size: 14px; color: var(--dim); text-align: left; border-top: 1px dashed var(--line); padding-top: 8px; }
.slide-count { font-size: 13px; white-space: nowrap; }

/* 수업 사진 클릭 → 큰 모달 */
.clickzoom { cursor: zoom-in; }
.img-modal { width: 100%; max-width: 900px; }
.img-big { display: block; max-width: 100%; max-height: 82vh; height: auto; margin: 0 auto; border-radius: 8px; }

/* 교사 보드 대화형 — 카톡처럼 이름표를 말풍선 위에 두고, 말풍선을 한쪽으로 몰아 반대쪽을 비운다.
   학생=왼쪽, 교사=오른쪽. 피드백 글씨는 작게 해 학생 글을 더 잘 보이게. */
.thread.chat .tturn { flex-direction: column; gap: 3px; }
.thread.chat .tturn.t-stu { align-items: flex-start; }
.thread.chat .tturn.t-tea { align-items: flex-end; }
.thread.chat .tbody { flex: 0 0 auto; max-width: 78%; min-width: 0; }
.thread.chat .tside { flex-direction: row; align-items: center; gap: 5px; }
/* 학생 글도 왼쪽 회색 말풍선으로 — 좌/우가 한눈에 갈리게. */
.thread.chat .tturn.t-stu .tt { display: inline-block; background: var(--soft, #eef0f3); border-radius: 12px; padding: 6px 10px; }
.thread.compact .tmsg { font-size: 12px; padding: 5px 8px; }
.thread.compact .fbtext { font-size: 12px; }
.thread.compact .fblabel { font-size: 10px; padding: 0 6px; }
.thread.compact .tt { font-size: 14px; }

/* 슬라이드 안 평가(색·AI·피드백) */
.slide-eval { margin-top: 14px; border-top: 1px dashed var(--line); padding-top: 12px; }
.slide-eval .picker { justify-content: center; margin-bottom: 4px; }
.slide-eval .ai-note { text-align: center; }
.slide-eval .fb-wrap { margin-top: 6px; }
.ox-pick { display: flex; gap: 12px; margin: 4px 0 8px; }
.ox-btn { flex: 1 1 0; max-width: 130px; font-size: 24px; font-weight: 800; padding: 14px 0; }
.ox-btn.on { background: var(--sec-blue); color: #fff; border-color: var(--sec-blue); }
/* 동료 반응(좋아요·한 줄 칭찬) */
.react-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); }
.react-got { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 8px 0; }
.rx-lb { font-size: 12px; color: var(--dim); font-weight: 700; }
.rx-like { font-size: 13px; padding: 3px 10px; border-radius: 16px; }
.rx-like.on { background: #ffe3ea; border-color: #f4b6c6; }
.rx-praise { font-size: 12.5px; background: var(--grn-bg); color: var(--grn-fg); border: 1px solid var(--grn-bd); border-radius: 14px; padding: 2px 9px; }
.rx-inp { flex: 1 1 120px; min-width: 100px; font-size: 13px; padding: 5px 9px; }
.rx-send { font-size: 12.5px; padding: 5px 11px; flex: none; }
.ox-agg { margin: 2px 0 14px; display: flex; flex-direction: column; gap: 8px; max-width: 440px; }
.oxa-row { display: flex; align-items: center; gap: 10px; }
.oxa-lb { width: 22px; font-weight: 800; font-size: 16px; text-align: center; flex: none; }
.oxa-track { flex: 1 1 auto; height: 16px; background: var(--line); border-radius: 8px; overflow: hidden; }
.oxa-track > i { display: block; height: 100%; transition: width .3s; }
.oxa-o { background: var(--sec-blue); }
.oxa-x { background: #e2823a; }
.oxa-n { width: 48px; font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; flex: none; }
/* 자유응답 낱말 구름 */
.wc-btn { flex: none; white-space: nowrap; }
.wc-modal .wc-cloud { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: baseline; justify-content: center; padding: 22px 8px; }
.wc-w { font-weight: 800; line-height: 1.05; }
/* 학생별 요약 표(학생별 보기 상단) */
.stu-sum-wrap { margin: 4px 0 18px; }
.stu-sum-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
.stu-sum { border-collapse: collapse; width: 100%; font-size: 13px; }
.stu-sum th, .stu-sum td { padding: 6px 12px; text-align: center; border-bottom: 1px solid var(--line); white-space: nowrap; font-variant-numeric: tabular-nums; }
.stu-sum tr:last-child td { border-bottom: 0; }
.stu-sum th { color: var(--dim); font-weight: 650; font-size: 12px; }
.stu-sum td:first-child, .stu-sum th:first-child { font-weight: 700; }
.stu-sum td:last-child, .stu-sum th:last-child { text-align: left; }
.stu-sum .td-fail { color: var(--red-fg); font-weight: 700; }
.stu-sum .row-red { background: var(--red-bg); }

/* 교사 수업 화면 실시간 대시보드(왼쪽 패널 상단) — 작은 버전 */
.teach-dash { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 12px 13px; margin-bottom: 12px; box-shadow: 0 4px 16px rgba(0,0,0,.06); font-size: 12px; }
.dash-title { font-weight: 800; font-size: 13px; margin-bottom: 6px; }
/* 보드 왼쪽 발문별 현황 대시보드 */
.teach-dash .bd-q { font-size: 12px; color: var(--ink); margin: 2px 0 8px; line-height: 1.4; }
.teach-dash .bd-tally { display: flex; flex-wrap: nowrap; gap: 9px; align-items: center; margin: 6px 0; font-size: 13px; }
.teach-dash .bd-tally > span { display: inline-flex; align-items: center; gap: 3px; }
.teach-dash .bd-tally .dot { margin: 0; }
.teach-dash .bd-sub { font-size: 11px; margin: 4px 0 2px; }
.teach-dash .miss-line { font-size: 11px; margin: 4px 0 0; }
.dash-sec + .dash-sec { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 8px; }
.dash-h { font-size: 11px; color: var(--dim); font-weight: 700; margin-bottom: 5px; }
.dash-row { display: flex; justify-content: space-between; align-items: baseline; }
.dash-row span { color: var(--dim); }
.dash-row b { font-size: 15px; font-variant-numeric: tabular-nums; }
.dash-donuts { display: flex; gap: 10px; margin: 4px 0 8px; }
.dnt { flex: 1 1 0; min-width: 0; text-align: center; }
.dnt-svg { width: 100%; max-width: 72px; display: block; margin: 0 auto; }
.dnt-track { stroke: #eceae4; }
.dnt-fill.sub { stroke: var(--sec-blue); }
.dnt-fill.ach { stroke: #2f9d5b; }
.dnt-pct { font-size: 10px; font-weight: 800; text-anchor: middle; dominant-baseline: central; fill: var(--ink); }
.dnt-l { font-size: 12px; color: var(--dim); margin-top: 3px; }
.dnt.sub .dnt-l { color: var(--sec-blue); }
.dnt.ach .dnt-l { color: #2f9d5b; }
.dash-legend { display: flex; flex-wrap: wrap; gap: 4px 8px; font-size: 11px; }
.dash-legend .dl-pass { color: var(--grn-fg); }
.dash-legend .dl-fail { color: var(--red-fg); }
.dash-legend .dl-none { color: var(--dim); }
.dash-q { padding: 4px 5px; margin: 0 -5px; border-radius: 6px; }
.dash-q[data-qid] { cursor: pointer; }
.dash-q[data-qid]:hover { background: #f0efe9; }
.dash-q .dq-l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; margin-bottom: 3px; }
.dq-combo { display: flex; align-items: center; gap: 7px; margin-top: 2px; }
.dq-combo .dq-bars { flex: 1; height: 11px; border-radius: 4px; overflow: hidden; background: #eceae4; display: flex; flex-direction: column; }
.dq-combo .dq-bars > .s { height: 50%; overflow: hidden; }
.dq-combo .dq-bars > .s.ach { box-shadow: inset 0 1px 0 #fff; }
.dq-combo .dq-bars > .s > i { display: block; height: 100%; }
.dq-combo .dq-bars > .s.sub > i { background: var(--sec-blue); }
.dq-combo .dq-bars > .s.ach > i { background: #2f9d5b; }
.dq-combo .dq-nums { display: flex; flex-direction: column; line-height: 1.15; width: 32px; text-align: right; flex: none; font-variant-numeric: tabular-nums; }
.dq-combo .dq-nums > span { font-size: 10px; font-weight: 700; }
.dq-combo .dq-nums > .sub { color: var(--sec-blue); }
.dq-combo .dq-nums > .ach { color: #2f9d5b; }
/* 미제출 학생 번호 */
.miss-line { margin: 3px 0 0; font-size: 12.5px; font-weight: 600; color: #a8660c; }

/* 보드 일괄 색적용 바 */
.bulk-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 10px 0 6px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); }
.bulk-bar.has-sel { border-color: var(--sec-blue); background: #eef7fd; }
.bulk-all { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; cursor: pointer; white-space: nowrap; }
.bulk-cnt { font-size: 13px; color: var(--dim); font-weight: 600; white-space: nowrap; }
.bulk-label { font-size: 12.5px; color: var(--dim); white-space: nowrap; }
.bulk-colors { display: inline-flex; gap: 4px; }
.bulk-clr { font-size: 12px; padding: 4px 9px; }
.bulk-bar .grow { flex: 1 1 8px; }
.bulk-all input, .card-sel { width: 16px; height: 16px; cursor: pointer; accent-color: var(--sec-blue); margin: 0; flex: none; }
.card-sel:disabled { opacity: .3; cursor: not-allowed; }
.card .who { justify-content: flex-start; gap: 8px; align-items: center; }
.bulk-sep { width: 1px; align-self: stretch; background: var(--line); margin: 0 2px; }
.bulk-ai, .bulk-send { font-size: 12.5px; padding: 5px 11px; white-space: nowrap; }
.bulk-ai { border-color: var(--sec-blue); color: var(--sec-blue); font-weight: 700; }
.bulk-ai:hover { background: #eef7fd; }
/* AI가 제안한(아직 안 보낸) 색 — 점선 링으로 표시 */
.sc.sug { outline: 2px dashed var(--sec-blue); outline-offset: 1px; }

/* 보드 카드 정렬 토글 */
.sort-row { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; }
.sort-row .dim { font-size: 12px; }
.sort-btn { font-size: 12px; padding: 3px 11px; border-radius: 20px; }
.sort-btn.on { background: var(--ink); color: #fff; border-color: var(--ink); }

.tutor-toggle { font-weight: 700; }
.tutor-toggle.on { color: var(--grn-fg); border-color: var(--grn-bd); background: var(--grn-bg); }
.tutor-toggle.on:hover { background: #e0efd0; }
.tutor-toggle.off { color: var(--red-fg); border-color: var(--red-bd); background: var(--red-bg); }
.tutor-toggle.off:hover { background: #fbdede; }
.tutor-note { padding: 5px 14px; font-size: 11px; color: var(--dim, #888); text-align: center; border-top: 1px solid var(--line, #f0f0f0); }
.tutor-inp { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line, #eee); }
.tutor-inp input { flex: 1 1 auto; min-width: 0; padding: 10px 12px; border: 1px solid var(--line, #ddd); border-radius: 10px; font-size: 14px; }
.tutor-inp button { flex: none; padding: 0 14px; }
@media (max-width: 480px) {
  #tutorPanel { right: 8px; left: 8px; width: auto; bottom: 78px; height: min(70vh, 520px); }
  #tutorFab { right: 12px; bottom: 12px; }
}
/* 단원 「+ 수업」 강조 */
.add-lesson { color: var(--sec-blue); }
/* 편집: 설정/공유 구분 안내 */
.setup-tag { font-size: 13px; color: var(--red-fg); background: var(--red-bg); border: 1px solid var(--red-bd);
  border-radius: 8px; padding: 8px 12px; margin: 0 0 12px; font-weight: 400; }
.setup-tag b { font-weight: 700; }
.share-note { font-size: 13px; color: #0068a8; background: #eaf7fe; border: 1px solid #bfe6f8;
  border-radius: 10px; padding: 9px 12px; margin: 4px 0 14px; }
.share-note b { color: #005b90; }
.fav-fallback { display: inline-flex; align-items: center; justify-content: center; font-size: 14px; line-height: 1; }
.sl-link:hover { color: var(--sec-blue); }
.sl-ctl { display: none; gap: 1px; flex: 0 0 auto; }
.sl-item:hover .sl-ctl { display: flex; }
.sl-b { font-size: 11px; padding: 2px 5px; border-color: transparent; background: transparent; color: var(--dim); }
.sl-b:hover { color: var(--ink); background: var(--paper); }
.sl-drag { font-size: 13px; flex: 0 0 auto; }
.sl-addwrap { margin-top: 10px; }
.sl-add { width: 100%; font-size: 13px; }
/* 편집기 블록 고정 버튼 */
.pinbtn { font-size: 12px; padding: 5px 9px; }
.pinbtn.on { background: #fff5d6; border-color: #e6c34a; color: #8a6d00; font-weight: 600; }
/* 수업 화면 왼쪽 고정 블록(비율 맞춰) + 사이트 여는 버튼 */
.pin-box { border: 1px solid var(--line); border-radius: 12px; padding: 12px 13px; background: var(--paper);
  max-height: 68vh; overflow: auto; margin-bottom: 10px; }
.pin-box .blk { margin: 0; }
.pin-box .ln { font-size: 13px; line-height: 1.5; margin: 3px 0; }
.pin-box img.pic { width: 100%; max-width: 100%; height: auto; border-radius: 8px; }
.pin-box .std { font-size: 12px; }
.sites-open { width: 100%; font-size: 13px; }
/* 이름·주소를 위아래로 함께 입력하는 폼 */
.sl-form { display: flex; flex-direction: column; gap: 6px; padding: 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); }
.sl-form input { font: inherit; font-size: 13px; padding: 7px 9px; border: 1px solid #cfcec9; border-radius: 7px; width: 100%; }
.sl-form .lf-row { display: flex; gap: 6px; }
.sl-form .lf-ok, .sl-form .lf-cancel { flex: 1 1 0; font-size: 13px; padding: 6px; }

/* 「🔗 사이트」 토글 버튼 */
.linkstoggle { font-size: 13px; }
/* 수업 편집·진행 중 오른쪽에서 밀려나오는 자주 가는 사이트 서랍 */
#linksDrawer {
  position: fixed; top: 0; left: 0; height: 100vh; width: 260px; max-width: 82vw;
  background: var(--paper); border-right: 1px solid var(--line); box-shadow: 8px 0 30px rgba(0,0,0,.12);
  transform: translateX(-100%); transition: transform .22s ease; z-index: 1000;
  display: flex; flex-direction: column; padding: 14px 12px; overflow-y: auto;
}
#linksDrawer.open { transform: translateX(0); }
.ld-head { display: flex; align-items: center; justify-content: space-between; font-size: 14px; font-weight: 700; margin-bottom: 10px; }
.ld-x { border: none; background: transparent; font-size: 15px; color: var(--dim); padding: 2px 6px; }
.ld-x:hover { color: var(--ink); }
.ld-list { display: flex; flex-direction: column; gap: 2px; }
.ld-link { display: flex; align-items: center; gap: 6px; padding: 9px 10px; border-radius: 8px;
  color: var(--ink); text-decoration: none; font-size: 14px; }
.ld-link span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ld-link:hover { background: #efeee9; color: var(--sec-blue); }
/* 좁은 화면(≤1000px): 본문 가운데로, 사이트 패널은 숨기고, 버튼 위젯은 하단 가로 바로. */
@media (max-width: 1000px) {
  main.shell { max-width: 940px; margin: 0 auto; padding-bottom: 132px; }
  #sitesFixed { display: none; }
  #navFixed { position: fixed; left: 8px; right: 8px; bottom: 8px; top: auto; transform: none;
    width: auto; max-height: 42vh; overflow-y: auto; flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 6px;
    padding-bottom: calc(8px + env(safe-area-inset-bottom)); }
  #navFixed button { width: auto; }
  #navFixed .wsep { display: none; }
}
/* 폰(9:16 세로): 여백·글자 줄이고 가로 넘침 방지. 가로 회전(landscape)도 ≤1000px라 위 규칙을 그대로 탄다. */
html, body { overflow-x: hidden; }
img, svg { max-width: 100%; }
@media (max-width: 480px) {
  main { padding-left: 12px; padding-right: 12px; }
  .topbar { padding: 8px 12px; }
  .tb-title h1 { font-size: 18px; }
  .tb-sub { font-size: 11px; }
  .tb-emoji { width: 26px; height: 26px; }
  #who .dim { font-size: 12px; }
  .fields { grid-template-columns: 1fr 1fr; }
  .icard-btn { height: 34px; font-size: 15px; }
  .subject-tabs { flex-wrap: wrap; }
}
/* 가로로 눕혔을 때(낮은 화면): 하단 바가 화면을 너무 먹지 않게 */
@media (max-height: 500px) and (max-width: 1000px) {
  main.shell { padding-bottom: 88px; }
  #navFixed { max-height: 60vh; }
}
/* 과목·단원 관리용 작은 버튼 */
.mini { font-size: 12px; font-weight: 400; padding: 3px 9px; color: var(--dim); }
.mini:hover { color: var(--ink); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.lcard {
  background: var(--paper); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 16px; cursor: pointer; text-align: left;
}
.lcard:hover { border-color: #b9b8b2; }
.lcard h3 { margin: 4px 0 6px; font-size: 16px; }
.draft { font-size: 12px; color: var(--dim); }

/* ── 게시글 ── */
.paper {
  background: var(--paper); border: 1px solid var(--line); border-radius: 12px;
  padding: 22px 26px;
}
.blk { margin: 0 0 20px; }
.ln { margin: 0; font-size: 17px; line-height: 1.85; white-space: pre-wrap; }
.c-blue { color: var(--sec-blue); }
.c-red { color: var(--sec-red); }
.c-teal { color: var(--sec-teal); }

/* ── 성취기준 ── */
.std { margin-top: 10px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.stdrow { display: grid; grid-template-columns: 34px 1fr 52px; align-items: center; gap: 10px;
  padding: 9px 12px; border-bottom: 1px solid var(--line); font-size: 14px; }
.stdrow:last-child { border-bottom: none; }
.stdrow .g { font-weight: 700; color: var(--dim); }
.stdrow .d { line-height: 1.5; }
.stdrow .s { color: var(--dim); text-align: right; white-space: nowrap; }

/* ── 답칸 ── */
.ask { border-left: 3px solid var(--line); padding: 4px 0 4px 14px; margin: 12px 0 18px; }
.ask.red { border-left-color: var(--red-dot); }
.ask.drop { outline: 2px dashed var(--ink); outline-offset: 4px; border-radius: 8px; }
.ask .row { margin-top: 8px; }

/* ── 친구들 답 팝업 ── */
.overlay { position: fixed; inset: 0; z-index: 50; padding: 16px;
  background: rgba(0, 0, 0, 0.45); display: flex; align-items: center; justify-content: center; }
.modal { background: var(--paper); border-radius: 14px; padding: 18px 20px;
  width: 100%; max-width: 900px; max-height: 85vh; overflow: auto; }
.modalhead { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 4px; }
.modalhead button { flex: 0 0 auto; }

/* ── 보드 ── */
.board { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; align-items: start; }
.card {
  background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 11px 13px;
}
.card .who { display: flex; justify-content: space-between; font-size: 12px; color: var(--dim); margin-bottom: 5px; }
/* 학생별 보기(보드 마지막 탭) — 학생이 세로 열, 그 아래 발문별 답을 쌓는다.
   24명이 가로 한 줄로 넘치지 않게 격자로 자동 줄바꿈(세로 스크롤). */
.stu-cols { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; align-items: start; }
.stu-col { display: flex; flex-direction: column; gap: 10px; }
.stu-colhead { font-size: 15px; font-weight: 700; text-align: center;
  border: 1px solid var(--line); border-radius: 8px; padding: 8px; background: var(--paper); }
.stu-box { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--paper); }
.stu-box .stu-qtext { font-size: 12px; color: var(--dim); margin: 0 0 5px; }
.stu-box.red { background: var(--red-bg); border-color: var(--red-bd); }
.stu-box.purple { background: var(--pur-bg); border-color: var(--pur-bd); }
.stu-box.green { background: var(--grn-bg); border-color: var(--grn-bd); }
.stu-box.blue { background: var(--blu-bg); border-color: var(--blu-bd); }
.card p { margin: 0; font-size: 15px; line-height: 1.6; }
.card .was { color: var(--dim); text-decoration: line-through; font-size: 13px; margin-bottom: 5px; }
.card .fb { margin-top: 8px; padding-top: 7px; border-top: 1px solid var(--line); font-size: 13px; }

/* 대화 기록 — 학생 답과 교사 피드백이 오간 과정 */
/* 보드 상단: 발문 + 「모두에게 보이기」를 한 줄에 */
.board-head { display: flex; align-items: flex-start; gap: 12px; }
.board-head .bq { margin: 0; flex: 1; min-width: 0; }
.reveal-btn { flex: none; white-space: nowrap; }
.thread { margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--line);
  display: flex; flex-direction: column; gap: 6px; }
.thread .tturn { display: flex; gap: 6px; font-size: 13px; line-height: 1.5; }
.thread .tw { flex: 0 0 auto; height: fit-content; font-size: 11px; color: var(--dim);
  background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; }
.thread .tt { flex: 1; white-space: pre-wrap; }

/* 내용+편집버튼을 세로로 담아, 편집버튼이 글 밑에 오고 말풍선이 넓게 퍼진다 */
.thread .tbody { flex: 1; min-width: 0; }
/* 교사 피드백 말풍선 — 색 이름 배지 + 그 색으로 칠해 학생이 결과를 한눈에 본다 */
.thread .tmsg { display: inline-block; max-width: 100%; border-radius: 9px; padding: 6px 9px; border: 1px solid var(--line); }
.thread .fblabel { display: inline-block; font-weight: 700; font-size: 11px; padding: 1px 8px;
  border-radius: 999px; margin-right: 6px; background: var(--dim); color: #fff; }
.thread .fbtext { white-space: pre-wrap; }
.thread .tmsg.red { background: var(--red-bg); border-color: var(--red-bd); color: var(--red-fg); }
.thread .tmsg.red .fblabel { background: var(--red-dot); }
.thread .tmsg.purple { background: var(--pur-bg); border-color: var(--pur-bd); color: var(--pur-fg); }
.thread .tmsg.purple .fblabel { background: var(--pur-dot); }
.thread .tmsg.green { background: var(--grn-bg); border-color: var(--grn-bd); color: var(--grn-fg); }
.thread .tmsg.green .fblabel { background: var(--grn-dot); }
.thread .tmsg.blue { background: var(--blu-bg); border-color: var(--blu-bd); color: var(--blu-fg); }
.thread .tmsg.blue .fblabel { background: var(--blu-dot); }

/* 자기가 쓴 대화 턴 고치기·지우기 — 글 밑에 붙는다 */
.thread .tturn:hover .tctl { opacity: 1; }
.thread .tctl { display: flex; gap: 6px; margin-top: 4px; opacity: .6; }
.thread .tctl-b { padding: 1px 7px; font-size: 11px; line-height: 1.4; border-radius: 6px; color: var(--dim); }
/* 이름표(선생님/학생) + ⋯ 메뉴를 왼쪽에 세로로 — 말풍선(글)이 넓게 쓰이게 */
.thread .tside { display: flex; flex-direction: column; gap: 5px; flex: none; align-items: flex-start; }
/* 대화 턴 ⋯ 메뉴(고치기·삭제) */
.thread .tmenu { position: relative; }
/* 학생 답: ⋯ 를 글 바로 뒤에 붙인다(글 길이에 따라 함께 이동, 글을 가리지 않게). */
.thread .tmenu-r { display: inline-block; vertical-align: middle; margin-left: 4px; }
.thread .tmenu-btn { height: 22px; min-width: 24px; padding: 0 6px; font-size: 15px; line-height: 1;
  color: var(--dim); border: 1px solid var(--line); border-radius: 6px; background: var(--paper); }
.thread .tmenu-btn:hover { color: var(--ink); border-color: var(--red-bd); }
.thread .tmenu-pop { position: absolute; left: 0; top: calc(100% + 3px); z-index: 60; display: none;
  flex-direction: column; gap: 2px; min-width: 104px; padding: 4px;
  background: var(--paper); border: 1px solid var(--line); border-radius: 9px; box-shadow: 0 8px 20px rgba(0,0,0,.14); }
.thread .tmenu-pop.open { display: flex; }
.thread .tmenu-item { text-align: left; font-size: 13px; padding: 7px 9px; border: none; background: transparent; border-radius: 6px; color: var(--ink); }
.thread .tmenu-item:hover { background: var(--bg); }
.thread .tmenu-item.danger { color: var(--red-fg); }
.thread .tmenu-item.danger:hover { background: var(--red-bg); }
.thread .tedit { flex: 1; }
.thread .tedit-in { width: 100%; min-height: 34px; resize: none; overflow: hidden; line-height: 1.4; font-size: 13px; }

/* 피드백 칸 — 엔터는 줄바꿈. 여러 줄 쓰면 잘리지 않고 늘어난다. 칸 안 세로 가운데 ➤ 버튼으로 보낸다 */
.fb-wrap { position: relative; margin-top: 8px; }
.fb-in { width: 100%; min-height: 38px; resize: none; overflow: hidden; line-height: 1.4; padding-right: 44px; }
.ans-in { min-height: 48px; }
.fb-send { position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  padding: 3px 9px; font-size: 13px; line-height: 1;
  border-radius: 6px; background: var(--ink); color: #fff; border-color: var(--ink); }
.fb-send:hover { background: #333; }
.ai-btn { font-size: 12px; padding: 3px 9px; line-height: 1.2; white-space: nowrap; border-color: var(--pur-bd); color: var(--pur-fg); background: var(--pur-bg); }
.ai-btn:hover { background: #e5e3fb; }
.ai-btn:disabled { opacity: .6; }
/* 색 줄 오른쪽 끝에 AI 제안 */
.picker .ai-btn { margin-left: auto; align-self: center; }
/* AI 제안 색 안내 — 색 줄 바로 아래, 내용 없으면 숨김 */
.ai-note { font-size: 12px; color: var(--dim); margin: 0 0 8px; }
.ai-note:empty { display: none; }
.thread .tt .dot { width: 9px; height: 9px; margin-right: 5px; vertical-align: middle; }

.card.red { background: var(--red-bg); border-color: var(--red-bd); }
.card.red p, .card.red .who, .card.red .fb { color: var(--red-fg); }
.card.purple { background: var(--pur-bg); border-color: var(--pur-bd); }
.card.purple p, .card.purple .who, .card.purple .fb { color: var(--pur-fg); }
.card.green { background: var(--grn-bg); border-color: var(--grn-bd); }
.card.green p, .card.green .who, .card.green .fb { color: var(--grn-fg); }
.card.blue { background: var(--blu-bg); border-color: var(--blu-bd); }
.card.blue p, .card.blue .who, .card.blue .fb { color: var(--blu-fg); }

/* 색 고르기 동그라미 넷 + AI 제안을 한 줄에(카드 폭을 넘지 않게 dot·gap을 알맞게). */
.picker { display: flex; gap: 6px; margin-top: 10px; flex-wrap: nowrap; align-items: center; }
.sc { width: 28px; height: 28px; flex: none; padding: 0; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center; }
.sc .dot { width: 15px; height: 15px; }
.sc.on { border-color: var(--ink); border-width: 2px; }
.dot { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }
.d-red { background: var(--red-dot); } .d-purple { background: var(--pur-dot); }
.d-green { background: var(--grn-dot); } .d-blue { background: var(--blu-dot); }
.d-none { background: var(--bg); border: 1px solid #cfcec9; }

/* 카운터는 색과 숫자만 — 이름은 툴팁과 화면 낭독기로만 */
.tally { display: flex; gap: 16px; align-items: center; margin: 6px 0 16px; }
.tally span { display: flex; align-items: center; gap: 7px; font-size: 15px; color: var(--dim); }
.tally .dot { width: 14px; height: 14px; }

/* 발문 탭 — 지금 보고 있는 보드를 진한 테두리·굵은 글씨로 짚어 준다.
   피드백 네 색과 헷갈리지 않게 중립색을 쓴다. */
/* 발문 탭 chips — 질문 전체가 잘리지 않게 필요한 만큼 여러 줄로 펼치고, 폭만 제한해 가지런히. */
.tabs.row { align-items: stretch; } /* 여러 줄 버튼끼리 높이를 맞춰 정렬 */
.tabs button.qtab {
  font-size: 12.5px; line-height: 1.4; text-align: left; white-space: normal;
  max-width: 190px; padding: 7px 12px;
}
.tabs button.on {
  border-color: var(--ink); border-width: 2px; font-weight: 700;
  background: var(--bg); padding: 6px 13px; /* 2px 테두리로 어긋나는 높이 보정 */
}
.tabs button.qtab.on { padding: 6px 11px; } /* 2px 테두리 높이 보정 */

.live { font-size: 13px; color: var(--grn-fg); display: flex; align-items: center; gap: 6px; }
.live .dot { width: 7px; height: 7px; background: var(--grn-dot); }

/* ── 편집기 ── */
.eblk { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; }
.eblk.focus { border-color: #9a9992; }
/* 사진을 끌고 왔을 때 — 여기 아래로 들어간다는 표시 */
.eblk.drop { border-color: var(--ink); box-shadow: 0 2px 0 0 var(--ink); }
.eblk.dragover { border-color: var(--ink); box-shadow: 0 -3px 0 0 var(--ink); }
.eblk header { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.eblk header .del { margin-left: auto; }
.eblk header .heading { flex: 1; min-width: 140px; font-weight: 700; }
.eblk header .grow { flex: 1; }
.drag { cursor: grab; padding: 5px 9px; color: var(--dim); }
.drag:active { cursor: grabbing; }
/* 수업 사진 — 업로드 크기가 달라도 화면에선 가로를 고정해 크기를 맞춘다. 세로는 비율대로(왜곡 없음). */
.pic { display: block; width: 520px; max-width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--line); margin: 6px 0; }
.pick { display: inline-block; font-size: 14px; padding: 7px 14px; border: 1px solid #cfcec9;
  background: var(--paper); border-radius: 8px; cursor: pointer; }
.pick:hover { background: #f2f1ec; }

/* 성취기준 학년(군) 선택 — 좁게 */
.stdgrade { width: auto; max-width: 100%; font-size: 14px; }

/* 블럭 색 — 스와치 드롭다운. 지금 색 동그라미만 보이고, 누르면 나머지 색이 펼쳐진다 */
.d-c-blue { background: var(--sec-blue); } .d-c-red { background: var(--sec-red); }
.d-c-teal { background: var(--sec-teal); } .d-c-black { background: var(--ink); }
.cdrop { position: relative; flex: 0 0 auto; }
.cdrop-btn { display: inline-flex; align-items: center; gap: 5px; padding: 6px 9px; }
.cdrop-btn .dot { width: 15px; height: 15px; }
.cdrop-btn .caret { font-size: 10px; color: var(--dim); }
.cdrop-menu { display: none; position: absolute; top: calc(100% + 4px); right: 0; z-index: 20;
  background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 6px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .12); gap: 4px; }
.cdrop-menu.open { display: flex; }
.cdrop-opt { width: 30px; height: 30px; padding: 0; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center; }
.cdrop-opt .dot { width: 16px; height: 16px; }
.cdrop-opt.on { border-color: var(--ink); border-width: 2px; }

/* 학생이 답에 올린 사진 — 카드·대화에서 썸네일로 */
.ans-pic { max-width: min(100%, 220px); max-height: 220px; width: auto; }
.thread .tt .ans-pic { display: block; margin-top: 4px; }

/* 답 입력창 — 클로드 입력창처럼 테두리 박스 하나에 사진칩 → 글 → [📷 · ➤] 액션바.
   붙여넣기·드롭한 사진이 박스 '안'에 썸네일 칩으로 들어간다. */
.composer { border: 1px solid var(--line); border-radius: 12px; background: var(--paper); padding: 8px 10px; }
.composer:focus-within { border-color: #9a9992; }
.composer .in-photo { display: flex; flex-wrap: wrap; gap: 8px; }
.composer .in-photo:not(:empty) { margin-bottom: 8px; }
.photo-chip { position: relative; display: inline-block; }
.photo-chip img { display: block; height: 56px; width: auto; max-width: 110px; object-fit: cover;
  border-radius: 8px; border: 1px solid var(--line); }
.chip-x { position: absolute; top: -7px; right: -7px; width: 20px; height: 20px; padding: 0;
  border-radius: 50%; background: var(--ink); color: #fff; border: 1px solid var(--paper);
  font-size: 13px; line-height: 1; display: flex; align-items: center; justify-content: center; }
.composer-in { width: 100%; border: none; background: transparent; resize: none; overflow: hidden;
  min-height: 44px; padding: 2px; line-height: 1.5; }
.composer-in:focus { outline: none; }
.composer-actions { display: flex; align-items: center; gap: 8px; margin-top: 2px; }
.composer-actions .grow { flex: 1; }
.composer-send { background: var(--ink); color: #fff; border-color: var(--ink); padding: 5px 14px; border-radius: 8px; }
.composer-send:hover { background: #333; }
.ask.drop .composer { border-color: var(--ink); border-style: dashed; }

/* 블럭 안 항목 줄(줄·사진·링크·파일) */
.eitem { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.eitem.col { display: block; }
/* 블럭 안 항목: ⠿ 손잡이 + 내용(끌어서 순서 바꾸기) */
.eitems { display: flex; flex-direction: column; }
.blk-item { display: flex; align-items: flex-start; gap: 4px; }
.blk-item > .eitem, .blk-item > .eitem.col { flex: 1; min-width: 0; }
.blk-item .item-drag { flex: none; margin-top: 6px; font-size: 13px; }
.blk-item.dragging { opacity: .6; }
.eitem .grow { flex: 1; }
.eitem label { font-size: 12px; color: var(--dim); white-space: nowrap; display: flex; align-items: center; gap: 4px; }
.itag { font-size: 11px; color: var(--dim); background: var(--bg); border: 1px solid var(--line);
  border-radius: 6px; padding: 3px 7px; white-space: nowrap; }

/* 블럭 붙이는 위젯 — 스크롤을 따라다닌다 */
.addwidget { position: fixed; right: 18px; top: 50%; transform: translateY(-50%);
  display: flex; flex-direction: column; gap: 8px; z-index: 30; width: 162px;
  background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 12px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .1); }
.addwidget button { width: 100%; white-space: nowrap; letter-spacing: -0.02em; }
.addwidget .hint { font-size: 11px; color: var(--dim); line-height: 1.4; margin: 2px 0 0; }
.addwidget .wsep { border-top: 1px solid var(--line); margin: 4px 0 0; }
.addwidget .wmsg { font-size: 11px; text-align: center; min-height: 14px; }
@media (max-width: 1000px) {
  .addwidget { position: sticky; top: auto; right: auto; transform: none; width: auto;
    flex-direction: row; flex-wrap: wrap; align-items: center; margin: 14px 0; box-shadow: none; }
  .addwidget button { width: auto; }
  .addwidget .hint { width: 100%; }
}
/* 자주 가는 사이트 여는 위젯 — 「+블럭」의 왼쪽 짝. 스크롤 따라다닌다. */
.leftwidget { position: fixed; left: 18px; top: 50%; transform: translateY(-50%);
  z-index: 30; width: 120px; }
.leftwidget button { width: 100%; }
@media (max-width: 1000px) {
  .leftwidget { position: sticky; top: auto; left: auto; transform: none; width: auto; margin: 0 0 12px; }
  .leftwidget button { width: auto; }
}

.eline { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.eline label { font-size: 12px; color: var(--dim); white-space: nowrap; display: flex; align-items: center; gap: 4px; }
.fields { display: grid; grid-template-columns: 120px minmax(140px, 1fr) 80px 150px; gap: 10px; }
.fld label { display: block; font-size: 12px; color: var(--dim); margin-bottom: 4px; }
@media (max-width: 560px) { .fields { grid-template-columns: 1fr 1fr; } }
