/* Aoki Chat presentation: first-party identities and media only. */
/* Native hidden must win over author display rules, including rich editors. */
#conversations[data-channel="crm_im"] [hidden] { display:none !important; }
#conversations[data-channel="crm_im"] {
  --im-bg:#ededed; --im-list:#f7f7f7; --im-card:#fff; --im-ink:#191919; --im-muted:#888;
  --im-line:#e3e3e3; --im-in:#fff; --im-out:#95ec69; --im-out-ink:#191919; --im-accent:#07c160;
  --im-active:#dedede; --im-avatar-radius:4px; --im-bubble-radius:4px;
}
#conversations[data-channel="crm_im"] .message-bubble { border:0; }
#conversations[data-channel="crm_im"] .wx-time { text-align:center; color:#999; font-size:12px; padding:12px 0; }
#conversations[data-channel="crm_im"] .message.is-media .message-bubble { background:transparent; padding:0; }
#conversations[data-channel="crm_im"] .aoki-image [data-aoki-image-open] { padding:0; border:0; background:transparent; cursor:zoom-in; line-height:0; }
#conversations[data-channel="crm_im"] .aoki-image img { border-radius:4px; }
#conversations[data-channel="crm_im"] .message-speaker strong { color:#888; font-weight:400; }
#conversations[data-channel="crm_im"] .conversation-item.is-pinned { background:#e6e6e6; }
#conversations[data-channel="crm_im"] .conversation-item.active { background:#dedede; }
#conversations[data-channel="crm_im"] .conversation-avatar,
#conversations[data-channel="crm_im"] .message-avatar { border-radius:4px; }
.aoki-call-dialog {
  width:min(820px,calc(100vw - 32px)); max-width:820px; max-height:calc(100dvh - 32px);
  padding:24px; overflow:auto; color:#fff; background:#252525; border:1px solid #414141;
  border-radius:12px; box-shadow:0 24px 90px #0007;
}
.aoki-call-dialog::backdrop { background:#0008; backdrop-filter:blur(3px); }
.aoki-call-dialog .eyebrow { color:#a6a6a6; font-size:11px; letter-spacing:.06em; margin-bottom:5px; }
.aoki-call-dialog h2 { font-size:20px; font-weight:500; }
.aoki-call-shell { gap:16px; }
.aoki-call-window-actions { display:flex; gap:4px; }
.aoki-call-window-actions button { width:32px; height:32px; border:0; border-radius:5px; background:transparent; color:#ccc; font-size:24px; cursor:pointer; }
.aoki-call-window-actions button:hover { background:#ffffff12; color:#fff; }
.aoki-call-summary { display:flex; justify-content:space-between; align-items:center; gap:12px; }
.aoki-call-status { color:#c2c2c2; font-size:13px; }
[data-aoki-call-elapsed] { font-variant-numeric:tabular-nums; white-space:nowrap; }
.aoki-call-summary time { color:#e5e5e5; font-size:13px; }
.aoki-call-video { position:relative; display:grid; grid-template-columns:1fr; gap:10px; background:transparent; min-height:260px; }
.aoki-call-video #aoki-call-remotes { display:grid; grid-template-columns:1fr; min-height:260px; }
.aoki-call-tile { position:relative; min-width:0; aspect-ratio:4 / 3; overflow:hidden; border-radius:8px; background:#171717; }
.aoki-call-video video,.aoki-call-video #aoki-call-remotes video { display:block; width:100%; height:100%; min-height:0; object-fit:contain; background:#171717; }
.aoki-call-placeholder { display:none; position:absolute; inset:0; align-items:center; justify-content:center; color:#fff; background:#343a36; font-size:48px; }
.aoki-call-tile.is-camera-off .aoki-call-placeholder { display:flex; }
.aoki-call-tile-caption { position:absolute; inset:auto 0 0; padding:24px 12px 10px; background:linear-gradient(transparent,#000b); display:grid; gap:3px; }
.aoki-call-tile-caption strong { font-size:13px; font-weight:500; }
.aoki-call-tile-caption small { font-size:11px; color:#ddd; }
.aoki-call-tile-caption small:empty { display:none; }
.aoki-call-video .aoki-call-self { position:absolute; top:12px; right:12px; width:25%; min-width:100px; border:1px solid #ffffff30; }
.aoki-call-dialog.is-group-call .aoki-call-video { grid-template-columns:repeat(2,minmax(0,1fr)); }
.aoki-call-dialog.is-group-call #aoki-call-remotes { display:contents; }
.aoki-call-dialog.is-group-call .aoki-call-self { position:relative; inset:auto; width:auto; min-width:0; }
.aoki-call-dialog.is-voice-call .aoki-call-tile { aspect-ratio:1; }
.aoki-call-dialog.is-voice-call .aoki-call-self { position:relative; inset:auto; width:auto; }
.aoki-call-dialog.is-voice-call .aoki-call-video { grid-template-columns:repeat(2,minmax(0,1fr)); }
.aoki-call-actions { justify-content:center; gap:12px; padding-top:6px; }
.aoki-call-actions button { min-width:90px; min-height:44px; padding:10px 16px; border:1px solid #555; border-radius:8px; background:#3b3b3b; color:#fff; font-size:13px; }
.aoki-call-actions button:hover { background:#494949; }
.aoki-call-actions button[aria-pressed="true"] { border-color:#07c160; background:#17432d; }
.aoki-call-actions [data-aoki-call-accept],.aoki-call-actions [data-aoki-call-resume] { background:#07b75a; border-color:#07b75a; }
.aoki-call-actions [data-aoki-call-end],.aoki-call-actions [data-aoki-call-reject] { color:#fff; background:#e74747; border-color:#e74747; }
.aoki-call-actions [data-aoki-call-end]:hover,.aoki-call-actions [data-aoki-call-reject]:hover { background:#cf3939; }
.aoki-call-dock { position:fixed; right:24px; bottom:24px; z-index:1100; display:flex; width:min(340px,calc(100vw - 32px)); color:#fff; background:#252525; border:1px solid #444; border-radius:12px; box-shadow:0 8px 35px #0005; }
.aoki-call-dock button { color:inherit; background:transparent; border:0; cursor:pointer; }
.aoki-call-dock [data-aoki-call-restore] { display:flex; align-items:center; gap:12px; flex:1; min-width:0; padding:14px; text-align:left; }
.aoki-call-dock [data-aoki-call-restore] > span:nth-child(2) { display:grid; gap:4px; flex:1; min-width:0; }
.aoki-call-dock strong { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:13px; font-weight:500; }
.aoki-call-dock small { color:#aaa; font-size:11px; }
.aoki-call-dock-mark { color:#07c160; font-size:24px; }
.aoki-call-dock [data-aoki-call-dock-end] { padding:10px 14px; font-size:24px; color:#ff7878; }
.aoki-call-dock button:focus-visible,.aoki-call-dialog button:focus-visible { outline:2px solid #07c160; outline-offset:2px; }
.aoki-call-dock[hidden],.aoki-call-tile[hidden],.aoki-call-actions button[hidden] { display:none !important; }
.aoki-image-viewer { width:100vw; max-width:none; height:100dvh; max-height:none; margin:0; padding:0; border:0; border-radius:0; color:#eee; background:#202020; overflow:hidden; }
.aoki-image-viewer[open] { display:flex; flex-direction:column; }
.aoki-image-viewer::backdrop { background:#202020; }
.aoki-image-viewer header { display:flex; align-items:center; gap:20px; padding:12px 20px; min-height:52px; flex-shrink:0; }
.aoki-image-viewer header strong { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:14px; font-weight:400; }
.aoki-image-viewer header span { color:#aaa; font-size:12px; }
.aoki-image-viewer button { min-height:36px; padding:6px 12px; color:#eee; background:#353535; border:1px solid #555; border-radius:4px; cursor:pointer; font-size:13px; }
.aoki-image-viewer button:hover { background:#444; }
.aoki-image-viewer button:disabled { opacity:.35; cursor:default; }
.aoki-image-viewer button:focus-visible { outline:2px solid #07c160; outline-offset:2px; }
.aoki-image-viewer [data-aoki-image-close] { background:transparent; border:0; font-size:26px; }
.aoki-image-stage { position:relative; flex:1; min-height:0; overflow:hidden; touch-action:none; user-select:none; cursor:grab; }
.aoki-image-stage:active { cursor:grabbing; }
.aoki-image-stage img { position:absolute; left:50%; top:50%; max-width:none; max-height:none; transform-origin:center; }
.aoki-image-stage [role="status"] { position:absolute; top:45%; left:16px; right:16px; text-align:center; pointer-events:none; font-size:14px; color:#ccc; }
.aoki-image-viewer footer { display:flex; justify-content:center; align-items:center; flex-wrap:wrap; gap:8px; padding:12px; flex-shrink:0; }
.aoki-image-viewer [data-aoki-image-zoom] { min-width:44px; text-align:center; font-size:12px; color:#aaa; }
.aoki-image-viewer [hidden] { display:none !important; }
@media (max-width:600px) {
  .aoki-call-dialog { width:calc(100vw - 16px); padding:16px; max-height:calc(100dvh - 16px); }
  .aoki-call-video,.aoki-call-video #aoki-call-remotes { min-height:200px; }
  .aoki-call-actions { gap:8px; }
  .aoki-call-actions button { min-width:72px; padding:10px 12px; }
  .aoki-call-dock { right:16px; bottom:16px; }
}

/* Independent address-book data inside the common conversation layout. */
.aoki-address-book[hidden] { display:none !important; }
#conversations[data-channel="crm_im"].aoki-contacts-visible .conversation-sidebar,#conversations[data-channel="crm_im"].aoki-contacts-visible .chat-pane,#conversations[data-channel="crm_im"].aoki-contacts-visible .contact-pane { display:none !important; }
.aoki-address-book { grid-column:2 / 4; grid-row:1; display:grid; grid-template-columns:minmax(240px,var(--queue-width,300px)) minmax(0,1fr); grid-template-rows:minmax(0,1fr) auto; min-width:0; min-height:450px; overflow:hidden; color:#222; background:#f5f5f5; }
.aoki-contact-list-pane { display:flex; flex-direction:column; min-height:0; background:#ededed; border-right:1px solid #ddd; }
.aoki-contact-list-pane>header { display:flex; flex-wrap:nowrap; align-items:center; gap:8px; padding:20px 12px 12px; }
.aoki-contact-list-pane input { flex:1; min-width:0; width:auto; border:0; border-radius:4px; background:#ddd; padding:7px 10px; font-size:12px; }
.aoki-address-book button { cursor:pointer; font:inherit; }
.aoki-contact-list-pane>header button { flex:0 0 30px; border:0; width:30px; background:#ddd; font-size:20px; border-radius:3px; }
.aoki-contact-tabs { display:flex; padding:0 8px 8px; gap:4px; }
.aoki-contact-tabs button { flex:1; padding:8px 4px; border:0; background:transparent; color:#666; font-size:12px; border-radius:3px; white-space:nowrap; }
.aoki-contact-tabs button.active { background:#ddd; color:#222; }
#aoki-contact-badge:not(:empty) { margin-left:3px; padding:1px 4px; background:#fa5151; color:white; border-radius:8px; font-size:10px; }
.aoki-contact-rows { flex:1; overflow:auto; min-height:200px; }
.aoki-contact-list-body { flex:1; display:grid; grid-template-columns:minmax(0,1fr) 26px; min-height:0; }
.aoki-contact-list-body.no-index { grid-template-columns:minmax(0,1fr); }
.aoki-contact-heading { margin:0; padding:6px 18px; background:#e4e4e4; color:#888; font-size:12px; font-weight:400; }
.aoki-contact-index { display:flex; flex-direction:column; justify-content:center; gap:1px; overflow:auto; min-height:0; padding:4px 0; user-select:none; touch-action:none; }
.aoki-contact-index[hidden] { display:none !important; }
#aoki-contact-index button { flex-shrink:0; justify-content:center; width:24px; height:18px; min-height:18px; line-height:18px; padding:0; border:0; border-radius:3px; background:transparent; color:#666; font-size:11px; }
.aoki-contact-index button[aria-pressed="true"] { background:#07b75c; color:#fff; }
.aoki-contact-row { width:100%; display:flex; align-items:center; gap:12px; padding:14px 18px; text-align:left; border:0; background:transparent; }
.aoki-contact-row:hover { background:#e2e2e2; }
.aoki-contact-row.active { background:#d6d6d6; }
.aoki-contact-avatar { display:flex; align-items:center; justify-content:center; width:40px; height:40px; flex-shrink:0; border-radius:4px; background:#a6cdb3; color:#32473a; font-size:20px; }
.aoki-contact-avatar img,.aoki-account-mark img { width:100%; height:100%; object-fit:cover; border-radius:inherit; }
.aoki-avatar-controls { display:grid; gap:10px; }
.aoki-avatar-controls[hidden] { display:none !important; }
.aoki-avatar-controls button { margin:4px; }
.aoki-avatar-images { display:flex; gap:16px; align-items:center; }
.aoki-avatar-images .aoki-contact-avatar,.aoki-avatar-images > img { width:72px; height:72px; border-radius:6px; object-fit:cover; }
.aoki-avatar-images > img[hidden] { display:none; }
.aoki-avatar-crop { width:min(390px,calc(100vw - 24px)); max-height:calc(100dvh - 24px); overflow:auto; padding:20px; border:1px solid #ddd; border-radius:10px; background:#fff; color:#333; }
.aoki-avatar-crop::backdrop { background:#0008; }
.aoki-avatar-crop h2 { margin:0 0 12px; font-size:18px; }
.aoki-avatar-crop canvas { display:block; width:min(256px,100%); height:auto; margin:auto; touch-action:none; cursor:grab; border-radius:8px; }
.aoki-avatar-crop label { display:grid; grid-template-columns:80px minmax(0,1fr); align-items:center; margin:10px 0; font-size:13px; }
.aoki-avatar-crop input { width:100%; }
.aoki-avatar-crop p { font-size:12px; color:#666; }
.aoki-avatar-crop > div { display:flex; justify-content:flex-end; gap:12px; }
.aoki-avatar-crop button { padding:8px 12px; border:1px solid #ddd; border-radius:4px; background:#f5f5f5; color:#333; }
.aoki-account-mark[role="button"] { cursor:pointer; }
#aoki-profile-dialog { width:min(560px,calc(100vw - 24px)); max-height:calc(100dvh - 32px); padding:22px; border:1px solid #ddd; border-radius:8px; background:#fff; color:#333; }
#aoki-profile-dialog::backdrop { background:#0008; backdrop-filter:blur(2px); }
#aoki-profile-dialog .stack-form { gap:14px; padding:0; }
#aoki-profile-dialog p { margin:0; }
#aoki-profile-dialog h2 { color:#333; font-size:18px; }
#aoki-profile-dialog .muted { color:#777; }
#aoki-profile-dialog .form-label { color:#555; }
#aoki-profile-dialog .form-label input,#aoki-profile-dialog textarea { background:#fafafa; color:#333; border:1px solid #ddd; border-radius:4px; }
#aoki-profile-dialog input:focus,#aoki-profile-dialog textarea:focus { border-color:#07b75c; outline:1px solid #07b75c; }
#aoki-profile-dialog input[type="checkbox"] { accent-color:#07b75c; }
#aoki-profile-dialog .policy-toggle { color:#444; }
#aoki-profile-dialog button { padding:7px 11px; border:1px solid #ddd; border-radius:4px; background:#f5f5f5; color:#333; cursor:pointer; }
#aoki-profile-dialog button:disabled { opacity:.5; cursor:default; }
#aoki-profile-dialog #aoki-avatar-save,#aoki-profile-dialog .primary { background:#07b75c; border-color:#07b75c; color:#fff; }
#aoki-profile-dialog .modal-head button { padding:3px 8px; border:0; background:transparent; color:#888; }
#aoki-profile-storage { padding:10px; border:1px solid #eee; border-radius:4px; background:#fafafa; color:#666; font-size:12px; }
.aoki-contact-row strong { display:block; font-size:14px; font-weight:500; overflow-wrap:anywhere; }
.aoki-contact-row small { display:block; font-size:12px; color:#999; margin-top:4px; overflow-wrap:anywhere; }
.aoki-contact-list-pane footer { display:flex; align-items:center; justify-content:space-between; gap:4px; padding:8px; font-size:11px; }
.aoki-contact-list-pane footer button { background:transparent; border:0; color:#555; padding:4px; font-size:11px; }
.aoki-address-book button:disabled { opacity:.45; cursor:default; }
.aoki-address-book button:focus-visible { outline:2px solid #07c160; outline-offset:2px; }
.aoki-contact-detail { min-width:0; padding:50px clamp(20px,4vw,68px); overflow:auto; }
#conversations .aoki-contact-profile { display:flex; justify-content:flex-start; align-items:center; gap:20px; padding-bottom:24px; border-bottom:1px solid #ddd; margin-bottom:20px; }
.aoki-contact-profile .aoki-contact-avatar { width:64px; height:64px; font-size:28px; }
#conversations .aoki-contact-detail h2 { margin:0; color:#222; font-size:20px; font-weight:500; overflow-wrap:anywhere; }
.aoki-contact-code { color:#888; font-size:13px; overflow-wrap:anywhere; }
.aoki-contact-detail label { display:flex; align-items:center; gap:20px; margin:20px 0; color:#888; font-size:13px; }
.aoki-contact-detail input,.aoki-contact-detail textarea { flex:1; min-width:0; max-width:360px; border:1px solid #ddd; border-radius:3px; background:#fff; padding:9px 10px; color:#222; font:inherit; }
.aoki-contact-detail textarea { width:100%; display:block; margin:20px 0; min-height:90px; resize:vertical; }
.aoki-contact-detail button { background:#fff; border:1px solid #ddd; border-radius:4px; padding:9px 16px; margin:10px 8px 0 0; font-size:13px; }
.aoki-contact-detail #aoki-contact-chat,.aoki-contact-detail #aoki-contact-request-send { background:#07c160; color:white; border-color:#07c160; }
.aoki-contact-actions { display:flex; flex-wrap:wrap; margin-top:20px; padding-top:14px; border-top:1px solid #ddd; }
.aoki-contact-empty { padding:50px 20px; text-align:center; color:#aaa; font-size:13px; }
.aoki-contact-warning { color:#a66c20; font-size:12px; line-height:1.6; }
.aoki-contact-feedback { grid-column:1 / 3; min-height:28px; background:#ededed; padding:6px 12px; display:flex; align-items:center; gap:12px; font-size:12px; color:#777; }
.aoki-contact-feedback button { padding:4px 8px; border:1px solid #bbb; border-radius:4px; background:#fff; }
.aoki-contact-confirm { width:min(390px,calc(100vw - 32px)); padding:24px; border:1px solid #ddd; border-radius:8px; }
.aoki-contact-confirm::backdrop { background:#0005; }
.aoki-contact-confirm p { line-height:1.7; }
.aoki-contact-confirm button { margin:8px 8px 0 0; padding:8px 22px; border:1px solid #ddd; border-radius:4px; background:#fff; }
.aoki-contact-confirm [data-aoki-contact-confirm] { background:#07c160; color:#fff; border-color:#07c160; }
.aoki-contact-back { display:none; }
@media(max-width:720px) {
  .aoki-address-book { grid-column:1; grid-row:1; grid-template-columns:1fr; min-height:0; }
  .aoki-contact-list-pane { border-right:0; }
  .aoki-contact-detail { display:none; grid-column:1; grid-row:1; padding:24px; }
  .aoki-address-book.show-detail .aoki-contact-list-pane { display:none; }
  .aoki-address-book.show-detail .aoki-contact-detail { display:block; }
  .aoki-contact-feedback { grid-column:1; }
  .aoki-contact-back { display:block; border:0 !important; background:transparent !important; padding:0 !important; margin:0 0 25px !important; color:#07a352; }
  .aoki-contact-detail label { flex-direction:column; align-items:stretch; gap:8px; }
  .aoki-contact-detail input { max-width:none; }
}

/* Bounded content panes retain the CRM shell and shared channel controls. */
#conversations[data-channel="crm_im"] { min-height:0; }
#conversations[data-channel="crm_im"] .contact-pane { display:none !important; }
#conversations[data-channel="crm_im"] .workbench-grid {
  min-height:0; overflow:hidden;
  grid-template-rows:minmax(0,1fr);
}
body[data-app-view="conversations"] #conversations[data-channel="crm_im"] .workbench-grid { min-height:0; }
#conversations[data-channel="crm_im"] .conversation-sidebar { grid-column:2; grid-row:1; display:flex; flex-direction:column; min-height:0; padding:0; background:#e9e9e9; border-color:#d6d6d6; overflow:hidden; }
#conversations[data-channel="crm_im"] .conversation-sidebar-head,
#conversations[data-channel="crm_im"] .resource-tabs,
#conversations[data-channel="crm_im"] .reply-batch-note,
#conversations[data-channel="crm_im"] #conversation-unread { display:none !important; }
#conversations[data-channel="crm_im"] .subhead { order:-1; flex:0 0 auto; display:flex; align-items:center; gap:8px; margin:0; padding:20px 12px 16px; }
#conversations[data-channel="crm_im"] #conversation-search { width:100%; min-width:0; padding:6px 9px; border:0; border-radius:4px; background:#dcdcdc; color:#333; font-size:12px; }
#conversations[data-channel="crm_im"] .conversation-list { flex:1 1 0; min-height:0; display:flex; flex-direction:column; gap:0; overflow-y:auto; overflow-x:hidden; }
#conversations[data-channel="crm_im"] .conversation-item { flex:0 0 auto; border:0; border-radius:0; padding:13px 14px; min-height:72px; }
#conversations[data-channel="crm_im"] .conversation-item:hover { background:#ddd; }
#conversations[data-channel="crm_im"] .conversation-avatar { width:40px; height:40px; }
#conversations[data-channel="crm_im"] .conversation-item strong { font-size:14px; font-weight:400; }
#conversations[data-channel="crm_im"] .conversation-item small { color:#999; font-size:12px; }
#conversations[data-channel="crm_im"] .session-kind,
#conversations[data-channel="crm_im"] .conversation-kind,
#conversations[data-channel="crm_im"] .conversation-platform,
#conversations[data-channel="crm_im"] .queue-handle { display:none; }
#conversations[data-channel="crm_im"] .list-pager { margin:0; padding:8px; min-height:32px; border-color:#ddd; }
#conversations[data-channel="crm_im"] .list-pager .task-action { padding:3px 6px; min-width:0; border:0; font-size:11px; }
#conversations[data-channel="crm_im"] .chat-pane { grid-column:3; grid-row:1; display:flex; flex-direction:column; height:100%; min-height:0; min-width:0; overflow:hidden; background:#f5f5f5; }
#conversations[data-channel="crm_im"] .chat-header { position:relative; flex:0 0 auto; min-height:64px; display:flex; align-items:center; justify-content:space-between; gap:12px; padding:12px 24px; margin:0; background:#f5f5f5; border-color:#ddd; z-index:40; }
#conversations[data-channel="crm_im"] .chat-header-main { min-width:0; gap:10px; }
#conversations[data-channel="crm_im"] .chat-header-main .conversation-avatar-wrap,
#conversations[data-channel="crm_im"] .chat-header-main > small { display:none; }
#conversations[data-channel="crm_im"] .aoki-chat-title { display:grid; gap:2px; min-width:0; }
#conversations[data-channel="crm_im"] .aoki-chat-title strong { font-size:18px; font-weight:400; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
#conversations[data-channel="crm_im"] .aoki-live-state { color:#999; font-size:11px; height:14px; line-height:14px; }
#conversations[data-channel="crm_im"] .chat-header-actions { display:flex; gap:14px; align-items:center; flex-shrink:0; }
#conversations[data-channel="crm_im"] .chat-header-actions > .icon-action { width:28px; height:28px; padding:4px; border:0; background:transparent; }
[data-aoki-search-toggle] svg { width:20px; height:20px; fill:none; stroke:currentColor; stroke-width:1.5; }
#conversations[data-channel="crm_im"] .chat-header-secondary { display:none; }
#conversations[data-channel="crm_im"] .chat-header.aoki-search-open .chat-header-secondary { display:block; position:absolute; top:100%; left:0; right:0; padding:10px 20px; background:#f5f5f5; border-bottom:1px solid #ddd; box-shadow:0 5px 10px #0001; }
#conversations[data-channel="crm_im"] .message-toolbar { margin:0; }
#conversations[data-channel="crm_im"] .message-list { flex:1 1 0; min-height:0; overflow:auto; padding:12px 24px 28px; background:#f5f5f5; overflow-anchor:none; }
#conversations[data-channel="crm_im"] #chat-new-messages { position:absolute; right:20px; bottom:calc(var(--aoki-compose-height,220px) + 12px); margin:0; padding:8px 12px; border:1px solid #ddd; border-radius:4px; background:#fff; color:#07a34a; box-shadow:0 2px 8px #0001; z-index:39; }
#conversations[data-channel="crm_im"] .message { flex:0 0 auto; gap:12px; max-width:min(80%,720px); }
#conversations[data-channel="crm_im"] .message-stack { position:relative; min-width:0; }
#conversations[data-channel="crm_im"] .message-bubble { position:relative; padding:9px 12px; font-size:14px; line-height:1.6; overflow-wrap:anywhere; }
#conversations[data-channel="crm_im"] .message-history-status { display:none; }
#conversations[data-channel="crm_im"] .message-receipt { display:none; }
#conversations[data-channel="crm_im"] .message-receipt[data-receipt-status="verification_required"],
#conversations[data-channel="crm_im"] .message-receipt[data-receipt-status="failed"] { display:block; color:#b66b22; font-size:11px; }
#conversations[data-channel="crm_im"] .chat-compose {
  position:relative; flex:0 0 auto; display:flex; flex-direction:column; gap:6px;
  min-height:0; height:clamp(166px,26dvh,220px); padding:10px 20px 14px;
  border-top:1px solid #ddd; background:#f5f5f5; overflow:visible; z-index:35;
}
#conversations[data-channel="crm_im"] .composer-tools { flex:0 0 auto; margin:0; min-height:28px; gap:8px; flex-wrap:nowrap; overflow-x:auto; }
#conversations[data-channel="crm_im"] .compose-tool { width:26px; height:26px; min-height:26px; padding:2px; border:0; background:transparent; color:#555; }
#conversations[data-channel="crm_im"] .compose-tool:hover { color:#07a34a; background:transparent; }
#conversations[data-channel="crm_im"] #chat-reply { display:none; }
#conversations[data-channel="crm_im"] #chat-message-type { display:block; flex:0 0 100px; width:100px; padding:5px 8px; border:1px solid #ddd; background:#fff; color:#555; font-size:12px; }
#conversations[data-channel="crm_im"] .composer-entry { flex:1 0 80px; min-height:80px; display:flex; flex-direction:column; align-items:stretch; gap:4px; }
#conversations[data-channel="crm_im"] #chat-message { flex:1 1 0; min-height:48px; max-height:none; width:100%; padding:8px 10px; border:1px solid #d5d5d5; border-radius:4px; box-shadow:none; resize:none; background:#fff; color:#191919; font-size:14px; line-height:1.6; overflow:auto; }
#conversations[data-channel="crm_im"] #chat-message:focus { border-color:#07a34a; outline:2px solid #07a34a33; outline-offset:0; }
#conversations[data-channel="crm_im"] #chat-compose .composer-send-controls > button.primary { flex:0 0 auto; align-self:flex-end; min-height:28px; width:64px; padding:4px 12px; border:0; border-radius:4px 0 0 4px; background:#e9e9e9; color:#07a34a; font-size:13px; font-weight:400; }
#conversations[data-channel="crm_im"] #chat-compose .composer-send-controls > button.primary:hover { background:#dedede; }
#conversations[data-channel="crm_im"] .composer-footer { display:none; }
#conversations[data-channel="crm_im"] #aoki-draft-status { position:absolute; bottom:17px; left:20px; right:110px; max-height:18px; overflow:hidden; font-size:11px; line-height:18px; color:#999; }
#conversations[data-channel="crm_im"] #aoki-draft-status[data-state="saved"] { visibility:hidden; }
#conversations[data-channel="crm_im"] #composer-status { position:absolute; bottom:17px; left:20px; right:110px; margin:0; max-height:18px; overflow:auto; background:#f5f5f5; font-size:11px; line-height:18px; }
#conversations[data-channel="crm_im"] #aoki-rich-fields,
#conversations[data-channel="crm_im"] #capture-panel { flex:1 1 0; min-height:0; overflow:auto; margin:0; }
#conversations[data-channel="crm_im"] .chat-compose:has(#aoki-rich-fields:not([hidden])),
#conversations[data-channel="crm_im"] .chat-compose:has(#capture-panel:not([hidden])) { height:45dvh; }
#conversations[data-channel="crm_im"] .chat-compose:has(#composer-pending:not([hidden])),
#conversations[data-channel="crm_im"] .chat-compose:has(#aoki-quote-pending:not([hidden])) { height:clamp(230px,50dvh,320px); }
#conversations[data-channel="crm_im"] .chat-compose:has(#aoki-rich-fields:not([hidden])) .composer-entry { flex:0 0 60px; }
#conversations[data-channel="crm_im"] #aoki-quote-pending,
#conversations[data-channel="crm_im"] .aoki-media-pending,
#conversations[data-channel="crm_im"] #composer-pending,
#conversations[data-channel="crm_im"] #aoki-draft-conflict { flex:0 1 auto; min-height:0; max-height:100px; overflow:auto; margin:0; }
#conversations[data-channel="crm_im"] .aoki-address-book { min-height:0; height:100%; }
#conversations[data-channel="crm_im"] .aoki-contact-rows { min-height:0; }
.aoki-chat-menu { position:relative; }
#conversations[data-channel="crm_im"] [data-compose-action="voice-input"] { display:none; }
.aoki-chat-menu summary { display:grid; place-items:center; list-style:none; cursor:pointer; border-radius:4px; width:30px; height:30px; color:#555; font-size:22px; }
.aoki-workspace-menu { position:absolute; top:calc(100% + 6px); right:0; z-index:100; width:210px; max-height:65dvh; overflow:auto; padding:6px; border:1px solid #ddd; border-radius:4px; background:#fff; color:#333; box-shadow:0 6px 22px #0002; font-size:13px; }
#conversations .aoki-workspace-menu button,#conversations .aoki-workspace-menu a { display:block !important; width:100%; min-height:32px; margin:0; padding:8px 12px; border:0; border-radius:2px; text-align:left; background:transparent; color:#333; font-size:13px; text-decoration:none; }
#conversations .aoki-workspace-menu button:hover,.aoki-workspace-menu a:hover { background:#f0f0f0; }
.aoki-workspace-menu strong { display:block; padding:8px 12px; font-size:14px; font-weight:500; }
#conversations[data-channel="crm_im"] .aoki-message-actions { position:absolute; top:0; right:-30px; margin:0; padding:0; z-index:2; }
#conversations[data-channel="crm_im"] .message.outbound .aoki-message-actions { right:auto; left:-30px; }
.aoki-message-actions summary { opacity:0; display:grid; place-items:center; width:26px; height:30px; list-style:none; cursor:pointer; color:#888; font-size:20px; }
.aoki-group-notice { grid-column:1 / -1; flex:0 0 100%; min-width:0; padding:6px 0 0; }
#conversations[data-channel="crm_im"] .chat-header { flex-wrap:wrap; }
#conversations[data-channel="crm_im"] [data-aoki-group-open] { flex:0 0 auto; white-space:nowrap; }
.aoki-group-notice[hidden] { display:none !important; }
#conversations .aoki-group-notice > button { display:flex; align-items:center; gap:10px; width:100%; min-width:0; margin:0; padding:7px 10px; border:0; border-radius:4px; background:#edf4ee; color:#426d4a; text-align:left; cursor:pointer; }
.aoki-group-notice strong { flex:0 0 auto; font-size:12px; font-weight:500; }
.aoki-group-notice span { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:12px; }
.aoki-group-notice[data-unread="true"] strong { color:#cf7a14; }
.aoki-group-notice-card { min-width:180px; max-width:340px; }
.aoki-group-notice-card > strong { display:block; padding-bottom:6px; font-size:14px; }
#conversations .aoki-group-notice-card > button { display:block; margin:8px 0 0; padding:6px 0; border:0; background:transparent; color:#258450; text-align:left; cursor:pointer; }
.message:hover .aoki-message-actions summary,.aoki-message-actions:focus-within summary,.aoki-message-actions[open] summary { opacity:1; }
.aoki-message-menu { position:fixed; width:180px; max-height:calc(100dvh - 8px); overflow-y:auto; border:1px solid #ddd; border-radius:4px; padding:4px; background:#fff; color:#333; box-shadow:0 4px 12px #0002; z-index:1200; }
#conversations .aoki-message-menu button:focus-visible { background:#edf4ee; outline:2px solid #07a34a; outline-offset:-2px; }
#conversations .aoki-message-menu button { display:block; width:100%; padding:7px 12px; margin:0; border:0; background:transparent; color:#333; text-align:left; font-size:13px; }
.aoki-action-receipt { display:block; padding:6px 12px; border-top:1px solid #eee; color:#999; font-size:10px; line-height:1.5; }
@media(max-width:720px) {
  #conversations[data-channel="crm_im"] .workbench-grid { grid-template-columns:1fr; grid-template-rows:minmax(0,1fr); }
  #conversations[data-channel="crm_im"] .conversation-sidebar,#conversations[data-channel="crm_im"] .chat-pane { grid-column:1; grid-row:1; }
  body:not(.app-chat) #conversations[data-channel="crm_im"] .chat-pane { display:none; }
  body.app-chat #conversations[data-channel="crm_im"] .conversation-sidebar { display:none; }
  #conversations[data-channel="crm_im"] .aoki-address-book { grid-column:1; grid-row:1; }
  #conversations[data-channel="crm_im"] .chat-header { min-height:56px; padding:8px 12px; }
  #conversations[data-channel="crm_im"] .chat-header-actions { gap:6px; }
  #conversations[data-channel="crm_im"] .chat-back { display:grid; }
  #conversations[data-channel="crm_im"] .message-list { padding:12px 16px 24px; }
  #conversations[data-channel="crm_im"] .chat-compose { height:170px; padding:8px 12px 12px; }
  #conversations[data-channel="crm_im"] .composer-tools { gap:6px; overflow:visible; }
  .aoki-message-actions summary { opacity:1; }
}
