#cargo-chat-launch{position:fixed;right:20px;bottom:20px;z-index:80;box-shadow:0 4px 22px #34114e55;min-height:48px}#cargo-chat-badge,.chat-unread{background:#b91865;color:#fff;border-radius:20px;padding:3px 8px;margin-left:6px}
#cargo-chat{position:fixed;right:20px;bottom:80px;width:min(900px,calc(100vw - 40px));height:min(680px,calc(100dvh - 110px));z-index:90;background:white;border:1px solid var(--line,#ddd);border-radius:16px;box-shadow:0 10px 45px #34114e44;display:flex;flex-direction:column;overflow:hidden}
.chat-header{display:flex;align-items:center;gap:10px;padding:12px;background:#4b206e;color:white;flex-wrap:wrap}.chat-header strong{flex:1}.chat-header button{background:#ffffff22;border:1px solid #ffffff77;padding:8px 12px}
.chat-layout{display:grid;grid-template-columns:260px minmax(0,1fr);flex:1;min-height:0}.chat-list{overflow:auto;border-right:1px solid #ddd;padding:8px}.chat-list button{display:block;width:100%;text-align:left;background:#f3edf7;color:#34114e;margin:0 0 8px;padding:10px;white-space:normal;overflow-wrap:anywhere}.chat-list button[aria-current=true]{outline:2px solid #77518e;outline-offset:-2px}.chat-list small{display:block;margin-top:4px;color:#725d80}.chat-detail{display:flex;flex-direction:column;min-width:0;min-height:0}.chat-detail h3{font-size:16px;margin:0;padding:10px 12px;border-bottom:1px solid #eee}.chat-messages{flex:1;overflow:auto;padding:12px;min-height:100px;overscroll-behavior:contain}.chat-bubble{background:#f1ebf6;border-radius:12px;padding:10px;margin:0 15% 10px 0;white-space:pre-wrap;overflow-wrap:anywhere}.chat-bubble.mine{background:#ead7f3;margin:0 0 10px 15%}.chat-bubble small{display:block;color:#725d80;font-size:11px;margin-top:6px}.chat-bubble .chat-ref{font-weight:bold;font-size:12px}
#cargo-chat-form{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;margin:0;padding:10px;border-top:1px solid #ddd}#cargo-chat-form input{grid-column:1/-1;width:100%;min-width:0;min-height:44px}#cargo-chat-form textarea{font:inherit;min-height:68px;height:68px;resize:vertical;min-width:0}#cargo-chat-form button{align-self:end;min-height:44px}.chat-note,.chat-status{font-size:12px;padding:6px 12px;margin:0;overflow-wrap:anywhere}.chat-note{background:#fff7df;color:#6f5420}.chat-status{color:#9f4315}.chat-toast{position:fixed;right:20px;bottom:82px;z-index:100;background:#4b206e;color:white;padding:14px 18px;border-radius:12px;max-width:min(360px,calc(100vw - 40px));box-shadow:0 4px 20px #34114e44;cursor:pointer}
@media(max-width:650px){#cargo-chat{right:8px;bottom:72px;width:calc(100vw - 16px);height:calc(100dvh - 92px)}#cargo-chat-launch{right:12px;bottom:max(12px,env(safe-area-inset-bottom))}.chat-layout{grid-template-columns:1fr;grid-template-rows:120px minmax(0,1fr)}.chat-list{display:flex;gap:8px;border-right:0;border-bottom:1px solid #ddd}.chat-list button{flex:0 0 210px;margin:0}.chat-header{padding:8px}.chat-header button{font-size:12px}.chat-bubble{margin-right:8%}.chat-bubble.mine{margin-left:8%}}
@media(max-width:650px){.chat-header{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}.chat-header strong{grid-column:1/-1;font-size:14px}.chat-header button{width:100%;padding:8px 4px;white-space:normal}}
.chat-queue-controls{display:flex;gap:6px;flex-wrap:wrap;padding:6px 10px;background:#f4eef8}.chat-queue-controls button{min-height:44px;padding:8px 10px;font-size:12px}#chat-queue-info{max-height:64px;overflow:auto}
