/* 商户端 iframe ?embed=1：去掉客服 PC 工作台灰底与居中留白，三栏铺满 */
html.kefu-embed,
html.kefu-embed body,
html.kefu-embed #app {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #fff;
}

html.kefu-embed .kefu-layouts,
html.kefu-embed .kefu-layouts .content-wrapper {
  padding: 0 !important;
  margin: 0 !important;
  height: 100% !important;
  width: 100% !important;
  max-width: none !important;
  background: #fff !important;
  display: flex;
  flex-direction: column;
  min-height: 0;
  box-sizing: border-box;
  overflow: hidden !important;
}

html.kefu-embed .kefu-layouts .container {
  width: 100% !important;
  max-width: none !important;
  height: 100% !important;
  flex: 1 1 0% !important;
  min-height: 0 !important;
  margin: 0 !important;
  border-radius: 0 !important;
  overflow: hidden;
}

/* 覆盖会话列表写死的 742px，三栏随工作区拉高 */
html.kefu-embed .kefu-layouts .chatList {
  height: 100% !important;
  min-height: 0 !important;
  flex-shrink: 0;
}

html.kefu-embed .kefu-layouts .chatList .scroll-box {
  height: 0 !important;
  flex: 1 1 0% !important;
  min-height: 0 !important;
}

html.kefu-embed .kefu-layouts .right-wrapper {
  height: 100% !important;
  min-height: 0 !important;
  overflow: auto;
}

html.kefu-embed .kefu-layouts .chat-content {
  display: flex !important;
  flex-direction: column !important;
  flex: 1 1 0%;
  width: auto !important;
  min-width: 0;
  min-height: 0;
  height: 100% !important;
}

/* 消息区吃掉剩余高度：height:0 + flex:1 才能盖过原 530px 上限 */
html.kefu-embed .kefu-layouts .chat-content .chat-body {
  max-height: none !important;
  flex: 1 1 0% !important;
  min-height: 0 !important;
  height: 0 !important;
  overflow: hidden;
}

html.kefu-embed .kefu-layouts .chat-content .chat-body .happy-scroll,
html.kefu-embed .kefu-layouts .chat-content .chat-body .happy-scroll-container,
html.kefu-embed .kefu-layouts .chat-content .chat-body .happy-scroll-content {
  width: 100% !important;
  height: 100% !important;
  max-height: none !important;
  min-height: 0;
}

/* 覆盖消息区写死的 600px，缩放/宽屏时铺满中间栏 */
html.kefu-embed .kefu-layouts #chat_scroll {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box;
}

/* 输入区贴底压缩，避免 214px 固定高度在全屏嵌入时留下大块白边 */
html.kefu-embed .kefu-layouts .chat-content .chat-textarea {
  height: 128px !important;
  flex: 0 0 auto !important;
  min-height: 0;
  position: relative;
}

html.kefu-embed .kefu-layouts .chat-content .chat-textarea .chat-btn-wrapper {
  padding: 4px 8px !important;
  flex-shrink: 0;
}

html.kefu-embed .kefu-layouts .chat-content .chat-textarea .textarea-box {
  min-height: 0;
}

html.kefu-embed .kefu-layouts .chat-content .chat-textarea .editable {
  min-height: 56px !important;
  max-height: 80px !important;
  flex: 1 1 auto !important;
}

html.kefu-embed .kefu-layouts .chat-content .chat-textarea .send-btn,
html.kefu-embed .send-btn {
  bottom: 8px !important;
}

/* 商户端注入的管家工具入口，单行排列避免撑高输入区 */
html.kefu-embed #jy-org-chat-tools {
  flex-wrap: nowrap;
}

/* 隐藏 CRMCC 原生无文字相册，只保留桥接注入的「相册」 */
html.kefu-embed .chat-btn-wrapper .left-wrapper > .icon-item:has(.icontupian1),
html.kefu-embed .chat-btn-wrapper .left-wrapper > .icon-item:has(.ivu-upload),
html.kefu-embed .jy-org-hide-native-album {
  display: none !important;
}

/* 原生自动回复与注入按钮对齐：图标在上、文字在下 */
html.kefu-embed .chat-btn-wrapper .left-wrapper > .icon-item.jy-org-native-tool {
  display: inline-flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 6px 8px;
  box-sizing: border-box;
  color: #515a6e;
  font-size: 12px;
  line-height: 16px;
  cursor: pointer;
  border-radius: 4px;
}

html.kefu-embed .chat-btn-wrapper .left-wrapper > .icon-item.jy-org-native-tool .jy-org-native-label {
  margin-top: 2px;
  white-space: nowrap;
}
