/* Robo Helper v2 — 공통 스타일 시안 (격리 폴더 전용 · 운영 미반영 · 교사 확인 전 초안) */
.rb2, .rb2 * { box-sizing: border-box; }
.rb2 { font-family: "Malgun Gothic","Apple SD Gothic Neo","Noto Sans KR",system-ui,sans-serif; color: #1F2A37; }
.rb2 [hidden] { display: none !important; }
.rb2 button, .rb2 input { font-family: inherit; }

/* 아이콘 (패널 아래 여백 84px = 아이콘 56px + 간격 12px + 바닥 16px) */
.rb2-fab { position: fixed; right: 16px; bottom: 16px; width: 56px; height: 56px; border-radius: 50%; border: none; background: #2E7D6B; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 14px rgba(31,42,55,.3); cursor: pointer; z-index: 2147483000; }
.rb2-fab:focus-visible, .rb2 button:focus-visible, .rb2 input:focus-visible { outline: 3px solid #1B5BD6; outline-offset: 2px; }

/* 패널: 높이 상한 대체값 4단 (아래 줄이 지원되는 브라우저에서만 위 줄을 덮어씀) */
.rb2-panel { position: fixed; right: 16px; bottom: 84px; width: 372px; max-width: calc(100vw - 24px);
  height: 540px;
  height: calc(100vh - 100px);
  height: min(560px, calc(100vh - 100px));
  height: min(548px, calc(100dvh - 100px));
  display: flex; flex-direction: column; background: #FFFDF8; border: 1px solid #C9CDC4; border-radius: 16px; overflow: hidden; box-shadow: 0 8px 28px rgba(31,42,55,.22); z-index: 2147483001; }
@media (max-width: 480px) { .rb2-panel { right: 8px; width: calc(100vw - 16px); } }

.rb2-head { flex: 0 0 auto; min-height: 56px; height: auto; display: flex; align-items: flex-start; gap: 6px; padding: 7px 4px 7px 12px; background: #2E7D6B; color: #fff; }
.rb2-name { flex: 0 0 auto; font-size: 16px; font-weight: 700; line-height: 1.2; white-space: nowrap; }
.rb2-hs { flex-direction: column; align-items: flex-start; gap: 1px; }
.rb2-hs > span:first-child { overflow: visible; text-overflow: clip; white-space: nowrap; }
.rb2-close { width: 44px; height: 44px; border: none; background: transparent; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.rb2-task { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 12px; background: #E8F3EF; border-bottom: 1px solid #CFE3DC; }
.rb2-task-txt { min-width: 0; flex: 1 1 auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; font-weight: 700; color: #1F4E43; }
.rb2-pill { flex: 0 0 auto; white-space: nowrap; font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 999px; border: 1px solid #2E7D6B; background: #fff; color: #1F4E43; }
.rb2-pill.off { background: #EEF0EC; color: #3F4650; border-color: #C9CDC4; }
.rb2-pill.limit, .rb2-pill.bad { background: #FFF4E0; color: #7A3E06; border-color: #F0C36D; }

.rb2-body { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.rb2-chat { flex: 1 1 120px; min-height: 120px; overflow-y: auto; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.rb2-row { display: flex; flex-direction: column; gap: 3px; }
.rb2-row.me { align-items: flex-end; }
.rb2-row.bot { align-items: flex-start; }
.rb2-bub { max-width: 88%; padding: 8px 11px; font-size: 15px; line-height: 1.45; white-space: pre-line; overflow-wrap: anywhere; }
.rb2-greet-bub { max-width: 100%; font-size: 14px; white-space: nowrap; overflow-wrap: normal; }
.rb2-row.bot .rb2-bub { background: #fff; border: 1px solid #D5D9D2; border-radius: 12px 12px 12px 4px; }
.rb2-row.me .rb2-bub { background: #2E7D6B; color: #fff; border: 1px solid #2E7D6B; border-radius: 12px 12px 4px 12px; }
.rb2-note { font-size: 12px; color: #5B6470; padding: 0 4px; }

.rb2-ctrl { flex: 0 1 auto; max-height: 68%; overflow-y: auto; padding: 8px 10px 0; display: flex; flex-direction: column; gap: 7px; border-top: 1px solid #E3E6DF; background: #FFFDF8; }
.rb2-ht { min-width: 0; flex: 1 1 auto; }
.rb2-hs { min-width: 0; display: flex; align-items: center; gap: 6px; }
.rb2-hs > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rb2-hs { flex-direction: column; align-items: flex-start; gap: 1px; }
.rb2-hs > span:first-child { flex: 0 0 auto; max-width: 100%; overflow: visible; text-overflow: clip; white-space: nowrap; }
.rb2-key-bub { background: #E8F3EF; border-color: #B9D8CB; }
.rb2-key-bub strong { font-weight: 800; color: #1F4E43; }
.rb2-reward { min-width: 0; border: 1px solid #CFE3DC; border-radius: 10px; background: #F4FBF7; padding: 7px 9px; color: #1F4E43; overflow-wrap: anywhere; }
.rb2-reward-line { font-weight: 800; font-size: 14px; }
.rb2-sticker-title { font-weight: 700; font-size: 13px; margin-top: 3px; }
.rb2-stickers { display: flex; flex-wrap: wrap; gap: 6px; font-size: 12px; margin-top: 4px; }
.rb2-reward-note, .rb2-experience { font-size: 11px; line-height: 1.35; color: #5B6470; }
.rb2-experience { padding: 6px 2px 8px; }
.rb2-banner { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 10px; font-size: 13px; line-height: 1.4; font-weight: 500; background: #EEF0EC; color: #2F3640; border: 1px solid #C9CDC4; }
.rb2-banner.warn { background: #FFF4E0; color: #7A3E06; border-color: #F0C36D; }
.rb2-banner span { flex: 1 1 auto; }
.rb2-retry { flex: 0 0 auto; min-height: 44px; padding: 0 10px; border-radius: 8px; border: 1.5px solid #7A3E06; background: #fff; color: #7A3E06; font-size: 13px; font-weight: 700; cursor: pointer; }
.rb2-btns { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 6px; }
.rb2-btn { min-height: 64px; padding: 5px 6px; border-radius: 10px; border: 1.5px solid #2E7D6B; background: #fff; color: #1F4E43; font-size: 14px; font-weight: 700; line-height: 1.25; display: flex; flex-direction: column; align-items: center; justify-content: center; cursor: pointer; word-break: keep-all; overflow-wrap: normal; }
.rb2-btn small { font-size: 11px; font-weight: 500; }
.rb2-btn:last-child { border-width: 2px; background: #E8F3EF; box-shadow: 0 0 0 2px rgba(46,125,107,.12); }
.rb2-btn:last-child small { font-size: 12px; font-weight: 800; color: #0E6B58; }
.rb2-one-line-callout { font-size: 12px; font-weight: 800; color: #0E6B58; margin-top: 2px; }
.rb2-btn:disabled { background: #F1F2EE; border-color: #C9CDC4; color: #5B6470; cursor: not-allowed; }
.rb2-chips { display: flex; gap: 6px; }
.rb2-chip { flex: 1 1 0; min-height: 44px; border: none; border-radius: 999px; background: #E8F3EF; color: #1F4E43; font-size: 14px; font-weight: 700; cursor: pointer; }
.rb2-chip:disabled { background: #F1F2EE; color: #5B6470; cursor: not-allowed; }
.rb2-bottom { position: sticky; bottom: 0; background: #FFFDF8; padding: 4px 0 8px; display: flex; flex-direction: column; gap: 5px; }
.rb2-inrow { display: flex; gap: 5px; }
.rb2-in { flex: 1 1 auto; min-width: 0; height: 44px; padding: 0 10px; font-size: 16px; border-radius: 10px; border: 1.5px solid #8A9189; background: #fff; color: #1F2A37; }
.rb2-in:disabled { background: #F1F2EE; }
.rb2-send { flex: 0 0 40px; width: 40px; height: 40px; border: none; border-radius: 10px; background: #2E7D6B; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.rb2-send:disabled { background: #9AA19A; cursor: not-allowed; }
.rb2-cap { font-size: 12px; line-height: 1.4; color: #5B6470; }

/* 가로 화면(짧은 높이): 패널 너비를 화면에 맞게 넓히고 2단 배치 */
@media (orientation: landscape) and (max-height: 480px) {
  .rb2-panel { top: auto; bottom: 68px; right: 8px; left: auto; width: min(372px, calc(100vw - 16px)); max-width: calc(100vw - 16px); height: min(548px, calc(100vh - 84px)); }
  .rb2-head { min-height: 64px; }
  .rb2-body { display: flex; }
  .rb2-chat { min-height: 120px; flex: 1 1 120px; }
  .rb2-ctrl { max-height: 68%; border-top: 1px solid #E3E6DF; border-left: none; }
  .rb2-btn { min-height: 60px; }
  .rb2.rb2-is-open .rb2-fab { display: none; }
}
@media (max-width: 390px) {
  .rb2-panel { right: 8px; bottom: 68px; width: calc(100vw - 16px); max-width: calc(100vw - 16px); height: min(548px, calc(100dvh - 84px)); }
  .rb2-btn { min-width: 0; overflow-wrap: anywhere; }
}

/* 시안 도구 막대 (실제 화면 아님 · ?bar=0 으로 숨김) */
.rb2-bar { position: fixed; left: 8px; top: 8px; z-index: 2147483002; background: #1F2A37; color: #F4F1EA; font-size: 12px; padding: 5px 8px; border-radius: 8px; display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; max-width: calc(100vw - 16px); }
.rb2-bar a { color: #BFE3D6; text-decoration: underline; padding: 2px 3px; }
.rb2-bar a.on { color: #fff; font-weight: 700; text-decoration: none; background: #2E7D6B; border-radius: 4px; }

/* FINAL 추가: 시연·초안 표시 */
.rb2-draft { flex: 0 0 auto; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: #FFF4E0; color: #7A3E06; border: 1px solid #F0C36D; }

/* G3 teacher-test styling: cleaner local font stack and compact message text; XP rewards stay visible. */
.rb2 {
  font-family: "Pretendard", "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
}
.rb2-name { font-size: 15px; }
.rb2-bub { font-size: 14px; }
.rb2-in { font-size: 15px; }

.rb2-fab img, .rb2-head > img, .rb2-av img { border-radius: 50%; clip-path: circle(50%); }
