/* 💬 메신저 (msgr.js, owner 2026-11-19 새로 만듦). 말풍선·줄 모양은 테마(html[data-vt] + .mmv/.mm, chat.css) 그대로. */

/* ── 왼쪽 › 메신저: 방 목록 ── */
/* (no display here: .view is hidden unless picked — html.v-messenger .view-messenger shows it. A display: flex here kept
   the room list under every other menu, owner 2026-11-19 "왼쪽 메뉴 하단에 에이전트 목록은 삭제") */
.msgr-side { min-height: 0; }
.msgr-side .msg-tabs, .msgr-side .msg-totab, .msgr-side .msg-max { display: none; }
.msgr-q { flex: none; padding: 6px 10px 4px; }
.msgr-q input { width: 100%; height: 30px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--fg); font: inherit; font-size: 13px; }
.msgr-list { flex: 1; min-height: 0; overflow-y: auto; padding: 2px 0 12px; }
.msgr-wait { padding: 10px 14px; }
.msgr-sec + .msgr-sec { margin-top: 6px; }
.msgr-sh { display: flex; align-items: center; gap: 6px; padding: 8px 14px 4px; font-size: 11.5px; font-weight: 700; color: var(--mut); letter-spacing: .02em; }
.msgr-sh span { font-weight: 500; }
.msgr-item { display: flex; align-items: center; gap: 10px; margin: 0 6px; padding: 7px 8px; border-radius: 9px; color: var(--fg); text-decoration: none; }
.msgr-item:hover { background: var(--bg2); }
.msgr-item.on { background: color-mix(in srgb, var(--acc) 13%, transparent); }
.msgr-item.off { opacity: .55; }
.msgr-av { flex: none; width: 34px; height: 34px; border-radius: var(--mm-av-r, 12px); display: grid; place-items: center; font-size: 14px; font-weight: 700; color: #fff; background: hsl(var(--h, 210) 45% 58%); }
.msgr-av.ch { background: var(--bg3); color: var(--mut); font-size: 16px; }
.msgr-it { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.msgr-r1, .msgr-r2 { display: flex; align-items: center; gap: 6px; min-width: 0; }
.msgr-r1 b { min-width: 0; font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msgr-when { margin-left: auto; flex: none; font-size: 11px; color: var(--mut); }
.msgr-last { flex: 1; min-width: 0; font-size: 12.5px; color: var(--mut); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msgr-badge { flex: none; min-width: 8px; height: 8px; border-radius: 9px; background: #e5484d; color: #fff; font-size: 10.5px; font-weight: 700; line-height: 17px; text-align: center; }
.msgr-badge:not(:empty) { min-width: 17px; height: 17px; padding: 0 5px; }
.msgr-tag { flex: none; padding: 0 5px; border-radius: 6px; background: var(--bg3); color: var(--mut); font-size: 10.5px; font-weight: 600; }

/* ── 메신저 홈 ── */
.msgr-page { height: 100%; min-height: 0; display: flex; flex-direction: column; }
.msgr-home { height: 100%; overflow-y: auto; padding: 22px clamp(14px, 4vw, 40px) 40px; }
.msgr-hh { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.msgr-hh h1 { margin: 0; font-size: 22px; }
.msgr-hq { flex: 1; max-width: 360px; height: 34px; padding: 0 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg); color: var(--fg); font: inherit; }
.msgr-home h2 { margin: 18px 0 8px; font-size: 14px; color: var(--mut); } .msgr-home h2 span { font-weight: 500; }
.msgr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.msgr-card { display: flex; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); color: var(--fg); text-decoration: none; transition: border-color .12s, box-shadow .12s; }
.msgr-card:hover { border-color: color-mix(in srgb, var(--acc) 50%, var(--line)); box-shadow: 0 2px 10px rgb(0 0 0 / .06); }
.msgr-card.off { opacity: .55; }
.msgr-ct { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.msgr-ct > b { font-size: 14px; }
.msgr-ct .msgr-tag { align-self: flex-start; }
.msgr-cd { font-size: 12.5px; color: var(--mut); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.msgr-cl { font-size: 12px; color: var(--mut); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── 대화방 ── */
.msgr-room { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; background: var(--mm-bg); color: var(--mm-fg); }
.msgr-head { flex: none; display: flex; flex-direction: column; gap: 1px; padding: 9px 16px 8px; border-bottom: 1px solid var(--line); background: var(--bg); color: var(--fg); }
.msgr-path { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 13px; }
.msgr-path a, .msgr-kind { color: var(--mut); text-decoration: none; white-space: nowrap; } .msgr-path a:hover { color: var(--acc); }
.msgr-path i { font-style: normal; color: var(--mut); opacity: .6; }
.msgr-path b { font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msgr-sub { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msgr-sub:empty { display: none; }
.msgr-log { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 6px 0 14px; background: var(--mm-bg); }
.msgr-log .mm-tools button { font-size: 14px; }
.msgr-older { display: block; margin: 8px auto; padding: 3px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg); color: var(--mut); font: inherit; font-size: 12px; cursor: pointer; }
.msgr-empty { margin: 18vh auto 0; text-align: center; color: var(--mm-t); font-size: 14px; }
.msgr-log .mm { animation: msgr-in .16s ease-out; }
@keyframes msgr-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.msgr-log .mm.mm-pending .mm-bub { opacity: .62; }
.msgr-log .mm.mm-fail .mm-bub { outline: 1px solid #e5484d; }
.msgr-fail { align-self: flex-end; margin-top: 3px; border: 0; background: none; color: #e5484d; font: inherit; font-size: 12px; cursor: pointer; }
.msgr-log .mm.msgr-flash { background: color-mix(in srgb, var(--mm-acc) 16%, transparent); transition: background .3s; }
.msgr-draft .mm-body { min-height: 1.4em; }
.msgr-caret { display: inline-block; width: 7px; height: 1em; margin-left: 2px; vertical-align: -2px; background: currentColor; opacity: .5; animation: msgr-blink 1s steps(2) infinite; }
@keyframes msgr-blink { 50% { opacity: 0; } }
.msgr-phase { color: var(--mm-t); font-size: 13px; }
.msgr-typing { margin: 8px 16px 0; color: var(--mm-t); font-size: 12.5px; }
.msgr-dots { display: inline-flex; gap: 3px; vertical-align: middle; margin-right: 4px; }
.msgr-dots b { width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .35; animation: msgr-dot 1.2s infinite; }
.msgr-dots b:nth-child(2) { animation-delay: .2s; } .msgr-dots b:nth-child(3) { animation-delay: .4s; }
@keyframes msgr-dot { 30% { opacity: 1; transform: translateY(-2px); } }
.msgr-down { position: absolute; right: 18px; bottom: 76px; z-index: 5; padding: 5px 12px; border: 0; border-radius: 16px; background: var(--acc); color: #fff; font: inherit; font-size: 12.5px; box-shadow: 0 2px 10px rgb(0 0 0 / .18); cursor: pointer; }
.msgr-reply { flex: none; display: flex; align-items: center; gap: 6px; margin: 0 12px; padding: 5px 10px; border-left: 3px solid var(--acc); border-radius: 0 8px 8px 0; background: var(--bg2); color: var(--mut); font-size: 12.5px; }
.msgr-reply[hidden] { display: none; }
.msgr-reply .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msgr-reply .x { border: 0; background: none; color: var(--mut); cursor: pointer; }
.msgr-box { flex: none; display: flex; align-items: flex-end; gap: 8px; margin: 8px 12px 12px; padding: 7px 7px 7px 14px; border: 1px solid var(--line); border-radius: 18px; background: var(--bg); box-shadow: 0 1px 4px rgb(0 0 0 / .05); }
.msgr-box:focus-within { border-color: color-mix(in srgb, var(--acc) 55%, var(--line)); }
.msgr-box textarea { flex: 1; min-width: 0; max-height: 200px; padding: 5px 0; border: 0; outline: 0; resize: none; background: transparent; color: var(--fg); font: inherit; font-size: 14.5px; line-height: 1.5; }
.msgr-send { flex: none; width: 34px; height: 34px; border: 0; border-radius: 50%; background: var(--acc); color: #fff; font-size: 17px; font-weight: 700; cursor: pointer; }
.msgr-box:has(textarea:placeholder-shown) .msgr-send { opacity: .45; }
@media (max-width: 700px) {
  .msgr-head { padding: 8px 12px; }
  .msgr-box { margin: 6px 8px 8px; }
  .msgr-home { padding: 14px 12px 30px; }
}
/* the old messenger's channel nav (app.js puts it in this view) and its sash: not in the new one */
.msgr-side .bz-nav, .msgr-side .bz-nav-sash { display: none !important; }
.msgr-box textarea { min-height: 0; height: 32px; }
/* 🎨 메신저 테마 (moved here from the old ⚙ 채팅 설정 › 메신저 보기) */
.msgr-hrow { display: flex; align-items: center; gap: 8px; min-width: 0; }
.msgr-hrow .msgr-path { flex: 1; }
.msgr-themebtn { flex: none; display: inline-grid; place-items: center; width: 30px; height: 28px; border: 0; border-radius: 7px; background: none; cursor: pointer; font-size: 15px; }
.msgr-themebtn:hover { background: var(--bg3); }
.msgr-theme { position: fixed; z-index: 200; width: 316px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); color: var(--fg); box-shadow: 0 8px 28px rgb(0 0 0 / .18); }
.msgr-th-h { margin: 0 2px 8px; font-size: 13px; font-weight: 700; }
.msgr-th-g { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.msgr-th-g button { display: flex; flex-direction: column; gap: 5px; padding: 6px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--fg); font: inherit; font-size: 12px; cursor: pointer; }
.msgr-th-g button.on { border-color: var(--acc); box-shadow: 0 0 0 1px var(--acc) inset; }
.msgr-th-g .sw { display: flex; flex-direction: column; justify-content: center; gap: 4px; height: 34px; padding: 4px 6px; border-radius: 7px; border: 1px solid var(--line); }
.msgr-th-g .sw i { display: block; height: 7px; border-radius: 4px; }
.msgr-th-g .sw .o { width: 80%; } .msgr-th-g .sw .m { width: 60%; }
.msgr-th-g .sw.bubble .o { width: 55%; } .msgr-th-g .sw.bubble .m { width: 42%; margin-left: auto; }
/* each preset's colours on its own swatch (the theme variables, scoped by a fake data-vt on the button) */
.msgr-th-g [data-vt-pv="default"] .sw { background: #fff; } .msgr-th-g [data-vt-pv="default"] .o { background: #f1f2f4; } .msgr-th-g [data-vt-pv="default"] .m { background: #fee500; }
.msgr-th-g [data-vt-pv="kakao"] .sw { background: #bacee0; } .msgr-th-g [data-vt-pv="kakao"] .o { background: #fff; } .msgr-th-g [data-vt-pv="kakao"] .m { background: #fee500; }
.msgr-th-g [data-vt-pv="telegram"] .sw { background: #cfe0c3; } .msgr-th-g [data-vt-pv="telegram"] .o { background: #fff; } .msgr-th-g [data-vt-pv="telegram"] .m { background: #effdde; }
.msgr-th-g [data-vt-pv="whatsapp"] .sw { background: #efeae2; } .msgr-th-g [data-vt-pv="whatsapp"] .o { background: #fff; } .msgr-th-g [data-vt-pv="whatsapp"] .m { background: #d9fdd3; }
.msgr-th-g [data-vt-pv="wechat"] .sw { background: #ededed; } .msgr-th-g [data-vt-pv="wechat"] .o { background: #fff; } .msgr-th-g [data-vt-pv="wechat"] .m { background: #95ec69; }
.msgr-th-g [data-vt-pv="slack"] .sw { background: #fff; } .msgr-th-g [data-vt-pv="slack"] .o, .msgr-th-g [data-vt-pv="slack"] .m { background: #1264a3; opacity: .55; }
.msgr-th-g [data-vt-pv="discord"] .sw { background: #313338; } .msgr-th-g [data-vt-pv="discord"] .o, .msgr-th-g [data-vt-pv="discord"] .m { background: #949ba4; }
.msgr-th-g [data-vt-pv="mattermost"] .sw { background: #fff; } .msgr-th-g [data-vt-pv="mattermost"] .o, .msgr-th-g [data-vt-pv="mattermost"] .m { background: #1c58d9; opacity: .5; }
.msgr-th-g [data-vt-pv="buzz"] .sw { background: #fff; } .msgr-th-g [data-vt-pv="buzz"] .o, .msgr-th-g [data-vt-pv="buzz"] .m { background: #d6336c; opacity: .5; }

/* 카테고리 (전체 · 에이전트 · 채널) under the search box */
.msgr-cats { display: flex; gap: 4px; margin-top: 6px; }
.msgr-cats button { flex: 1; height: 26px; padding: 0 6px; border: 1px solid var(--line); border-radius: 13px; background: var(--bg); color: var(--mut); font: inherit; font-size: 12px; cursor: pointer; white-space: nowrap; }
.msgr-cats button span { opacity: .75; }
.msgr-cats button.on { border-color: var(--acc); background: color-mix(in srgb, var(--acc) 12%, var(--bg)); color: var(--fg); font-weight: 600; }
.msgr-side .pane-head .msgr-themebtn { width: 26px; height: 26px; margin-left: auto; color: var(--mut); }
.msgr-side .pane-head .msgr-themebtn:hover { color: var(--fg); }
.msgr-side .pane-head .msgr-themebtn + .msgr-home-btn { margin-left: 2px; }
.msgr-item[draggable="false"] { -webkit-user-drag: none; }
.msgr-cfg { flex: none; display: inline-grid; place-items: center; width: 28px; height: 26px; border-radius: 7px; color: var(--mut); text-decoration: none; font-size: 15px; }
.msgr-cfg:hover { background: var(--bg3); color: var(--fg); }
.msgr-cfg[hidden] { display: none; }
.msgr-fm { width: 300px; }
.msgr-fm-l { display: flex; flex-direction: column; gap: 4px; max-height: 50vh; overflow: auto; }
.msgr-fm-l button { display: block; padding: 7px 10px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--fg); font: inherit; font-size: 13px; text-align: left; cursor: pointer; }
.msgr-fm-l button:hover { background: var(--bg3); }
.msgr-fm-l button.on { border-color: var(--acc); box-shadow: 0 0 0 1px var(--acc) inset; }
.msgr-fm-l button.busy { opacity: .6; }
.msgr-fm-n { margin: 8px 2px 0; font-size: 11.5px; line-height: 1.45; }
.msgr-fm-e { margin: -4px 2px 8px; font-size: 12px; }
.msgr-fm-p { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.msgr-fm-p button { padding: 3px 9px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg); color: var(--fg); font: inherit; font-size: 12px; cursor: pointer; }
.msgr-fm-p button.on { border-color: var(--acc); background: var(--acc); color: #fff; }
.mm-files { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 5px; max-width: min(520px, 100%); }
.mm-fw { display: inline-flex; align-items: stretch; max-width: 100%; }
.mm-files a, .mm-fl { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; padding: 4px 10px 4px 7px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--fg); font-size: 12.5px; text-decoration: none; }
.mm-files a:hover { border-color: var(--acc); color: var(--acc); }
.mm-fn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mm-fi { flex: none; }
.mm-me .mm-files { margin-left: auto; justify-content: flex-end; }

/* ↗ 오른쪽 탭에서 열기 · ＋ 첨부 (2026-11-19) */
.mm-fw > a { border-radius: 8px 0 0 8px; min-width: 0; }
.mm-fb { flex: none; padding: 0 8px; border: 1px solid var(--line); border-left: 0; border-radius: 0 8px 8px 0; background: var(--bg); color: var(--mut); font-size: 13px; cursor: pointer; }
.mm-fb:hover { color: var(--acc); border-color: var(--acc); }
.mm-fl { color: var(--mut); border-style: dashed; }
.msgr-box:has(.msgr-plus) { padding-left: 7px; }
.msgr-plus { flex: none; align-self: flex-end; width: 32px; height: 32px; border: 0; border-radius: 50%; background: var(--bg3); color: var(--fg); font-size: 20px; line-height: 1; cursor: pointer; }
.msgr-plus:hover { background: var(--line); }
.msgr-atts { display: flex; flex-wrap: wrap; gap: 5px; padding: 6px 12px 0; }
.msgr-atts[hidden] { display: none; }
.msgr-att { display: inline-flex; align-items: center; gap: 4px; max-width: 260px; padding: 3px 4px 3px 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); font-size: 12.5px; }
.msgr-att > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msgr-att button { flex: none; border: 0; background: none; color: var(--mut); cursor: pointer; font-size: 11px; }
.msgr-room.msgr-dz { outline: 2px dashed var(--acc); outline-offset: -6px; }
