/* Purple CRM chat launcher: real authenticated Inbox inside a compact drawer. */
#crm-widget-chat-root{position:fixed;right:18px;bottom:16px;z-index:2100;color:#f4edff;font:13px/1.38 system-ui,-apple-system,Segoe UI,sans-serif}
#crm-widget-chat-root *{box-sizing:border-box}
#crm-widget-chat-root [hidden]{display:none!important}
#crm-widget-chat-root .crm-chat-trigger{
 position:absolute;right:0;bottom:0;width:54px;height:54px;min-height:54px;
 border-radius:50%;border:1px solid #b691f5!important;background:linear-gradient(135deg,#7842d5,#36226b)!important;
 box-shadow:0 7px 25px #160c3bb3;color:#fff!important;font-size:21px!important;cursor:pointer
}
#crm-widget-chat-root .crm-chat-trigger:hover{transform:translateY(-2px)}
#crm-widget-chat-root .crm-chat-badge{
 position:absolute;right:-4px;top:-5px;min-width:20px;height:20px;padding:2px 4px;
 border-radius:999px;background:#d44b70;color:#fff;font-size:11px;font-weight:800
}
#crm-widget-chat-root .crm-chat-drawer{
 position:absolute;right:0;bottom:65px;
 width:min(580px,calc(100vw - 22px));height:min(680px,calc(100dvh - 100px));
 border:1px solid #7156a8;border-radius:15px;background:#11162b;
 box-shadow:0 18px 70px #05020fdd;overflow:hidden;
 display:flex;flex-direction:column;animation:crm-chat-enter .16s ease-out
}
#crm-widget-chat-root .crm-chat-header{
 display:flex;align-items:center;gap:10px;min-height:44px;padding:7px 11px;
 border-bottom:1px solid #51416e;background:linear-gradient(120deg,#211a43,#1b2240);color:#fff
}
#crm-widget-chat-root .crm-chat-header strong{font-size:13px}
#crm-widget-chat-root .crm-chat-inbox-link{
 margin-left:auto;color:#dbcaff!important;font-size:11px;font-weight:750;text-decoration:none
}
#crm-widget-chat-root .crm-chat-close{
 width:28px;min-height:28px;border:1px solid #685586;background:#34254e;color:#fff;
 border-radius:6px;font-size:19px
}
#crm-widget-chat-root .crm-chat-layout{
 flex:1;min-height:0;display:grid;grid-template-columns:minmax(135px,35%) minmax(0,1fr)
}
#crm-widget-chat-root .crm-chat-threads{
 padding:5px;display:flex;flex-direction:column;gap:3px;overflow-y:auto;
 border-right:1px solid #423a59;background:#151830
}
#crm-widget-chat-root .crm-chat-thread-link{
 position:relative;display:flex;flex-direction:column;align-items:stretch;
 width:100%;text-align:left;min-height:40px;margin:0;padding:6px 7px;
 border:1px solid transparent!important;border-radius:7px;
 color:#eae1fc!important;background:transparent!important;
 font-size:11px;font-weight:750;cursor:pointer;overflow-wrap:anywhere
}
#crm-widget-chat-root .crm-chat-thread-link[aria-pressed=true]{
 border-color:#8363c4!important;background:#352651!important
}
#crm-widget-chat-root .crm-chat-thread-link small{
 display:block;color:#afadd0;font-size:10px;font-weight:400;
 white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%
}
#crm-widget-chat-root .crm-chat-test{border-color:#58436d!important}
#crm-widget-chat-root .crm-chat-thread-count{
 position:absolute;top:6px;right:6px;padding:2px 5px;border-radius:12px;
 color:white;background:#9553ce;font-size:10px
}
#crm-widget-chat-root .crm-chat-thread{
 display:flex;flex-direction:column;min-width:0;min-height:0;background:#0d1428
}
#crm-widget-chat-root .crm-chat-thread-head{
 flex:0 0 auto;padding:8px 10px;border-bottom:1px solid #40345c;font-size:12px;font-weight:700
}
#crm-widget-chat-root .crm-chat-log{
 min-height:0;flex:1;overflow-y:auto;overscroll-behavior:contain;
 display:flex;flex-direction:column;align-items:flex-start;gap:7px;padding:9px
}
#crm-widget-chat-root .crm-chat-bubble{
 max-width:93%;padding:7px 9px;border:1px solid #403a65;border-radius:10px 10px 10px 3px;
 background:#222943;color:#f1ecff;white-space:pre-wrap;overflow-wrap:anywhere
}
#crm-widget-chat-root .crm-chat-bubble.is-mine{
 margin-left:auto;border-color:#714ec2;border-radius:10px 10px 3px 10px;background:#4b337a
}
#crm-widget-chat-root .crm-chat-meta{display:block;margin-top:4px;color:#c7bfda;font-size:9px}
#crm-widget-chat-root .crm-chat-compose{
 padding:7px 8px;flex:0 0 auto;border-top:1px solid #45375d
}
#crm-widget-chat-root .crm-chat-draft{
 display:block;width:100%;height:55px;min-height:42px;max-height:115px;
 padding:7px 8px;resize:vertical;border:1px solid #57477c;border-radius:7px;
 background:#1d243e;color:#fff;font:12px/1.3 inherit
}
#crm-widget-chat-root .crm-chat-compose-actions{
 display:flex;justify-content:flex-end;align-items:center;gap:5px;margin-top:5px
}
#crm-widget-chat-root .crm-chat-demo-author{
 margin-right:auto;min-height:28px;padding:3px 6px;border-radius:6px;
 background:#31264b;color:#fff;border:1px solid #68578d;font-size:11px
}
#crm-widget-chat-root .crm-chat-send{
 min-height:29px;padding:4px 13px;border-radius:6px;border:1px solid #b48cf8!important;
 background:#7944d5!important;color:#fff!important;font-size:11px;font-weight:800
}
#crm-widget-chat-root .crm-chat-send:disabled{opacity:.5}
#crm-widget-chat-root .crm-chat-status{min-height:15px;margin:0;padding:3px 8px;font-size:10px;color:#beb5da}
#crm-widget-chat-root .crm-chat-status[data-status=error]{color:#ffa3af}
#crm-widget-chat-root .crm-chat-status[data-status=success]{color:#8ce2c2}
#crm-widget-chat-root .crm-chat-status[data-status=demo]{color:#e5cf9d}
#crm-widget-chat-root button:focus-visible,#crm-widget-chat-root a:focus-visible,
#crm-widget-chat-root textarea:focus-visible,#crm-widget-chat-root select:focus-visible{
 outline:3px solid #f8d278;outline-offset:2px
}
@keyframes crm-chat-enter{from{opacity:0;transform:translateY(8px) scale(.99)}to{opacity:1;transform:none}}
@media(max-width:600px){
 #crm-widget-chat-root{right:9px;bottom:9px}
 #crm-widget-chat-root .crm-chat-drawer{height:min(620px,calc(100dvh - 90px))}
 #crm-widget-chat-root .crm-chat-layout{grid-template-columns:minmax(100px,34%) minmax(0,1fr)}
 #crm-widget-chat-root .crm-chat-trigger{width:48px;height:48px;min-height:48px}
}
@media(prefers-reduced-motion:reduce){
 #crm-widget-chat-root .crm-chat-drawer{animation:none}
 #crm-widget-chat-root .crm-chat-trigger{transition:none}
}

