/* 1:1 상담 채팅 위젯 — js/chat.js 가 만든다 (비즈하우스/채널톡 스타일, 챗봇 없음) */
.mc-chat-navbadge {
  margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px; box-sizing: border-box;
  border-radius: 9px; background: #ef4444; color: #fff; font-size: 11px; font-weight: 700;
  line-height: 18px; text-align: center; flex-shrink: 0;
}
.mc-chat-panel {
  position: fixed; left: 212px; bottom: 16px; z-index: 8000; width: 390px; height: 610px; max-height: calc(100vh - 36px);
  background: #fff; border-radius: 20px; box-shadow: 0 16px 48px rgba(17, 24, 39, .24); border: 1px solid #e5e7eb;
  flex-direction: column; overflow: hidden; font-family: inherit; transition: width .18s ease, height .18s ease;
}
.mc-chat-panel.wide {
  width: min(780px, calc(100vw - 232px));
  height: min(680px, calc(100vh - 36px));
}
.mc-chat-head {
  display: flex; align-items: center; gap: 6px; padding: 13px 16px;
  background: linear-gradient(135deg, #F2564B 0%, #D8392D 100%); color: #fff; flex-shrink: 0;
}
.mc-chat-head-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.mc-chat-title-row { display: flex; align-items: center; gap: 7px; min-width: 0; }
.mc-chat-title { font-size: 15px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; letter-spacing: -.01em; }
.mc-chat-status-pill {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 99px;
  font-size: 11px; font-weight: 700; background: rgba(255, 255, 255, .2); color: #fff; flex-shrink: 0;
}
.mc-chat-status-dot { width: 7px; height: 7px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 0 2px rgba(74, 222, 128, .35); }
.mc-chat-status-pill.lunch .mc-chat-status-dot { background: #fbbf24; box-shadow: 0 0 0 2px rgba(251, 191, 36, .35); }
.mc-chat-status-pill.offline .mc-chat-status-dot { background: #cbd5e1; box-shadow: none; }
.mc-chat-sub { font-size: 11.5px; color: rgba(255, 255, 255, .88); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mc-chat-hbtn {
  background: transparent; border: 0; color: #fff; font-size: 18px; cursor: pointer;
  padding: 4px 8px; border-radius: 8px; line-height: 1; flex-shrink: 0;
}
.mc-chat-hbtn:hover { background: rgba(255, 255, 255, .18); }
.mc-chat-end { font-size: 11px !important; font-weight: 700; border: 1px solid rgba(255, 255, 255, .65) !important; padding: 5px 8px !important; margin-right: 1px; white-space: nowrap; }

/* 상단 운영시간 안내 배너 (비즈하우스 고객센터 스타일) */
.mc-chat-hours-bar {
  display: flex; align-items: flex-start; gap: 9px; padding: 10px 14px;
  background: #fff8f6; border-bottom: 1px solid #f6dad6; font-size: 12px; line-height: 1.45; color: #4b5563; flex-shrink: 0;
}
.mc-chat-hours-bar.offline { background: #f8fafc; border-bottom-color: #e2e8f0; }
.mc-chat-hours-icon { font-size: 14px; line-height: 1.3; flex-shrink: 0; }
.mc-chat-hours-body { flex: 1; min-width: 0; }
.mc-chat-hours-title { font-weight: 700; color: #111827; margin-bottom: 1px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.mc-chat-hours-text { color: #6b7280; font-size: 11.5px; word-break: keep-all; }
.mc-chat-hours-cfgbtn {
  background: #fff; border: 1px solid #d1d5db; border-radius: 6px; padding: 3px 8px;
  font-size: 11px; font-weight: 700; color: #374151; cursor: pointer; flex-shrink: 0; align-self: center;
}
.mc-chat-hours-cfgbtn:hover { border-color: #F2564B; color: #F2564B; }

/* 관리자 빠른 운영시간 설정 박스 */
.mc-chat-cfgbox {
  padding: 12px 14px; background: #fff; border-bottom: 1px solid #e5e7eb; display: flex; flex-direction: column; gap: 8px;
  font-size: 12px; max-height: 360px; overflow-y: auto; flex-shrink: 0;
}
.mc-chat-cfg-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.mc-chat-cfg-row label { font-weight: 700; color: #374151; min-width: 68px; font-size: 11.5px; }
.mc-chat-cfg-inp {
  border: 1px solid #d1d5db; border-radius: 6px; padding: 5px 8px; font-size: 12px; font-family: inherit; color: #111827;
}
.mc-chat-cfg-inp.full { width: 100%; }
.mc-chat-cfg-actions { display: flex; justify-content: flex-end; gap: 6px; margin-top: 2px; }

/* 본문 2단 분할 래퍼 */
.mc-chat-body-wrap {
  flex: 1; display: flex; min-height: 0; overflow: hidden;
}
.mc-chat-list-col {
  width: 280px; min-width: 260px; border-right: 1px solid #e5e7eb; display: flex; flex-direction: column; background: #fff; min-height: 0;
}
.mc-chat-panel:not(.wide) .mc-chat-list-col {
  width: 100%; border-right: 0;
}
.mc-chat-chat-col {
  flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 0;
}

/* 대화창 본문 */
.mc-chat-msgs {
  flex: 1; overflow-y: auto; padding: 14px 12px; background: #f7f8fa;
  display: flex; flex-direction: column; gap: 9px;
}
.mc-chat-empty { margin: auto; text-align: center; color: #9ca3af; font-size: 13px; line-height: 1.6; white-space: pre-line; padding: 24px; }
.mc-chat-day {
  align-self: center; font-size: 11px; color: #6b7280; background: #e9ecf2;
  border-radius: 99px; padding: 3px 11px; font-weight: 600; margin: 2px 0;
}
.mc-chat-row { display: flex; align-items: flex-end; gap: 6px; }
.mc-chat-row.mine { justify-content: flex-end; }
.mc-chat-avatar {
  width: 28px; height: 28px; border-radius: 50%; background: #F2564B; color: #fff;
  font-size: 12px; font-weight: 800; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; align-self: flex-start; margin-top: 2px;
}
.mc-chat-col { display: flex; flex-direction: column; gap: 3px; max-width: 76%; min-width: 0; }
.mc-chat-row.mine .mc-chat-col { align-items: flex-end; }
.mc-chat-sender { font-size: 11px; font-weight: 700; color: #6b7280; padding-left: 2px; }
.mc-chat-bubble {
  padding: 9px 13px; border-radius: 16px; border-top-left-radius: 4px; font-size: 13.5px; line-height: 1.52;
  background: #fff; color: #1f2937; border: 1px solid #e5e7eb; white-space: pre-wrap; word-break: break-word;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .03);
}
.mc-chat-row.mine .mc-chat-bubble {
  background: #F2564B; color: #fff; border-color: #F2564B;
  border-top-left-radius: 16px; border-top-right-radius: 4px;
}
.mc-chat-bubble a { color: #2563eb; text-decoration: underline; word-break: break-all; }
.mc-chat-row.mine .mc-chat-bubble a { color: #fff; font-weight: 600; }
.mc-chat-img {
  display: block; max-width: 220px; max-height: 220px; width: auto; height: auto;
  border-radius: 10px; cursor: zoom-in; border: 1px solid rgba(0, 0, 0, .08); margin-bottom: 4px; background: #fff;
}
.mc-chat-img:last-child { margin-bottom: 0; }
.mc-chat-meta { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; flex-shrink: 0; line-height: 1.15; }
.mc-chat-row.mine .mc-chat-meta { align-items: flex-end; }
.mc-chat-unread-mark { font-size: 10.5px; font-weight: 800; color: #F2564B; }
.mc-chat-time { font-size: 10px; color: #9ca3af; flex-shrink: 0; }

/* 이미지 첨부 미리보기 바 */
.mc-chat-attach-preview {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px;
  background: #fff8f6; border-top: 1px solid #f6dad6; flex-shrink: 0;
}
.mc-chat-attach-thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; border: 1px solid #e5e7eb; background: #fff; }
.mc-chat-attach-info { flex: 1; min-width: 0; font-size: 12px; color: #374151; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mc-chat-attach-rm {
  background: #fff; border: 1px solid #d1d5db; border-radius: 6px; padding: 3px 8px;
  font-size: 11px; font-weight: 700; color: #6b7280; cursor: pointer;
}
.mc-chat-attach-rm:hover { color: #ef4444; border-color: #ef4444; }

/* 관리자 상용구(자주 쓰는 답변) 바 */
.mc-chat-quickbar {
  display: flex; gap: 5px; padding: 7px 10px; background: #fafafa; border-top: 1px solid #e5e7eb;
  overflow-x: auto; scrollbar-width: thin; flex-shrink: 0;
}
.mc-chat-qchip {
  border: 1px solid #e5e7eb; background: #fff; color: #374151; font-size: 11.5px; font-weight: 600;
  padding: 4px 10px; border-radius: 99px; cursor: pointer; white-space: nowrap; flex-shrink: 0;
  transition: border-color .12s, color .12s, background .12s;
}
.mc-chat-qchip:hover { border-color: #F2564B; color: #F2564B; background: #fff8f6; }

/* 하단 입력 폼 */
.mc-chat-form {
  display: flex; gap: 6px; padding: 10px 10px; border-top: 1px solid #e5e7eb;
  background: #fff; align-items: flex-end; flex-shrink: 0;
}
.mc-chat-attach-btn {
  width: 36px; height: 36px; border-radius: 10px; border: 1px solid #e5e7eb; background: #f9fafb;
  color: #6b7280; display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0;
  transition: border-color .12s, color .12s, background .12s;
}
.mc-chat-attach-btn:hover { border-color: #F2564B; color: #F2564B; background: #fff8f6; }
.mc-chat-input {
  flex: 1; resize: none; border: 1px solid #d1d5db; border-radius: 10px; padding: 8px 11px; font-size: 13.5px;
  font-family: inherit; line-height: 1.42; max-height: 110px; outline: none; min-height: 36px;
  overflow-y: hidden;
}
.mc-chat-input:focus { border-color: #F2564B; }
.mc-chat-send {
  border: 0; border-radius: 10px; background: #F2564B; color: #fff; padding: 0 14px; height: 36px;
  font-size: 13px; font-weight: 700; cursor: pointer; flex-shrink: 0; transition: background .12s;
}
.mc-chat-send:hover { background: #D8392D; }
.mc-chat-send:disabled { opacity: .5; cursor: default; }

.mc-chat-sys {
  align-self: center; max-width: 90%; text-align: center; font-size: 12px; color: #6b7280;
  background: #e9ecf2; border-radius: 10px; padding: 6px 12px; line-height: 1.5; white-space: pre-line;
}
.mc-chat-list-tools { display: flex; flex-direction: column; flex-shrink: 0; background: #fff; }
.mc-chat-tabs { display: flex; border-bottom: 1px solid #e5e7eb; background: #fff; }
.mc-chat-tab { flex: 1; border: 0; background: transparent; padding: 10px; font-size: 13px; color: #6b7280; cursor: pointer; border-bottom: 2px solid transparent; }
.mc-chat-tab.on { color: #F2564B; font-weight: 700; border-bottom-color: #F2564B; }
.mc-chat-search-row { display: flex; gap: 6px; padding: 8px 10px; border-bottom: 1px solid #f0f1f5; background: #fafafa; align-items: center; }
.mc-chat-search-inp { flex: 1; min-width: 0; border: 1px solid #d1d5db; border-radius: 7px; padding: 5px 9px; font-size: 12px; font-family: inherit; outline: none; background: #fff; }
.mc-chat-search-inp:focus { border-color: #F2564B; }
.mc-chat-filter-btn { border: 1px solid #d1d5db; background: #fff; color: #6b7280; font-size: 11px; font-weight: 700; padding: 5px 8px; border-radius: 7px; cursor: pointer; white-space: nowrap; flex-shrink: 0; }
.mc-chat-filter-btn.on { background: #F2564B; border-color: #F2564B; color: #fff; }

.mc-chat-past { align-self: center; border: 0; background: transparent; color: #F2564B; font-size: 12px; font-weight: 600; cursor: pointer; text-decoration: underline; padding: 2px 8px; }
.mc-chat-pastbox { display: flex; flex-direction: column; gap: 8px; opacity: .72; padding: 8px 0; border-bottom: 1px dashed #d1d5db; }

/* 관리자 대화 목록 */
.mc-chat-rooms { flex: 1; overflow-y: auto; background: #fff; }
.mc-chat-room { padding: 11px 14px; border-bottom: 1px solid #f0f1f5; cursor: pointer; transition: background .1s; }
.mc-chat-room:hover { background: #fff8f6; }
.mc-chat-room.active { background: #fdecea; border-left: 3px solid #F2564B; padding-left: 11px; }
.mc-chat-room-top, .mc-chat-room-bottom { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.mc-chat-room-name { font-size: 13px; font-weight: 700; color: #111827; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mc-chat-room.unread .mc-chat-room-name { color: #F2564B; }
.mc-chat-room-time { font-size: 11px; color: #9ca3af; flex-shrink: 0; }
.mc-chat-room-bottom { margin-top: 4px; }
.mc-chat-room-last { font-size: 12px; color: #6b7280; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mc-chat-room-dot {
  background: #ef4444; color: #fff; font-size: 11px; font-weight: 700; min-width: 18px; height: 18px;
  line-height: 18px; text-align: center; border-radius: 9px; padding: 0 5px; box-sizing: border-box; flex-shrink: 0;
}

/* 이미지 확대 라이트박스 */
.mc-chat-lightbox {
  position: fixed; inset: 0; z-index: 9500; background: rgba(15, 23, 42, .82);
  display: flex; align-items: center; justify-content: center; padding: 24px; cursor: zoom-out;
}
.mc-chat-lightbox img {
  max-width: 92vw; max-height: 90vh; border-radius: 12px; box-shadow: 0 20px 60px rgba(0, 0, 0, .5); background: #fff;
}

/* 비회원 상담(로그인 화면): 사이드바가 없으므로 오른쪽 아래에 띄운다 */
.mc-chat-panel.mc-chat-guest { left: auto; right: 24px; width: 380px; height: 560px; }
.mc-chat-guestbox { padding: 22px 20px; display: flex; flex-direction: column; gap: 6px; overflow-y: auto; flex: 1; background: #fff; }
.mc-chat-guest-title { font-size: 17px; font-weight: 800; color: #111827; }
.mc-chat-guest-desc { font-size: 13px; color: #6b7280; line-height: 1.6; white-space: pre-line; margin-bottom: 10px; }
.mc-chat-guest-label { font-size: 12px; font-weight: 700; color: #374151; margin-top: 6px; }
.mc-chat-guest-input { border: 1px solid #d1d5db; border-radius: 10px; padding: 10px 12px; font-size: 14px; font-family: inherit; outline: none; }
.mc-chat-guest-input:focus { border-color: #4f46e5; }
.mc-chat-guest-err { min-height: 18px; font-size: 12px; color: #ef4444; margin-top: 4px; }
.mc-chat-guest-btn { border: 0; border-radius: 10px; background: #4f46e5; color: #fff; padding: 12px; font-size: 14px; font-weight: 700; cursor: pointer; }
.mc-chat-guest-btn:disabled { opacity: .5; cursor: default; }
.mc-chat-guest-note { font-size: 11px; color: #9ca3af; text-align: center; margin-top: 8px; }
@media (max-width: 720px) {
  .mc-chat-panel.mc-chat-guest { left: 0; right: 0; width: auto; height: 100%; }
  .mc-chat-panel, .mc-chat-panel.wide { right: 0; left: 0; bottom: 0; width: auto; height: 100%; max-height: 100%; border-radius: 0; }
}
