/* Chat (5.73.0): a messenger layout. The chat list (round avatars, last message, unread count) sits beside the
   conversation; messages are bubbles on a tinted background with the time and sent mark inside them; the composer is
   one row (attach · message · round send). Phones show the list or the open conversation, never both. */
.chat-layout{--chat-offset:255px;--chat-wall:#dfe8f1;--chat-in:#ffffff;--chat-out:#e5f4d6;--chat-out-meta:#5d9a52;--chat-accent:#2f6fae;
 display:grid;grid-template-columns:330px minmax(0,1fr);height:max(500px,calc(100dvh - var(--chat-offset) - 24px));background:white;border:1px solid var(--border,#e2e8f0);border-radius:14px;overflow:hidden;box-shadow:0 4px 24px #102d4f06}
.chat-sidebar{position:relative;min-width:0;display:flex;flex-direction:column;min-height:0;background:white;border-right:1px solid #e3eaf2}
.chat-sidebar-head{display:flex;align-items:center;gap:8px;padding:10px 12px 8px}
.chat-menu{position:relative}
.chat-menu summary{list-style:none;display:grid;place-items:center;width:40px;height:40px;border-radius:50%;color:#6d7f95;cursor:pointer}
.chat-menu summary::-webkit-details-marker{display:none}
.chat-menu summary:hover,.chat-menu[open] summary{background:#f0f4f8;color:#102d4f}
.chat-menu summary:focus-visible{outline:2px solid var(--chat-accent);outline-offset:1px}
.chat-menu-list{position:absolute;z-index:20;top:46px;left:0;min-width:230px;display:grid;padding:6px;background:white;border:1px solid #e3eaf2;border-radius:12px;box-shadow:0 10px 30px #102d4f26}
.chat-menu-list button{display:flex;align-items:center;gap:12px;border:0;background:none;padding:10px 12px;border-radius:8px;font:inherit;font-size:13px;font-weight:500;color:#1c3550;text-align:left;cursor:pointer}
.chat-menu-list button:hover,.chat-menu-list button:focus-visible{background:#f0f4f8;outline:0}
.chat-menu-list .icon{width:18px;height:18px;color:#6d7f95}
.chat-search{flex:1;min-width:0;display:flex;align-items:center;gap:8px;height:40px;border-radius:20px;background:#f1f4f7;padding:0 14px;border:2px solid transparent}
.chat-search:focus-within{background:white;border-color:var(--chat-accent)}
.chat-search .icon{width:17px;height:17px;color:#8a99ab}
.chat-search input{min-width:0;width:100%;border:0;outline:0;background:transparent;font:inherit;font-size:14px;padding:0}
.chat-filters{display:flex;gap:2px;padding:0 10px;border-bottom:1px solid #e9eef3;overflow-x:auto;scrollbar-width:none}
.chat-filters::-webkit-scrollbar{display:none}
.chat-filters button{flex:0 0 auto;display:inline-flex;align-items:center;gap:6px;border:0;border-bottom:3px solid transparent;background:none;padding:9px 10px 8px;font:inherit;font-size:13px;font-weight:600;color:#7c8ca0;cursor:pointer}
.chat-filters button[aria-selected=true]{color:var(--chat-accent);border-bottom-color:var(--chat-accent)}
.chat-filters button:focus-visible{outline:2px solid var(--chat-accent);outline-offset:-2px}
.chat-filter-count{min-width:18px;height:18px;padding:0 5px;border-radius:9px;background:#9aa8b8;color:white;font-size:10px;font-weight:700;display:inline-grid;place-items:center}
.chat-filters button[aria-selected=true] .chat-filter-count{background:var(--chat-accent)}
#chatRoomList{overflow-y:auto;flex:1;padding:6px 6px 72px}
.chat-room{display:flex;align-items:center;gap:12px;width:100%;text-align:left;border:0;border-radius:12px;background:transparent;padding:8px 9px;color:#102d4f;cursor:pointer;font:inherit}
.chat-room:hover{background:#f2f5f8}
.chat-room:focus-visible{outline:2px solid var(--chat-accent);outline-offset:-2px}
.chat-room.selected{background:var(--chat-accent);color:white}
.chat-room-copy{display:grid;gap:3px;min-width:0;flex:1}
.chat-room-top,.chat-room-bottom{display:flex;align-items:center;gap:8px;min-width:0}
.chat-room-top b{flex:1;min-width:0;font-size:14px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.chat-room-top time{flex-shrink:0;font-size:12px;color:#8a99ab;display:inline-flex;gap:3px;align-items:center}
.chat-room-preview{flex:1;min-width:0;font-size:13px;color:#6f8097;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.chat-room-sender{color:#2b4a69}
.chat-room-kind{color:#97a5b5}
.chat-tick{color:#4fae4e;font-size:12px;line-height:1}
.chat-room.selected time,.chat-room.selected .chat-room-preview,.chat-room.selected .chat-room-sender,.chat-room.selected .chat-room-kind,.chat-room.selected .chat-tick{color:#ffffffd9}
.chat-count{display:inline-grid;place-items:center;border-radius:11px;min-width:22px;height:22px;padding:0 6px;background:var(--chat-accent,#2f6fae);color:white;font-size:11px;font-weight:700;flex-shrink:0}
.chat-count[hidden]{display:none}
.chat-room.selected .chat-count{background:white;color:var(--chat-accent)}
.chat-list-empty{padding:16px;color:#7d8ba0;font-size:13px;text-align:center}
.chat-compose-fab{position:absolute;right:18px;bottom:18px;display:grid;place-items:center;width:52px;height:52px;border:0;border-radius:50%;background:var(--chat-accent);color:white;box-shadow:0 4px 14px #102d4f40;cursor:pointer}
.chat-compose-fab:hover{filter:brightness(1.08)}
.chat-compose-fab:focus-visible{outline:3px solid #102d4f;outline-offset:2px}
.chat-compose-fab .icon{width:22px;height:22px}

/* Round avatars: initials for people, a symbol for company and project chats. */
.chat-avatar{display:inline-grid;place-items:center;flex-shrink:0;width:50px;height:50px;border-radius:50%;color:white;font-size:16px;font-weight:600;letter-spacing:.02em;background:var(--hue,#7d93ab)}
.chat-avatar .icon{width:24px;height:24px}
.chat-avatar.small{width:40px;height:40px;font-size:14px}
.chat-avatar.small .icon{width:20px;height:20px}
.chat-avatar.company{background:linear-gradient(135deg,#f6a35c,#e8711d)}
.chat-c0{--hue:#e0716f}.chat-c1{--hue:#e19b4a}.chat-c2{--hue:#8b72d6}.chat-c3{--hue:#4fae6e}.chat-c4{--hue:#3f9dc6}.chat-c5{--hue:#4e7cc9}.chat-c6{--hue:#d06a9b}.chat-c7{--hue:#36a3a0}
.chat-room.selected .chat-avatar{box-shadow:0 0 0 2px #ffffff80}

.chat-conversation{position:relative;display:flex;flex-direction:column;min-width:0;min-height:0;background-color:var(--chat-wall);
 background-image:radial-gradient(circle at 20% 15%,#ffffff55 0 2px,transparent 3px),radial-gradient(circle at 70% 60%,#ffffff44 0 2px,transparent 3px),linear-gradient(160deg,#e6eef5 0%,#d6e3ee 55%,#dde7d9 100%);background-size:46px 46px,58px 58px,100% 100%}
.chat-thread-head{display:flex;align-items:center;gap:10px;padding:8px 14px;min-height:58px;background:white;border-bottom:1px solid #e3eaf2;flex:none}
.chat-thread-empty{display:none}
.chat-back{display:none;place-items:center;width:40px;height:40px;border:0;border-radius:50%;background:none;color:#4a6079;cursor:pointer;flex-shrink:0}
.chat-back .icon{width:22px;height:22px}
.chat-thread-title{flex:1;min-width:0;display:grid;gap:1px;border:0;background:none;padding:2px 4px;text-align:left;font:inherit;color:#102d4f;cursor:pointer;border-radius:8px}
.chat-thread-title:focus-visible{outline:2px solid var(--chat-accent)}
.chat-thread-title b{font-size:15px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.chat-thread-title small{font-size:12.5px;color:#8a99ab;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.chat-connection{color:#8a99ab}
.chat-head-action{display:grid;place-items:center;width:40px;height:40px;border:0;border-radius:50%;background:none;color:#6d7f95;cursor:pointer;flex-shrink:0}
.chat-head-action:hover{background:#f0f4f8;color:#102d4f}
.chat-head-action:focus-visible{outline:2px solid var(--chat-accent)}
.chat-head-action .icon{width:21px;height:21px}
.chat-history{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;padding:6px max(16px,calc((100% - 760px)/2)) 10px}
.chat-day{position:sticky;top:6px;z-index:2;display:flex;justify-content:center;padding:10px 0 6px;pointer-events:none}
.chat-day span,.chat-empty-pill{display:inline-block;font-size:12.5px;font-weight:500;color:white;background:#3d5a77c4;backdrop-filter:blur(4px);padding:4px 11px;border-radius:14px}
.chat-empty{height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;padding:24px;text-align:center}
.chat-older{display:flex;justify-content:center;padding-top:10px}
.chat-older .chat-empty-pill{border:0;cursor:pointer;font:inherit;font-size:12.5px}
.chat-message{display:flex;align-items:flex-end;gap:6px;margin-top:2px}
.chat-message.first{margin-top:8px}
.chat-message.own{flex-direction:row-reverse}
.chat-message>.chat-avatar{width:34px;height:34px;font-size:12px}
.chat-avatar-gap{width:34px;flex-shrink:0}
.chat-bubble{position:relative;max-width:min(75%,520px);min-width:0;background:var(--chat-in);color:#14263a;border-radius:16px;padding:6px 10px 6px 11px;font-size:14.5px;line-height:1.4;box-shadow:0 1px 1px #0d2a4a1f}
.chat-message.own .chat-bubble{background:var(--chat-out)}
/* The last bubble of a group has a tail on the sender's side. */
.chat-message.last:not(.own) .chat-bubble{border-bottom-left-radius:4px}
.chat-message.last.own .chat-bubble{border-bottom-right-radius:4px}
.chat-message.last:not(.own) .chat-bubble::before,.chat-message.last.own .chat-bubble::before{content:"";position:absolute;bottom:0;width:10px;height:14px;background:inherit}
.chat-message.last:not(.own) .chat-bubble::before{left:-7px;clip-path:path("M10 0 C10 8 6 12 0 14 L10 14 Z")}
.chat-message.last.own .chat-bubble::before{right:-7px;clip-path:path("M0 0 C0 8 4 12 10 14 L0 14 Z")}
.chat-message-author{display:block;font-size:13px;font-weight:600;color:var(--hue,#2f6fae);margin-bottom:1px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.chat-message-author span{font-weight:400;color:#8a99ab}
.chat-text{white-space:pre-wrap;overflow-wrap:anywhere}
/* Time and sent mark float at the end of the last line, inside the bubble. */
.chat-stamp{float:right;display:inline-flex;align-items:center;gap:3px;margin:8px 0 -4px 10px;font-size:11px;color:#8a99ab;line-height:1;position:relative;top:2px}
.chat-message.own .chat-stamp{color:var(--chat-out-meta)}
.chat-message.own .chat-tick{color:var(--chat-out-meta)}
.chat-bubble.chat-hidden{font-style:italic;color:#7b8ca0}
.chat-bubble.has-files{padding-top:4px}
.chat-message-more{align-self:center;border:0;background:#ffffffb3;color:#5b7088;font-size:15px;line-height:1;width:28px;height:28px;border-radius:50%;cursor:pointer;opacity:0;transition:opacity .15s}
.chat-message:hover .chat-message-more,.chat-message-more:focus-visible{opacity:1}
.chat-message-more:focus-visible{outline:2px solid var(--chat-accent)}
@media(hover:none){.chat-message-more{opacity:.75}}
.chat-new{position:absolute;right:18px;bottom:78px;z-index:3;display:grid;place-items:center;width:44px;height:44px;border:0;border-radius:50%;background:white;color:#4a6079;box-shadow:0 2px 10px #0d2a4a33;cursor:pointer}
.chat-new .icon{width:22px;height:22px}

.chat-composer{flex:none;display:grid;gap:6px;padding:8px max(12px,calc((100% - 760px)/2)) 10px}
.chat-attachments{display:grid;gap:4px}
.chat-attachments:has(.chat-staged:empty):has(.chat-upload-state:empty){display:none}
.chat-upload-state{font-size:12px;color:#38536f;background:#ffffffd9;border-radius:8px;padding:3px 9px;justify-self:start}
.chat-upload-state:empty{display:none}
.chat-composer-row{display:flex;align-items:flex-end;gap:8px}
.chat-input{flex:1;min-width:0;display:flex;align-items:flex-end;gap:2px;background:white;border-radius:22px;padding:2px 4px;box-shadow:0 1px 2px #0d2a4a26}
.chat-input:focus-within{box-shadow:0 0 0 2px var(--chat-accent)}
.chat-attach{position:relative;flex-shrink:0;display:grid;place-items:center;width:40px;height:40px;border-radius:50%;color:#7c8ca0;cursor:pointer;overflow:hidden}
.chat-attach:hover{color:#2f6fae}
.chat-attach:focus-within{color:#2f6fae;outline:2px solid var(--chat-accent);outline-offset:-2px}
.chat-attach .icon{width:22px;height:22px}
.chat-attach input{position:absolute;inset:0;opacity:0;cursor:pointer;width:100%}
.chat-attach.disabled{opacity:.45;pointer-events:none}
.chat-composer textarea{flex:1;min-width:0;box-sizing:border-box;resize:none;height:40px;min-height:40px;max-height:140px;border:0;padding:10px 12px 10px 2px;outline:0;font:inherit;font-size:15px;line-height:1.35;background:transparent;overflow-y:auto}
.chat-send{flex-shrink:0;display:grid;place-items:center;width:44px;height:44px;border:0;border-radius:50%;background:var(--chat-accent);color:white;cursor:pointer;box-shadow:0 1px 3px #0d2a4a33}
.chat-send:hover{filter:brightness(1.08)}
.chat-send:focus-visible{outline:3px solid #102d4f;outline-offset:2px}
.chat-send:disabled{opacity:.6;cursor:default}
.chat-send .icon{width:21px;height:21px;margin-left:-2px}
.chat-send-state:not(.error){position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}
.chat-send-state.error{font-size:12px;color:#a33a36;background:#fff3f2;border-radius:8px;padding:5px 10px}

/* Attachments waiting to be sent, and files inside messages. */
.chat-staged{display:flex;flex-wrap:wrap;gap:6px;max-height:126px;overflow-y:auto}
.chat-staged:empty{display:none}
.chat-staged>span{display:flex;align-items:center;gap:6px;max-width:min(100%,320px);overflow-wrap:anywhere;font-size:12px;background:white;border-radius:10px;padding:6px 8px;box-shadow:0 1px 2px #0d2a4a26}
.chat-staged>span img{display:block;width:64px;height:48px;object-fit:contain;border-radius:6px;background:#eef3f8;flex-shrink:0}
.chat-staged-name{min-width:0;overflow-wrap:anywhere}
.chat-staged-name small{display:block;margin-top:3px;color:#7c8ca0}
.chat-staged button{border:0;background:transparent;font-size:20px;cursor:pointer;padding:0 5px;color:#5b7088}
.chat-file{white-space:normal;color:#123153;border-radius:11px;margin:4px 0;max-width:320px;overflow:hidden;background:#00000008}
.chat-file img{display:block;width:100%;height:auto;max-height:280px;object-fit:cover;background:#e8eef5}
.chat-file-link{display:flex;align-items:center;gap:10px;padding:8px 10px;text-decoration:none;color:inherit;font-size:13px}
.chat-file-link span{overflow-wrap:anywhere;flex:1;min-width:0;color:#2f6fae;font-weight:500}
.chat-file-link small{white-space:nowrap;color:#7c8ca0}

/* Members, new private chat, notification settings, reporting. */
.chat-members{display:grid;gap:0;margin:15px 0}
.chat-members>div{display:flex;gap:12px;align-items:center;padding:12px 0;border-bottom:1px solid #edf1f6}
.chat-members>div>span:nth-child(2){display:flex;flex:1;flex-direction:column;gap:4px}
.chat-members b{font-size:13px}
.chat-members small{font-size:11px;color:#8493a5}
.chat-member-actions{display:flex;gap:6px;flex-wrap:wrap;justify-content:flex-end}
.chat-contact-list{max-height:50vh;overflow:auto;margin-top:14px}
.chat-contact{display:flex;gap:12px;align-items:center;width:100%;padding:12px;border:0;border-bottom:1px solid #e5ebf2;background:white;text-align:left;cursor:pointer;color:inherit}
.chat-contact:hover{background:#f3f7fc}
.chat-contact>span:nth-child(2){flex:1}
.chat-contact b,.chat-contact small{display:block}
.chat-contact small{font-size:11px;color:#72849a;margin-top:4px}
.chat-contact-list .avatar{flex-shrink:0}
.chat-notify-settings{display:grid;gap:12px}
.chat-notify-settings p{margin:0;line-height:1.6}
.chat-notify-settings label{display:flex;align-items:center;gap:10px}
.chat-notify-settings input{width:auto}
.chat-notify-settings hr{width:100%;border:0;border-top:1px solid #e3e9f0}
.chat-safety-actions{display:grid;gap:10px;margin:14px 0}
.chat-report-quote{margin:10px 0;padding:10px 14px;border-left:3px solid #f47721;background:#f8fafc;white-space:pre-wrap;overflow-wrap:anywhere;font-size:13px;line-height:1.6;max-height:180px;overflow:auto}
.chat-report-reasons{border:0;padding:0;margin:12px 0}
.chat-report-reasons legend{font-weight:600;margin-bottom:4px}
.chat-report-reasons .service-consent{margin:8px 0;font-weight:500}
.chat-reports{display:grid;gap:12px;margin-top:12px}
.chat-reports article{border:1px solid #e2e8f0;border-radius:12px;padding:14px}
.chat-reports header{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.chat-reports p{margin:6px 0}
#chatShortcut{position:relative;color:var(--ink,#102d4f)}
#chatShortcut .chat-count{position:absolute;right:-7px;top:-5px;border:2px solid white;min-width:20px;height:20px;font-size:9px;background:#f47b20}
.nav-item>.chat-count{margin-left:auto;background:#f47b20}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}

@media(max-width:1100px){.chat-layout{grid-template-columns:280px minmax(0,1fr)}}

/* Phones: the chat list is the page; an opened conversation covers the screen (top bar and bottom menu included)
   and follows the visible area above the keyboard (--chat-vv-top / --chat-vv-height from chat-ui.js). */
@media(max-width:650px){
 .content:has(.chat-layout)>.page-head{margin-bottom:10px}
 .content:has(.chat-layout)>.page-head .eyebrow,.content:has(.chat-layout)>.page-head p{display:none}
 .chat-layout{display:block;height:auto;border-radius:14px}
 .chat-sidebar{border-right:0}
 .chat-search input{font-size:16px}
 #chatRoomList{overflow:visible;padding:4px 4px 76px}
 .chat-compose-fab{position:fixed;right:max(18px,env(safe-area-inset-right,0px));bottom:calc(80px + env(safe-area-inset-bottom,0px));z-index:31}
 .chat-layout:not(.is-open) .chat-conversation{display:none}
 .chat-layout.is-open .chat-sidebar{display:none}
 .chat-layout.is-open .chat-conversation{position:fixed;left:0;right:0;top:var(--chat-vv-top,0px);height:var(--chat-vv-height,100dvh);z-index:50;padding-top:env(safe-area-inset-top,0px)}
 .chat-back{display:grid}
 .chat-thread-empty{display:flex}
 .chat-thread-head{padding:4px 6px;gap:6px;min-height:54px}
 .chat-history{padding:4px 8px 8px}
 .chat-bubble{max-width:82%}
 .chat-composer{padding:6px 8px calc(8px + env(safe-area-inset-bottom,0px))}
 .chat-new{right:12px;bottom:70px}
 .chat-file{max-width:250px}
 .chat-staged small{display:none}
}
html.chat-open,html.chat-open body{overflow:hidden}
html.chat-keyboard .chat-composer{padding-bottom:8px}
@media(prefers-reduced-motion:reduce){.chat-message-more{transition:none}}
