/* ═══ 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; }
