/* Messagerie interne : un « autre monde » plein écran au-dessus du CRM. Verre dépoli sur un fond vivant aux couleurs
   de la marque ; barres et saisie flottent au-dessus des messages. Toutes les classes commencent par « cw- » pour ne
   jamais toucher au reste du CRM. Champs en 16 px : Safari sur iPhone ne zoome pas. */
.cw-root {
  --cw-font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --cw-head: 'Space Grotesk', 'Inter', system-ui, sans-serif;
  --cw-mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  --cw-bg: #eef2f1; --cw-bg2: #e4ebe9; --cw-glass: rgba(255,255,255,.64); --cw-glass2: rgba(255,255,255,.86); --cw-line: rgba(255,255,255,.75); --cw-edge: rgba(15,30,25,.09);
  --cw-text: #0e1714; --cw-text2: #42514b; --cw-muted: #66756f;
  --cw-in: rgba(255,255,255,.92); --cw-in-text: #0e1714;
  --cw-ok: #16a34a; --cw-warn: #b4700f; --cw-bad: #dc2626; --cw-white: #ffffff;
  --cw-brand: #14c9b9; --cw-brand2: #7b5cff; --cw-ink: #03201d; --cw-soft: rgba(20,201,185,.14); --cw-btext: #0a7d73;
  --cw-out-a: #15c7b6; --cw-out-b: #6d5cff; --cw-out-text: #ffffff;
  --cw-b1: rgba(20,201,185,.33); --cw-b2: rgba(123,92,255,.26); --cw-b3: rgba(25,227,210,.2);
  --cw-shadow: 0 1px 2px rgba(10,30,25,.06), 0 8px 24px rgba(10,30,25,.08);
  --cw-r: 22px;
  position: fixed; inset: 0; z-index: 60; background: var(--cw-bg); color: var(--cw-text); font: 15px/1.45 var(--cw-font);
  -webkit-font-smoothing: antialiased; touch-action: manipulation; -webkit-text-size-adjust: 100%; overflow: hidden;
}
:root[data-brand='cryp'] .cw-root { --cw-brand: #d4a843; --cw-brand2: #8b5e10; --cw-ink: #241700; --cw-soft: rgba(212,168,67,.16); --cw-btext: #85590c; --cw-out-a: #e2bd60; --cw-out-b: #a8741a; --cw-out-text: #1d1300; --cw-b1: rgba(212,168,67,.32); --cw-b2: rgba(139,94,16,.2); --cw-b3: rgba(240,210,140,.28); }
:root[data-theme='dark'] .cw-root {
  --cw-bg: #07100e; --cw-bg2: #0c1715; --cw-glass: rgba(18,30,27,.6); --cw-glass2: rgba(22,34,31,.88); --cw-line: rgba(255,255,255,.07); --cw-edge: rgba(255,255,255,.08);
  --cw-text: #eaf2ef; --cw-text2: #b6c3be; --cw-muted: #8b9a94; --cw-in: rgba(30,44,40,.9); --cw-in-text: #eaf2ef;
  --cw-btext: #45e8d8; --cw-b1: rgba(20,201,185,.18); --cw-b2: rgba(123,92,255,.2); --cw-b3: rgba(25,227,210,.09); --cw-warn: #f0b04a;
  --cw-shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 12px 32px rgba(0,0,0,.35); color-scheme: dark;
}
:root[data-theme='dark'][data-brand='cryp'] .cw-root { --cw-btext: #e8c46e; --cw-b1: rgba(212,168,67,.16); --cw-b2: rgba(139,94,16,.18); --cw-b3: rgba(240,210,140,.07); }
.cw-root * { box-sizing: border-box; }
.cw-root button, .cw-root input, .cw-root textarea, .cw-root select { font: inherit; color: inherit; }
.cw-root input, .cw-root textarea, .cw-root select { font-size: 16px; }
.cw-root button { cursor: pointer; }
.cw-root :focus-visible { outline: 2px solid var(--cw-brand); outline-offset: 2px; border-radius: 8px; }
.cw-root [hidden] { display: none !important; }
.cw-root .svg { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.cw-root .svg.sm { width: 16px; height: 16px; } .cw-root .svg.xs { width: 13px; height: 13px; }
.cw-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.cw-world { position: absolute; inset: 0; overflow: hidden; background: linear-gradient(160deg, var(--cw-bg), var(--cw-bg2)); }
.cw-world i { position: absolute; border-radius: 50%; filter: blur(70px); }
.cw-world i:nth-child(1) { width: 46vmax; height: 46vmax; left: -10vmax; top: -14vmax; background: var(--cw-b1); animation: cw-drift 26s ease-in-out infinite alternate; }
.cw-world i:nth-child(2) { width: 40vmax; height: 40vmax; right: -12vmax; bottom: -16vmax; background: var(--cw-b2); animation: cw-drift 32s ease-in-out infinite alternate-reverse; }
.cw-world i:nth-child(3) { width: 26vmax; height: 26vmax; left: 38%; top: 30%; background: var(--cw-b3); animation: cw-drift 22s ease-in-out infinite alternate; }
@keyframes cw-drift { to { transform: translate(6vmax, 4vmax) scale(1.08); } }

.cw-app { position: relative; z-index: 1; height: 100%; display: grid; grid-template-columns: 76px minmax(300px, 370px) minmax(0, 1fr); gap: 12px;
  padding: max(12px, env(safe-area-inset-top, 0px)) max(12px, env(safe-area-inset-right, 0px)) max(12px, env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px)); }
.cw-app.info-open { grid-template-columns: 76px minmax(300px, 370px) minmax(0, 1fr) 330px; }
.cw-glass { background: var(--cw-glass); backdrop-filter: blur(28px) saturate(1.6); -webkit-backdrop-filter: blur(28px) saturate(1.6); border: 1px solid var(--cw-line); box-shadow: var(--cw-shadow); }

/* Rail */
.cw-rail { border-radius: 26px; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 0; min-height: 0; overflow-y: auto; scrollbar-width: none; }
.cw-mark { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: linear-gradient(140deg, var(--cw-out-a), var(--cw-out-b)); color: var(--cw-out-text); font: 700 16px var(--cw-head); margin-bottom: 8px; flex: none; }
.cw-rail button { position: relative; width: 48px; height: 48px; border-radius: 16px; border: 0; background: transparent; color: var(--cw-text2); display: grid; place-items: center; flex: none; transition: background .2s, color .2s; }
.cw-rail button:hover { background: var(--cw-soft); color: var(--cw-text); }
.cw-rail button.on { background: var(--cw-glass2); color: var(--cw-btext); box-shadow: var(--cw-shadow); }
.cw-pip { position: absolute; top: 5px; right: 5px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--cw-bad); color: var(--cw-white); font: 700 10px/18px var(--cw-font); }
.cw-grow { flex: 1; }

/* Liste */
.cw-list { border-radius: 26px; display: flex; flex-direction: column; min-height: 0; min-width: 0; overflow: hidden; }
.cw-list-h { padding: 18px 18px 10px; display: grid; gap: 12px; min-width: 0; }
.cw-row1 { display: flex; align-items: center; gap: 10px; min-width: 0; }
.cw-row1 h1 { margin: 0; font: 700 24px/1.1 var(--cw-head); letter-spacing: -.02em; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cw-ib { width: 38px; height: 38px; border-radius: 12px; border: 1px solid var(--cw-edge); background: var(--cw-glass2); display: grid; place-items: center; color: var(--cw-text2); transition: transform .15s, color .15s; flex: none; position: relative; }
.cw-ib:hover { color: var(--cw-btext); transform: translateY(-1px); }
.cw-ib.primary { background: linear-gradient(140deg, var(--cw-out-a), var(--cw-out-b)); color: var(--cw-out-text); border-color: transparent; }
.cw-ib.flat { border: 0; background: transparent; }
.cw-ib.on { color: var(--cw-bad); }
.cw-ib.danger { color: var(--cw-bad); }
.cw-mback { display: none; }
.cw-search { display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 14px; border-radius: 14px; background: var(--cw-glass2); border: 1px solid var(--cw-edge); color: var(--cw-muted); min-width: 0; }
.cw-search input { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; color: var(--cw-text); }
.cw-chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.cw-chips::-webkit-scrollbar, .cw-tools::-webkit-scrollbar, .cw-rail::-webkit-scrollbar { display: none; }
.cw-chip { flex: none; height: 32px; padding: 0 13px; border-radius: 999px; border: 1px solid var(--cw-edge); background: transparent; color: var(--cw-text2); font-weight: 500; font-size: 13px; display: inline-flex; align-items: center; gap: 6px; }
.cw-chip.on { background: var(--cw-text); color: var(--cw-bg); border-color: transparent; }
.cw-chip b { font-size: 11px; padding: 1px 6px; border-radius: 9px; background: var(--cw-soft); color: var(--cw-btext); }
.cw-chip.on b { background: var(--cw-brand); color: var(--cw-ink); }
.cw-convs { flex: 1; overflow-y: auto; padding: 4px 10px 14px; min-height: 0; }
.cw-sec { font: 600 11px var(--cw-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--cw-muted); padding: 12px 10px 6px; }
.cw-empty { text-align: center; color: var(--cw-muted); padding: 30px 16px; font-size: 14px; display: grid; gap: 10px; justify-items: center; }
.cw-livecard { display: flex; align-items: center; gap: 12px; margin: 4px 0 6px; padding: 12px; border-radius: 18px; background: linear-gradient(135deg, color-mix(in srgb, var(--cw-brand) 22%, transparent), color-mix(in srgb, var(--cw-brand2) 18%, transparent)); border: 1px solid var(--cw-edge); min-width: 0; }
.cw-livecard .lv { width: 40px; height: 40px; border-radius: 14px; display: grid; place-items: center; background: var(--cw-glass2); color: var(--cw-btext); position: relative; flex: none; }
.cw-livecard .lv::after { content: ''; position: absolute; top: -3px; right: -3px; width: 11px; height: 11px; border-radius: 50%; background: var(--cw-bad); box-shadow: 0 0 0 3px var(--cw-glass2); animation: cw-blink 1.6s infinite; }
@keyframes cw-blink { 50% { opacity: .35; } }
.cw-livecard div { min-width: 0; flex: 1; display: grid; }
.cw-livecard b, .cw-livecard span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cw-livecard b { font-size: 14px; } .cw-livecard span { font-size: 12.5px; color: var(--cw-text2); }
.cw-root .cw-join { height: 34px; padding: 0 14px; border-radius: 999px; border: 0; background: var(--cw-text); color: var(--cw-bg); font-weight: 600; font-size: 13px; flex: none; }
.cw-conv { width: 100%; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px; border-radius: 18px; border: 0; background: transparent; text-align: left; transition: background .15s; }
.cw-conv:hover { background: var(--cw-soft); }
.cw-conv.on { background: var(--cw-glass2); box-shadow: var(--cw-shadow); }
.cw-conv .mid { min-width: 0; display: grid; gap: 2px; }
.cw-conv .top { display: flex; align-items: center; gap: 5px; min-width: 0; color: var(--cw-muted); }
.cw-conv .name { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--cw-text); min-width: 0; }
.cw-conv .prev { color: var(--cw-muted); font-size: 13.5px; white-space: nowrap; overflow: hidden; display: flex; gap: 4px; align-items: center; min-width: 0; }
.cw-conv .prev b { font-weight: 600; color: var(--cw-text2); flex: none; max-width: 45%; overflow: hidden; text-overflow: ellipsis; }
.cw-conv .prev span { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.cw-conv .prev .typ { color: var(--cw-btext); font-weight: 500; }
.cw-conv .cw-cside { display: grid; justify-items: end; gap: 5px; }
.cw-conv .time { font-size: 12px; color: var(--cw-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.cw-conv .time.hot { color: var(--cw-btext); font-weight: 600; }
.cw-badge { min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px; background: var(--cw-brand); color: var(--cw-ink); font: 700 12px/22px var(--cw-font); text-align: center; }
.cw-badge.mention { background: var(--cw-brand2); color: var(--cw-white); }
.cw-badge.cw-muted { background: var(--cw-edge); color: var(--cw-muted); }
.cw-person { width: 100%; display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 16px; border: 0; background: transparent; text-align: left; min-width: 0; }
.cw-person:hover { background: var(--cw-soft); }
.cw-person > div { min-width: 0; flex: 1; display: grid; }
.cw-person b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 2px; min-width: 0; }
.cw-person b > span:first-child { overflow: hidden; text-overflow: ellipsis; }
.cw-person span.s { font-size: 12.5px; color: var(--cw-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cw-person.sel { background: var(--cw-soft); }
.cw-check { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--cw-edge); display: grid; place-items: center; flex: none; color: var(--cw-ink); }
.cw-person.sel .cw-check { background: var(--cw-brand); border-color: var(--cw-brand); }

/* Avatars */
.cw-av { position: relative; width: 50px; height: 50px; border-radius: 18px; display: grid; place-items: center; font: 700 17px var(--cw-head); color: var(--cw-white); flex: none; }
.cw-av img { width: 100%; height: 100%; border-radius: inherit; object-fit: cover; display: block; }
.cw-av.sm { width: 34px; height: 34px; border-radius: 12px; font-size: 13px; }
.cw-av.md { width: 42px; height: 42px; border-radius: 15px; font-size: 15px; }
.cw-av.lg { width: 96px; height: 96px; border-radius: 32px; font-size: 34px; }
.cw-av.group { border-radius: 50%; }
.cw-dot { position: absolute; right: -2px; bottom: -2px; width: 15px; height: 15px; border-radius: 50%; border: 3px solid var(--cw-glass2); background: var(--cw-ok); }
.cw-av.sm .cw-dot { width: 12px; height: 12px; border-width: 2px; }
.cw-dot.call { background: var(--cw-warn); } .cw-dot.video { background: var(--cw-brand2); } .cw-dot.idle { background: var(--cw-muted); }
.cw-cert { color: var(--cw-brand); flex: none; display: inline-grid; margin-left: 2px; }
.cw-cert .svg { width: 16px; height: 16px; }

/* Conversation */
.cw-chat { position: relative; border-radius: 26px; min-width: 0; min-height: 0; overflow: hidden; display: flex; flex-direction: column; background: color-mix(in srgb, var(--cw-bg) 35%, transparent); border: 1px solid var(--cw-line); box-shadow: var(--cw-shadow); }
.cw-welcome { flex: 1; display: grid; place-items: center; text-align: center; padding: 30px; color: var(--cw-muted); }
.cw-welcome > div { display: grid; gap: 12px; justify-items: center; max-width: 380px; }
.cw-welcome .big { width: 84px; height: 84px; border-radius: 28px; display: grid; place-items: center; background: linear-gradient(140deg, var(--cw-out-a), var(--cw-out-b)); color: var(--cw-out-text); }
.cw-welcome .big .svg { width: 40px; height: 40px; }
.cw-welcome h2 { margin: 0; color: var(--cw-text); font: 700 22px var(--cw-head); }
.cw-head { position: absolute; top: 10px; left: 10px; right: 10px; z-index: 5; height: 64px; border-radius: 20px; display: flex; align-items: center; gap: 10px; padding: 0 10px 0 12px; min-width: 0; }
.cw-head .cw-who { min-width: 0; flex: 1; display: grid; border: 0; background: transparent; text-align: left; padding: 0; }
.cw-head .cw-who b { font: 600 16px var(--cw-head); white-space: nowrap; overflow: hidden; display: flex; align-items: center; gap: 2px; min-width: 0; }
.cw-head .cw-who b > span:first-child { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.cw-head .cw-who span.sub { font-size: 12.5px; color: var(--cw-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cw-head .cw-who span.sub.cw-live { color: var(--cw-btext); }
.cw-pin { position: absolute; top: 82px; left: 22px; right: 22px; z-index: 4; display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 14px; border-radius: 14px; font-size: 13px; min-width: 0; color: var(--cw-muted); cursor: pointer; text-align: left; }
.cw-pin .bar { width: 3px; align-self: stretch; border-radius: 2px; background: linear-gradient(var(--cw-out-a), var(--cw-out-b)); flex: none; }
.cw-pin .tx { min-width: 0; flex: 1; display: grid; }
.cw-pin b { font-size: 12px; color: var(--cw-btext); }
.cw-pin span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--cw-text2); }
.cw-banner { position: absolute; top: 82px; left: 22px; right: 22px; z-index: 4; display: flex; gap: 10px; align-items: center; padding: 9px 14px; border-radius: 14px; font-size: 13px; color: var(--cw-text2); background: color-mix(in srgb, var(--cw-brand2) 16%, var(--cw-glass2)); }
.cw-msgs { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 92px max(18px, 4%) 130px; display: flex; flex-direction: column; gap: 3px; min-height: 0; overscroll-behavior: contain; }
.cw-msgs.pinned { padding-top: 138px; }
.cw-more { align-self: center; margin: 4px 0 10px; }
.cw-day { align-self: center; margin: 14px 0 10px; padding: 5px 12px; border-radius: 999px; font: 600 12px var(--cw-font); color: var(--cw-text2); }
.cw-unread { display: flex; align-items: center; gap: 10px; margin: 12px 0; color: var(--cw-btext); font: 600 12px var(--cw-font); }
.cw-unread::before, .cw-unread::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--cw-brand), transparent); }
.cw-sys { align-self: center; font-size: 12.5px; color: var(--cw-muted); padding: 4px 12px; text-align: center; max-width: 86%; border-radius: 999px; overflow-wrap: anywhere; }

.cw-m { display: flex; gap: 8px; align-items: flex-end; max-width: min(78%, 620px); position: relative; min-width: 0; }
.cw-m.out { align-self: flex-end; flex-direction: row-reverse; }
.cw-m .gap { width: 34px; flex: none; }
.cw-m.gs { margin-top: 10px; }
.cw-m.flash .cw-b { animation: cw-flash 1.6s ease; }
@keyframes cw-flash { 0%, 40% { box-shadow: 0 0 0 3px var(--cw-brand); } }
.cw-b { position: relative; min-width: 0; padding: 8px 12px 6px; border-radius: var(--cw-r); background: var(--cw-in); color: var(--cw-in-text); box-shadow: 0 1px 1px rgba(0,0,0,.04); overflow-wrap: anywhere; }
.cw-m.out .cw-b { background: linear-gradient(135deg, var(--cw-out-a), var(--cw-out-b)); color: var(--cw-out-text); }
.cw-m.in.gm .cw-b, .cw-m.in.ge .cw-b { border-top-left-radius: 8px; }
.cw-m.in.gs:not(.ge) .cw-b, .cw-m.in.gm .cw-b { border-bottom-left-radius: 8px; }
.cw-m.out.gm .cw-b, .cw-m.out.ge .cw-b { border-top-right-radius: 8px; }
.cw-m.out.gs:not(.ge) .cw-b, .cw-m.out.gm .cw-b { border-bottom-right-radius: 8px; }
.cw-m.emo .cw-b { background: transparent !important; box-shadow: none; padding: 0 2px; color: var(--cw-text); }
.cw-m.emo .cw-txt { font-size: 42px; line-height: 1.15; }
.cw-m.emo .cw-meta { background: var(--cw-glass2); color: var(--cw-text2); padding: 1px 6px; border-radius: 8px; opacity: 1; }
.cw-m.del .cw-b { opacity: .75; font-style: italic; }
.cw-m.sched .cw-b { outline: 2px dashed color-mix(in srgb, var(--cw-brand) 60%, transparent); outline-offset: 2px; }
.cw-author { display: flex; gap: 2px; align-items: center; font: 600 12.5px var(--cw-font); margin-bottom: 2px; min-width: 0; }
.cw-author span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cw-txt { white-space: pre-wrap; font-size: 15px; line-height: 1.42; }
.cw-txt a { color: inherit; text-decoration: underline; text-underline-offset: 2px; overflow-wrap: anywhere; }
.cw-meta { float: right; display: inline-flex; align-items: center; gap: 3px; margin: 6px -2px -2px 10px; font-size: 11px; opacity: .78; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cw-meta .rd { color: var(--cw-btext); opacity: 1; }
.cw-m.out .cw-meta .rd { color: inherit; }
.cw-meta .ed { font-style: italic; }
.cw-b.urgent { box-shadow: 0 0 0 2px var(--cw-bad), 0 6px 18px rgba(220,38,38,.18); }
.cw-urg { display: inline-flex; align-items: center; gap: 4px; font: 700 10.5px var(--cw-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--cw-bad); margin-bottom: 3px; }
.cw-m.out .cw-urg { color: inherit; }
.cw-ment { color: var(--cw-btext); font-weight: 600; }
.cw-m.out .cw-ment { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.cw-reply { display: block; width: calc(100% + 8px); border-radius: 12px; padding: 6px 10px; margin: 2px -4px 6px; background: color-mix(in srgb, var(--cw-brand) 12%, transparent); border: 0; border-left: 3px solid var(--cw-brand); font-size: 13px; min-width: 0; text-align: left; color: inherit; }
.cw-m.out .cw-reply { background: rgba(255,255,255,.18); border-left-color: rgba(255,255,255,.75); }
.cw-reply b, .cw-reply span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cw-reply b { font-size: 12px; } .cw-reply span { opacity: .85; }
.cw-reacts { position: absolute; bottom: -14px; left: 12px; display: flex; gap: 4px; z-index: 2; max-width: calc(100% - 12px); overflow: hidden; }
.cw-m.in.grp .cw-reacts { left: 54px; max-width: calc(100% - 54px); }
.cw-m.out .cw-reacts { left: auto; right: 12px; }
.cw-react { height: 26px; padding: 0 8px; border-radius: 13px; display: inline-flex; align-items: center; gap: 4px; font-size: 13px; border: 1px solid var(--cw-edge); background: var(--cw-glass2); color: var(--cw-text); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); box-shadow: var(--cw-shadow); flex: none; }
.cw-react.mine { border-color: var(--cw-brand); }
.cw-react small { font-size: 11px; color: var(--cw-text2); font-weight: 600; }
.cw-m.hr { margin-bottom: 16px; }
.cw-hover { position: absolute; top: -18px; right: 8px; display: none; gap: 2px; padding: 4px; border-radius: 14px; z-index: 3; }
.cw-m.out .cw-hover { right: auto; left: 8px; }
.cw-m:hover .cw-hover, .cw-m:focus-within .cw-hover { display: flex; }
.cw-hover button { width: 30px; height: 30px; border: 0; border-radius: 10px; background: transparent; display: grid; place-items: center; color: var(--cw-text2); }
.cw-hover button:hover { background: var(--cw-soft); color: var(--cw-text); }

.cw-card { display: grid; gap: 10px; margin: 4px -4px 4px; padding: 12px; border-radius: 16px; background: var(--cw-glass2); color: var(--cw-text); border: 1px solid var(--cw-edge); width: min(320px, 62vw); max-width: 100%; }
.cw-card .r1 { display: flex; align-items: center; gap: 10px; min-width: 0; }
.cw-card .r1 div { min-width: 0; flex: 1; display: grid; }
.cw-card .r1 b, .cw-card .r1 span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cw-card .r1 span { font-size: 12px; color: var(--cw-muted); }
.cw-card .cw-flag { width: 22px; height: 16px; border-radius: 3px; object-fit: cover; flex: none; }
.cw-card .stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.cw-card .stats div { padding: 7px 8px; border-radius: 10px; background: var(--cw-soft); display: grid; min-width: 0; }
.cw-card .stats small { font-size: 10.5px; color: var(--cw-muted); text-transform: uppercase; letter-spacing: .06em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cw-card .stats b { font: 600 14px var(--cw-head); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cw-card .acts { display: flex; gap: 6px; flex-wrap: wrap; }
.cw-card .lock { font-size: 12.5px; color: var(--cw-muted); }
.cw-pill { display: inline-flex; align-items: center; gap: 5px; height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--cw-edge); background: var(--cw-glass2); color: var(--cw-text); font-weight: 500; font-size: 13px; flex: none; white-space: nowrap; }
.cw-pill.go { background: var(--cw-ok); color: var(--cw-white); border-color: transparent; }
.cw-pill.on { background: var(--cw-bad); color: var(--cw-white); border-color: transparent; }
.cw-pill.brand { background: linear-gradient(140deg, var(--cw-out-a), var(--cw-out-b)); color: var(--cw-out-text); border-color: transparent; }
.cw-pill.danger { color: var(--cw-bad); }
.cw-pill:disabled { opacity: .5; cursor: default; }
.cw-status { padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: color-mix(in srgb, var(--cw-warn) 18%, transparent); color: var(--cw-warn); flex: none; white-space: nowrap; }

.cw-photos { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; margin: -4px -8px 4px; border-radius: 18px; overflow: hidden; width: min(330px, 62vw); max-width: calc(100% + 16px); }
.cw-photos.one { grid-template-columns: 1fr; }
.cw-photos button { border: 0; padding: 0; background: var(--cw-edge); display: block; aspect-ratio: 1; overflow: hidden; }
.cw-photos.one button { aspect-ratio: auto; }
.cw-photos button:first-child:nth-last-child(3) { grid-column: span 2; aspect-ratio: 2 / 1; }
.cw-photos img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cw-photos.one img { height: auto; max-height: 380px; object-fit: contain; }
.cw-voice { display: flex; align-items: center; gap: 10px; width: min(300px, 58vw); max-width: 100%; padding: 2px 0; }
.cw-voice .play { width: 38px; height: 38px; border-radius: 50%; border: 0; display: grid; place-items: center; background: var(--cw-brand); color: var(--cw-ink); flex: none; }
.cw-m.out .cw-voice .play { background: rgba(255,255,255,.92); color: var(--cw-brand2); }
.cw-voice .wave { flex: 1; display: flex; align-items: center; gap: 2px; height: 30px; min-width: 0; cursor: pointer; }
.cw-voice .wave i { flex: 1; border-radius: 2px; background: currentColor; opacity: .35; min-width: 2px; }
.cw-voice .wave i.p { opacity: 1; }
.cw-voice .vr { display: grid; justify-items: end; gap: 2px; flex: none; }
.cw-voice .spd { font: 600 11px var(--cw-mono); padding: 3px 7px; border-radius: 8px; border: 0; background: rgba(127,127,127,.18); color: inherit; }
.cw-voice small { font-size: 11px; opacity: .8; font-variant-numeric: tabular-nums; }
.cw-file { display: flex; align-items: center; gap: 10px; padding: 6px 2px; min-width: 0; width: min(300px, 58vw); max-width: 100%; border: 0; background: transparent; text-align: left; color: inherit; }
.cw-file .ic { width: 42px; height: 48px; border-radius: 10px; display: grid; place-items: center; background: rgba(127,127,127,.16); font: 700 10px var(--cw-mono); flex: none; text-transform: uppercase; }
.cw-file div { min-width: 0; display: grid; }
.cw-file b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; }
.cw-file span { font-size: 12px; opacity: .8; }
.cw-poll { display: grid; gap: 8px; width: min(330px, 62vw); max-width: 100%; padding: 2px 0 4px; }
.cw-poll > b { font: 600 15px var(--cw-head); overflow-wrap: anywhere; }
.cw-opt { position: relative; display: flex; justify-content: space-between; gap: 8px; padding: 9px 12px; border-radius: 12px; border: 1px solid var(--cw-edge); background: transparent; overflow: hidden; text-align: left; font-size: 14px; color: inherit; }
.cw-opt i { position: absolute; inset: 0 auto 0 0; background: var(--cw-soft); z-index: 0; transition: width .4s; }
.cw-m.out .cw-opt i { background: rgba(255,255,255,.22); }
.cw-opt span, .cw-opt em { position: relative; z-index: 1; font-style: normal; min-width: 0; overflow-wrap: anywhere; }
.cw-opt em { font-weight: 600; font-variant-numeric: tabular-nums; flex: none; }
.cw-opt.voted { border-color: var(--cw-brand); }
.cw-m.out .cw-opt.voted { border-color: rgba(255,255,255,.85); }
.cw-poll small { opacity: .75; font-size: 12px; }
.cw-typ { display: inline-flex; gap: 4px; padding: 6px 2px; }
.cw-typ i { width: 7px; height: 7px; border-radius: 50%; background: var(--cw-muted); animation: cw-bob 1.2s infinite; }
.cw-typ i:nth-child(2) { animation-delay: .15s; } .cw-typ i:nth-child(3) { animation-delay: .3s; }
@keyframes cw-bob { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-5px); opacity: 1; } }

/* Saisie */
.cw-comp { position: absolute; left: 10px; right: 10px; bottom: 10px; z-index: 5; display: grid; gap: 6px; min-width: 0; }
.cw-bar-note { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 16px; font-size: 13px; min-width: 0; }
.cw-bar-note div { flex: 1; min-width: 0; border-left: 3px solid var(--cw-brand); padding-left: 8px; display: grid; }
.cw-bar-note b { color: var(--cw-btext); font-size: 12px; }
.cw-bar-note span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cw-tray { display: flex; gap: 8px; overflow-x: auto; padding: 8px; border-radius: 16px; }
.cw-tray .t { position: relative; flex: none; width: 74px; height: 74px; border-radius: 12px; overflow: hidden; background: var(--cw-edge); display: grid; place-items: center; font: 700 11px var(--cw-mono); text-transform: uppercase; color: var(--cw-text2); }
.cw-tray .t img { width: 100%; height: 100%; object-fit: cover; }
.cw-tray .t .x { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; display: grid; place-items: center; }
.cw-tray .t .fn { position: absolute; inset: auto 0 0 0; font: 500 10px var(--cw-font); text-transform: none; padding: 2px 4px; background: rgba(0,0,0,.55); color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cw-tools { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 0 4px; min-width: 0; }
.cw-cbar { display: flex; align-items: flex-end; gap: 4px; padding: 7px; border-radius: 26px; min-width: 0; }
.cw-cbar textarea { flex: 1; min-width: 0; resize: none; border: 0; outline: none; background: transparent; padding: 10px 4px; max-height: 140px; line-height: 1.4; color: var(--cw-text); }
.cw-send { width: 44px; height: 44px; border-radius: 50%; border: 0; display: grid; place-items: center; background: linear-gradient(140deg, var(--cw-out-a), var(--cw-out-b)); color: var(--cw-out-text); transition: transform .15s; flex: none; }
.cw-send:hover { transform: scale(1.06); }
.cw-send:disabled { opacity: .55; }
.cw-rec { display: flex; align-items: center; gap: 10px; padding: 7px 7px 7px 14px; border-radius: 26px; min-width: 0; }
.cw-rec .dotr { width: 10px; height: 10px; border-radius: 50%; background: var(--cw-bad); animation: cw-blink 1s infinite; flex: none; }
.cw-rec .lv { flex: 1; display: flex; align-items: center; justify-content: flex-end; gap: 2px; height: 28px; min-width: 0; overflow: hidden; color: var(--cw-btext); }
.cw-rec .lv i { width: 3px; border-radius: 2px; background: currentColor; flex: none; }
.cw-rec time { font-variant-numeric: tabular-nums; font-weight: 600; flex: none; }
.cw-readonly { padding: 12px 16px; border-radius: 20px; text-align: center; font-size: 13.5px; color: var(--cw-text2); }

/* Fenêtres flottantes : émojis, réactions, menu, suggestions */
.cw-pop { position: absolute; z-index: 9; border-radius: 22px; display: flex; flex-direction: column; overflow: hidden; }
.cw-emo { bottom: 120px; left: 10px; width: min(380px, calc(100% - 20px)); height: min(380px, 62%); }
.cw-emo .es { margin: 10px; }
.cw-emo .cats { display: flex; gap: 2px; padding: 0 8px 6px; border-bottom: 1px solid var(--cw-edge); overflow-x: auto; scrollbar-width: none; flex: none; }
.cw-emo .cats button { flex: none; width: 38px; height: 34px; border: 0; border-radius: 10px; background: transparent; font-size: 18px; color: var(--cw-text2); display: grid; place-items: center; padding: 0; }
.cw-emo .cats button.on { background: var(--cw-soft); color: var(--cw-btext); }
.cw-emo .grid { flex: 1; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: 2px; padding: 8px; align-content: start; }
.cw-emo .grid button { height: 40px; border: 0; border-radius: 10px; background: transparent; font-size: 24px; transition: transform .1s; padding: 0; }
.cw-emo .grid button:hover { background: var(--cw-soft); transform: scale(1.15); }
.cw-emo .lbl { font: 600 11px var(--cw-mono); color: var(--cw-muted); letter-spacing: .08em; text-transform: uppercase; grid-column: 1 / -1; padding: 6px 2px 2px; }
.cw-quick { position: absolute; z-index: 10; display: flex; gap: 2px; padding: 6px; border-radius: 999px; max-width: calc(100% - 16px); overflow-x: auto; scrollbar-width: none; }
.cw-quick button { width: 40px; height: 40px; border: 0; border-radius: 50%; background: transparent; font-size: 24px; transition: transform .12s; flex: none; padding: 0; }
.cw-quick button:hover { transform: scale(1.25); }
.cw-quick .more { color: var(--cw-text2); display: grid; place-items: center; }
.cw-menu { position: absolute; z-index: 11; width: 236px; max-width: calc(100% - 16px); padding: 6px; border-radius: 18px; display: grid; }
.cw-menu button { display: flex; align-items: center; gap: 10px; height: 42px; padding: 0 12px; border: 0; border-radius: 12px; background: transparent; text-align: left; color: var(--cw-text); font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cw-menu button:hover { background: var(--cw-soft); }
.cw-menu button.danger { color: var(--cw-bad); }
.cw-menu hr { border: 0; border-top: 1px solid var(--cw-edge); margin: 4px 6px; }
.cw-sugg { position: absolute; bottom: 120px; left: 10px; width: min(360px, calc(100% - 20px)); max-height: 280px; overflow-y: auto; padding: 6px; border-radius: 18px; z-index: 9; }
.cw-sugg .cw-sec { padding: 6px 8px; }

.cw-jump { position: absolute; right: 22px; bottom: 140px; z-index: 6; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; color: var(--cw-text2); border: 1px solid var(--cw-line); }
.cw-jump .cw-badge { position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; line-height: 20px; font-size: 11px; }

/* Infos */
.cw-info { border-radius: 26px; min-height: 0; min-width: 0; overflow-y: auto; padding: 22px 18px; display: none; flex-direction: column; gap: 18px; }
.cw-app.info-open .cw-info { display: flex; }
.cw-info .head { display: grid; justify-items: center; gap: 8px; text-align: center; min-width: 0; }
.cw-info .head b { font: 700 20px var(--cw-head); overflow-wrap: anywhere; }
.cw-info .head .sub { color: var(--cw-muted); font-size: 13px; overflow-wrap: anywhere; }
.cw-info .head p { margin: 0; color: var(--cw-text2); font-size: 14px; overflow-wrap: anywhere; white-space: pre-wrap; }
.cw-info h3 { margin: 0 0 8px; font: 600 11px var(--cw-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--cw-muted); display: flex; align-items: center; gap: 8px; }
.cw-mem { display: flex; align-items: center; gap: 10px; padding: 7px 4px; min-width: 0; }
.cw-mem > div { min-width: 0; flex: 1; display: grid; }
.cw-mem b { font-size: 14px; white-space: nowrap; overflow: hidden; display: flex; align-items: center; gap: 2px; min-width: 0; }
.cw-mem b > span:first-child { overflow: hidden; text-overflow: ellipsis; }
.cw-mem span.s { font-size: 12px; color: var(--cw-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cw-role { font: 600 10.5px var(--cw-mono); letter-spacing: .06em; padding: 3px 7px; border-radius: 7px; background: var(--cw-soft); color: var(--cw-btext); text-transform: uppercase; flex: none; }
.cw-media { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; border-radius: 14px; overflow: hidden; }
.cw-media button { border: 0; padding: 0; aspect-ratio: 1; background: var(--cw-edge); overflow: hidden; display: grid; place-items: center; color: var(--cw-text2); font: 700 10px var(--cw-mono); text-transform: uppercase; }
.cw-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cw-sw { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 4px; font-size: 14px; }
.cw-sw span { min-width: 0; }
.cw-tg { width: 42px; height: 24px; border-radius: 12px; border: 0; background: var(--cw-edge); position: relative; flex: none; }
.cw-tg::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--cw-white); transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.cw-tg.on { background: var(--cw-brand); } .cw-tg.on::after { transform: translateX(18px); }
.cw-note { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border-radius: 16px; background: color-mix(in srgb, var(--cw-brand2) 12%, transparent); font-size: 13px; color: var(--cw-text2); }
.cw-info .acts { display: grid; gap: 8px; }
.cw-info .acts .cw-pill { justify-content: center; height: 40px; }

/* Fenêtre (nouveau groupe, nouveau message, sondage, programmer, transférer) */
.cw-modal-bg { position: absolute; inset: 0; z-index: 20; background: rgba(5,12,10,.45); display: grid; place-items: center; padding: 16px; }
.cw-modal { width: min(460px, 100%); max-height: min(720px, calc(100% - 16px)); border-radius: 26px; display: flex; flex-direction: column; overflow: hidden; background: var(--cw-glass2); }
.cw-modal header { display: flex; align-items: center; gap: 10px; padding: 16px 16px 8px 20px; }
.cw-modal header h2 { margin: 0; flex: 1; min-width: 0; font: 700 19px var(--cw-head); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cw-modal .body { padding: 8px 20px 12px; overflow-y: auto; display: grid; gap: 12px; min-height: 0; }
.cw-modal footer { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px 18px; flex-wrap: wrap; }
.cw-field { display: grid; gap: 6px; font-size: 13px; color: var(--cw-text2); min-width: 0; }
.cw-field input, .cw-field textarea, .cw-field select { width: 100%; min-width: 0; border: 1px solid var(--cw-edge); background: var(--cw-glass); border-radius: 12px; padding: 10px 12px; color: var(--cw-text); outline: none; }
.cw-field textarea { resize: vertical; min-height: 70px; }
.cw-field input:focus, .cw-field textarea:focus { border-color: var(--cw-brand); }
.cw-people { display: grid; gap: 2px; max-height: 320px; overflow-y: auto; margin: 0 -8px; }
.cw-err { color: var(--cw-bad); font-size: 13px; }
.cw-gphoto { display: flex; align-items: center; gap: 12px; }

/* Visionneuse de photos */
.cw-viewer { position: absolute; inset: 0; z-index: 30; background: rgba(0,0,0,.92); display: grid; grid-template-rows: auto minmax(0, 1fr) auto; color: #fff; }
.cw-viewer header { display: flex; align-items: center; gap: 10px; padding: max(12px, env(safe-area-inset-top, 0px)) 14px 10px; min-width: 0; }
.cw-viewer header div { flex: 1; min-width: 0; display: grid; }
.cw-viewer header b, .cw-viewer header span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cw-viewer header span { font-size: 12px; opacity: .7; }
.cw-viewer .ib { width: 40px; height: 40px; border-radius: 12px; border: 0; background: rgba(255,255,255,.12); color: #fff; display: grid; place-items: center; text-decoration: none; flex: none; }
.cw-viewer .stage { display: grid; place-items: center; min-height: 0; padding: 8px; position: relative; }
.cw-viewer .stage img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 8px; }
.cw-viewer .cw-vnav { position: absolute; top: 50%; transform: translateY(-50%); width: 46px; height: 46px; border-radius: 50%; border: 0; background: rgba(255,255,255,.14); color: #fff; display: grid; place-items: center; }
.cw-viewer .cw-vnav.l { left: 12px; } .cw-viewer .cw-vnav.r { right: 12px; }
.cw-viewer footer { text-align: center; padding: 8px 14px max(14px, env(safe-area-inset-bottom, 0px)); font-size: 13px; opacity: .8; }

.cw-toast { position: absolute; left: 50%; bottom: 150px; transform: translateX(-50%); z-index: 40; padding: 10px 16px; border-radius: 14px; font-size: 14px; max-width: calc(100% - 32px); text-align: center; }

/* Téléphone : une colonne (liste, puis conversation, puis infos) */
@media (max-width: 860px) {
  .cw-app, .cw-app.info-open { grid-template-columns: minmax(0, 1fr); padding: 0; gap: 0; }
  .cw-rail { display: none; }
  .cw-list, .cw-chat, .cw-info { border-radius: 0; border: 0; }
  .cw-app .cw-chat, .cw-app .cw-info { display: none; }
  .cw-app.v-chat .cw-list { display: none; } .cw-app.v-chat .cw-chat { display: flex; }
  .cw-app.v-info .cw-list, .cw-app.v-info .cw-chat { display: none; } .cw-app.v-info .cw-info { display: flex; }
  .cw-mback { display: grid; }
  .cw-list-h { padding-top: max(16px, env(safe-area-inset-top, 0px)); }
  .cw-head { top: max(8px, env(safe-area-inset-top, 0px)); left: 8px; right: 8px; }
  .cw-pin, .cw-banner { top: calc(max(8px, env(safe-area-inset-top, 0px)) + 72px); left: 14px; right: 14px; }
  .cw-msgs { padding: calc(86px + env(safe-area-inset-top, 0px)) 10px 132px; }
  .cw-msgs.pinned { padding-top: calc(132px + env(safe-area-inset-top, 0px)); }
  .cw-m { max-width: 88%; }
  .cw-comp { left: 8px; right: 8px; bottom: max(8px, env(safe-area-inset-bottom, 0px)); }
  .cw-convs { padding-bottom: max(20px, env(safe-area-inset-bottom, 0px)); }
  .cw-hover { display: none !important; }
  .cw-jump { right: 16px; }
  .cw-info { padding-top: max(18px, env(safe-area-inset-top, 0px)); padding-bottom: max(18px, env(safe-area-inset-bottom, 0px)); }
  .cw-modal-bg { place-items: end center; padding: 0; }
  .cw-modal { width: 100%; max-height: 92%; border-radius: 26px 26px 0 0; padding-bottom: env(safe-area-inset-bottom, 0px); }
}
@media (max-width: 420px) { .cw-head .opt { display: none; } .cw-head { gap: 8px; } }
@media (prefers-reduced-motion: reduce) { .cw-world i { animation: none; } .cw-root * { transition: none !important; animation: none !important; } }

/* Un avatar garde sa taille, même dans une ligne dont la colonne de texte prend la place restante */
.cw-root .cw-av { flex: none; }
.cw-mem > .cw-av, .cw-person > .cw-av, .cw-card .r1 > .cw-av { flex: none; display: grid; min-width: 0; }
/* Le CRM donne à tous les champs une hauteur et une largeur (formulaires) : annulé dans la messagerie */
.cw-root textarea { min-height: 0; width: auto; }
.cw-root .cw-field textarea { width: 100%; min-height: 70px; }
.cw-cbar textarea, .cw-search input { border: 0; border-radius: 0; background: transparent; padding-left: 4px; padding-right: 4px; }
.cw-cbar textarea:focus, .cw-cbar textarea:focus-visible, .cw-search input:focus, .cw-search input:focus-visible { outline: none; border: 0; }
.cw-search:focus-within, .cw-cbar:focus-within { border-color: color-mix(in srgb, var(--cw-brand) 60%, transparent); }
@media (max-width: 860px) { .cw-msgs { padding-bottom: 156px; } }

/* v4 : profils cliquables (photo, nom, membres) et fiche profil */
.cw-root .cw-avbtn { flex: none; display: grid; padding: 0; margin: 0; border: 0; background: none; cursor: pointer; border-radius: 14px; color: inherit; min-width: 0; min-height: 0; align-self: flex-end; transition: transform .15s; }
.cw-head .cw-avbtn { align-self: center; }
.cw-root .cw-avbtn:hover { transform: scale(1.06); }
.cw-root .cw-avbtn:focus-visible, .cw-root .cw-memw:focus-visible, .cw-root button.cw-author:focus-visible { outline: 2px solid var(--cw-brand); outline-offset: 2px; }
.cw-root button.cw-author { border: 0; background: none; padding: 0; cursor: pointer; max-width: 100%; text-align: left; min-height: 0; }
.cw-root button.cw-author:hover span { text-decoration: underline; }
.cw-root .cw-memw { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 4px; margin: -4px; border: 0; background: none; color: inherit; text-align: left; cursor: pointer; border-radius: 14px; font: inherit; min-height: 0; }
.cw-root .cw-memw:hover { background: var(--cw-soft); }
.cw-memw > .cw-av { flex: none; display: grid; }
.cw-memw > div { min-width: 0; flex: 1; display: grid; }
.cw-prof { display: grid; justify-items: center; text-align: center; gap: 6px; padding: 6px 0 4px; min-width: 0; }
.cw-prof .cw-av { margin-bottom: 6px; }
.cw-prof .nm { display: flex; align-items: center; gap: 4px; max-width: 100%; min-width: 0; font-size: 19px; }
.cw-prof .nm b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.cw-prof .ti { font-size: 14px; max-width: 100%; overflow-wrap: anywhere; }
.cw-prof .pr { font-size: 13px; color: var(--cw-muted); }
.cw-prof .pr.cw-live { color: var(--cw-ok, #16a34a); }
.cw-prof .cw-sw { justify-self: stretch; margin-top: 8px; border-top: 1px solid var(--cw-edge); padding-top: 12px; text-align: left; }
.cw-meav { flex: none; }
.cw-meav .cw-avbtn { align-self: center; }
.cw-stack { display: grid; gap: 14px; min-width: 0; }
.cw-steps { margin: 0; padding-left: 22px; display: grid; gap: 8px; font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.cw-acts { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
@media (max-width: 400px) { .cw-row1 { gap: 6px; } .cw-row1 h1 { font-size: 20px; } .cw-row1 .cw-ib { width: 38px; height: 38px; } }
.cw-prof .nm { flex-wrap: wrap; justify-content: center; }
.cw-prof .nm b { white-space: normal; overflow: visible; overflow-wrap: anywhere; text-align: center; }

/* v7 : appels, recherche dans la conversation, groupes certifiés */
@media (max-width: 420px) { .cw-head .opt { display: grid; } .cw-head .opt2 { display: none; } .cw-head .cw-ib { width: 36px; height: 36px; } }
.cw-ib.act { color: var(--cw-btext); border-color: color-mix(in srgb, var(--cw-brand) 55%, transparent); }
.cw-callb { display: flex; align-items: center; gap: 10px; min-width: min(250px, 58vw); max-width: 100%; padding: 2px 0 4px; }
.cw-callb .ic { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex: none; background: color-mix(in srgb, var(--cw-ok) 18%, transparent); color: var(--cw-ok); }
.cw-m.out .cw-callb .ic { background: rgba(255,255,255,.22); color: inherit; }
.cw-callb.missed .ic { background: color-mix(in srgb, var(--cw-bad) 16%, transparent); color: var(--cw-bad); }
.cw-callb.live .ic { animation: cw-callpulse 1.6s infinite; }
@keyframes cw-callpulse { 50% { box-shadow: 0 0 0 7px color-mix(in srgb, var(--cw-ok) 18%, transparent); } }
.cw-callb > div { flex: 1; min-width: 0; display: grid; }
.cw-callb b { font: 600 14.5px var(--cw-head); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cw-callb span { font-size: 12.5px; opacity: .8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cw-callb.missed span { color: var(--cw-bad); opacity: 1; }
.cw-m.out .cw-callb.missed span { color: inherit; }
.cw-callb .cw-pill { flex: none; height: 30px; }
.cw-m.out .cw-callb .cw-pill:not(.go) { background: rgba(255,255,255,.9); color: #0e1714; border-color: transparent; }
/* Appel entrant : plein écran au-dessus de tout le CRM */
.cw-root.cw-ringroot { z-index: 90; background: rgba(4, 10, 9, .55); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); display: grid; place-items: center; padding: 20px; }
.cw-ring { width: min(360px, 100%); border-radius: 30px; padding: 30px 22px 24px; display: grid; justify-items: center; gap: 8px; text-align: center; animation: cw-ringin .25s ease-out; }
@keyframes cw-ringin { from { transform: translateY(16px) scale(.97); opacity: 0; } }
.cw-ring .cw-pulse { position: relative; margin-bottom: 10px; border-radius: 32px; }
.cw-ring .cw-pulse::before, .cw-ring .cw-pulse::after { content: ''; position: absolute; inset: -10px; border-radius: 40px; border: 2px solid color-mix(in srgb, var(--cw-brand) 55%, transparent); animation: cw-ripple 1.8s ease-out infinite; }
.cw-ring .cw-pulse::after { animation-delay: .9s; }
@keyframes cw-ripple { from { transform: scale(.92); opacity: .9; } to { transform: scale(1.35); opacity: 0; } }
.cw-ring b { font: 700 21px var(--cw-head); max-width: 100%; overflow-wrap: anywhere; }
.cw-ring > span { color: var(--cw-muted); font-size: 14px; }
.cw-ring .acts { display: flex; gap: 46px; margin-top: 22px; }
.cw-rbtn { display: grid; justify-items: center; gap: 8px; border: 0; background: none; color: var(--cw-text); font-size: 13px; font-weight: 600; cursor: pointer; padding: 0; }
.cw-rbtn i { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; color: #fff; box-shadow: var(--cw-shadow); transition: transform .15s; }
.cw-rbtn:hover i { transform: scale(1.07); }
.cw-rbtn.no i { background: var(--cw-bad); }
.cw-rbtn.yes i { background: var(--cw-ok); animation: cw-callpulse 1.6s infinite; }
@media (prefers-reduced-motion: reduce) { .cw-ring .cw-pulse::before, .cw-ring .cw-pulse::after, .cw-rbtn.yes i, .cw-callb.live .ic { animation: none; } }
/* Recherche dans la conversation */
.cw-csearch { position: absolute; top: 82px; left: 22px; right: 22px; z-index: 7; border-radius: 18px; padding: 8px; display: grid; gap: 6px; max-height: min(60%, 420px); min-width: 0; }
.cw-csearch .cw-search { height: 42px; }
.cw-csearch .cw-search .cw-ib { width: 30px; height: 30px; }
.cw-csearch .hits { overflow-y: auto; display: grid; gap: 2px; min-height: 0; }
.cw-csearch .hits:empty { display: none; }
.cw-csearch .hits button { display: flex; gap: 10px; align-items: center; text-align: left; border: 0; background: none; padding: 8px; border-radius: 12px; min-width: 0; color: inherit; cursor: pointer; }
.cw-csearch .hits button:hover { background: var(--cw-soft); }
.cw-csearch .hits button > div:not(.cw-av) { min-width: 0; flex: 1; display: grid; }
.cw-csearch .hits button > .cw-av { flex: none; display: grid; }
.cw-csearch .hits b { font-size: 13px; display: flex; gap: 8px; justify-content: space-between; min-width: 0; }
.cw-csearch .hits b small { color: var(--cw-muted); font-weight: 500; flex: none; }
.cw-csearch .hits span { font-size: 13.5px; color: var(--cw-text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cw-csearch .hits p { margin: 6px 8px; color: var(--cw-muted); font-size: 13px; }
@media (max-width: 860px) { .cw-csearch { left: 14px; right: 14px; top: calc(max(8px, env(safe-area-inset-top, 0px)) + 72px); } }
.cw-info .head > div { display: flex; align-items: center; justify-content: center; gap: 4px; max-width: 100%; min-width: 0; }
/* Colonne de conversation étroite (panneau d'infos ouvert, petit écran) : l'en-tête et la bulle d'appel s'adaptent */
.cw-chat { container-type: inline-size; container-name: cwchat; }
.cw-head .cw-ib { flex: none; }
@container cwchat (max-width: 480px) { .cw-head .opt2 { display: none; } .cw-head { gap: 6px; } .cw-head .cw-ib { width: 34px; height: 34px; border-radius: 11px; } }
.cw-callb { min-width: 0; flex-wrap: wrap; row-gap: 8px; }
.cw-callb > div { min-width: 110px; }
/* Logo de la marque en haut du menu (AIpropfirm ou Cryptieni) */
.cw-root .cw-mark { background: none; padding: 0; overflow: hidden; box-shadow: var(--cw-shadow); }
.cw-mark img { width: 100%; height: 100%; display: block; object-fit: cover; }

:root[data-brand='tvx'] .cw-root { --cw-brand: #4b3bff; --cw-brand2: #3326d6; --cw-ink: #ffffff; --cw-soft: rgba(75,59,255,.12); --cw-btext: #4b3bff; --cw-out-a: #5a4bff; --cw-out-b: #3a2ae0; --cw-out-text: #ffffff; --cw-b1: rgba(75,59,255,.22); --cw-b2: rgba(198,243,94,.22); --cw-b3: rgba(75,59,255,.12); }
:root[data-theme='dark'][data-brand='tvx'] .cw-root { --cw-bg: #0a0f1c; --cw-bg2: #111827; --cw-btext: #9d94ff; --cw-b1: rgba(124,112,255,.16); --cw-b2: rgba(198,243,94,.10); --cw-b3: rgba(124,112,255,.08); }
