: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=email], input[type=number], 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-clickable { cursor: pointer; border-radius: 8px; transition: opacity .12s; }
.tb-clickable:hover { opacity: .65; }
.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; }

/* 수업 시작(교사) 화면 헤더 — 수업 주제 크게 가운데 */
.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; }
.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); }
/* 자유응답 낱말 구름 */
.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 2px 10px rgba(0,0,0,.04); font-size: 12px; }
.dash-title { font-weight: 800; font-size: 13px; margin-bottom: 6px; }
.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; }

/* ── 수업 목록 ── */
/* 과목 탭 — 먼저 과목을 고른다 */
.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; }
/* 「전체」 탭에서 과목 제목 */
.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; }
/* 공유 모음에서 내 수업 내리기(오른쪽 위) */
.gal-del { position: absolute; top: 8px; right: 8px; z-index: 2; padding: 4px 7px; }
/* 공유 수업 모음 검색 바 */
.gal-search { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 16px; }
.gal-search select, .gal-search input { width: auto; min-width: 120px; font-size: 14px; padding: 7px 10px; }
.gal-search input { flex: 0 1 200px; }
.gal-count { margin-left: auto; white-space: nowrap; }

/* 드래그 중: 집어 든 항목은 파란 점선 테두리로 또렷하게(놓일 자리에 실시간으로 옮겨 다닌다) */
.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); }
/* 수업 카드 아이콘 버튼 한 줄 */
.lcard-actions { margin-top: 10px; gap: 6px; flex-wrap: wrap; }
.icon-btn { padding: 6px 9px; font-size: 15px; line-height: 1; display: inline-flex; align-items: center; justify-content: center; min-width: 38px; }
.icon-btn img, .icon-btn svg { display: block; }
/* 공유 중인 수업(📤) — 초록으로 표시 */
.icon-btn.shared-on { background: var(--grn-bg); border-color: var(--grn-bd); }
.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 { 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: 122px; }
  #sitesFixed { display: none; }
  #navFixed { position: fixed; left: 0; right: 0; bottom: 0; top: auto; transform: none;
    width: auto; border: none; border-top: 1px solid var(--line); border-radius: 0;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, .08); background: var(--paper);
    flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 6px;
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px));
    max-height: 44vh; overflow-y: auto; }
  #navFixed button { width: auto; }
  #navFixed .wsep { display: none; }
}
/* 폰 가로(회전): 화면이 짧으니 툴바를 한 줄(가로 스크롤)로, 본문 아래 여백도 줄인다. */
@media (max-width: 1000px) and (orientation: landscape) {
  main.shell { padding-bottom: 74px; }
  #navFixed { flex-wrap: nowrap; overflow-x: auto; overflow-y: visible; justify-content: flex-start; }
  #navFixed button { flex: 0 0 auto; }
}
/* 과목·단원 관리용 작은 버튼 */
.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; }

/* 대화 기록 — 학생 답과 교사 피드백이 오간 과정 */
.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 .tleft { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; flex: 0 0 auto; }
.tmenu { position: relative; }
.tmenu-inline { display: inline-block; vertical-align: middle; margin-left: 2px; }
.tmenu-btn { border: none; background: transparent; color: var(--dim); font-size: 17px; line-height: 1; padding: 0 6px; border-radius: 6px; }
.tmenu-btn:hover { background: rgba(0, 0, 0, .07); color: var(--ink); }
.tmenu-pop { display: none; position: absolute; top: 100%; left: 0; z-index: 40; min-width: 104px;
  background: var(--paper); border: 1px solid var(--line); border-radius: 9px; box-shadow: 0 6px 22px rgba(0, 0, 0, .14); padding: 4px; }
.tmenu-pop.open { display: block; }
.tmenu-item { display: block; width: 100%; text-align: left; border: none; background: transparent;
  padding: 8px 11px; font-size: 13px; border-radius: 6px; color: var(--ink); }
.tmenu-item:hover { background: #f2f1ec; }
.tmenu-item.del { color: var(--red-fg); }
.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 8px; border-color: var(--pur-bd); color: var(--pur-fg); background: var(--pur-bg); white-space: nowrap; align-self: center; }
.ai-btn:hover { background: #e5e3fb; }
.ai-btn:disabled { opacity: .6; }
.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); }

/* 색 고르기는 동그라미 넷을 한 줄에. 이름은 title·aria-label로만 준다(카운터와 같은 방식). */
.picker { display: flex; gap: 8px; margin-top: 10px; flex-wrap: nowrap; }
.sc { width: 30px; height: 30px; flex: 0 0 30px; padding: 0; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center; }
.sc .dot { width: 16px; height: 16px; }
.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; }

