/* Communication UI; original send/upload/history handlers and IDs are retained. */
body.v4-communication{margin:0;background:#0c1a29;color:#b3cedf;font-family:Arial,"Microsoft YaHei",sans-serif}
.v4-communication-main{box-sizing:border-box;width:100%;max-width:1600px;padding:32px clamp(22px,3vw,48px) 70px;margin:auto}
.v4-communication .v4-catalog-intro{max-width:none;padding-bottom:35px}
.v4-communication .chat-container{width:100%;max-width:none!important;padding:0!important;margin:0;border:1px solid #7197ad44;border-radius:0;box-shadow:0 20px 60px #0002;background:#0f2434;height:650px;max-height:none;display:flex;flex-direction:column;overflow:hidden}
.v4-communication .chat-header{background:#153449;border-bottom:1px solid #7197ad33;padding:22px 26px;color:#d9edf8;flex-shrink:0}
.v4-communication .chat-header h3{font-size:18px;font-weight:400;letter-spacing:.05em;margin:0 0 6px;color:#d9edf8}
.v4-communication .chat-header .status{color:#89b7c9;font-size:11px}
.v4-communication .avatar,.v4-communication .message-avatar{background:#21495f;color:#bbebf9;border:1px solid #7197ad55;border-radius:4px}
.v4-communication .chat-messages{background:radial-gradient(ellipse at 70% 20%,#17354944,transparent 65%),#0d2130;flex:1;min-height:0;padding:30px;overflow-y:auto}
.v4-communication .message-content{max-width:75%}
.v4-communication .message-text{background:#1b3b50;color:#c6e0ee;border:1px solid #7197ad33;border-radius:3px;padding:13px 17px;line-height:1.8;font-size:13px;overflow-wrap:anywhere}
.v4-communication .myself .message-text{background:#b1e8f5;color:#173b51;border-color:#b1e8f5}
.v4-communication .message-time{color:#6e91a8;font-size:9px;margin-top:8px}
.v4-communication .message-image{max-width:100%;border-radius:3px}
.v4-communication .chat-input{background:#152f41;border-top:1px solid #7197ad33;padding:18px 22px;display:flex;gap:14px;align-items:center;flex-shrink:0}
.v4-communication #messageInput{flex:1;min-width:0;background:#0c202e;color:#dcecf5;border:1px solid #7197ad55;border-radius:0;padding:13px 15px;font-size:13px}
.v4-communication #messageInput:focus{outline:1px solid #97d9ec}
.v4-communication .chat-input>button{background:#a0e3f6;color:#15374c;border:1px solid #a0e3f6;padding:12px 24px;border-radius:0;font-size:12px}
.v4-communication .input-actions{display:flex;gap:8px}
.v4-communication .action-btn{background:#1b4159;color:#a5d9ed;border:1px solid #7197ad44;border-radius:0;width:38px;height:38px}
.v4-communication .product-modal{background:#071421cc;backdrop-filter:blur(12px);z-index:2100}
.v4-communication .product-modal-content{background:#122b3e;color:#bfd7e7;border:1px solid #7197ad55;border-radius:0;box-shadow:0 25px 100px #0005;max-width:1100px;width:90%;max-height:85svh;overflow-y:auto}
.v4-communication .product-modal-header{background:#173952;color:#d3edf8;border-color:#7197ad33}
.v4-communication .product-modal-header h3{font-weight:400;color:#d3edf8}
.v4-communication .product-search{background:transparent;border-color:#7197ad33}
.v4-communication #productSearchInput{background:#0d2231;color:#c7dfec;border:1px solid #7197ad55;border-radius:0}
.v4-communication .product-list .product-item{background:#153449;border:1px solid #7197ad33;border-radius:0;color:#c4deed}
.v4-communication .product-list .product-item:hover{border-color:#91d6eb;background:#1d455e}
.v4-communication .product-list .product-name{color:#c4deed}
.v4-communication .product-pagination-info{color:#80a4bb}
@media(max-width:760px){.v4-communication-main{padding:24px 22px 45px}.v4-communication .chat-container{height:560px}.v4-communication .chat-header{padding:18px}.v4-communication .chat-messages{padding:20px 14px}.v4-communication .message-content{max-width:85%}.v4-communication .chat-input{padding:12px;gap:8px;flex-wrap:wrap}.v4-communication #messageInput{order:2;flex:1 1 calc(100% - 90px)}.v4-communication .chat-input>button{order:3;padding:12px 16px}.v4-communication .input-actions{flex:1 0 100%}.v4-communication .product-modal-content{width:calc(100% - 32px)}}

/* Both message directions share the dark industrial palette. */
.v4-communication .message.myself .message-text{background:linear-gradient(135deg,#164258,#173d53);color:#d8f3fc;border:1px solid #72cde94d;border-radius:14px 14px 4px 14px;box-shadow:0 5px 18px #0002}
.v4-communication .message.other .message-text{background:#172f41;color:#c9deeb;border:1px solid #7197ad3d;border-radius:14px 14px 14px 4px;box-shadow:0 5px 18px #0002}
.v4-communication .message-text{overflow-wrap:anywhere;line-height:1.65}
.v4-communication .message.myself .message-avatar{background:#1a4358;color:#b5edff;border:1px solid #72cde94d}
.v4-communication .message.other .message-avatar{background:#1b394f;color:#c2e0ef;border:1px solid #7197ad44}
.v4-communication .message-time{color:#91aec1}
.v4-communication .product-modal-header h3,.v4-communication .product-modal-close{color:#d6edf9!important}
.v4-communication .product-modal-close:hover{color:#a8edff!important;background:#1d4257}
.v4-communication .product-modal .product-name,.v4-communication .product-modal .product-title,.v4-communication .product-modal .product-info h4{color:#d2e8f5!important}
.v4-communication .product-modal .product-description,.v4-communication .product-modal .product-info p,.v4-communication .product-pagination-info,.v4-communication .product-modal #paginationInfo{color:#9ebbd0!important}
.v4-communication .product-modal .product-pagination{background:#102739;border-color:#7197ad33}
.v4-communication .product-modal .pagination-btn{background:#1a3d55;color:#c6e5f5;border-color:#7197ad55}
.v4-communication .product-modal .pagination-btn.active,.v4-communication .product-modal .pagination-btn:hover:not(:disabled){background:#a0e3f6;color:#15374c;border-color:#a0e3f6}
.v4-communication .product-modal .product-search i{color:#9bcadd}
.v4-communication .product-modal input::placeholder{color:#8caabf;opacity:1}
.v4-communication .product-modal .product-item img{object-fit:contain!important;background:#fff;border-radius:6px}

.v4-communication .product-modal .product-pagination-info{background:#102739!important;border-color:#7197ad33!important;color:#a8c4d7!important}.v4-communication .product-modal .page-number{background:#1a3d55!important;color:#bddbec!important;border:1px solid #7197ad44!important;border-radius:6px!important}.v4-communication .product-modal .page-number.active,.v4-communication .product-modal .page-number:hover{background:#9fe3f5!important;color:#15374c!important;border-color:#9fe3f5!important}

.v4-communication .product-modal-close{display:grid;place-items:center;width:44px;height:44px;padding:0;flex:0 0 44px;font-size:28px;line-height:1;background:transparent;border:0;border-radius:7px;cursor:pointer}
.v4-communication .product-modal-close:focus-visible{outline:2px solid #92d9ed;outline-offset:2px}
.v4-communication .product-modal .pagination-pages{position:relative;min-width:0;max-width:100%;flex:1;display:flex;gap:6px;overflow-x:auto;overscroll-behavior-x:contain;scrollbar-width:thin;padding:3px 0}
.v4-communication .product-modal .page-number{display:grid;place-items:center;flex:0 0 40px;width:40px;height:44px;min-height:44px;padding:0;line-height:1;font-size:14px}
.v4-communication .product-modal .product-pagination{display:flex;gap:8px;align-items:center}
.v4-communication .product-modal .pagination-btn{flex:0 0 44px;width:44px;height:44px;padding:0}
@media(max-width:760px){.v4-communication .input-actions .action-btn{width:44px;height:44px}.v4-communication .chat-input>button{min-height:44px}.v4-communication .product-modal-header{gap:12px}.v4-communication .product-modal-content{overscroll-behavior:contain}.v4-communication .product-modal .product-pagination{padding:10px 14px}}

@media(max-width:760px){.v4-communication .product-modal-content{display:flex;flex-direction:column;height:85svh;max-height:85svh;overflow:hidden}.v4-communication .product-modal :is(.product-modal-header,.product-search,.product-pagination,.product-pagination-info){flex-shrink:0}.v4-communication .product-modal .product-list{flex:1;min-height:0;max-height:none!important;overflow-y:auto;overscroll-behavior:contain}}

/* Remove the legacy fixed top:56px chat layout beneath the shared header. */
.v4-communication .chat-container{position:relative;inset:auto}
@media(max-width:760px){.v4-communication .chat-container{height:clamp(360px,66svh,560px);inset:auto}body.v4-communication .v4-product-footer>footer.footer{display:none!important}.v4-communication .chat-header .avatar{flex-shrink:0}}

@media(max-width:760px){.v4-communication .chat-input :is(input,button){scroll-margin-top:290px;scroll-margin-bottom:90px}}@media(max-width:760px) and (max-height:500px){.v4-communication .chat-input :is(input,button){scroll-margin-top:174px}}

.v4-communication .product-modal :is(.product-modal-content,.product-list,.pagination-pages){color-scheme:dark;scrollbar-color:#47697f #0f2637;scrollbar-width:thin}

/* Industrial conversation panel: clear hierarchy, quiet surfaces, integrated composer. */
body.v4-communication main.v4-communication-main>div.chat-container{padding:0!important}
body.v4-communication .chat-container{height:660px;border:1px solid #46617480;border-radius:10px;background:#0e202e;box-shadow:0 24px 70px #0004,inset 0 1px #d6efff0a;isolation:isolate}
body.v4-communication .chat-header{position:relative;display:flex;justify-content:flex-start;align-items:center;gap:16px;padding:22px 26px;background:linear-gradient(110deg,#1a3547,#132939 75%);border-bottom:1px solid #668ba338;text-align:left}
body.v4-communication .chat-header::before{content:'';position:absolute;left:0;top:22px;bottom:22px;width:3px;background:#9ed9e7}
body.v4-communication .chat-header .avatar{display:grid;place-items:center;flex:0 0 48px;width:48px;height:48px;border:1px solid #91c2d34d;border-radius:8px;background:linear-gradient(145deg,#254457,#193548);color:#b8e6f0;box-shadow:inset 0 1px #e1f6ff10}
body.v4-communication .chat-header .avatar svg{width:27px;height:27px}
body.v4-communication .chat-team-label{display:block;color:#8da9bb;font-size:11px;line-height:1.3;letter-spacing:.14em;margin-bottom:4px}
body.v4-communication .chat-header h3{font-size:22px;line-height:1.2;letter-spacing:.055em;font-weight:500;margin:0 0 5px;color:#e0eef7}
body.v4-communication .chat-header .status{display:flex;align-items:center;gap:7px;color:#9cb8c9;opacity:1;font-size:13px!important;line-height:1.5!important}
body.v4-communication .chat-header .status::before{content:'';width:6px;height:6px;flex:0 0 6px;border-radius:50%;background:#7fc5b5;box-shadow:0 0 0 3px #7fc5b511}
body.v4-communication #communicationlist{padding:28px;background:radial-gradient(ellipse at 0 0,#264c611c,transparent 65%),#0e202e;height:auto;min-height:0;flex:1;overflow-y:auto;scrollbar-width:thin;scrollbar-color:#38586b #0e202e;overscroll-behavior-y:contain}
body.v4-communication #communicationlist .message{gap:12px;margin:0 0 24px;align-items:flex-start}
body.v4-communication #communicationlist .message:last-child{margin-bottom:0}
body.v4-communication #communicationlist .message-avatar{display:grid;place-items:center;flex:0 0 30px;width:30px;height:30px;margin:3px 0 0;border-radius:5px;font-size:12px;font-weight:500;color:#9ebecf;background:#193547;border:1px solid #6f99b03b}
body.v4-communication #communicationlist .message-content{min-width:0;max-width:min(76%,620px)}
body.v4-communication #communicationlist .message-text{padding:16px 19px;font-size:16px!important;line-height:1.7!important;letter-spacing:0;color:#c9dce8!important;overflow-wrap:anywhere;box-shadow:0 4px 14px #0002}
body.v4-communication #communicationlist .message.other .message-text{background:linear-gradient(135deg,#193447,#152c3c);border:1px solid #6b91a63b;border-left:2px solid #80afc466;border-radius:2px 9px 9px 9px}
body.v4-communication #communicationlist .message.myself .message-text{background:linear-gradient(135deg,#22495e,#1b3b50);border:1px solid #91c9dc4d;border-right:2px solid #a0dce7a0;border-radius:9px 2px 9px 9px;color:#dcf0f7!important}
body.v4-communication #communicationlist .message-time{font-size:11px!important;line-height:1.5!important;margin-top:8px;color:#7995a9;letter-spacing:.015em}
body.v4-communication #communicationlist .message-image{max-width:min(100%,300px);border:1px solid #5c7d904d;border-radius:7px;overflow:hidden;box-shadow:none}
body.v4-communication #communicationlist .message-image img{max-width:100%;height:auto;object-fit:contain}
body.v4-communication .chat-input{display:grid;grid-template-columns:minmax(0,1fr) 108px;gap:12px 10px;align-items:stretch;padding:16px 22px 20px;background:linear-gradient(120deg,#162f3f,#122939);border-top:1px solid #648ba33b}
body.v4-communication .chat-input .input-actions{grid-column:1/-1;grid-row:1;display:flex;flex:none;gap:8px;align-items:center;min-width:0}
body.v4-communication .chat-input .input-actions .action-btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;width:auto;height:40px;min-height:40px;padding:7px 12px;background:#18374a;border:1px solid #6c99af44;border-radius:6px;box-shadow:none;color:#a8c8d9;font-size:13px!important;line-height:1.2;transform:none;transition:background .2s,border-color .2s,color .2s}
body.v4-communication .chat-input .input-actions .action-btn::before{display:none}
body.v4-communication .chat-input .action-btn svg{width:18px;height:18px;flex:0 0 18px}
body.v4-communication .chat-input .input-actions .action-btn:hover{background:#214960;border-color:#91cbdc88;color:#d6f0f7;transform:none}
body.v4-communication .chat-input #messageInput{grid-column:1;grid-row:2;order:initial;box-sizing:border-box;width:100%;min-width:0;height:48px;margin:0;padding:12px 15px;background:#0e2332;border:1px solid #587d925c;border-radius:6px;color:#deedf5;font-size:16px!important;line-height:1.4!important;box-shadow:inset 0 2px 5px #0001;transition:border-color .2s,box-shadow .2s}
body.v4-communication .chat-input #messageInput::placeholder{color:#819eaf;opacity:1}
body.v4-communication .chat-input #messageInput:focus{outline:none;border-color:#91cedf;box-shadow:0 0 0 3px #91cedf12}
body.v4-communication .chat-input .chat-send{grid-column:2;grid-row:2;order:initial;display:flex;align-items:center;justify-content:center;gap:12px;height:48px;min-height:48px;padding:0 16px;background:#a9dce7;color:#103143;border:1px solid #b6e6ee;border-radius:6px;font-size:15px!important;font-weight:500;line-height:1.3;box-shadow:inset 0 1px #fff3;transition:background .2s;transform:none}
body.v4-communication .chat-input .chat-send svg{width:19px;height:19px;flex:0 0 19px}
body.v4-communication .chat-input .chat-send:hover{background:#c2edf3;transform:none}
body.v4-communication .chat-input button:focus-visible{outline:2px solid #bee9f4;outline-offset:3px}
@media(max-width:760px){
body.v4-communication .v4-communication-main{padding:18px 16px 24px}
body.v4-communication .v4-communication-main>.v4-catalog-intro{display:none}
body.v4-communication .chat-container{height:clamp(430px,calc(100svh - var(--v4-header-height,150px) - 112px),680px);border-radius:9px}
body.v4-communication .chat-header{padding:18px;gap:13px}
body.v4-communication .chat-header .avatar{flex-basis:44px;width:44px;height:44px}
body.v4-communication .chat-header h3{font-size:20px}
body.v4-communication .chat-team-label{font-size:10px;letter-spacing:.12em}
body.v4-communication #communicationlist{padding:22px 14px}
body.v4-communication #communicationlist .message{gap:8px;margin-bottom:20px}
body.v4-communication #communicationlist .message-avatar{flex-basis:25px;width:25px;height:25px;font-size:11px}
body.v4-communication #communicationlist .message-content{max-width:calc(100% - 33px)}
body.v4-communication #communicationlist .message-text{padding:13px 14px;font-size:15px!important;line-height:1.65!important}
body.v4-communication .chat-input{grid-template-columns:minmax(0,1fr) 84px;padding:13px;gap:10px 8px}
body.v4-communication .chat-input .input-actions .action-btn{min-height:38px;height:38px;padding:7px 10px;gap:7px}
body.v4-communication .chat-input #messageInput{padding:11px 12px}
body.v4-communication .chat-input .chat-send{padding:0 10px;gap:8px}
}
@media(prefers-reduced-motion:reduce){body.v4-communication .chat-input :is(button,#messageInput){transition:none}}

/* Phones: the conversation owns the whole screen, one scroll area, compact chrome. */
@media(max-width:760px){
body.v4-communication{display:flex;flex-direction:column;height:100svh;overflow:hidden;overscroll-behavior:none}
body.v4-communication .footer-device-mobile,body.v4-communication .v4-mobile-dock{display:none!important}
body.v4-communication .v4-communication-main{box-sizing:border-box;flex:1 1 auto;min-height:0;height:auto;max-width:none;margin:0;padding:0!important;overflow:hidden}
body.v4-communication .v4-communication-main>.v4-catalog-intro{display:none!important}
body.v4-communication .chat-container{height:100%!important;min-height:0!important;margin:0!important;border:0!important;border-radius:0!important;box-shadow:none!important}
body.v4-communication .chat-header{padding:10px 22px;gap:10px;align-items:center}
body.v4-communication .chat-header::before{top:10px;bottom:10px;width:2px}
body.v4-communication .chat-header .avatar{flex:0 0 34px;width:34px;height:34px;border-radius:6px}
body.v4-communication .chat-header .avatar svg{width:19px;height:19px}
body.v4-communication .chat-team-label{font-size:8px;letter-spacing:.12em;margin-bottom:1px}
body.v4-communication .chat-header h3{font-size:15px;line-height:1.2;margin:0 0 1px}
body.v4-communication .chat-header .status{font-size:10px!important;line-height:1.4!important;gap:5px}
body.v4-communication .chat-header .status::before{width:5px;height:5px;flex-basis:5px}
body.v4-communication #communicationlist{padding:12px;min-height:0}
body.v4-communication #communicationlist .message{gap:7px;margin-bottom:12px}
body.v4-communication #communicationlist .message-avatar{flex:0 0 22px;width:22px;height:22px;font-size:9px;margin-top:2px}
body.v4-communication #communicationlist .message-content{max-width:calc(100% - 29px)}
body.v4-communication #communicationlist .message-text{padding:8px 11px!important;font-size:12px!important;line-height:1.45!important}
body.v4-communication #communicationlist .message-time{font-size:9px!important;line-height:1.3!important;margin-top:4px}
body.v4-communication #communicationlist .message-image{max-width:min(100%,220px)}
body.v4-communication .chat-input{grid-template-columns:minmax(0,1fr) 62px;padding:8px 12px;gap:7px 8px}
body.v4-communication .chat-input .input-actions{gap:6px}
body.v4-communication .chat-input .input-actions .action-btn{height:30px;min-height:30px;padding:4px 8px;gap:5px;font-size:11px!important;border-radius:4px}
body.v4-communication .chat-input .action-btn svg{width:14px;height:14px;flex-basis:14px}
body.v4-communication .chat-input #messageInput{height:36px;padding:7px 10px;font-size:12px!important}
body.v4-communication .chat-input .chat-send{height:36px;min-height:36px;padding:0 8px;gap:5px;font-size:12px!important;border-radius:4px}
body.v4-communication .chat-input .chat-send svg{width:14px;height:14px;flex-basis:14px}
/* Product picker: center the thumbnail and keep each row short. */
body.v4-communication .product-modal-content{width:calc(100% - 16px);height:calc(100svh - 24px);max-height:none;border-radius:8px}
body.v4-communication .product-modal-header{padding:10px 12px;gap:8px}
body.v4-communication .product-modal-header h3{font-size:14px!important}
body.v4-communication .product-modal-close{width:32px;height:32px;flex:0 0 32px;font-size:22px}
body.v4-communication .product-search{padding:8px 12px}
body.v4-communication .product-search #productSearchInput{height:34px;font-size:12px!important}
body.v4-communication .product-list{display:flex;flex-direction:column;gap:6px;padding:8px}
body.v4-communication .product-item{display:flex;align-items:center!important;gap:10px!important;padding:6px 8px!important;margin:0!important;border-width:1px;border-radius:6px}
body.v4-communication .product-item img{width:46px!important;height:46px!important;flex:0 0 46px!important;align-self:center!important;object-fit:contain!important;border-radius:4px}
body.v4-communication .product-item .product-info{min-width:0;justify-content:center}
body.v4-communication .product-item .product-info h4{font-size:12px!important;line-height:1.3!important;margin:0 0 2px!important;display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical;overflow:hidden}
body.v4-communication .product-item .product-info p{font-size:10px!important;line-height:1.3!important;display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical;overflow:hidden}
body.v4-communication .product-item .favorite-tag{display:none!important}
body.v4-communication .product-pagination{padding:6px 8px!important}
body.v4-communication .product-pagination-info{padding:6px 12px!important;font-size:10px!important}
}

/* Desktops: the conversation owns the viewport — edge to edge, a single scroll area. */
@media(min-width:761px){
html:has(body.v4-communication){height:100%;overflow:hidden;overscroll-behavior:none}
body.v4-communication{display:flex;flex-direction:column;height:100vh;height:100dvh;min-height:0;margin:0;overflow:hidden;overscroll-behavior:none}
body.v4-communication>.v4-shell-host{flex:0 0 auto;min-height:0}
body.v4-communication .v4-product-footer,body.v4-communication .footer-device-mobile,body.v4-communication .v4-mobile-dock,body.v4-communication .header-device-mobile{display:none!important}
body.v4-communication .v4-communication-main{display:flex;flex-direction:column;flex:1 1 auto;min-height:0;width:100%;max-width:none;margin:0;padding:0!important;overflow:hidden}
body.v4-communication .v4-communication-main>.v4-catalog-intro{display:none!important}
body.v4-communication .chat-container{flex:1 1 auto;min-height:0;width:100%;max-width:none;height:auto!important;max-height:none!important;margin:0!important;border:0!important;border-radius:0!important;box-shadow:none!important;background:#0e202e}
body.v4-communication #communicationlist{padding:22px clamp(22px,3vw,48px);scrollbar-gutter:stable}
body.v4-communication .chat-header{padding:18px clamp(22px,3vw,48px)}
body.v4-communication .chat-input{padding:14px clamp(22px,3vw,48px) 18px}
}

/* Product-picker rows keep identical copy slots for long and short names. */
html body.v4-communication .product-modal .product-item{align-items:center!important;min-width:0}
html body.v4-communication .product-modal .product-item .product-info{flex:1;min-width:0}
html body.v4-communication .product-modal .product-item .product-info h4{font-size:15px!important;line-height:1.5!important;height:45px!important;min-height:45px!important;max-height:45px!important;display:-webkit-box!important;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;margin:0 0 6px!important;overflow-wrap:break-word}
html body.v4-communication .product-modal .product-item .product-info p{font-size:14px!important;line-height:1.6!important;height:44.8px!important;min-height:44.8px!important;max-height:44.8px!important;display:-webkit-box!important;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;margin:0!important;overflow-wrap:break-word}
