/* ════════════════════════════════════════
   휴대폰 채팅 화면(잔디식) — public/css/chat-mobile.css  (2026-10-22 · chat-mobile.js)
   ★채팅 모드(/chat) + 폭 700px 이하에서만 적용한다. PC 화면은 바뀌지 않는다.
════════════════════════════════════════ */
.cmb-nav, .cmb-fab, .cmb-page, .oc-room-last-m, .oc-room-time-m { display: none; }

@media (max-width: 700px) {
  /* 위쪽: 탭 단추·내 메뉴는 아래 탭이 대신한다 */
  body.chat-mode #view-office .office-tabs, body.chat-mode .cm-me { display: none !important; }
  body.chat-mode:not(.cmb-in-room) #view-office .office-wrap { height: calc(100vh - 12px - 60px); height: calc(100dvh - 12px - 60px); }

  /* 아래 탭 */
  body.chat-mode .cmb-nav { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 1600; height: 60px;
    background: #fff; border-top: 1px solid #e3e8ee; padding-bottom: env(safe-area-inset-bottom); }
  body.chat-mode.cmb-in-room .cmb-nav, body.chat-mode.cmb-in-room .cmb-fab { display: none; }
  .cmb-tab { flex: 1; position: relative; border: 0; background: transparent; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 3px; color: #a3abb6; font-size: 19px; font-family: inherit; cursor: pointer; }
  .cmb-tab-label { font-size: 11.5px; }
  .cmb-tab.is-on { color: #1f2a37; }
  .cmb-tab.is-on .cmb-tab-label { font-weight: 700; }
  .cmb-badge { position: absolute; top: 5px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
    background: #ef4444; color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }
  .cmb-badge[hidden], .cmb-badge:empty { display: none; }

  /* 오른쪽 아래 [+] — 테마·채팅 탭에서만 */
  body.chat-mode:not(.cmb-in-room)[data-cmb-tab="theme"] .cmb-fab, body.chat-mode:not(.cmb-in-room)[data-cmb-tab="chat"] .cmb-fab { display: flex; }
  .cmb-fab { position: fixed; right: 16px; bottom: 76px; z-index: 1601; width: 54px; height: 54px; border-radius: 50%; border: 0;
    background: #2F557F; color: #fff; font-size: 22px; align-items: center; justify-content: center; box-shadow: 0 4px 14px rgba(47, 85, 127, .35); cursor: pointer; }

  /* 테마 탭 = 테마 묶음만, 채팅 탭 = 그룹·개인 채팅만 */
  body.chat-mode[data-cmb-tab="theme"] .oc-sec-chat, body.chat-mode[data-cmb-tab="chat"] .oc-sec-theme { display: none; }
  /* 조직도·더보기 탭 = 아래 칸(cmb-page)만 */
  body.chat-mode[data-cmb-tab="org"] #office-chat-root, body.chat-mode[data-cmb-tab="more"] #office-chat-root,
  body.chat-mode[data-cmb-tab="org"] #office-org-root, body.chat-mode[data-cmb-tab="more"] #office-org-root,
  body.chat-mode[data-cmb-tab="org"] #office-vote-root, body.chat-mode[data-cmb-tab="more"] #office-vote-root,
  body.chat-mode[data-cmb-tab="org"] #office-meeting-root, body.chat-mode[data-cmb-tab="more"] #office-meeting-root { display: none !important; }   /* 투표(2026-10-26)·화상회의(2026-10-27) */
  body.chat-mode[data-cmb-tab="org"] .cmb-page, body.chat-mode[data-cmb-tab="more"] .cmb-page { display: block; }
  .cmb-page { flex: 1; min-height: 0; height: 100%; overflow-y: auto; background: #fff; border-radius: 12px; padding: 14px 16px 24px; }

  /* 채팅 목록 — 잔디처럼 마지막 글·시간 */
  body.chat-mode .oc-room-last-m { display: block; font-size: 13px; color: #8a94a1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
  body.chat-mode .oc-room-time-m { display: inline; margin-left: auto; padding-left: 8px; font-size: 11.5px; color: #a3abb6; font-weight: 400; white-space: nowrap; }
  body.chat-mode .oc-room { padding: 10px 8px; }

  /* 조직도·더보기 칸 */
  .cmb-title { font-size: 22px; margin: 4px 0 14px; color: #1f2a37; }
  .cmb-head { display: flex; align-items: center; gap: 10px; }
  .cmb-head h2 { font-size: 19px; margin: 0; color: #1f2a37; }
  .cmb-back { border: 0; background: transparent; font-size: 20px; color: #1f2a37; padding: 4px 6px; cursor: pointer; }
  .cmb-count { font-size: 12.5px; color: #8a94a1; background: #f1f4f8; border-radius: 10px; padding: 2px 8px; }
  .cmb-path { font-size: 13px; color: #2F557F; margin: 10px 0 8px; padding-bottom: 10px; border-bottom: 1px solid #e3e8ee; }
  .cmb-search { width: 100%; font-size: 16px; margin-bottom: 8px; }
  .cmb-sec { font-size: 12.5px; color: #98a2af; margin: 14px 0 4px; padding-bottom: 6px; border-bottom: 1px solid #e3e8ee; }
  .cmb-unit, .cmb-person, .cmb-item { display: flex; align-items: center; gap: 12px; width: 100%; border: 0; border-bottom: 1px solid #f1f4f8;
    background: transparent; padding: 14px 2px; text-align: left; font-family: inherit; cursor: pointer; }
  .cmb-unit-name { flex: 1; font-size: 16px; font-weight: 700; color: #1f2a37; }
  .cmb-unit-count { font-size: 14px; color: #8a94a1; }
  .cmb-unit i { color: #b0b8c3; font-size: 13px; }
  .cmb-person > :first-child { position: relative; flex-shrink: 0; width: 46px; height: 46px; }
  .cmb-person-mid { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
  .cmb-person-name { font-size: 15.5px; font-weight: 700; color: #1f2a37; }
  .cmb-person-sub { font-size: 13px; color: #6b7684; }
  .cmb-empty { color: #98a2af; text-align: center; padding: 24px 0; font-size: 13px; }
  .cmb-me { display: flex; align-items: center; gap: 12px; padding: 6px 2px 16px; border-bottom: 1px solid #e3e8ee; font-size: 17px; color: #1f2a37; }
  .cmb-item { font-size: 15.5px; color: #1f2a37; }
  .cmb-item i { width: 22px; text-align: center; color: #5b6776; }
}

/* ── 휴대폰 폭(채팅 모드·행정 화면 공통, 2026-10-23) ──
   · 보내기 = 둥근 ➤ 단추(글자는 화면에서만 숨김 — 읽어 주기 프로그램은 「보내기」로 읽는다) · 2026-10-29: 입력란 안에 들어가는 작은 단추
   · 메시지 옆 글자 단추(전달·답장·고정·수정·삭제)는 숨기고, 메시지를 길게 누르면 메뉴(office-chat-longpress.js) */
.cmb-lp { display: none; }
@media (max-width: 700px) {
  #oc-input .oc-send { width: 34px; min-width: 34px; height: 34px; padding: 0; border-radius: 50%; font-size: 0; align-self: center;
    background: #2F557F url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='white' d='M3.5 3.3 21 12 3.5 20.7 6.9 12z'/%3E%3C/svg%3E") 56% 50% / 15px no-repeat; }
  #oc-input .oc-send:disabled { opacity: .45; }
  /* 입력란 = 카카오처럼 둥근 한 칸(2026-10-29 사무장: 너무 좁아 보임). 차례: 📎 · 😊(왼쪽) · 글 · ➤ 보내기(오른쪽) — 화면 차례 그대로 */
  #oc-input:has(.oc-text) { margin: 6px 8px 8px; padding: 4px 6px; gap: 2px; align-items: flex-end; border: 1px solid #d5dde7; border-radius: 24px; background: #F3F6F9; }
  #oc-input:has(.oc-text) .oc-send { margin-bottom: 1px; }
  #oc-input .oc-text { flex: 1; min-width: 0; min-height: 36px; padding: 8px 6px; border: 0; border-radius: 0; background: transparent; font-size: 16px; }   /* 16px — 아이폰이 글칸을 누를 때 화면을 키우지 않게 */
  #oc-input .oc-attach-btn { padding: 6px 7px; font-size: 19px; align-self: center; }
  .oc-msg .oc-msg-acts { display: none; }
  .oc-msg .oc-bubble, .oc-msg img { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
  .cmb-lp { display: flex; position: fixed; inset: 0; z-index: 3200; align-items: center; justify-content: center; padding: 24px; background: rgba(15, 23, 42, .45); }
  .cmb-lp-card { width: 100%; max-width: 320px; background: #fff; border-radius: 20px; padding: 8px 0; box-shadow: 0 12px 32px rgba(0, 0, 0, .25); }
  .cmb-lp-item { display: block; width: 100%; border: 0; background: transparent; text-align: left; padding: 15px 24px; font-size: 16.5px; color: #1f2a37; font-family: inherit; cursor: pointer; }
  .cmb-lp-item:active { background: #f1f4f8; }
  .cmb-lp-item.is-danger { color: #c0392b; }
}
