.team-messenger-launch { margin:0 0 20px; text-align:center; }
.team-messenger-launch button { display:inline-flex; align-items:center; justify-content:center; gap:8px; min-height:40px; max-width:100%; padding:9px 20px; border:1px solid #243551; border-radius:4px; background:#243551; color:#fff; font:inherit; cursor:pointer; }
.team-messenger-launch img { width:20px; height:20px; flex-shrink:0; filter:brightness(0) invert(1); }
.team-messenger { position:fixed; inset:0; width:1240px; max-width:calc(100vw - 32px); height:760px; max-height:calc(100vh - 32px); max-height:calc(100dvh - 32px); margin:auto; padding:0; box-sizing:border-box; border:1px solid #cdd9e0; border-radius:8px; background:#fff; color:#26384c; text-align:left; font:14px/1.45 Arial,sans-serif; }
.team-messenger[open] { display:flex; flex-direction:column; }
.team-messenger [hidden] { display:none !important; }
.team-messenger::backdrop { background:rgba(18,30,40,.5); }
.team-messenger button, .team-messenger input, .team-messenger textarea { font:inherit; box-sizing:border-box; }
.team-messenger button { cursor:pointer; }
.team-messenger button:disabled { opacity:.55; cursor:default; }
.team-messenger-header { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:12px 20px; border-bottom:1px solid #d9e0e6; flex-shrink:0; }
.team-messenger .team-messenger-title { margin:0; padding:0; font-size:22px; line-height:28px; font-weight:600; text-transform:none; }
.team-messenger-header form { margin:0; }
.team-messenger .team-messenger-close, .team-messenger .tm-icon { display:inline-flex; align-items:center; justify-content:center; width:40px; height:40px; padding:0; border:0; border-radius:4px; background:transparent; color:#26384c; font:26px/1 Arial,sans-serif; flex-shrink:0; }
.team-messenger-close:hover, .team-messenger .tm-icon:hover { background:#e8eeea; }
.tm-workspace { display:grid; grid-template-columns:300px minmax(0,1fr); flex:1; min-height:0; }
.tm-sidebar { display:flex; flex-direction:column; min-height:0; border-right:1px solid #d9e0e6; background:#fafcfc; }
.tm-tabs { display:flex; gap:6px; padding:12px; border-bottom:1px solid #d9e0e6; }
.tm-tabs button { flex:1; min-height:38px; padding:7px; border:1px solid transparent; border-radius:4px; background:transparent; color:#526173; }
.tm-tabs button[aria-selected="true"] { border-color:#b8d2c6; background:#e8f1ea; color:#204d3d; }
.tm-dialogs { min-height:0; overflow-y:auto; }
.tm-room { display:block; width:100%; min-height:72px; padding:12px 14px; border:0; border-bottom:1px solid #e5e9ec; background:transparent; color:#26384c; text-align:left; }
.tm-room:hover { background:#f0f5f3; }
.tm-room[aria-current="true"] { background:#e5efea; box-shadow:inset 3px 0 #47826a; }
.tm-room-title { display:flex; gap:8px; align-items:center; justify-content:space-between; font-weight:600; }
.tm-room-title span:first-child { min-width:0; overflow-wrap:anywhere; }
.tm-unread { padding:1px 6px; background:#245f49; color:#fff; border-radius:4px; font-size:12px; flex-shrink:0; }
.tm-preview { display:block; margin-top:4px; color:#647482; white-space:nowrap; text-overflow:ellipsis; overflow:hidden; font-size:12px; }
.tm-private { display:flex; flex-direction:column; min-height:0; }
.tm-search-label { display:block; padding:12px 12px 4px; font-size:12px; color:#536572; }
.team-messenger #tm-search { display:block; width:calc(100% - 24px); min-height:38px; margin:0 12px 10px; padding:7px 9px; border:1px solid #cdd9e0; border-radius:4px; background:#fff; }
.tm-conversation { display:flex; flex-direction:column; min-width:0; min-height:0; }
.tm-chat-header { display:flex; align-items:center; gap:8px; min-height:62px; padding:8px 18px; box-sizing:border-box; border-bottom:1px solid #d9e0e6; font-weight:600; flex-shrink:0; }
#tm-chat-title { overflow-wrap:anywhere; min-width:0; flex:1; }
.team-messenger #tm-members-link { margin-left:auto; color:#285b7b; font-size:13px; font-weight:400; text-align:right; }
.tm-members { display:flex; flex-direction:column; min-height:0; flex:1; padding:12px; }
.tm-members-header { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.team-messenger #tm-members-search { min-height:38px; width:100%; padding:7px 9px; margin-bottom:10px; border:1px solid #cdd9e0; border-radius:4px; }
.tm-members-list { overflow-y:auto; min-height:0; }
.tm-member { display:block; width:100%; text-align:left; border:0; border-bottom:1px solid #e5e9ec; background:#fff; padding:10px; color:#26384c; }
.tm-member strong { overflow-wrap:anywhere; }
.tm-member:hover { background:#f0f5f3; }
.tm-message-header { display:flex; align-items:flex-start; justify-content:space-between; gap:8px; }
.tm-message-header>.tm-author { flex:1; min-width:0; }
.team-messenger .tm-message-menu-toggle { display:inline-flex; align-items:center; justify-content:center; width:28px; height:28px; flex-shrink:0; margin:-4px -4px 0 0; padding:0; border:0; border-radius:4px; background:transparent; color:#466254; }
.tm-message-menu-toggle img { display:block; width:18px; height:18px; opacity:.7; }
.team-messenger .tm-message-menu-toggle:hover, .team-messenger .tm-message-menu-toggle[aria-expanded="true"] { background:#d8e7df; }
.tm-message-menu { position:absolute; z-index:30; width:210px; max-width:calc(100% - 16px); max-height:calc(100% - 16px); padding:4px; box-sizing:border-box; overflow-y:auto; border:1px solid #cdd9e0; border-radius:6px; background:#fff; box-shadow:0 5px 18px rgba(18,30,40,.18); }
.tm-message-actions { display:flex; flex-direction:column; gap:2px; margin:0; }
.tm-reaction-picker { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:2px; }
.team-messenger .tm-reaction-picker button { display:flex; align-items:center; justify-content:center; min-height:44px; padding:5px; border:1px solid transparent; border-radius:4px; background:#fff; font-size:24px; }
.team-messenger .tm-reaction-picker button:hover, .team-messenger .tm-reaction-picker button:focus-visible { background:#edf4ef; }
.team-messenger .tm-reaction-picker button[aria-checked="true"] { border-color:#47826a; background:#e2efe7; }
.tm-reactions { display:flex; flex-wrap:wrap; gap:4px; margin-top:6px; }
.team-messenger .tm-reaction { display:inline-flex; align-items:center; justify-content:center; gap:5px; min-width:48px; min-height:30px; padding:3px 7px; border:1px solid #cdd9e0; border-radius:6px; background:#fff; color:#354b60; font-size:18px; }
.team-messenger .tm-reaction[aria-pressed="true"] { border-color:#47826a; background:#e2efe7; }
.tm-reaction-count { font-size:12px; }
.tm-quote { display:block; width:100%; max-width:100%; margin:6px 0; padding:7px 9px; border:0; border-left:3px solid #47826a; border-radius:2px; background:#f0f5f2; color:#466254; text-align:left; }
.tm-quote strong { display:block; font-size:12px; }
.tm-quote span { display:block; font-size:12px; white-space:pre-wrap; overflow-wrap:anywhere; }
.tm-pins { flex-shrink:0; border-bottom:1px solid #d9e0e6; padding:4px 12px; background:#f0f5f2; }
.tm-pin-row { display:flex; align-items:center; gap:8px; }
.tm-pin-preview { flex:1; min-width:0; padding:5px 0; border:0; background:transparent; color:#375c50; text-align:left; white-space:nowrap; text-overflow:ellipsis; overflow:hidden; font-size:12px !important; }
.team-messenger .tm-unpin { width:30px; height:30px; font-size:21px; }
.tm-replying { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:8px; padding-left:9px; border-left:3px solid #47826a; color:#375c50; }
.tm-replying div { min-width:0; }
.tm-replying strong, .tm-replying span { display:block; font-size:12px; white-space:nowrap; text-overflow:ellipsis; overflow:hidden; }
.tm-pin-settings { display:flex; flex-wrap:wrap; align-items:center; gap:8px; margin-bottom:8px; font-size:12px; }
.tm-pin-settings select, .tm-pin-settings button:not(.tm-icon) { min-height:34px; border:1px solid #cdd9e0; border-radius:4px; background:#fff; color:#26384c; padding:5px 8px; }
.tm-message-highlight { outline:2px solid #47826a; outline-offset:2px; }
.team-messenger .tm-message-actions button { display:block; width:100%; min-height:38px; padding:8px 12px; border:0; border-radius:4px; background:transparent; color:#285b7b; font-size:14px; text-align:left; }
.team-messenger .tm-message-actions button:hover, .team-messenger .tm-message-actions button:focus-visible { background:#edf4ef; }
.team-messenger .tm-message-actions button[data-delete] { color:#a32929; }
.tm-deleted .tm-body { color:#687a86; font-style:italic; }
.tm-editing { display:flex; align-items:center; justify-content:space-between; gap:8px; padding-bottom:6px; color:#375c73; font-size:12px; }
.team-messenger #tm-back { display:none; }
.tm-messages { flex:1; min-height:0; overflow-y:auto; padding:16px 20px; background:#f5f8f7; }
.tm-message { width:fit-content; max-width:85%; margin:0 0 12px; padding:10px 12px; border:1px solid #dde5e0; border-radius:6px; background:#fff; box-sizing:border-box; }
.tm-message-own { margin-left:auto; background:#e8f2ed; border-color:#c8dcd1; }
.tm-author { font-size:12px; font-weight:600; color:#3c6857; overflow-wrap:anywhere; }
.team-messenger .tm-author-link { display:block; max-width:100%; margin:0; padding:0; border:0; border-bottom:1px dotted #8eafa0; background:transparent; color:#3c6857; font-size:12px; font-weight:600; text-align:left; white-space:normal; }
.team-messenger .tm-author-link:hover { color:#204d3d; border-bottom-style:solid; }
.tm-body { white-space:pre-wrap; overflow-wrap:anywhere; margin:5px 0; }
.tm-time { display:block; color:#687a86; text-align:right; font-size:11px; }
.tm-status { padding:16px; margin:0; color:#637383; font-size:14px; }
.tm-error { padding:10px 16px; background:#fff0ed; border-bottom:1px solid #efcbc2; color:#922e21; overflow-wrap:anywhere; flex-shrink:0; }
.team-messenger .tm-older { align-self:center; margin:7px; padding:5px 12px; background:#fff; border:1px solid #cdd9e0; border-radius:4px; color:#375c73; }
.tm-compose { margin:0; padding:10px 12px 6px; border-top:1px solid #d9e0e6; background:#fff; flex-shrink:0; }
.tm-compose-row { display:flex; align-items:flex-end; gap:8px; }
.team-messenger #tm-body { display:block; flex:1; min-width:0; height:64px; min-height:64px; max-height:150px; resize:vertical; padding:8px; border:1px solid #c6d4cd; border-radius:4px; background:#fff; color:#26384c; }
.team-messenger #tm-send { height:40px; padding:8px 12px; border:1px solid #245f49; border-radius:4px; background:#245f49; color:#fff; flex-shrink:0; }
.tm-length { display:block; margin:4px 0 0; text-align:right; color:#687a86; font-size:11px; }
.tm-emojis { padding:0 0 8px; }
.tm-emoji-tabs { display:flex; gap:4px; padding-bottom:8px; }
.team-messenger .tm-emoji-tabs button { flex:1; min-width:0; min-height:34px; padding:5px 4px; border:1px solid #d9e0e6; border-radius:4px; background:#fff; color:#526173; font-size:12px; }
.team-messenger .tm-emoji-tabs button[aria-selected="true"] { border-color:#b8d2c6; background:#e8f1ea; color:#204d3d; }
.tm-emoji-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(36px,1fr)); gap:4px; max-height:160px; max-height:min(160px,24dvh); overflow-y:auto; overscroll-behavior:contain; }
.team-messenger .tm-emoji-grid button { width:100%; height:38px; padding:0; border:1px solid #d9e0e6; border-radius:4px; background:#fff; font-size:22px; }
.team-messenger button:focus-visible, .team-messenger input:focus-visible, .team-messenger textarea:focus-visible, .team-messenger-launch button:focus-visible { outline:2px solid #3f876d; outline-offset:1px; }
.tm-messages:focus-visible { outline:2px solid #3f876d; outline-offset:-2px; }
@media(max-width:700px) {
 .team-messenger { width:calc(100vw - 16px); max-width:calc(100vw - 16px); height:calc(100vh - 16px); height:calc(100dvh - 16px); max-height:calc(100vh - 16px); max-height:calc(100dvh - 16px); }
 .team-messenger-header { padding:8px 12px; }
 .team-messenger .team-messenger-title { font-size:19px; line-height:24px; }
 .tm-workspace { display:flex; flex-direction:column; }
 .tm-sidebar { flex:1; border-right:0; }
 .tm-workspace[data-view="list"] .tm-conversation, .tm-workspace[data-view="chat"] .tm-sidebar { display:none; }
 .tm-workspace[data-view="chat"] .tm-conversation { flex:1; }
 .team-messenger #tm-back { display:inline-flex; }
 .tm-chat-header { padding:4px 8px; min-height:52px; }
 .team-messenger #tm-members-link { max-width:170px; font-size:12px; }
 .tm-messages { padding:12px; }
 .tm-compose { padding:8px; }
 .tm-compose-row { gap:4px; flex-wrap:wrap; }
 .team-messenger #tm-send { padding:8px; }
 .tm-message { max-width:95%; }
 .team-messenger .tm-message-menu-toggle { width:32px; height:32px; }
 .team-messenger .tm-message-actions button { min-height:44px; }
 .team-messenger .tm-reaction { min-height:36px; }
}
