/* ═══ v191 — 모바일 전용 화면 (#/m) + 채팅 한 화면 모드 ═══ */
body.m-on #topbar, body.m-on #nav, body.m-on .breadcrumb, body.m-on #v2hdr,
body.m-on #mnav, body.m-on .chat-fab, body.m-on #v2fab { display: none !important; }
body.m-on #content { padding: 0 !important; margin: 0 !important; max-width: none !important; }
body.m-on { background: #f5f4ea; }

#mv { min-height: 100vh; background: #f5f4ea; padding-bottom: 30px; }
#mv * { -webkit-tap-highlight-color: rgba(90, 102, 54, .12); }

.m-top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 9px;
  padding: calc(11px + env(safe-area-inset-top)) 14px 11px;
  background: #2a3020; color: #f2eeda;
}
.m-top b { letter-spacing: -.3px; }
.m-back {
  width: 34px; height: 34px; flex: none; border: 0; border-radius: 10px;
  background: rgba(242, 238, 218, .12); color: #f2eeda; font-size: 20px; line-height: 1;
  cursor: pointer; display: flex; align-items: center; justify-content: center; padding-bottom: 3px;
}
.m-pcbtn {
  flex: none; border: 1px solid rgba(242, 238, 218, .3); background: none; color: #d9d5b8;
  border-radius: 99px; padding: 5px 11px; font-size: 11px; font-weight: 700; cursor: pointer;
}

