/* Chat like Facebook, on a computer (Rami, 2 November 2026; public/chatdock.js): the chat icon in the top bar, its Chats dropdown, and the
   chat windows docked at the bottom of the page (right; left in Arabic), beside Kasper. Cadence's tokens (public/cadence.css), light and
   dark. Phones keep the Hub's own Chat: none of this shows under 861px. */

/* ---------- the chat icon, between Escalate and the bell ---------- */
.tb-chat{display:none}
@media (min-width:861px){
  html body .tb-chat:not([hidden]){position:fixed;top:10px;inset-inline-end:106px;z-index:41;width:38px;height:38px;border:0;border-radius:999px;background:none;color:var(--c-ink);display:grid;place-items:center;cursor:pointer;padding:0}
  html body .tb-chat:hover,html body .tb-chat[aria-expanded="true"]{background:var(--side-active)}
  html body .tb-chat:focus-visible{outline:2px solid var(--focus);outline-offset:2px}
  html body .tb-chat svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
  html body .tb-chat i{position:absolute;top:3px;inset-inline-end:2px;min-width:16px;height:16px;padding:0 4px;border-radius:999px;background:#d4382c;color:#fff;font:700 10px/16px var(--font-sans);font-style:normal;text-align:center;box-sizing:border-box}
  html body .tb-chat i[hidden]{display:none}
}
body.bd-full-on .tb-chat,body.bd-full-on .cd-dock,body.bd-full-on .cd-pop{display:none!important}
@media print{.tb-chat,.cd-dock,.cd-pop{display:none!important}}

/* ---------- Chats, under the icon ---------- */
.cd-pop{position:fixed;top:56px;inset-inline-end:62px;z-index:58;width:360px;max-height:min(560px,calc(100vh - 72px));display:flex;flex-direction:column;border-radius:16px;background:var(--surface);color:var(--c-ink);box-shadow:var(--shadow-menu);overflow:hidden;font-family:var(--font-sans)}
.cd-pop[hidden]{display:none}
.cd-ph{display:flex;align-items:baseline;justify-content:space-between;gap:12px;padding:16px 18px 8px}
.cd-ph h2{margin:0;font:700 20px/1.2 var(--font-sans);letter-spacing:-.01em}
.cd-link{font:500 13px var(--font-sans);color:var(--c-ink);text-decoration:underline;text-underline-offset:3px}
.cd-tabs{display:flex;gap:6px;padding:4px 14px 10px}
.cd-tabs button{height:32px;padding:0 13px;border:0;border-radius:999px;background:var(--surface-sunken);color:var(--c-ink);font:500 13px var(--font-sans);cursor:pointer}
.cd-tabs button:hover{background:var(--surface-hover)}
.cd-tabs button.on{background:var(--c-ink);color:var(--surface)}
.cd-list{flex:1 1 auto;overflow-y:auto;padding:0 6px 6px;overscroll-behavior:contain}
.cd-row{display:flex;align-items:center;gap:12px;width:100%;padding:8px 10px;border:0;border-radius:12px;background:none;color:inherit;text-align:start;cursor:pointer;font:inherit}
.cd-row:hover{background:var(--surface-hover)}
.cd-row:focus-visible,.cd-all:focus-visible,.cd-link:focus-visible,.cd-tabs button:focus-visible,.cd-ib:focus-visible,.cd-open:focus-visible,.cd-who:focus-visible,.cd-bo:focus-visible,.cd-bx:focus-visible{outline:2px solid var(--focus);outline-offset:2px}
.cd-rt{flex:1;min-width:0;display:grid;gap:1px}
.cd-rt b{font:600 14.5px/1.3 var(--font-sans);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.cd-rt small{display:flex;min-width:0;font:400 13px/1.35 var(--font-sans);color:var(--ink-subtle)}
.cd-pv{min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.cd-ago{flex:none;white-space:nowrap}
.cd-sep{flex:none;padding:0 4px}
.cd-row.new .cd-rt b{font-weight:700}
.cd-row.new .cd-rt small{color:var(--c-ink);font-weight:600}
.cd-dot{flex:none;width:10px;height:10px;border-radius:50%;background:var(--focus)}
.cd-empty{margin:0;padding:22px 14px;text-align:center;color:var(--ink-subtle);font-size:13.5px}
.cd-all{display:block;padding:12px;border-top:1px solid var(--border);text-align:center;font:600 14px var(--font-sans);color:var(--c-ink);text-decoration:none}
.cd-all:hover{background:var(--surface-hover)}

/* a chat's picture: a person's initials in their colour (as in a group chat), a client's logo, # for a channel */
.cd-av{position:relative;flex:none;width:44px;height:44px;border-radius:50%;display:grid;place-items:center;font:700 14px var(--font-sans);background:var(--surface-sunken);color:var(--c-ink);overflow:hidden}
.cd-av img{width:100%;height:100%;object-fit:cover;border-radius:inherit}
.cd-av.k-dm{background:hsl(var(--h,220) 70% 88%);color:hsl(var(--h,220) 45% 28%)}
.cd-av.k-group{font-size:17px;font-weight:600}
.cd-av.live::after{content:"";position:absolute;bottom:1px;inset-inline-end:1px;width:10px;height:10px;border-radius:50%;background:var(--accent-green);box-shadow:0 0 0 2px var(--surface)}
.cd-av.live{overflow:visible}

/* ---------- the windows at the bottom, beside Kasper ---------- */
.cd-dock{display:none}
@media (min-width:861px){
  .cd-dock.has{display:block}
  .cd-wins{position:fixed;bottom:0;inset-inline-end:96px;z-index:38;display:flex;flex-direction:row;align-items:flex-end;gap:12px;pointer-events:none}
  .cd-bubs{position:fixed;bottom:92px;inset-inline-end:25px;z-index:38;display:flex;flex-direction:column-reverse;gap:10px}
}
html body:has(#p-ch.on) .cd-dock{display:none!important}
.cd-win{pointer-events:auto;width:330px;height:430px;max-height:calc(100vh - 80px);display:flex;flex-direction:column;border-radius:14px 14px 0 0;background:var(--surface);color:var(--c-ink);box-shadow:var(--shadow-modal);font-family:var(--font-sans);overflow:hidden}
.cd-wh{display:flex;align-items:center;gap:2px;padding:8px 8px 8px 10px;border-bottom:1px solid var(--border)}
.cd-who{flex:1;min-width:0;display:flex;align-items:center;gap:10px;padding:2px 4px;border-radius:10px;color:inherit;text-decoration:none}
.cd-who:hover{background:var(--surface-hover)}
.cd-who .cd-av{width:32px;height:32px;font-size:12px}
.cd-who>span{min-width:0;display:grid}
.cd-who b{font:700 14.5px/1.25 var(--font-sans);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.cd-who small{font:400 12px/1.3 var(--font-sans);color:var(--ink-subtle)}
.cd-ib{flex:none;width:30px;height:30px;padding:0;border:0;border-radius:50%;background:none;color:var(--ink-muted);display:grid;place-items:center;cursor:pointer}
.cd-ib:hover{background:var(--surface-hover);color:var(--c-ink)}
.cd-ib svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}
.cd-msgs{flex:1 1 auto;overflow-y:auto;padding:12px 12px 6px;display:flex;flex-direction:column;gap:6px;overscroll-behavior:contain}
.cd-m{display:flex;flex-direction:column;align-items:flex-start;max-width:82%}
.cd-m.cont{margin-top:-3px}
.cd-m.mine{align-self:flex-end;align-items:flex-end}
.cd-by{font:600 12px var(--font-sans);color:hsl(var(--h,220) 55% var(--chat-name-l,36%));padding:0 4px 2px}
.cd-b{padding:7px 12px;border-radius:18px;background:var(--surface-sunken);font:400 14px/1.4 var(--font-sans);overflow-wrap:anywhere}
.cd-m.mine .cd-b{background:var(--chat-mine,#7a2fd0);color:var(--chat-mine-ink,#fff)}
.cd-b p{margin:0;white-space:pre-wrap}
.cd-b a{color:inherit;text-decoration:underline}
.cd-b em{font-style:italic;opacity:.8}
.cd-pics{display:flex;flex-wrap:wrap;gap:4px;margin:-2px -6px 4px}
.cd-pics:last-child{margin-bottom:-2px}
.cd-pic{padding:0;border:0;background:none;cursor:zoom-in;border-radius:12px;overflow:hidden;line-height:0}
.cd-pic img{width:120px;height:120px;object-fit:cover}
.cd-open{display:flex;align-items:center;justify-content:center;gap:4px;margin:4px 12px 8px;height:34px;border-radius:999px;background:var(--surface-sunken);color:var(--c-ink);font:600 13px var(--font-sans);text-decoration:none}
.cd-open:hover{background:var(--surface-hover)}
.cd-open svg{width:14px;height:14px;fill:none;stroke:currentColor;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round}
[dir="rtl"] .cd-open svg{transform:scaleX(-1)}
.cd-say{position:relative;padding:8px 10px 10px;border-top:1px solid var(--border)}
.cd-in{display:flex;align-items:flex-end;gap:2px;padding:3px 4px;border-radius:20px;background:var(--surface-sunken)}
html body .cd-in textarea:not(#_):not(#_){flex:1;min-width:0;width:auto;min-height:30px;max-height:96px;resize:none;border:0!important;border-radius:0;background:none!important;box-shadow:none!important;color:var(--c-ink);font:400 14px/1.4 var(--font-sans);padding:5px 4px;margin:0;outline:none}
.cd-in:focus-within{box-shadow:0 0 0 2px var(--focus)}
.cd-send{color:var(--focus)}
.cd-say .cd-at{position:absolute;bottom:calc(100% - 4px);inset-inline:10px;z-index:2}
.cd-emo{position:absolute;bottom:calc(100% - 4px);inset-inline-end:10px;z-index:2;display:grid;grid-template-columns:repeat(8,30px);gap:2px;padding:6px;border-radius:12px;background:var(--surface);box-shadow:var(--shadow-menu)}
.cd-emo[hidden],.cd-pend[hidden]{display:none}
.cd-emo button{width:30px;height:30px;padding:0;border:0;border-radius:8px;background:none;font-size:18px;cursor:pointer}
.cd-emo button:hover,.cd-emo button:focus-visible{background:var(--surface-hover)}
.cd-pend{display:flex;flex-wrap:wrap;gap:4px;margin-bottom:6px}
.cd-pend span{display:inline-flex;align-items:center;gap:4px;max-width:100%;padding:2px 4px 2px 10px;border-radius:999px;background:var(--surface-sunken);font-size:12px}
.cd-pend button{border:0;background:none;color:inherit;cursor:pointer;font-size:15px;line-height:1}
.cd-said{display:block;font-size:12px;color:var(--ink-subtle)}
.cd-said:empty{display:none}

/* a minimised window: its picture above Kasper, with its number */
.cd-bub{position:relative;display:block}
.cd-bo{position:relative;display:block;width:48px;height:48px;padding:0;border:0;border-radius:50%;background:none;cursor:pointer;box-shadow:var(--shadow-menu)}
.cd-bo .cd-av{width:48px;height:48px;font-size:15px}
.cd-bo i{position:absolute;top:-4px;inset-inline-end:-4px;min-width:18px;height:18px;padding:0 5px;border-radius:999px;background:#d4382c;color:#fff;font:700 11px/18px var(--font-sans);font-style:normal;text-align:center;box-shadow:0 0 0 2px var(--c-bg);box-sizing:border-box}
.cd-bx{position:absolute;top:-6px;inset-inline-start:-6px;width:20px;height:20px;padding:0;border:0;border-radius:50%;background:var(--surface);color:var(--c-ink);box-shadow:var(--shadow-menu);display:grid;place-items:center;cursor:pointer;opacity:0;transition:opacity var(--dur-fast,120ms)}
.cd-bx svg{width:11px;height:11px;fill:none;stroke:currentColor;stroke-width:2.6;stroke-linecap:round}
.cd-bub:hover .cd-bx,.cd-bub:focus-within .cd-bx{opacity:1}
@media (prefers-reduced-motion:no-preference){.cd-win{animation:cd-up var(--dur-base,200ms) var(--ease-out,ease-out)}}
@keyframes cd-up{from{transform:translateY(16px);opacity:0}to{transform:none;opacity:1}}
html body .cd-in textarea:is(:focus,:focus-visible):not(#_):not(#_){outline:none!important;box-shadow:none!important}
