.chat-conversation-sidebar{display:none}
.chat-panel .chat-current-product{display:flex;align-items:center;gap:10px;flex-shrink:0;min-width:0;padding:12px 7px;background:#fff;border-bottom:1px solid #f2f2f2}
.chat-panel .chat-current-product-info{display:flex;align-items:center;gap:10px;min-width:0;flex:1;color:inherit;text-decoration:none}
.chat-current-product-info>img,.chat-current-product-placeholder{width:44px;height:44px;flex:none;object-fit:contain;border-radius:4px;background:#f6f6f6}
.chat-current-product-placeholder{display:grid;place-items:center;color:#999;font-size:9px}
.chat-current-product-info>span:last-child{min-width:0}.chat-current-product-info strong{display:block;font-size:12px;color:#fa624a;font-weight:500}
.chat-current-product-title{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px;line-height:20px;color:#777}
.chat-panel .chat-buy-now{display:grid;place-items:center;position:relative;flex:none;width:70px;height:26px;border-radius:4px;background:#fa624a;color:#fff;font-size:12px;text-decoration:none;white-space:nowrap}
.chat-buy-now:before{content:"";position:absolute;inset:-9px 0}.chat-buy-now:focus-visible{outline:2px solid #333;outline-offset:4px}
.chat-current-product-state{max-width:100px;color:#888;font-size:11px}.chat-current-product>p{margin:0;font-size:12px;color:#888}.chat-current-product>button{font-size:12px;padding:6px;flex:none}
@media(min-width:1100px){.chat-panel .chat-current-product{padding:12px 16px;background:#fafafa;border:1px solid #eee;border-radius:10px;gap:20px}.chat-current-product-info>img,.chat-current-product-placeholder{width:56px;height:56px}.chat-current-product-info strong{font-size:16px}.chat-current-product-title{font-size:14px;line-height:24px}.chat-panel .chat-buy-now{width:100px;height:36px;font-size:14px}}
.chat-sidebar-pagination{position:sticky;bottom:0;background:#fafafa;border-top:1px solid #e8e8e8;padding:12px;font-size:12px;z-index:1}.chat-sidebar-pagination p{margin:0 0 8px}.chat-sidebar-pagination button{font-size:12px;padding:7px 10px;margin-right:6px}
@media(max-width:1099px){.chat-workspace{display:contents}}
@media(min-width:1100px){
 .chat-workspace{display:grid;grid-template-columns:260px minmax(0,1fr);min-width:0;background:#fff;border:1px solid #eee;border-radius:16px;overflow:hidden;min-height:calc(100dvh - 185px)}
 .chat-conversation-sidebar{display:block;min-width:0;border-right:1px solid #eee;background:#fafafa;max-height:calc(100dvh - 185px);overflow:auto}
 .chat-sidebar-heading{padding:23px 20px 18px;border-bottom:1px solid #eee;background:#fff9d7;position:sticky;top:0;z-index:1}.chat-sidebar-heading h2{font-size:20px;margin:0 0 14px}.chat-sidebar-heading>a{font-size:12px;color:#666}
 .chat-conversations{display:block;margin:0;padding:0;white-space:normal}.chat-conversations .chat-conversation{display:flex;gap:10px;align-items:flex-start;padding:18px 14px;border-radius:0;border-bottom:1px solid #eee;color:inherit;text-decoration:none;text-align:left;background:transparent;white-space:normal}
 .chat-conversations .chat-conversation.is-current{background:#fff2a6;box-shadow:inset 3px 0 #e6bf00}.chat-conversation:hover{background:#fffbe5}.chat-conversation>img{width:36px;height:36px;flex:none;border-radius:50%}.chat-conversation-text{min-width:0;flex:1}.chat-conversation-text strong{font-size:14px;display:block;overflow-wrap:anywhere}.chat-conversation-product,.chat-conversation-preview{display:block;font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-top:6px;color:#666}.chat-conversation-product{color:#967700}.chat-conversation-text time{display:block;font-size:10px;font-weight:400;color:#999;margin-top:8px}.chat-conversation .social-badge{flex:none;margin-top:2px}
 .chat-sidebar-error,.chat-sidebar-empty{font-size:12px;padding:16px;color:#888;line-height:1.7}.chat-sidebar-error button{display:block;margin-top:8px;font-size:12px}
 .chat-workspace>.chat-panel{min-width:0;max-width:none;margin:0;border:0;border-radius:0;padding:24px;min-height:0;display:flex;flex-direction:column}
 .chat-workspace .chat-panel>h1{font-size:20px;margin:18px 0 10px}.chat-workspace .chat-panel>a[href^="#product/"]{background:#fafafa;border:1px solid #eee;border-radius:10px;padding:14px;font-size:14px;line-height:1.7;overflow-wrap:anywhere}
 .chat-workspace .chat-panel>.chat-log{flex:1;min-height:260px;max-height:48vh;padding:18px 0}.chat-workspace .chat-panel>#chat-form{padding:18px 0 0;margin-top:16px;border-top:1px solid #eee}.chat-workspace .chat-panel #chat-form textarea{width:100%;resize:vertical;max-height:180px}.chat-workspace .chat-log .bubble{max-width:85%}
}
@media(min-width:1500px){.chat-workspace{grid-template-columns:310px minmax(0,1fr)}.chat-workspace .chat-panel>.chat-log{max-height:54vh}.chat-workspace .chat-log .bubble{max-width:70%}}
/* Keep tools inside the fixed composer so the input cannot cover their hit area. */
.chat-panel>#chat-form{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;align-items:end}
.chat-panel #chat-form>.chat-compose-tools{grid-column:1/-1;grid-row:1;display:flex;align-items:center;gap:10px;min-height:34px}
.chat-panel #chat-form>.chat-compose-tools .quick-reply-trigger{margin:0;padding:7px 12px;min-height:34px;height:auto;border-radius:6px;background:#f1f2f5;color:#444;font-size:12px}
.chat-panel #chat-form>label{grid-column:1;grid-row:2;min-width:0}
.chat-panel #chat-form>button[type=submit]{grid-column:2;grid-row:2}
.chat-panel #chat-form>#chat-status{position:static;grid-column:1/-1;grid-row:3;text-align:right;font-size:10px;line-height:14px;min-height:14px}
@media(max-width:700px){.chat-panel>.chat-log{padding-bottom:160px}.chat-panel>#chat-form{padding:10px 12px calc(10px + env(safe-area-inset-bottom,0px))}.chat-panel #chat-form textarea{max-height:140px}.chat-panel #chat-form>.chat-compose-tools{min-height:34px}}
/* Chat owns a bounded scroll viewport; messages must never size the page. */
.chat-workspace .chat-panel>.chat-log{min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:12px 4px;flex:1 1 0;max-height:none}
.chat-workspace .chat-panel>.chat-log>.bubble{flex-shrink:0}
.chat-workspace .chat-panel>#chat-form{flex-shrink:0}
@media(max-width:1099px){
 body[data-page=chat]{overflow:hidden;padding-bottom:0}
 body[data-page=chat] .chat-workspace>.chat-panel{position:fixed;inset:0;z-index:20;width:100%;max-width:none;height:100vh;height:100dvh;min-height:0;max-height:100dvh;margin:0;border-radius:0;padding:12px 12px 0;display:flex;flex-direction:column;overflow:hidden;background:#fff}
 .chat-workspace .chat-panel>h1{margin:8px 0;font-size:16px;flex-shrink:0}
 .chat-workspace .chat-panel>a{flex-shrink:0;font-size:13px;line-height:20px}
 .chat-workspace .chat-panel>a[href^="#product/"]{overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}
 .chat-workspace .chat-panel>.muted{margin:6px 0;font-size:11px;line-height:16px;flex-shrink:0}
 .chat-workspace .chat-panel>#older-messages{padding:6px 12px;min-height:32px;flex-shrink:0;align-self:center;font-size:12px}
 .chat-workspace .chat-panel>#chat-form{position:static;inset:auto;margin:0;padding:8px 0 calc(8px + env(safe-area-inset-bottom,0px));flex-shrink:0;background:#fff}
 .chat-workspace .chat-panel #chat-form textarea{height:42px;min-height:42px;max-height:90px;resize:none}
 .chat-workspace .chat-panel #chat-form>.chat-compose-tools{gap:6px;flex-wrap:wrap;min-height:30px}
 .chat-workspace .chat-panel .chat-compose-tools>button{padding:5px 9px;font-size:12px;min-height:32px;height:auto}
 .chat-workspace .chat-panel>.chat-new-messages{flex-shrink:0;margin:4px auto;padding:5px 12px;min-height:32px}
}
@media(min-width:1100px){
 .chat-workspace{height:max(520px,calc(100dvh - 185px));min-height:0}
 .chat-conversation-sidebar{max-height:none;min-height:0}
 .chat-workspace>.chat-panel{min-height:0;overflow:hidden;padding:18px}
 .chat-workspace .chat-panel>h1{margin:8px 0}
 .chat-workspace .chat-panel>a[href^="#product/"]{padding:8px 12px;max-height:70px;overflow:auto;flex-shrink:0}
 .chat-workspace .chat-panel>#chat-form{margin-top:8px;padding-top:8px}
 .chat-workspace .chat-panel #chat-form textarea{max-height:110px}
}

/* APK chat-h5 message avatar: 78rpx (39 CSS px), outside each message bubble. */
.chat-workspace .chat-log .bubble{position:relative;margin-left:49px;margin-right:0;max-width:calc(100% - 98px);min-height:39px;flex-shrink:0}
.chat-workspace .chat-log .bubble.sent{margin-left:0;margin-right:49px}
.chat-author-avatar{position:absolute;left:-49px;top:0;width:39px;height:39px;border-radius:50%;display:block}
.bubble.sent>.chat-author-avatar{left:auto;right:-49px}
.chat-author-avatar img{display:block;width:39px;height:39px;border-radius:50%;object-fit:cover;background:#f5f5f5}
.chat-author-name{color:inherit;overflow-wrap:anywhere;text-decoration:none}.chat-author-avatar:focus-visible,.chat-author-name:focus-visible{outline:2px solid #8c7628;outline-offset:3px}
@media(min-width:1100px){.chat-workspace .chat-log .bubble{max-width:min(75%,calc(100% - 98px))}}