/* Keep the chat launcher above the optional full-screen CRM workspace and avoid overlapping modal content. */
#crm-widget-chat-root .crm-chat-trigger{isolation:isolate}
@media(max-width:600px){#crm-widget-chat-root{right:10px;bottom:10px}#crm-widget-chat-root .crm-chat-trigger{width:49px;height:49px;min-height:49px}}

/* Shared on every authenticated CRM screen, not only the dashboard. */
#crm-widget-chat-root .crm-chat-workspace{min-width:0;max-width:110px;text-transform:capitalize;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#c9b8ec;font-size:11px}
#crm-widget-chat-root .crm-chat-search{display:block;width:100%;flex:none;margin:2px 0 7px;padding:7px 8px;border:1px solid #6b588e;border-radius:7px;background:#24223c;color:#fff;font-size:12px}
#crm-widget-chat-root .crm-chat-thread-list{min-height:0;flex:1;overflow:auto;overscroll-behavior:contain}
#crm-widget-chat-root .crm-chat-section-label{margin:9px 4px 5px;padding:6px 4px 2px;border-top:1px solid #483d65;color:#d1b5ff;font-size:10px;letter-spacing:.02em;font-weight:750}
#crm-widget-chat-root .crm-chat-empty{padding:10px;color:#b6afcc;font-size:12px}
#crm-widget-chat-root .crm-chat-test{border-left:2px solid #b893e4!important}
#crm-widget-chat-root .crm-chat-header strong{white-space:nowrap}
@media(max-width:600px){
 #crm-widget-chat-root .crm-chat-header{gap:6px}
 #crm-widget-chat-root .crm-chat-workspace{max-width:72px}
 #crm-widget-chat-root .crm-chat-inbox-link{font-size:10px}
 #crm-widget-chat-root .crm-chat-draft{font-size:12px}
}

#crm-widget-chat-root .crm-chat-quo-sync{
 min-height:28px;padding:4px 7px;border:1px solid #9b78c3;border-radius:6px;
 background:#3b2a62;color:#eee4ff;font-size:10px;font-weight:700;cursor:pointer;
 white-space:nowrap
}
#crm-widget-chat-root .crm-chat-quo-sync:disabled{opacity:.55;cursor:progress}
#crm-widget-chat-root .crm-chat-quo{border-left:2px solid #5fcee6!important}
@media(max-width:600px){
 #crm-widget-chat-root .crm-chat-workspace{display:none}
 #crm-widget-chat-root .crm-chat-quo-sync{font-size:9px;padding:3px 5px}
}