/* 카운터는 색과 숫자만 — 이름은 툴팁과 화면 낭독기로만 */
/* 일괄 색적용 바(보드) — 수업(sueop)과 동일 */
.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; }
.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; }
.sc.sug { outline: 2px dashed var(--sec-blue); outline-offset: 1px; }
.ai-note { font-size: 12px; color: var(--dim); margin: 0 0 8px; }
.ai-note:empty { display: none; }
.miss-line { margin: 3px 0 0; font-size: 12.5px; font-weight: 600; color: #a8660c; }
.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; }
.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); }
.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; }

.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; 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; }
/* 블럭 안 항목 순서 드래그 */
.eitem-wrap { display: flex; align-items: flex-start; gap: 4px; }
.eitem-wrap > .eitem, .eitem-wrap > .eitem.col { flex: 1 1 auto; min-width: 0; }
.ei-drag { flex: 0 0 auto; margin-top: 7px; font-size: 13px; }
.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: 160px;
  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; font-size: 13px; letter-spacing: -0.3px; padding-left: 8px; padding-right: 8px; }
.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: 130px 110px minmax(110px, 1fr) 80px 140px; 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; } }

/* ── 로그인·가입 (게스트 화면) ── */
.auth { max-width: 420px; margin: 8vh auto 0; }
.auth-t { font-size: 20px; margin: 0 0 16px; text-align: center; }
.auth-back { margin-bottom: 10px; font-size: 13px; color: var(--dim); }
.auth-pick { display: grid; gap: 14px; }
.pickcard { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 26px 18px; border: 1px solid var(--line); border-radius: 14px; text-align: center; }
.pickcard:hover { background: #f2f1ec; border-color: #cfcec9; }
.pc-emoji { font-size: 40px; line-height: 1.1; }
.pc-t { font-size: 17px; font-weight: 700; }
.pc-d { font-size: 13px; color: var(--dim); }
/* 로그인 이어서 하기 — 밑의 선택 카드보다 작은 가로형 버튼 */
.pc-cont { display: flex; flex-direction: row; align-items: center; gap: 12px; width: 100%;
  padding: 11px 16px; border: 1px solid #378add; background: #f0f7ff; border-radius: 12px; text-align: left; }
.pc-cont:hover { background: #e4f0ff; border-color: #2b76c4; }
.pc-cont-ico { font-size: 22px; line-height: 1; flex: none; }
.pc-cont-txt { display: flex; flex-direction: column; min-width: 0; }
.pc-cont-txt b { font-size: 15px; font-weight: 700; }
.pc-cont-txt small { font-size: 12px; color: var(--dim); }
.auth-or { text-align: center; font-size: 13px; color: var(--dim); margin: 12px 0 12px; }
/* 데모 체험하기 버튼(선생님이에요 밑) */
.pc-demo { display: flex; flex-direction: column; align-items: center; gap: 3px; width: 100%; margin-top: 12px;
  padding: 14px; border: 1px dashed #b48bd8; border-radius: 14px; background: #f7f0fb; color: #5b2a86; font-size: 16px; font-weight: 700; cursor: pointer; }
.pc-demo:hover { background: #f0e4f9; border-color: #9a63c8; }
.pc-demo span { font-size: 12px; font-weight: 400; color: var(--dim); }
.pc-demo:disabled { opacity: .6; cursor: default; }
.pc-demo-stu { margin-top: 8px; border-color: #7fc0d6; background: #eef7fb; color: #185f75; }
.pc-demo-stu:hover { background: #e2f0f7; border-color: #4ba0bd; }
/* 데모 안내 배너(목록) */
.demo-bar { background: #f3e9fb; border: 1px solid #d9bff0; color: #5b2a86; border-radius: 12px; padding: 11px 15px; font-size: 14px; line-height: 1.55; margin: 0 0 14px; }
.demo-bar .db-exit { color: #8a6aa8; }

/* ── AI 튜터(챗봇) 플로팅 위젯 — 수업(sueop)과 동일 ── */
#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(--paper, #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; }
.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; }
/* 수업 화면 셸의 학생 튜터 토글(초록=켜짐 / 빨강=꺼짐) */
.tutor-tgl { border-color: var(--grn-bd); color: var(--grn-fg); background: var(--grn-bg); font-weight: 700; }
.tutor-tgl:hover { background: #e0efd0; }
.tutor-tgl.tgl-off { border-color: var(--red-bd); color: var(--red-fg); background: var(--red-bg); }
.tutor-tgl.tgl-off:hover { background: #fbe0e0; }
.tutor-toggle { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; }
.tutor-toggle input { width: 18px; height: 18px; flex: none; cursor: pointer; }
@media (max-width: 520px) {
  #tutorPanel { right: 8px; left: 8px; width: auto; bottom: 78px; height: min(70vh, 520px); }
  #tutorFab { right: 12px; bottom: 12px; }
}

/* 아이콘 버튼 등에 마우스 올리면 즉시 뜨는 툴팁 */
.hovertip {
  position: fixed; z-index: 3000; pointer-events: none;
  background: #1a1a18; color: #fff; font-size: 12px; font-weight: 600; line-height: 1.4;
  padding: 5px 9px; border-radius: 7px; max-width: 240px; text-align: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .25);
  opacity: 0; transform: translateY(2px); transition: opacity .1s ease, transform .1s ease;
}
.hovertip.show { opacity: 1; transform: translateY(0); }

/* 처음 사용 안내(코치마크 튜토리얼) */
.tour-ov { position: fixed; inset: 0; z-index: 9998; }
.tour-spot { position: fixed; border-radius: 10px; border: 3px solid #378add; box-shadow: 0 0 0 9999px rgba(17,17,17,.55); transition: top .2s, left .2s, width .2s, height .2s; pointer-events: none; }
.tour-tip { position: fixed; z-index: 10000; background: #fff; color: #222; border-radius: 12px; padding: 14px 16px; box-shadow: 0 10px 34px rgba(0,0,0,.3); box-sizing: border-box; max-width: calc(100vw - 24px); }
.tt-step { font-size: 12px; color: #378add; font-weight: 700; margin-bottom: 4px; }
.tt-title { font-size: 16px; font-weight: 800; margin-bottom: 6px; }
.tt-text { font-size: 13.5px; line-height: 1.55; color: #444; }
.tt-btns { display: flex; align-items: center; gap: 8px; margin-top: 14px; }
.tt-grow { flex: 1 1 auto; }
.tour-tip button { padding: 7px 12px; border-radius: 8px; border: 1px solid var(--line); background: #fff; font-size: 13px; cursor: pointer; }
.tour-tip button.primary { background: #378add; border-color: #378add; color: #fff; font-weight: 700; }
.tt-skip { color: #888; }
.auth-in { text-align: center; letter-spacing: 4px; font-size: 22px !important; text-transform: uppercase; margin-bottom: 12px; }
.auth-go { width: 100%; }
.auth-form { display: grid; gap: 12px; margin-bottom: 14px; }
.auth-form input { width: 100%; }
.auth-switch { text-align: center; font-size: 14px; color: var(--dim); margin-top: 14px; }
.auth-switch a { color: var(--sec-blue); cursor: pointer; text-decoration: underline; }
/* 번호 고르기 그리드 */
.numgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(74px, 1fr)); gap: 8px; }
.numbtn { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 4px; border-radius: 10px; }
.numbtn:hover { background: #eef4fb; border-color: #85b7eb; }
.nb-no { font-size: 18px; font-weight: 700; }
.nb-name { font-size: 12px; color: var(--dim); }

/* ── 반 코드 배너(교사 목록 상단) ── */
.codebar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; margin: 0 0 14px;
  background: #eef4fb; border: 1px solid #cfe0f3; border-radius: 12px; }
.cb-label { font-size: 13px; color: var(--dim); }
.cb-code { font-size: 22px; font-weight: 800; letter-spacing: 3px; color: var(--sec-blue); }
.cb-hint { font-size: 12px; color: var(--dim); }

/* ── 설정 모달 ── */
.setmodal { max-width: 560px; }
.setsec { padding: 16px 0; border-top: 1px solid var(--line); }
.setsec:first-of-type { border-top: none; }
.setsec-t { font-size: 15px; margin: 0 0 10px; }
.setin { width: 100%; }
.setsec .fld { margin-bottom: 10px; }
.setsec .primary { margin-top: 4px; }
.bigcode { font-size: 30px; font-weight: 800; letter-spacing: 5px; color: var(--sec-blue); margin: 0 0 10px; }
/* 복구 코드(XXXX-XXXX-XXXX-XXXX) — bigcode보다 길어서 작게, 가운데, 줄바꿈 허용 */
.reccode { font-size: 22px; font-weight: 800; letter-spacing: 2px; color: var(--sec-blue); text-align: center;
  background: #eef4fb; border: 1px dashed #a9cbee; border-radius: 10px; padding: 12px 10px; word-break: break-all; }
.namegrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin-bottom: 12px; max-height: 240px; overflow: auto; padding-right: 4px; }
.namecell { display: flex; align-items: center; gap: 6px; }
.namelbl { font-size: 13px; color: var(--dim); width: 22px; text-align: right; flex: none; }
.idcell { display: flex; flex-direction: column; gap: 3px; border: 1px solid var(--line); border-radius: 8px; padding: 6px 7px; }
.idhead { font-size: 12px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.idcell .setin { font-size: 14px; padding: 5px 7px; letter-spacing: 1px; }
.stdadd { display: grid; gap: 6px; margin-top: 8px; padding: 10px; background: #faf9f5; border: 1px solid var(--line); border-radius: 10px; }

/* 자주 가는 사이트 — 앱 안 모달(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); }
