/* 메신저 단독 화면 조정 — EMR은 채팅을 화면 오른쪽 패널(위 30px는 EMR 메뉴줄)로 띄운다. 메신저(5007)는 그 패널을 화면 전체로 편다.
   목록 340px는 EMR 그대로, 대화 칸만 남은 폭을 다 쓴다(기획 추천안 — 데이빗 결정 전). 색·모양은 emr.css(EMR 그대로)를 따른다. */
html, body { height: 100%; }
body { padding-right: 0 !important; display: block; }
.chat-panel { left: 0; right: 0; width: auto !important; } /* 위는 EMR처럼 맨 위 메뉴줄(30px) 아래 */
body.embed .chat-panel { top: 0; } /* 매니저·콘솔 안에선 메뉴줄 없이 */
.gnb[hidden] { display: none; }
/* EMR은 패널 폭만큼 body 오른쪽을 비우고 GNB를 그만큼 넓힌다(chat.js updateChatPanelBodyOffset). 단독 화면은 body를 비우지 않으므로 GNB도 넓히지 않는다 — 넓히면 화면이 옆으로 밀림(QA 12-02) */
.gnb { margin-right: 0 !important; }
.chat-panel .chat-thread { flex: 1; width: auto; min-width: 0; }
.chat-panel.layout-single .chat-panel-list, .chat-panel.layout-single .chat-thread { width: 100%; }
.chat-panel-list { border-left: 0; }
.chat-header { border-left: 0; }
/* 단독 화면에선 패널을 닫거나 고정할 곳이 없다(EMR은 맨 위 메뉴줄의 채팅 버튼으로 다시 연다) */
#chat-pin-toggle-btn, .chat-header .chat-close-btn { display: none; }
/* 새창으로 보기(EMR chat-window.html)는 아직 옮기지 않았다 */
[data-onclick="cptHeaderMenuAction('popout')"] { display: none; }
/* 새 메시지 알림 카드: EMR은 카드가 대화 입력칸을 가리지 않게 패널 왼쪽(빈 업무 화면) 아래에 띄운다(chat.js updateChatPanelBodyOffset).
   단독 화면 2단: 같은 뜻으로 왼쪽 목록 칸 아래(왼쪽·아래 16px) — 대화 칸의 "맨 아래로" 단추도 안 가림(디자인 3차 제안).
   1단(폰·좁은 창): 옆자리가 없으므로 입력줄(높이 96px) 위, 오른쪽 16px. */
.chat-toast-stack { right: auto !important; left: 16px; bottom: 16px; align-items: flex-start; }
#chat-panel.layout-single ~ .chat-toast-stack { left: auto; right: 16px !important; bottom: 112px; align-items: flex-end; }
/* EMR 화면에서 채팅 밖(예약·환자) 요소 자리 — 화면엔 안 보인다 */
.gm-emr-hidden { display: none !important; }
/* 로그인 전 안내(EMR 색·버튼 클래스만 씀) */
.gm-login { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: var(--bg); }
.gm-login[hidden] { display: none; }
.gm-login-box { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 28px 28px 24px; width: 320px; display: flex; flex-direction: column; gap: 10px; text-align: center; }
.gm-login-box h1 { font-size: 16px; color: var(--text); margin-bottom: 4px; }
.gm-login-box p { font-size: 12.5px; color: var(--text-2); line-height: 1.6; word-break: keep-all; } /* 낱말 가운데서 줄이 갈리지 않게("계정|으로" — 디자인 12-02) */
.gm-login-box .ub-btn { min-height: 44px; display: flex; align-items: center; justify-content: center; } /* 폰 누르기 44px 이상(디자인 12-02) */
.gm-login-err { color: var(--coral) !important; text-wrap: balance; } /* 두 줄일 때 마지막 낱말만 떨어지지 않게(디자인 12-03) */
.gm-login-box a { text-decoration: none; }
/* "여기까지 읽었습니다" 줄은 EMR 그대로 주황 갈색(var(--coral)) — 데이빗 #512 "EMR처럼 주황 갈색"(2026-12-02). 여기서 덮어쓰지 않는다 */
/* 말풍선 폭: EMR은 대화 칸 340px의 80%(=252px)에서 줄바꿈한다. 단독 화면은 대화 칸이 넓어도 같은 자리에서 줄바꿈하게 252px로 고정 */
.chat-messages .chat-msg { max-width: min(80%, 252px); }
/* 폰·좁은 폭(720px 미만): 목록↔대화 한 칸씩(EMR 1단 모드). 2단 전환 단추는 숨김 — 좁은 폭에서 2단이면 대화 칸이 찌그러진다(기획 #510 답) */
@media (max-width: 719px) { #chat-layout-toggle-btn { display: none; } }
.gm-nb { white-space: nowrap; } /* "본사 계정으로"가 한 줄에(디자인 12-02) */