.m-tiles { display: flex; flex-direction: column; gap: 9px; padding: 14px; }
.m-tile {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 15px 15px; border: 1.5px solid #dcd8c0; border-radius: 14px; background: #fff;
  font: inherit; cursor: pointer; color: #3a4030;
}
.m-tile:active { background: #f5f4e7; }
.m-tile__ico {
  width: 42px; height: 42px; flex: none; border-radius: 12px; background: #f3f2e6;
  display: flex; align-items: center; justify-content: center; font-size: 20px;
}
.m-hint { padding: 4px 20px 16px; font-size: 11px; color: #98a08a; line-height: 1.6; text-align: center; }

.m-mode {
  margin: 11px 14px 0; padding: 9px 13px; border: 1px solid #c9c5a1; background: #f5f4e7;
  border-radius: 10px; font-size: 12.5px; font-weight: 700; color: #4d5434;
}
.m-search { padding: 11px 14px 4px; position: sticky; top: 56px; z-index: 15; background: #f5f4ea; }
.m-search input {
  width: 100%; padding: 12px 15px; border: 1.5px solid #dcd8c0; border-radius: 12px;
  font: inherit; font-size: 14px; outline: none; background: #fff; box-sizing: border-box;
}
.m-search input:focus { border-color: #5a6636; }
.m-list { display: flex; flex-direction: column; gap: 8px; padding: 9px 14px; }
.m-card {
  display: flex; align-items: center; gap: 11px; width: 100%;
  padding: 12px 14px; border: 1px solid #e2dfc8; border-radius: 12px; background: #fff;
  font: inherit; cursor: pointer; color: #3a4030;
}
.m-card:active { background: #f5f4e7; }
.m-empty { padding: 26px 14px; text-align: center; font-size: 12.5px; color: #98a08a; }

.m-detail { margin: 13px 14px; padding: 15px; border: 1.5px solid #dcd8c0; border-radius: 14px; background: #fff; }
.m-locs { display: flex; flex-direction: column; gap: 6px; margin-top: 11px; }
.m-loc {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 12px; border: 1px solid #eceade; border-radius: 10px; background: #fbfaf2; font-size: 12.5px;
}
.m-btn {
  flex: 1; padding: 12px 0; border: 1.5px solid #dcd8c0; border-radius: 11px; background: #fff;
  font: inherit; font-size: 13.5px; font-weight: 800; color: #4d5434; cursor: pointer;
}
.m-btn.is-on { background: #4d5434; border-color: #4d5434; color: #f2eeda; }
.m-form { margin-top: 13px; padding-top: 4px; border-top: 1px dashed #dcd8c0; }
.m-form label { display: block; margin: 11px 0 5px; font-size: 11.5px; font-weight: 800; color: #6b7160; }
.m-form input, .m-form select {
  width: 100%; padding: 11px 13px; border: 1.5px solid #dcd8c0; border-radius: 10px;
  font: inherit; font-size: 14px; outline: none; background: #fff; box-sizing: border-box;
}
.m-form input:focus, .m-form select:focus { border-color: #5a6636; }
.m-go {
  width: 100%; margin-top: 14px; padding: 13px 0; border: 0; border-radius: 11px;
  background: #5a6636; color: #f2eeda; font: inherit; font-size: 14px; font-weight: 800; cursor: pointer;
}
.m-note { margin-top: 9px; font-size: 11px; color: #98a08a; line-height: 1.6; }

/* ═══ 채팅 — 좁은 화면 한 화면(single-pane) 모드 ═══ */
@media (max-width: 740px) {
  #chatv .ct-list { width: 100% !important; max-width: none !important; }
  #chatv .ct-main { display: none !important; }
  #chatv.m-room .ct-list { display: none !important; }
  #chatv.m-room .ct-main { display: flex !important; min-width: 0 !important; width: 100% !important; }
  .ct-back { display: inline-flex !important; }
}
.ct-back {
  display: none; width: 30px; height: 30px; flex: none; align-items: center; justify-content: center;
  border: 0; border-radius: 9px; background: #f3f2e6; color: #4d5434; font-size: 18px; cursor: pointer; padding-bottom: 2px;
}

/* ═══ v218 — 업무용 채팅 모바일 (시안 「chatmobile」): 하단 탭바 · 바텀시트 · 방 메뉴 ═══ */
@media (max-width: 740px) {
  #chatv .ct-rail { display: none !important; }
  #chatv .ct-app { flex-direction: column; }
  #chatv .ct-list, #chatv .ct-main { flex: 1 1 auto !important; min-height: 0; }
  #chatv .ct-side { display: none !important; }
  /* 파일 · 태스크 탭 — 우측 패널을 전체 화면으로 */
  #chatv.m-side .ct-list, #chatv.m-side.m-room .ct-main { display: none !important; }
  #chatv.m-side .ct-side { display: flex !important; width: 100% !important; flex: 1 1 auto !important; min-height: 0; border-left: 0; }
  /* 하단 탭바 */
  #chatv .ct-mtabs { display: flex; flex: none; background: #fff; border-top: 1px solid #dcd8c0; padding-bottom: max(2px, env(safe-area-inset-bottom)); }
  #chatv .ct-mtab { flex: 1; padding: 8px 2px 6px; border: 0; background: none; cursor: pointer; display: flex;
    flex-direction: column; align-items: center; gap: 3px; color: #98a2b3; position: relative; font-family: inherit; }
  #chatv .ct-mtab.is-on { color: #2a3020; }
  #chatv .ct-mtab .i { font-size: 16px; filter: grayscale(1); opacity: .75; }
  #chatv .ct-mtab.is-on .i { opacity: 1; }
  #chatv .ct-mtab .l { font-size: 9.5px; font-weight: 800; }
  #chatv .ct-mtab .b { position: absolute; top: 3px; right: 50%; margin-right: -22px; min-width: 15px; height: 15px;
    padding: 0 3px; background: #d97706; color: #fff; font-size: 9px; font-weight: 800; line-height: 15px; text-align: center; }
  /* 방 행 ⋯ 메뉴 버튼 (모바일에서만) */
  #chatv .ct-room__mo { display: inline-flex !important; }
  /* 우클릭 메뉴 · 전체메뉴 팝업 → 바텀시트 */
  .ct-ctx { left: 0 !important; right: 0 !important; top: auto !important; bottom: 0 !important;
    min-width: 0 !important; border-radius: 0 !important; border-top: 2px solid #4d5434 !important;
    box-shadow: 0 -14px 34px rgba(16,24,40,.3) !important; padding: 8px 6px max(10px, env(safe-area-inset-bottom)) !important; }
  .ct-ctx [data-ctx] { padding: 13px 14px !important; font-size: 13px !important; }
  #chatv .ct-pop { left: 10px !important; right: 10px !important; top: auto !important; bottom: 64px !important; width: auto !important; max-height: 70%; overflow-y: auto; }
  /* 대화 헤더의 데스크톱 전용 버튼 숨김 */
  #chatv .ct-head [data-act="winmode"], #chatv .ct-head [data-act="popout"], #chatv .ct-head [data-act="call"] { display: none; }
  #chatv .ct-msg__body { max-width: 82%; }
}
#chatv .ct-room__mo { display: none; width: 26px; height: 26px; flex: none; border: 1px solid #e8e5d1; background: #fff;
  color: #98a2b3; font-size: 12px; cursor: pointer; align-items: center; justify-content: center; padding: 0; }
/* 더보기 바텀시트 */
.ct-msheetov { position: fixed; inset: 0; z-index: 99998; background: rgba(16,24,40,.45); display: flex; align-items: flex-end; }
.ct-msheet { width: 100%; max-height: 88%; overflow-y: auto; background: #fff; border-top: 2px solid #4d5434;
  animation: ctmup .16s ease-out; padding-bottom: max(4px, env(safe-area-inset-bottom)); }
@keyframes ctmup { from { transform: translateY(14px); opacity: .6; } to { transform: none; opacity: 1; } }
.ct-msheet__h { display: flex; align-items: center; gap: 9px; padding: 12px 14px; background: #2a3020; color: #f2eeda; position: sticky; top: 0; }
.ct-msheet__h b { flex: 1; min-width: 0; font-size: 14px; }
.ct-msheet__x { width: 28px; height: 28px; flex: none; border: 1px solid #4d5434; background: none; color: #b9bda6; font-size: 13px; cursor: pointer; }
.ct-mact { display: flex; align-items: center; gap: 11px; width: 100%; text-align: left; padding: 13px 14px; border: 0;
  border-bottom: 1px solid #f2f1e4; background: #fff; cursor: pointer; color: #1c2430; font-family: inherit; }
.ct-mact:active { background: #f5f4e7; }
.ct-mact__i { width: 30px; height: 30px; flex: none; background: #f6f5ec; border: 1px solid #e8e5d1; font-size: 14px;
  display: flex; align-items: center; justify-content: center; filter: grayscale(1); opacity: .85; }
.ct-mact b { display: block; font-size: 13px; }
.ct-mact span.d { display: block; font-size: 10.5px; color: #98a2b3; margin-top: 2px; }

/* ═══ v564 — 업무용 채팅 모바일 v2 (디자인 인계 «채팅 (모바일) v2»): 선 아이콘 · 테두리를 줄이고 여백으로 구분 · 올리브 헤더 · 알림음 시트 ═══ */
@media (max-width: 740px) {
  /* 목록 헤더 — 제목 · 검색 · 종 · 그룹 (34px 투명 버튼) */
  #chatv .ct-mhead { display:flex; align-items:center; gap:2px; padding:9px 8px 9px 14px; background:#2a3020; flex:none; }
  #chatv .ct-mhead > b { flex:1; min-width:0; font-size:17px; color:#f2eeda; letter-spacing:-.4px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  #chatv .ct-mhead__n { display:inline-block; font-size:11px; font-weight:800; color:#2a3020; background:#d6d2b8; padding:1px 6px; vertical-align:2px; }
  #chatv .ct-mhead__b { position:relative; flex:none; width:34px; height:34px; border:0; background:none; color:#d6d2b8; display:flex; align-items:center; justify-content:center; padding:0; cursor:pointer; font:inherit; }
  #chatv .ct-mhead__b:active, #chatv .ct-mhead__b.is-on { background:#3f4a2b; }
  #chatv .ct-mhead__b.is-hi { color:#f2eeda; }
  #chatv .ct-mhead__b svg { display:block; }
  #chatv .ct-mhead__off { position:absolute; top:7px; right:7px; width:7px; height:7px; background:#98a2b3; border:1.5px solid #2a3020; }
  #chatv .ct-list__search { margin:0; padding:0 14px 10px; background:#2a3020; }
  #chatv .ct-list__search input { width:100%; box-sizing:border-box; border:0; background:#1f2417; color:#f2eeda; font-size:12.5px; padding:8px 10px; outline:none; }
  /* 필터 칩 · 방 목록 — 테두리 · 구분선 없이 여백으로 */
  #chatv .ct-list .ct-chips { padding:9px 14px 7px; background:#fff; }
  #chatv .ct-rooms { padding:0 0 10px; }
  #chatv .ct-roomrow { margin:0; border-radius:0; }
  #chatv .ct-roomrow.is-on { background:#efeddf; box-shadow:inset 2px 0 0 #5a6636; }
  #chatv .ct-roomrow .ct-room { padding:11px 36px 11px 14px; gap:11px; }
  #chatv .ct-room__av { width:44px; height:44px; font-size:13px; }
  #chatv .ct-room__name { font-size:13.5px; }
  #chatv .ct-room__dots { opacity:1; top:50%; right:0; transform:translateY(-50%); width:34px; height:34px; font-size:15px; color:#b6bda7; border:0; background:none; }
  #chatv .ct-roomrow:hover .ct-room__time, #chatv .ct-roomrow.is-on .ct-room__time { visibility:visible; }
  #chatv .ct-rooms::after { content:'방을 길게 누르거나 ⋯ 를 눌러 고정 · 알림음 · 나가기'; display:block; padding:15px; text-align:center; font-size:10.5px; color:#b6bda7; line-height:1.6; }
  /* 하단 탭 — 선 아이콘 · 주황 배지 */
  #chatv .ct-mtabs { border-top-color:#efede2; padding:6px 4px max(10px, env(safe-area-inset-bottom)); }
  #chatv .ct-mtab { padding:5px 2px; gap:3px; }
  #chatv .ct-mtab .i { filter:none; opacity:1; height:20px; display:flex; align-items:center; }
  #chatv .ct-mtab .i svg { display:block; }
  #chatv .ct-mtab .l { font-size:10px; font-weight:600; }
  #chatv .ct-mtab.is-on .l { font-weight:800; }
  #chatv .ct-mtab .b { top:1px; right:auto; left:calc(50% + 6px); margin:0; min-width:0; height:14px; line-height:14px; padding:0 4px; background:#c2410c; }
  /* 대화 헤더 — 올리브 · 뒤로 · 연동 자료 · 방 설정만 */
  #chatv .ct-head { background:#2a3020; border-bottom:0; padding:8px 10px 9px; gap:7px; }
  #chatv .ct-head b { color:#f2eeda; }
  #chatv .ct-head > span > span { color:#9aa189 !important; }
  #chatv .ct-head__av { background:#ecead7 !important; color:#4d5434 !important; }
  #chatv .ct-head [data-act="thsearch"], #chatv .ct-head [data-act="notice"], #chatv .ct-head .ct-head__sep, #chatv .ct-head .ct-head__members { display:none; }
  #chatv .ct-head .ct-icon { width:34px; height:34px; color:#d6d2b8; border-color:transparent; background:none; }
  #chatv .ct-head .ct-icon:active { background:#3f4a2b; }
  .ct-back { width:34px; height:34px; background:none; color:#f2eeda; border-radius:0; padding:0; }
  .ct-back svg { display:block; }
  #chatv .ct-notice { background:#fef3e2; border-bottom:1px solid #f2d3ae; }
  #chatv .ct-thread { background:#fbfaf2; }
  /* 입력창 — 38px · 포커스 시 흰 바탕 + 올리브 테두리 + 옅은 링 */
  #chatv .ct-composer { padding:8px 10px max(12px, env(safe-area-inset-bottom)); border-top-color:#efede2; }
  #chatv .ct-mcomp { display:flex; align-items:flex-end; gap:7px; }
  #chatv .ct-mcomp__plus { flex:none; width:38px; height:38px; border:0 !important; background:none !important; color:#4d5434; padding:0; }
  #chatv .ct-mcomp__plus:active { background:#ecead7 !important; }
  #chatv .ct-mcomp input { flex:1; min-width:0; height:38px; box-sizing:border-box; border:1px solid #ebe8d8; background:#fbfaf5; font:inherit; font-size:12.5px; padding:0 11px; outline:none; color:#1c2430; transition:border-color .15s, background .15s, box-shadow .15s; }
  #chatv .ct-mcomp input:focus { border-color:#5a6636; background:#fff; box-shadow:0 0 0 3px rgba(90,102,54,.12); }
  #chatv .ct-mcomp .ct-send { flex:none; height:38px; padding:0 12px; }
  /* 알림음 설정 · 상세 창 → 하단 시트 */
  #chatv .ct-overlay { align-items:flex-end !important; padding:0 !important; }
  #chatv .ct-overlay .ct-modal { width:100% !important; max-width:none !important; max-height:78%; border:0; border-top:1px solid #c9c5a1; box-shadow:0 -12px 30px rgba(20,23,15,.22); animation:ctmsheet .17s cubic-bezier(.2,.8,.2,1); }
  @keyframes ctmsheet { from { transform:translateY(100%); } to { transform:none; } }
  #chatv .ct-snd__row select { max-width:132px; height:32px; }
}
/* v564 — 알림음 시트 머리글: 좁은 화면에서는 안내 문구를 숨겨 제목이 한 줄에 */
@media (max-width: 740px) {
  #chatv .ct-snd .ct-modal__head > span:not(.ct-snd__dev) { display:none; }
  #chatv .ct-snd .ct-modal__head b { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
}
