/* WhatsApp-style workspace. These tokens and overrides belong only to Conversas. */
.view--conversations {
  --chat-panel:#111b21; --chat-header:#202c33; --chat-canvas:#0b141a;
  --chat-incoming:#202c33; --chat-outgoing:#005c4b; --chat-text:#e9edef;
  --chat-muted:#aebac1; --chat-line:#26343d; --chat-hover:#202c33;
  --chat-active:#2a3942; --chat-input:#2a3942; --chat-accent:#00a884;
  --chat-pill:#233138; --chat-search:#202c33; --chat-avatar:#28463e;
  --chat-shadow:0 1px 1px #0003; --chat-bubble-muted:#c2d1d0;
  width:100%;max-width:none;margin:0;padding:0;height:calc(100dvh - var(--topbar-h));
  min-height:0;display:flex;flex-direction:column;color:var(--chat-text);
}
[data-theme="light"] .view--conversations {
  --chat-panel:#fff; --chat-header:#f5f6f7; --chat-canvas:#f1f4f6;
  --chat-incoming:#fff; --chat-outgoing:#d9fdd3; --chat-text:#111b21;
  --chat-muted:#667781; --chat-line:#e9edef; --chat-hover:#f5f6f6;
  --chat-active:#eef2f5; --chat-input:#fff; --chat-accent:#008069;
  --chat-pill:#fff; --chat-search:#f0f2f5; --chat-avatar:#dbece5;
  --chat-shadow:0 1px 1px #0b141a1c; --chat-bubble-muted:#52646c;
}
.view--conversations .chat-page { height:100%;min-height:0;flex:1; }
.view--conversations .chat-shell { grid-template-columns:350px minmax(0,1fr);border:0;border-radius:0;background:var(--chat-panel); }
.view--conversations .chat-side { background:var(--chat-panel);border-color:var(--chat-line); }
.chat-list-header { min-height:68px;display:flex;align-items:center;justify-content:space-between;gap:10px;padding:14px 20px 8px; }
.chat-list-header h1 { font:650 23px/1.2 var(--font-sans);letter-spacing:-.6px;margin:0;color:var(--chat-text); }
.chat-list-actions { display:flex;align-items:center;gap:3px; }
.view--conversations .icon-btn { color:var(--chat-muted);width:36px;height:36px;flex-shrink:0;border-radius:50%; }
.view--conversations .icon-btn:hover { background:var(--chat-hover);color:var(--chat-text); }
.view--conversations .chat-side-head { min-height:34px;padding:0 14px 8px;gap:5px;border:0; }
.view--conversations .chat-side-head .select { height:30px;border:0;background:transparent;color:var(--chat-muted);font-size:11px;padding-left:5px;box-shadow:none; }
.chat-instance-dot { width:7px;height:7px;flex:0 0 7px;border-radius:50%;background:var(--chat-muted);margin-left:7px; }
.is-connected .chat-instance-dot { background:var(--chat-accent); }
.view--conversations .chat-search { margin:0 12px 10px;padding:0 10px 0 13px;height:38px;border-radius:8px;background:var(--chat-search);gap:12px;color:var(--chat-muted); }
.view--conversations .chat-search .input { border:0;background:transparent;height:36px;padding:0;font-size:13px;color:var(--chat-text);box-shadow:none; }
.view--conversations .chat-search .input::placeholder { color:var(--chat-muted);opacity:1; }
.chat-filters { display:flex;gap:7px;padding:0 13px 13px;border-bottom:1px solid var(--chat-line); }
.chat-filters button { border:0;border-radius:24px;background:var(--chat-search);color:var(--chat-muted);font-size:12px;line-height:1;padding:9px 14px;cursor:pointer;min-height:32px; }
.chat-filters button[aria-pressed="true"] { background:color-mix(in srgb,var(--chat-accent) 16%,var(--chat-panel));color:var(--chat-accent);font-weight:600; }
.view--conversations .chat-new { padding:10px 12px;background:var(--chat-header);border-color:var(--chat-line); }
.view--conversations .chat-new[hidden] { display:none; }
.view--conversations .chat-new .input { height:38px;font-size:13px; }
.view--conversations .chat-item { gap:13px;min-height:79px;padding:13px 16px;border-color:var(--chat-line);background:var(--chat-panel);color:var(--chat-text); }
.view--conversations .chat-item:hover { background:var(--chat-hover); }
.view--conversations .chat-item.is-active { background:var(--chat-active); }
.view--conversations .avatar { width:46px;height:46px;border-radius:50%;background:var(--chat-avatar);border:0;color:var(--chat-text);font-size:15px;letter-spacing:.2px;overflow:hidden;flex-shrink:0; }
.view--conversations .avatar img { width:100%;height:100%;object-fit:cover; }
.view--conversations .chat-body { gap:5px; }
.view--conversations .chat-item-top strong { font-size:14px;font-weight:600; }
.view--conversations .chat-item-top>span { font-size:11px;color:var(--chat-muted); }
.view--conversations .chat-preview { font-size:13px;color:var(--chat-muted);line-height:1.4; }
.chat-list-footer { display:flex;align-items:center;gap:6px;padding:10px 14px;color:var(--chat-muted);font-size:10px;border-top:1px solid var(--chat-line); }
.chat-list-footer a { color:inherit;margin-left:auto;display:flex;align-items:center;justify-content:center;width:28px;min-height:28px;border-radius:50%; }
.view--conversations .thread-head { height:68px;min-height:68px;padding:10px 22px;gap:12px;background:var(--chat-header);border-bottom:1px solid var(--chat-line); }
.view--conversations .thread-head .avatar { width:42px;height:42px;border-radius:50%; }
.view--conversations .thread-who { gap:3px;flex:1; }
.view--conversations .thread-who strong { font-size:15px;font-weight:600;color:var(--chat-text); }
.view--conversations .thread-who span { font-size:12px;color:var(--chat-muted); }
.view--conversations #thread-status { font-size:10px;white-space:nowrap;gap:5px;color:var(--chat-muted); }
.view--conversations #thread-status::before { width:6px;height:6px; }
.view--conversations .thread-actions { display:flex;flex-wrap:nowrap;align-items:center;gap:6px;margin-left:8px;padding:0;border:0;background:none; }
.view--conversations .thread-messages { background:var(--chat-canvas);padding:22px clamp(22px,5vw,88px) 26px;gap:3px;scrollbar-gutter:stable; }
.view--conversations .msg-day { background:var(--chat-pill);color:var(--chat-muted);font-size:10px;letter-spacing:0;font-weight:500;padding:5px 12px;line-height:1.3;border:0;border-radius:8px;box-shadow:var(--chat-shadow);margin:0 auto 14px; }
.view--conversations .msg-row { padding:1px 0;position:relative;flex-shrink:0; }
.view--conversations .msg { position:relative;max-width:min(78%,560px);min-width:90px;padding:7px 10px 5px;background:var(--chat-incoming);color:var(--chat-text);border:0;border-radius:0 9px 9px 9px;box-shadow:var(--chat-shadow);font-size:14px;line-height:1.45; }
.view--conversations .msg-row.is-out .msg { border-radius:9px 0 9px 9px;background:var(--chat-outgoing);color:var(--chat-text);border:0; }
.view--conversations .msg::before { content:"";position:absolute;top:0;left:-7px;width:8px;height:12px;background:var(--chat-incoming);clip-path:polygon(0 0,100% 0,100% 100%); }
.view--conversations .msg-row.is-out .msg::before { left:auto;right:-7px;background:var(--chat-outgoing);transform:scaleX(-1); }
.view--conversations .msg-meta { display:flex;justify-content:flex-end;align-items:center;gap:4px;margin:3px 0 0 20px; }
.view--conversations .msg-time { font-size:10px;line-height:1.2;margin:0;color:var(--chat-muted); }
.msg-sent { display:inline-flex;color:var(--chat-muted); }
.view--conversations .msg-kind { display:none; }
.view--conversations .msg-actions { position:absolute;right:5px;top:2px;padding:2px 3px;border-radius:8px;background:var(--chat-incoming);opacity:0;transition:opacity var(--dur-fast);margin:0;z-index:2; }
.view--conversations .is-out .msg-actions { background:var(--chat-outgoing); }
.view--conversations .msg:hover .msg-actions,.view--conversations .msg:focus-within .msg-actions { opacity:1; }
.view--conversations .msg-action { min-height:26px;min-width:26px;font-size:11px;color:var(--chat-muted); }
.view--conversations .msg-reply { position:static;opacity:1;visibility:visible;width:26px;height:26px;padding:3px;border:0;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;color:var(--chat-muted);background:none; }
.view--conversations .msg-media-open { font-size:12px;color:var(--chat-accent);margin:5px 0; }
.chat-image { display:block;max-width:100%;max-height:300px;border-radius:6px;object-fit:contain; }
.chat-audio { display:flex;align-items:center;gap:10px;min-width:250px;padding:8px 0 3px; }
.chat-audio-play { width:40px;height:40px;flex:0 0 40px;display:grid;place-items:center;border:0;border-radius:50%;background:color-mix(in srgb,var(--chat-accent) 20%,transparent);color:var(--chat-accent);cursor:pointer; }
.chat-audio-track { min-width:0;flex:1; }
.chat-audio input[type=range] { width:100%;accent-color:var(--chat-accent);height:20px;cursor:pointer; }
.chat-audio-time { font-size:10px;color:var(--chat-muted);font-variant-numeric:tabular-nums; }
.chat-audio-speed { font-size:11px;border:0;border-radius:12px;padding:5px;color:var(--chat-muted);background:transparent;cursor:pointer;min-width:30px;min-height:30px; }
.chat-media-error { font-size:11px;color:var(--chat-muted);margin:5px 0; }
.view--conversations .compose { min-height:76px;background:var(--chat-header);padding:13px 22px;gap:12px;align-items:center;border-top:1px solid var(--chat-line); }
.view--conversations .compose textarea { min-height:46px;height:46px;max-height:120px;line-height:22px;padding:12px 15px;border:0;border-radius:10px;background:var(--chat-input);color:var(--chat-text);font:14px/22px var(--font-sans);resize:none; }
.view--conversations .compose textarea::placeholder { color:var(--chat-muted); }
.view--conversations .compose-send { border:0;border-radius:50%;width:44px;height:44px;min-height:44px;min-width:44px;padding:0;display:grid;place-items:center;background:var(--chat-accent);color:#fff;box-shadow:none; }
.view--conversations .compose-send:hover { background:color-mix(in srgb,var(--chat-accent) 85%,#000); }
.compose-emojis { position:relative;flex-shrink:0;color:var(--chat-muted); }
.compose-emojis summary { list-style:none;display:grid;place-items:center;width:32px;height:40px;cursor:pointer;border-radius:50%; }
.compose-emojis summary::-webkit-details-marker { display:none; }
.emoji-picker { position:absolute;bottom:56px;left:-10px;background:var(--chat-panel);border:1px solid var(--chat-line);box-shadow:0 8px 32px #0002;border-radius:12px;padding:10px;display:grid;grid-template-columns:repeat(6,36px);gap:2px;z-index:5; }
.emoji-picker button { display:grid;place-items:center;width:36px;height:36px;border:0;background:none;border-radius:6px;font-size:23px;cursor:pointer; }
.emoji-picker button:hover { background:var(--chat-hover); }
.view--conversations .reply-preview { padding:10px 22px;background:var(--chat-header);border-color:var(--chat-line); }
.view--conversations .reply-preview>div { border-left:3px solid var(--chat-accent);padding-left:10px; }
.view--conversations .reply-preview span { color:var(--chat-accent);font-size:11px; }
.view--conversations .reply-preview strong { font-size:12px;color:var(--chat-muted); }
.view--conversations .chat-placeholder { display:flex;flex-direction:column;align-items:center;justify-content:center;gap:14px;height:100%;max-width:330px;margin:auto;line-height:1.6;text-align:center;color:var(--chat-muted);font-size:13px; }
.view--conversations .chat-placeholder strong { font-size:23px;font-weight:400;color:var(--chat-text); }
.view--conversations .chat-readonly { background:var(--chat-header);border-color:var(--chat-line);color:var(--chat-muted); }
.view--conversations .chat-shell.has-tools { grid-template-columns:300px minmax(250px,1fr) 320px; }
.view--conversations .chat-workbench { background:var(--chat-panel);color:var(--chat-text);border-color:var(--chat-line); }
@media (max-width:1250px) and (min-width:761px) {
 .view--conversations .chat-shell { grid-template-columns:310px minmax(0,1fr); }
 .view--conversations .chat-shell.has-tools { grid-template-columns:minmax(250px,1fr) 320px; }
 .view--conversations .chat-shell.has-tools .chat-side { display:none; }
 .view--conversations .thread-messages { padding-left:24px;padding-right:24px; }
}
@media (max-width:760px) {
 .view--conversations .chat-shell,.view--conversations .chat-shell.has-tools { grid-template-columns:minmax(0,1fr); }
 .view--conversations .chat-thread { display:none; }
 .view--conversations .chat-shell.is-thread .chat-thread { display:flex; }
 .view--conversations .chat-shell.is-thread .chat-side { display:none; }
 .view--conversations .chat-shell.has-tools .chat-side,.view--conversations .chat-shell.has-tools .chat-thread { display:none; }
 .view--conversations .chat-shell.has-tools .chat-workbench { display:flex; }
 .view--conversations .thread-head { padding:8px 10px;gap:8px;min-height:62px;height:62px; }
 .view--conversations .thread-actions { gap:0;margin-left:0; }
 .view--conversations .thread-actions .icon-btn { width:32px; }
 .view--conversations #thread-status { display:none; }
 .view--conversations .thread-who strong { font-size:14px; }
 .view--conversations .thread-who span { font-size:11px; }
 .view--conversations .thread-messages { padding:16px 14px 20px; }
 .view--conversations .msg { max-width:88%;font-size:14px; }
 .view--conversations .compose { padding:10px;gap:5px;min-height:70px; }
 .view--conversations .compose textarea { padding:11px 12px; }
 .view--conversations .compose-send { width:40px;height:40px;min-width:40px;min-height:40px; }
 .view--conversations .compose>.icon-btn { width:32px; }
 .view--conversations .reply-preview { padding:10px 14px; }
 .chat-audio { min-width:220px; }
}
@media(hover:none) {
 .view--conversations .msg-actions { position:static;opacity:1;padding:0;justify-content:flex-end; }
}
@media(prefers-reduced-motion:reduce) {
 .view--conversations * { scroll-behavior:auto;transition:none;animation:none; }
}

.view--conversations .msg-time,.view--conversations .msg-sent,.chat-audio-time,.chat-audio-speed { color:var(--chat-bubble-muted); }
/* Reserve media geometry while files load or expire. */
.view--conversations .chat-media:has(.chat-image) { width:280px;max-width:100%;height:200px;display:grid;place-items:center;border-radius:6px;background:var(--chat-canvas);overflow:hidden; }
.view--conversations .chat-image { width:100%;height:100%;max-height:200px;object-fit:contain; }

/* Non-modal call widget. Remains usable while switching conversations. */
.softphone { position:fixed;right:24px;bottom:24px;z-index:80;width:320px;max-width:calc(100vw - 24px);margin:0;border:1px solid var(--chat-line,var(--border));border-radius:18px;background:var(--chat-panel,var(--surface));color:var(--chat-text,var(--text));box-shadow:0 14px 48px #0003;overflow:hidden; }
.softphone-heading { display:flex;align-items:center;justify-content:space-between;padding:10px 12px 10px 18px;background:var(--chat-accent,var(--accent-lime));color:var(--chat-panel,var(--surface)); }
.softphone-heading>span { display:flex;align-items:center;gap:7px;font-size:11px;font-weight:600; }
.softphone-heading>div { display:flex;gap:2px; }
.softphone-heading .icon-btn { color:inherit;width:30px;height:30px;min-height:30px;border-radius:8px;cursor:pointer; }
.softphone-heading .icon-btn:hover { background:#ffffff26; }
.softphone-main { display:flex;flex-direction:column;align-items:center;text-align:center;gap:14px;padding:24px 20px 12px; }
.softphone-main>div { display:flex;flex-direction:column;align-items:center;gap:6px;min-width:0;max-width:100%; }
.softphone-main strong { font-size:19px;line-height:1.3;font-weight:600;overflow-wrap:anywhere; }
.softphone-main [data-softphone-number] { color:var(--chat-muted,var(--muted));font-size:11px;overflow-wrap:anywhere; }
.softphone-main [role=status] { color:var(--chat-accent,var(--text));font-size:12px;line-height:1.5; }
.softphone-icon { width:68px;height:68px;display:grid;place-items:center;background:var(--chat-avatar,var(--accent-soft));color:var(--chat-accent,var(--accent-lime));border-radius:50%;flex-shrink:0; }
.softphone-timer { font-variant-numeric:tabular-nums;font-size:18px;font-weight:500;letter-spacing:1px;line-height:1.4; }
.softphone-controls { display:flex;gap:18px;align-items:flex-start;justify-content:center;padding:16px 16px 20px; }
.softphone-action { display:flex;flex-direction:column;align-items:center;gap:8px;width:62px;border:0;background:none;color:var(--chat-text,var(--text));font:inherit;cursor:pointer;padding:0;border-radius:12px; }
.softphone-action>svg { box-sizing:content-box;padding:13px;border-radius:50%;background:var(--chat-canvas,var(--surface));transition:background .15s; }
.softphone-action>span { font-size:10px;line-height:1.4; }
.softphone-action:hover>svg { background:var(--chat-avatar,var(--accent-soft)); }
.softphone-action:focus-visible,.softphone-heading button:focus-visible,.softphone-footer summary:focus-visible { outline:2px solid var(--chat-accent,var(--accent-lime));outline-offset:4px; }
.softphone-action:disabled { opacity:.45;cursor:wait; }
.softphone-end>svg,.softphone-end:hover>svg { background:var(--danger);color:var(--text-inverse,#fff);transform:rotate(135deg); }
.softphone-join>svg { background:var(--chat-accent,var(--accent-lime));color:var(--chat-panel,var(--surface)); }
.softphone-controls [aria-pressed=true]>svg { background:var(--danger-soft);color:var(--danger); }
.softphone-error { font-size:12px;line-height:1.5;color:var(--danger);padding:0 20px;margin:8px 0;overflow-wrap:anywhere; }
.softphone-footer { border-top:1px solid var(--chat-line,var(--border));padding:10px 16px;text-align:center;color:var(--chat-muted,var(--muted));font-size:10px;line-height:1.5; }
.softphone-footer details { margin-top:5px; }
.softphone-footer summary { cursor:pointer;list-style:none;text-decoration:underline;text-underline-offset:3px; }
.softphone-footer summary::-webkit-details-marker { display:none; }
.softphone-audio { display:flex;justify-content:center;gap:10px;margin-top:8px;flex-wrap:wrap;font-size:10px; }
.softphone[data-minimized=true] { width:280px; }
.softphone[data-minimized=true] .softphone-main { flex-direction:row;text-align:left;padding:12px 16px;gap:12px; }
.softphone[data-minimized=true] .softphone-main>div { align-items:flex-start;gap:3px; }
.softphone[data-minimized=true] .softphone-main strong { font-size:13px; }
.softphone[data-minimized=true] .softphone-icon { width:38px;height:38px; }
.softphone[data-minimized=true] .softphone-icon>svg { width:18px;height:18px; }
.softphone[data-minimized=true] .softphone-main [data-softphone-number],.softphone[data-minimized=true] .softphone-footer,.softphone[data-minimized=true] .softphone-controls [data-softphone-mute],.softphone[data-minimized=true] .softphone-controls [data-softphone-output] { display:none; }
.softphone[data-minimized=true] .softphone-controls { padding:0 16px 12px;gap:12px; }
.softphone[data-minimized=true] .softphone-timer { font-size:12px; }
@media(max-width:760px){ .softphone { right:12px;bottom:max(12px,env(safe-area-inset-bottom));width:300px;max-height:calc(100dvh - 24px);overflow:auto; }.softphone-main{padding:18px 16px 10px;gap:12px;}.softphone-icon{width:56px;height:56px;} }
@media(prefers-reduced-motion:reduce){.softphone *{transition:none;}}

/* A real button gives keyboard and touch users the same movement control. */
.softphone-drag { display:flex;align-items:center;gap:7px;min-height:36px;padding:3px 6px;border:0;border-radius:6px;background:transparent;color:inherit;font:inherit;cursor:grab;touch-action:none;user-select:none; }
.softphone-drag[data-dragging] { cursor:grabbing; }
.softphone-drag:focus-visible { outline:2px solid var(--chat-accent);outline-offset:2px; }

/* Homologação reuses the messenger; resource navigation owns only this toolbar. */
.homologation-header { display:flex;align-items:center;justify-content:space-between;gap:16px;padding:12px 18px;background:var(--chat-panel);border-bottom:1px solid var(--chat-line); }
.homologation-header>div { display:grid;gap:3px;min-width:0; }
.homologation-header strong { font-size:14px; }
.homologation-header span { font-size:11px;color:var(--chat-muted); }
.homologation-resources { display:flex;gap:6px;padding:8px 14px;overflow-x:auto;flex-shrink:0;background:var(--chat-header);border-bottom:1px solid var(--chat-line);scrollbar-gutter:stable; }
.homologation-resources button { flex-shrink:0;border:1px solid var(--chat-line);border-radius:18px;padding:7px 12px;background:var(--chat-panel);color:var(--chat-text);font:inherit;font-size:12px;cursor:pointer; }
.homologation-resources button:hover { background:var(--chat-active); }
.chat-contact-avatar,#thread-avatar { position:relative; }
.chat-contact-avatar img,#thread-avatar img { position:absolute;inset:0;width:100%;height:100%;object-fit:cover; }
.softphone { max-height:calc(100dvh - 16px);overflow-y:auto;overscroll-behavior:contain; }
.softphone-heading { position:sticky;top:0;z-index:1; }
.softphone-recording { display:flex;flex-wrap:wrap;justify-content:center;align-items:center;gap:8px;padding:0 16px 14px;color:var(--chat-text); }
.softphone-recording[hidden] { display:none; }
.softphone-recording [data-record-status],.softphone-recording small { width:100%;text-align:center;font-size:11px;line-height:1.5;color:var(--chat-muted); }
.softphone-recording[data-recording=true] [data-record-status] { color:var(--danger);font-weight:600; }
.softphone[data-recording=true] .softphone-drag::after { content:'';width:8px;height:8px;border-radius:50%;background:var(--danger); }
.softphone[data-minimized=true] .softphone-recording { display:none; }
.softphone-recording .btn { min-height:32px; }
@media(max-width:600px){.homologation-header{padding:10px 12px}.homologation-header span{display:none}.homologation-header strong{font-size:13px}}

/* Constrain the entire flex/grid chain; intrinsic list sizes must not grow the page. */
.view--conversations { flex:0 0 auto;overflow:hidden; }
.view--conversations .chat-page { height:auto;flex:1 1 0;overflow:hidden; }
.view--conversations .chat-shell { flex:1 1 0;grid-template-rows:minmax(0,1fr); }
.view--conversations .chat-side,.view--conversations .chat-thread,.view--conversations .chat-workbench { min-height:0;max-height:100%;overflow:hidden; }
.view--conversations .chat-list,.view--conversations .thread-messages,.view--conversations .workbench-list { flex:1 1 0;min-height:0;overflow-y:auto;overscroll-behavior-y:contain; }
.view--conversations .chat-list-header,.view--conversations .chat-side-head,.view--conversations .chat-search,.view--conversations .chat-filters,.view--conversations .chat-new,.view--conversations .chat-list-footer,.view--conversations .thread-head,.view--conversations .compose,.view--conversations .reply-preview,.view--conversations .chat-readonly,.homologation-header { flex-shrink:0; }
.view--conversations .workbench-head,.view--conversations .workbench-intro,.view--conversations .workbench-search,.view--conversations .workbench-category,.view--conversations .workbench-count,.view--conversations .workbench-footer { flex-shrink:0; }
/* Short windows cannot fit all filters plus the list: scroll this panel as one. */
@media(max-height:650px) {
 .homologation-header span { display:none; }
 .view--conversations .thread-head { height:52px;min-height:52px;padding:6px 12px; }
 .view--conversations .thread-head .avatar { width:32px;height:32px; }
 .view--conversations .thread-messages { padding:10px 12px; }
 .view--conversations .compose { min-height:64px;padding:6px 10px; }
 .view--conversations .compose textarea { max-height:56px; }
 .view--conversations .reply-preview { max-height:48px;padding:6px 12px;overflow:hidden; }
 .view--conversations .chat-side { overflow-y:auto;overscroll-behavior-y:contain; }
 .view--conversations .chat-list { flex:0 0 auto;overflow:visible; }
 .view--conversations .chat-list-header { position:sticky;top:0;z-index:2;background:var(--chat-panel); }
 .view--conversations .chat-workbench { overflow-y:auto;overscroll-behavior-y:contain; }
 .view--conversations .workbench-list { flex:0 0 auto;overflow:visible; }
 .view--conversations .workbench-head { position:sticky;top:-16px;z-index:2;background:var(--chat-panel);padding:8px 0; }
 .view--conversations .workbench-live { flex-shrink:0; }
}

/* Shared portable chat: composer, expression palette and contact profile. */
.view--conversations .chat-shell { position:relative; }
.thread-contact { display:flex;align-items:center;gap:12px;flex:1;min-width:0;padding:3px;border:0;border-radius:8px;background:transparent;text-align:left;color:var(--chat-text);cursor:pointer; }
.thread-contact:hover { background:var(--chat-hover); }
.thread-contact .thread-who { display:flex;flex-direction:column;min-width:0; }
.thread-contact strong,.thread-contact .thread-who>span { overflow:hidden;text-overflow:ellipsis;white-space:nowrap; }
.composer-panel { flex-shrink:0;max-height:min(54dvh,480px);overflow:auto;background:var(--chat-panel);border-top:1px solid var(--chat-line);padding:0 18px 14px;color:var(--chat-text);scrollbar-gutter:stable; }
.composer-panel[hidden],.chat-profile[hidden] { display:none; }
.composer-panel-head { position:sticky;top:0;z-index:2;display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:48px;background:var(--chat-panel);border-bottom:1px solid var(--chat-line);margin-bottom:10px; }
.composer-panel-head strong { font-size:14px;font-weight:600; }
.attachment-menu { display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;padding:6px 0; }
.attachment-menu button { display:flex;flex-direction:column;align-items:center;gap:8px;border:0;border-radius:10px;background:transparent;color:var(--chat-text);padding:12px 4px;min-height:84px;font-size:12px;cursor:pointer; }
.attachment-menu button>span { display:grid;place-items:center;width:42px;height:42px;background:color-mix(in srgb,var(--chat-accent) 12%,var(--chat-panel));color:var(--chat-accent);border-radius:14px; }
.attachment-menu button:hover,.expression-grid button:hover,.emoji-categories button:hover,.expression-tabs button:hover { background:var(--chat-hover); }
.composer-panel-actions { display:flex;align-items:center;justify-content:flex-end;flex-wrap:wrap;gap:8px;margin-top:12px; }
.composer-panel-actions>span { flex:1;font-size:11px;color:var(--chat-muted); }
.composer-feedback { margin:10px 0;color:var(--chat-muted);font-size:12px;line-height:1.5;overflow-wrap:anywhere; }
.attachment-preview { display:flex;flex-direction:column;align-items:center;gap:6px;padding:8px;min-height:110px;border-radius:8px;background:var(--chat-canvas); }
.attachment-preview img,.attachment-preview video { max-height:150px;max-width:100%;object-fit:contain; }
.attachment-preview strong { font-size:13px;max-width:100%;overflow-wrap:anywhere; }
.attachment-preview>span { color:var(--chat-muted);font-size:11px; }
.attachment-preview .attachment-file-icon { display:grid;place-items:center;padding:14px;color:var(--chat-accent); }
.attachment-queue { display:flex;gap:6px;overflow-x:auto;padding:10px 0; }
.attachment-queue-item { flex:0 0 150px;display:flex;border:1px solid var(--chat-line);border-radius:8px;background:var(--chat-panel); }
.attachment-queue-item button { padding:8px;border:0;border-radius:8px;background:transparent;color:var(--chat-text);font-size:11px;cursor:pointer;min-width:0; }
.attachment-queue-item button:first-child { flex:1;text-align:left;overflow:hidden;text-overflow:ellipsis;white-space:nowrap; }
.attachment-queue-item small { display:block;color:var(--chat-muted);font-size:10px;margin-top:4px; }
.attachment-queue-item button[aria-pressed="true"] { background:var(--chat-hover); }
.attachment-queue-item[data-state="sent"] small { color:var(--chat-accent); }
.attachment-caption { display:flex;flex-direction:column;gap:6px;font-size:12px;color:var(--chat-muted); }
.attachment-caption textarea { resize:none;min-height:42px;max-height:80px;padding:10px;border:1px solid var(--chat-line);border-radius:8px;background:var(--chat-input);color:var(--chat-text);font:13px/1.4 var(--font-sans); }
.expression-tabs { display:flex;gap:8px; }
.expression-tabs button { display:flex;align-items:center;gap:8px;padding:9px 14px;border:0;border-radius:8px;background:transparent;color:var(--chat-muted);font:13px var(--font-sans);cursor:pointer; }
.expression-tabs button[aria-pressed="true"] { background:var(--chat-hover);color:var(--chat-accent); }
.expression-search { position:relative;display:flex;align-items:center;gap:4px;margin-top:12px; }
.expression-search .input { width:100%;background:var(--chat-search);border-color:var(--chat-line);color:var(--chat-text); }
.expression-search .icon-btn { position:absolute;right:5px; }
.expression-search input { padding-right:40px; }
.emoji-categories { display:flex;justify-content:space-between;gap:3px;border-bottom:1px solid var(--chat-line);padding:8px 0; }
.emoji-categories button { background:transparent;border:0;border-radius:6px;min-width:32px;min-height:36px;cursor:pointer;font-size:21px; }
.emoji-categories button[aria-pressed="true"] { background:var(--chat-hover);box-shadow:inset 0 -2px var(--chat-accent); }
.expression-grid { display:grid;grid-template-columns:repeat(auto-fill,minmax(40px,1fr));gap:3px;padding-top:10px; }
.expression-grid button { display:grid;place-items:center;min-height:40px;min-width:40px;padding:4px;border:0;border-radius:8px;background:transparent;cursor:pointer;color:var(--chat-text);font-size:27px; }
.expression-grid>.composer-feedback { grid-column:1/-1; }
.sticker-grid { grid-template-columns:repeat(auto-fill,minmax(80px,1fr)); }
.sticker-grid button { height:88px; }
.sticker-grid img { width:76px;height:76px;object-fit:contain; }
.voice-note-label { display:flex;align-items:center;gap:8px;margin:14px 0; }
.voice-note-label strong { flex:1;font-size:13px; }
.voice-note-label [data-voice-clock] { color:var(--chat-muted);font-size:13px;font-variant-numeric:tabular-nums; }
.voice-note-dot { width:9px;height:9px;background:var(--chat-muted);border-radius:50%; }
.voice-note-dot.is-recording { background:var(--danger); }
.voice-note audio { width:100%;height:42px; }
.chat-profile { position:absolute;z-index:15;inset:0 0 0 auto;width:min(390px,100%);display:flex;flex-direction:column;min-height:0;background:var(--chat-panel);border-left:1px solid var(--chat-line);box-shadow:-8px 0 28px #0001;color:var(--chat-text); }
.profile-head { display:flex;align-items:center;gap:12px;padding:14px;min-height:68px;flex-shrink:0;background:var(--chat-header);border-bottom:1px solid var(--chat-line); }
.profile-head strong { flex:1;font-size:14px;font-weight:600; }
.profile-content { overflow:auto;min-height:0;flex:1;scrollbar-gutter:stable; }
.profile-identity { display:flex;align-items:center;flex-direction:column;padding:26px 20px 16px;text-align:center; }
.profile-photo { width:150px;height:150px;border-radius:50%;border:0;padding:0;overflow:hidden;display:grid;place-items:center;background:var(--chat-avatar);color:var(--chat-text);font:40px var(--font-sans);cursor:pointer; }
.profile-photo img { width:100%;height:100%;object-fit:cover; }
.profile-photo:disabled { cursor:default; }
.profile-identity h2 { font-size:22px;font-weight:500;margin:16px 0 6px;overflow-wrap:anywhere; }
.profile-identity p { font-size:14px;color:var(--chat-muted);margin:0; }
.profile-business-badge { display:flex;align-items:center;gap:5px;font-size:11px;margin-top:12px;color:var(--chat-accent); }
.profile-actions { display:flex;gap:10px;justify-content:center;padding:0 20px 24px; }
.profile-actions button { display:flex;flex-direction:column;align-items:center;gap:8px;min-width:100px;padding:12px;border:1px solid var(--chat-line);border-radius:10px;background:var(--chat-panel);color:var(--chat-accent);cursor:pointer; }
.profile-actions button:hover { background:var(--chat-hover); }
.profile-section { padding:18px 22px;border-top:8px solid var(--chat-canvas); }
.profile-section>span { font-size:12px;color:var(--chat-accent); }
.profile-section p,.profile-section a { font-size:13px;line-height:1.6;overflow-wrap:anywhere;white-space:pre-wrap; }
.profile-section a { display:block;margin-top:8px;color:var(--chat-accent); }
.profile-media-grid { display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px; }
.profile-media-grid button { height:88px;display:grid;place-items:center;padding:0;border:0;border-radius:6px;overflow:hidden;background:var(--chat-canvas);color:var(--chat-muted);cursor:pointer; }
.profile-media-grid img { width:100%;height:100%;object-fit:cover; }
.profile-participant { display:flex;justify-content:space-between;gap:10px;padding:10px 0;font-size:12px;border-bottom:1px solid var(--chat-line); }
.profile-participant small { color:var(--chat-accent); }
.profile-photo-expanded { display:block;max-width:100%;max-height:65dvh;margin:auto;object-fit:contain; }
.view--conversations :is(.attachment-menu,.expression-grid,.expression-tabs,.emoji-categories,.profile-actions,.attachment-queue) button:focus-visible,.thread-contact:focus-visible { outline:2px solid var(--chat-accent);outline-offset:2px; }
@media(max-width:760px){
 .thread-contact { gap:8px; }
 .composer-panel { padding:0 10px 10px;max-height:52dvh; }
 .attachment-menu { gap:3px; }
 .attachment-menu button { font-size:11px;min-height:76px; }
 .expression-grid { grid-template-columns:repeat(auto-fill,minmax(36px,1fr)); }
 .sticker-grid { grid-template-columns:repeat(auto-fill,minmax(70px,1fr)); }
 .compose [data-compose-mic] { width:30px; }
 .view--conversations .compose textarea { min-width:0;padding-left:10px;padding-right:10px; }
}
.view--conversations .chat-thread { position:relative; }
.composer-panel[data-composer-view="attach"] { position:absolute;z-index:12;left:18px;bottom:84px;width:min(268px,calc(100% - 36px));max-height:calc(100% - 100px);border:1px solid var(--chat-line);border-radius:14px;box-shadow:0 8px 32px #0002;padding:0 10px 10px; }
.composer-panel[data-composer-view="attach"] .attachment-menu { grid-template-columns:minmax(0,1fr);gap:2px;padding:0; }
.composer-panel[data-composer-view="attach"] .attachment-menu button { flex-direction:row;min-height:46px;padding:5px 8px;gap:14px;font-size:13px;text-align:left; }
.composer-panel[data-composer-view="attach"] .attachment-menu button>span { width:34px;height:34px;border-radius:10px;flex-shrink:0; }
.view--conversations .msg-row.is-sticker .msg { background:transparent;box-shadow:none;min-width:0; }
.view--conversations .msg-row.is-sticker .msg::before { display:none; }
.chat-sticker { display:block;width:160px;height:160px;object-fit:contain; }
@media(max-width:760px){.composer-panel[data-composer-view="attach"]{bottom:76px;left:10px;width:min(268px,calc(100% - 20px));max-height:calc(100% - 86px);}}
.composer-panel-actions .btn { min-width:120px; }
