.support-widget{font:14px/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI","Microsoft YaHei",sans-serif;color:#23364e;letter-spacing:normal}
.support-widget [hidden]{display:none!important}.support-widget button,.support-widget textarea{font:inherit}.support-widget button{cursor:pointer}.support-widget button:disabled{cursor:wait;opacity:.6}.support-widget button:focus-visible,.support-widget a:focus-visible,.support-widget textarea:focus-visible{outline:3px solid #72b6ff;outline-offset:3px}
.sw-launcher{position:fixed;right:28px;bottom:28px;z-index:800;display:flex;align-items:center;gap:9px;border:1px solid #467eec;border-radius:30px;padding:14px 20px;background:#2463d9;color:white;box-shadow:0 8px 28px #1b468b40;font-weight:600;transition:background .15s}.sw-launcher:hover{background:#194fb8}.sw-launcher svg{width:25px;height:25px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}.sw-badge{position:absolute;top:-5px;right:-3px;min-width:21px;height:21px;display:grid;place-items:center;padding:0 5px;border:2px solid white;border-radius:20px;background:#e64456;color:white;font-size:10px;line-height:1}
.sw-window{position:fixed;right:28px;bottom:104px;z-index:801;width:390px;height:min(620px,calc(100dvh - 135px));display:flex;flex-direction:column;overflow:hidden;background:white;border:1px solid #dae3ef;border-radius:18px;box-shadow:0 18px 70px #152d5338;text-align:left}.sw-header{display:flex;align-items:center;gap:12px;padding:18px 18px 17px;background:#142d51;color:white;flex-shrink:0}.sw-heading{flex:1;min-width:0}.sw-heading strong{display:block;font-size:16px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.sw-heading small{display:block;font-size:11px;color:#b7c9e2;margin-top:3px}.sw-icon{background:transparent;border:1px solid #ffffff36;border-radius:9px;color:white;width:32px;height:32px;padding:0;font-size:25px!important;line-height:1}.sw-icon:hover{background:#ffffff1c}
.sw-layout{display:flex;flex:1;min-height:0}.sw-conversations,.sw-conversation{flex:1;min-width:0;display:flex;flex-direction:column;min-height:0}.sw-list-heading{padding:14px 18px;border-bottom:1px solid #edf1f6;display:flex;justify-content:space-between;font-size:12px}.sw-list-heading span{color:#8a96a8}.sw-thread-list{overflow-y:auto;flex:1;overscroll-behavior:contain}.sw-thread{width:100%;display:flex;align-items:center;gap:11px;background:white;border:0;border-bottom:1px solid #edf1f6;padding:17px 15px;text-align:left;color:inherit}.sw-thread:hover,.sw-thread:focus-visible{background:#f1f6ff}.sw-avatar{width:38px;height:38px;border-radius:12px;display:grid;place-items:center;flex-shrink:0;color:#3462a1;background:#e9f0fc;font-weight:700}.sw-thread-text{min-width:0;flex:1}.sw-thread-text strong,.sw-thread-text small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.sw-thread-text strong{font-size:13px}.sw-thread-text small{font-size:11px;color:#8290a3;margin-top:5px}.sw-thread-meta{font-size:10px;color:#93a0b1;display:flex;flex-direction:column;align-items:flex-end;gap:5px}.sw-unread{display:inline-block;border-radius:12px;min-width:19px;line-height:19px;text-align:center;background:#e64456;color:white;font-size:10px;padding:0 5px}
.sw-messages{background:#f5f7fb;flex:1;overflow-y:auto;overscroll-behavior:contain;min-height:0;padding:20px 16px;scrollbar-width:thin;scrollbar-color:#c2cddd transparent}.sw-message{margin:0 25px 18px 0}.sw-message-heading{display:flex;align-items:center;gap:8px;margin:0 0 6px;font-size:10px;color:#8390a4}.sw-message-heading strong{font-size:11px;font-weight:500;color:#6a7a92}.sw-message p{margin:0;padding:11px 13px;background:white;border:1px solid #e1e7f0;border-radius:3px 13px 13px;white-space:pre-wrap;overflow-wrap:anywhere;font-size:13px;line-height:1.7;color:#2a3d58}.sw-message.sw-own{margin:0 0 18px 25px}.sw-own .sw-message-heading{justify-content:flex-end}.sw-own p{background:#e8f0ff;border-color:#cfdffd;border-radius:13px 3px 13px 13px;color:#204b8b}.sw-compose{padding:12px 14px;background:white;border-top:1px solid #e6ecf4}.sw-compose textarea{display:block;width:100%;min-height:65px;resize:none;border:0;border-radius:5px;background:white;padding:5px 2px;box-shadow:none;color:#263b58;font-size:13px;line-height:1.7}.sw-compose textarea::placeholder{color:#9aa6b5;font-size:11px}.sw-compose>div{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-top:7px}.sw-compose small{font-size:10px;color:#9aa5b4}.sw-primary{display:inline-flex;align-items:center;justify-content:center;border:1px solid #2463d9;background:#2463d9;color:white!important;border-radius:8px;padding:8px 22px;text-decoration:none;font-size:12px!important;font-weight:600}.sw-primary:hover{background:#194fb8}.sw-status{background:white;margin:0;padding:8px 14px;font-size:10px;color:#8b98aa;border-top:1px solid #edf1f6;flex-shrink:0;overflow-wrap:anywhere}.sw-empty{padding:25px 14px;text-align:center;font-size:12px;color:#8b98aa}.sw-load{border:0;border-bottom:1px solid #e8edf5;background:#f9fbff;color:#5476a4;padding:10px;font-size:11px!important}.sw-guest{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:18px;flex:1;padding:28px}.sw-guest h2{font-size:19px;margin:0}.sw-guest p{color:#7b8aa0;font-size:13px;text-align:center;margin:0}.sw-guest>a:last-child{font-size:12px;color:#58729b}.sw-welcome-icon{display:grid;place-items:center;font-size:30px;width:66px;height:66px;background:#edf3ff;border-radius:22px;color:#2463d9}.sw-visually-hidden{position:absolute!important;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.sw-desk .sw-window{position:relative;right:auto;bottom:auto;width:100%;height:min(720px,75dvh);min-height:420px;border-radius:12px;box-shadow:0 8px 30px #172c4910}.sw-desk .sw-launcher{position:static;margin:16px 0}.sw-desk:has(.sw-window:not([hidden])) .sw-launcher{display:none}.sw-desk .sw-message{max-width:75%}.sw-desk .sw-own{margin-left:auto}.sw-desk .sw-messages{padding:24px 28px}.sw-desk .sw-compose{padding:16px 26px}
.sw-thread[aria-pressed=true]{background:#edf3ff;box-shadow:inset 3px 0 #3276df}
@media(min-width:1000px){.sw-desk[data-role=admin] .sw-conversations{width:290px;flex:none;border-right:1px solid #e2e8f1}.sw-desk[data-role=admin] .sw-thread-meta time{max-width:65px;text-align:right}.sw-desk[data-role=admin] .sw-conversations .sw-thread{padding:16px 12px;gap:9px}.sw-desk[data-role=admin] .sw-avatar{width:32px;height:32px}}
@media(max-width:520px){.sw-launcher{right:16px;bottom:18px;padding:13px;gap:0}.sw-launch-label{display:none}.sw-window{right:12px;bottom:84px;width:calc(100% - 24px);height:min(600px,calc(100dvh - 100px));border-radius:15px}.sw-header{padding:14px}.sw-message{margin-right:15px}.sw-message.sw-own{margin-left:15px}.sw-desk .sw-window{height:70dvh;min-height:370px}.sw-desk .sw-messages{padding:16px 12px}.sw-desk .sw-compose{padding:12px}.sw-desk .sw-message{max-width:95%}}

/* Compact edge docking keeps customer actions unobstructed. */
.sw-launcher{right:0;bottom:24px;width:40px;height:46px;padding:9px;border-radius:14px 0 0 14px;transform:translateX(7px);transition:transform .2s,background .2s;gap:0}.sw-launch-label{display:none}.sw-launcher:hover,.sw-launcher:focus-visible{transform:translateX(0)}.sw-launcher svg{width:24px;height:24px}.sw-badge{right:1px;top:-7px}
.sw-window{right:14px;bottom:82px;width:min(410px,calc(100vw - 28px));height:min(650px,calc(100dvh - 106px))}.sw-icon{display:inline-flex;align-items:center;justify-content:center;flex:none;min-width:32px;min-height:32px;box-sizing:border-box;text-decoration:none}.sw-icon svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}.sw-header{padding:13px 15px}.sw-desk .sw-header{padding:15px 20px}.sw-contact{font-size:10px;color:#8290a5;margin-top:8px}.sw-contact input{font-size:12px;padding:7px;margin-top:3px}
.sw-notify .sw-launcher{animation:chat-nudge .65s ease 3}.support-widget[data-role=guest] .sw-launcher,.support-widget[data-role=customer] .sw-launcher{animation:chat-idle 14s ease-in-out 2}.sw-notify[data-role] .sw-launcher{animation:chat-nudge .65s ease 3}
@keyframes chat-nudge{50%{transform:translate(0,-6px)}}@keyframes chat-idle{0%,90%,100%{transform:translateX(7px)}94%{transform:translate(0,-4px)}97%{transform:translateX(0)}}
@media(prefers-reduced-motion:reduce){.support-widget .sw-launcher{animation:none!important;transition:none!important}}
@media(max-width:520px){.sw-window{right:8px;bottom:78px;width:calc(100vw - 16px)}.sw-launcher{right:0;bottom:22px;padding:9px}}

/* Session state is separate from the transcript and never covers messages. */
.sw-session-bar{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:8px 14px;border-bottom:1px solid #e8edf5;font-size:10px;color:#6d7f96;flex-shrink:0}
.sw-session-bar button,.sw-end-confirm button{border:1px solid #d6dfeb;background:#fff;border-radius:6px;padding:4px 8px;white-space:nowrap;color:#4b6384;font-size:10px}
.sw-end-confirm{display:flex;gap:8px;align-items:center;padding:10px 14px;background:#f5f8fd;font-size:11px;flex-wrap:wrap}.sw-end-confirm span{flex:1}
.sw-lifecycle{padding:9px 14px;background:#edf3fa;color:#526b8b;font-size:11px;border-bottom:1px solid #e2e9f2;flex-shrink:0}.sw-lifecycle.sw-warning{background:#fff7e7;color:#986819;border-color:#f1dfb9}
.sw-filter{display:flex;align-items:center;gap:8px;padding:8px 14px;font-size:11px;color:#728199;border-bottom:1px solid #edf1f6;flex-shrink:0}
.sw-filter select{min-width:0;width:auto;flex:1;padding:5px 8px;font-size:11px;border:1px solid #dce4ef;border-radius:6px;background-color:#fff;color:#405775}
.sw-thread-state{font-size:10px;color:#8a98ab;display:block;margin-top:2px}
.sw-presence:before{content:"";display:inline-block;width:5px;height:5px;border-radius:50%;background:#a4afbd;margin:0 4px 1px 0}
.sw-presence-online{color:#258967}.sw-presence-online:before{background:#2ea77b}.sw-presence-away{color:#a17a32}.sw-presence-away:before{background:#d2a34f}
.sw-thread-text small{margin-top:3px}.sw-heading small{overflow-wrap:anywhere}
@media(max-width:520px){.sw-session-bar{padding:6px 10px}.sw-lifecycle{padding:7px 10px}.sw-thread{padding:13px 12px}}

/* Dense conversation list and a larger transcript. */
.sw-window{width:min(470px,calc(100vw - 28px));height:min(760px,calc(100dvh - 100px))}
.sw-thread,.sw-desk[data-role=admin] .sw-conversations .sw-thread{padding:10px 12px;gap:8px}
.sw-avatar,.sw-desk[data-role=admin] .sw-avatar{width:30px;height:30px;border-radius:9px}
.sw-thread-text strong{font-size:12px}.sw-thread-state{display:inline;font-size:9px;margin-left:7px}
.sw-thread-text strong{display:inline}.sw-thread-text small{margin-top:2px}
.sw-thread-meta{gap:3px}.sw-list-heading{padding:9px 12px}.sw-filter{padding:6px 12px}
.sw-desk .sw-header{padding:10px 16px}.sw-desk .sw-messages{padding:18px}
.sw-desk .sw-compose{padding:8px 18px}.sw-compose textarea{min-height:48px}
.sw-compose>div{margin-top:4px}.sw-upload{display:flex;flex-wrap:wrap;align-items:center;gap:5px;font-size:10px;color:#6b829c}
.sw-upload input[type=file]{max-width:200px;font-size:10px;padding:3px;border:0}
.sw-upload small{font-size:9px}.sw-upload input::file-selector-button{border:1px solid #d6e1ed;background:#f6f9fd;border-radius:4px;padding:3px 6px;color:#486886;cursor:pointer}
.sw-message .support-attachment{max-width:min(260px,100%)}.sw-message .support-attachment img{max-height:200px}
@media(max-width:520px){.sw-window{width:calc(100vw - 16px)}.sw-desk .sw-compose{padding:8px 12px}.sw-upload input[type=file]{max-width:180px}.sw-desk .sw-messages{padding:12px}}

.sw-compose textarea{height:54px}

.sw-pagination{display:flex;align-items:center;justify-content:center;gap:5px;padding:8px 4px;border-top:1px solid #e3eaf3;flex-shrink:0;font-size:10px}.sw-pagination button{border:1px solid #d8e2ee;background:#fff;padding:3px 5px;border-radius:4px;color:#4c6a90;font-size:10px}

/* A compact tool row keeps the message editor usable with attachments. */
.sw-compose{flex-shrink:0;padding:9px 14px}
.sw-compose textarea{height:72px;min-height:72px;max-height:150px;padding:4px;line-height:1.6}
.sw-compose>.sw-compose-tools{display:flex;align-items:center;gap:8px;margin-top:4px}
.sw-compose-tools small{flex:1;min-width:0;font-size:10px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.sw-attach{display:inline-flex;align-items:center;justify-content:center;flex:none;width:30px;height:30px;padding:5px;border:1px solid #e1e7ef;border-radius:7px;background:#f6f8fb;color:#607590}
.sw-attach:hover{background:#eaf0f8}
.sw-attach svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round}
.sw-compose-tools .sw-primary{padding:6px 18px;min-height:32px;flex:none}
.sw-compose>.sw-pending-files{display:flex;align-items:center;justify-content:flex-start;gap:5px;flex-wrap:wrap;max-height:66px;overflow:auto;margin:2px 0 5px}
.sw-file-chip{display:inline-flex;align-items:center;gap:6px;max-width:min(220px,100%);padding:3px 6px 3px 9px;border:1px solid #dce5ef;border-radius:6px;background:#f3f6fb;font-size:10px}
.sw-file-chip>span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}
.sw-file-chip button{display:grid;place-items:center;flex:none;width:20px;height:20px;border:0;border-radius:4px;background:transparent;color:#6c7e94;font-size:17px;line-height:1;padding:0}
.sw-file-chip button:hover{background:#e1e9f4;color:#243d60}
.sw-desk .sw-compose textarea{height:80px}
.sw-desk .sw-window{height:calc(100dvh - var(--sw-top,150px) - 24px);min-height:420px}
.sw-desk .sw-compose{padding:10px 18px}
.sw-filter select{min-height:30px;line-height:18px;padding:5px 28px 5px 8px;background-color:#fff;background-position:right 8px center;background-size:12px}
.sw-window .sw-status{padding:5px 14px;line-height:1.5}
.sw-header .sw-heading{align-self:center}
@media(max-width:520px){.sw-compose textarea{height:64px;min-height:64px}.sw-desk .sw-compose{padding:8px 12px}.sw-desk .sw-window{min-height:360px}.sw-file-chip{max-width:180px}}

/* One floating surface, animated without remounting the conversation or draft. */
.support-widget:not(.sw-desk) .sw-window{transform-origin:bottom right;opacity:0;transform:translate(12px,18px) scale(.94);transition:opacity .18s ease,transform .18s ease,width .22s ease,height .22s ease,bottom .22s ease,right .22s ease;border-radius:16px}
.support-widget.sw-open:not(.sw-desk) .sw-window{opacity:1;transform:translate(0,0) scale(1)}
.support-widget.sw-closing .sw-window{pointer-events:none}
.support-widget.sw-fullscreen:not(.sw-desk) .sw-window{right:16px;bottom:16px;width:calc(100vw - 32px);height:calc(100dvh - 32px);max-width:none;z-index:115}
.support-widget.sw-fullscreen .sw-launcher{visibility:hidden}
.support-widget.sw-fullscreen .sw-messages{padding:20px max(16px,calc((100% - 1000px)/2))}
.support-widget.sw-fullscreen .sw-compose{padding-inline:max(16px,calc((100% - 1000px)/2))}
@media(min-width:1000px){.support-widget.sw-fullscreen[data-role=admin] .sw-conversations{width:290px;flex:none;border-right:1px solid #e2e8f1}}
@media(max-width:520px){.support-widget.sw-fullscreen:not(.sw-desk) .sw-window{right:0;bottom:0;width:100vw;height:100dvh;border-radius:0}}
@media(prefers-reduced-motion:reduce){.support-widget .sw-window{transition:none!important;transform:none!important}}

/* Staff can scan and reply side by side without covering the whole desktop. */
.sw-thread-heading{display:flex;align-items:center;gap:5px;min-width:0}
.sw-thread-heading strong{display:block;flex:1;min-width:0}
.sw-thread-heading .sw-thread-state{flex:none;max-width:85px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin-left:0}
@media(min-width:1000px){
  .support-widget[data-role=admin]:not(.sw-desk) .sw-window{width:min(790px,calc(100vw - 40px));height:min(660px,calc(100dvh - 100px))}
  .support-widget[data-role=admin] .sw-conversations{width:245px;flex:none;border-right:1px solid #e2e8f1}
  .support-widget[data-role=admin] .sw-thread{padding:9px 10px;gap:7px}
  .support-widget[data-role=admin] .sw-thread-meta{max-width:48px;flex:none}
  .support-widget[data-role=admin] .sw-thread-meta time{font-size:9px;text-align:right}
  .support-widget[data-role=admin] .sw-thread-heading .sw-thread-state{max-width:65px;font-size:9px}
  .support-widget[data-role=admin] .sw-avatar{width:28px;height:28px}
  .support-widget[data-role=admin].sw-fullscreen:not(.sw-desk) .sw-window{width:calc(100vw - 32px);height:calc(100dvh - 32px)}
  .support-widget[data-role=admin].sw-fullscreen .sw-messages{padding:18px}
  .support-widget[data-role=admin].sw-fullscreen .sw-compose{padding-inline:18px}
}