#crm-widget-chat-root .crm-chat-transfer{display:flex;gap:10px;padding:4px 4px 8px;flex-wrap:wrap;border-bottom:1px solid #40395e}
#crm-widget-chat-root .crm-chat-transfer a{font-size:10px;color:#dbccff;text-decoration:underline;text-underline-offset:3px}

/* CRM messenger refinement: compact list controls and a true wide review mode. */
#crm-widget-chat-root .crm-chat-filters{
 display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:3px;
 margin:0 0 5px
}
#crm-widget-chat-root .crm-chat-filter{
 min-width:0;min-height:32px;padding:4px 5px;border:1px solid #50456f!important;
 border-radius:6px;background:#211e39!important;color:#d8cce9!important;
 font-size:10px;font-weight:700;white-space:nowrap;cursor:pointer
}
#crm-widget-chat-root .crm-chat-filter[aria-pressed=true]{
 background:#563795!important;border-color:#9b7add!important;color:#fff!important
}
#crm-widget-chat-root .crm-chat-filter[hidden]{display:none!important}
#crm-widget-chat-root .crm-chat-threads{gap:2px;padding:7px}
#crm-widget-chat-root .crm-chat-thread-link{
 min-height:48px;padding:8px;border-bottom:1px solid #39334f!important;
 border-radius:6px
}
#crm-widget-chat-root .crm-chat-thread-link:hover{background:#262441!important}
#crm-widget-chat-root .crm-chat-thread-link[aria-pressed=true]{
 background:#392b5b!important;border-color:#8464c0!important
}
#crm-widget-chat-root .crm-chat-thread-head{min-height:36px;padding:9px 11px}
#crm-widget-chat-root .crm-chat-log{gap:7px;padding:10px}
#crm-widget-chat-root .crm-chat-day-heading{
 align-self:center;position:sticky;top:0;z-index:1;padding:3px 9px;margin:3px 0;
 border:1px solid #534871;border-radius:999px;background:#181a31ed;
 color:#d6cbe7;font-size:10px;font-weight:700
}
#crm-widget-chat-root .crm-chat-bubble{max-width:min(85%,480px);line-height:1.48}
#crm-widget-chat-root .crm-chat-expand{
 display:grid;place-items:center;flex:0 0 30px;width:30px;height:30px;
 padding:0;border:1px solid #69578b;border-radius:6px;background:#34254e;
 color:#f7ecff;font-size:18px;cursor:pointer
}
#crm-widget-chat-root .crm-chat-draft{max-height:160px;min-height:57px;line-height:1.4}
#crm-widget-chat-root[data-expanded=true] .crm-chat-drawer{
 width:min(940px,calc(100vw - 24px));height:min(820px,calc(100dvh - 84px))
}
#crm-widget-chat-root[data-expanded=true] .crm-chat-layout{grid-template-columns:minmax(230px,30%) minmax(0,1fr)}
#crm-widget-chat-root .crm-chat-expand[aria-pressed=true]{
 background:#6845b1;border-color:#ab86f0
}
#crm-widget-chat-root .crm-chat-compose-actions::before{
 content:'Ctrl/⌘ + Enter to send';margin-right:auto;color:#aea4cd;font-size:10px
}
#crm-widget-chat-root .crm-chat-compose-actions:has(.crm-chat-demo-author:not([hidden]))::before{
 content:'Local example only'
}
@media(max-width:600px){
 #crm-widget-chat-root .crm-chat-drawer{width:calc(100vw - 18px);height:calc(100dvh - 92px)}
 #crm-widget-chat-root[data-expanded=true] .crm-chat-drawer{
  width:calc(100vw - 18px);height:calc(100dvh - 92px)
 }
 #crm-widget-chat-root[data-expanded=true] .crm-chat-layout{grid-template-columns:minmax(115px,37%) minmax(0,1fr)}
 #crm-widget-chat-root .crm-chat-filter{font-size:9px;padding:4px 2px}
 #crm-widget-chat-root .crm-chat-threads{padding:4px}
 #crm-widget-chat-root .crm-chat-bubble{max-width:96%}
 #crm-widget-chat-root .crm-chat-compose-actions::before{content:'Ctrl+Enter';font-size:9px}
}
