/* WoofAPI chat scroll fix 2026-07-10
   Keep the fixed composer visible while allowing long answers to scroll. */
@media (min-width: 901px) {
  body:has(.ai-chat-workbench),
  body:has(.ai-chat-workbench) #root,
  body:has(.ai-chat-workbench) .semi-layout,
  body:has(.ai-chat-workbench) .app-content-shell {
    min-height: 0 !important;
  }

  body .ai-chat-workbench,
  body .ai-chat-workbench .ai-chat-main,
  body .ai-chat-workbench .ai-chat-console-body,
  body .ai-chat-workbench .ai-chat-semi-shell {
    min-height: 0 !important;
  }

  body .ai-chat-workbench .ai-chat-main {
    display: flex !important;
    flex-direction: column !important;
  }

  body .ai-chat-workbench .ai-chat-console-body {
    flex: 1 1 auto !important;
    height: auto !important;
    min-height: 0 !important;
    overflow: hidden !important;
    position: relative !important;
  }

  body .ai-chat-workbench .ai-chat-semi-shell,
  body .ai-chat-workbench .semi-chat,
  body .ai-chat-workbench .semi-chat-chat,
  body .ai-chat-workbench .semi-chat-container,
  body .ai-chat-workbench .semi-chat-inner {
    height: 100% !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }

  body .ai-chat-workbench .semi-chat-content,
  body .ai-chat-workbench .semi-chat-list,
  body .ai-chat-workbench .semi-chat-scroll-list,
  body .ai-chat-workbench .semi-chat-chatBoxList,
  body .ai-chat-workbench .semi-chat-chatBoxWrap,
  body .ai-chat-workbench [class*='chatBoxList'],
  body .ai-chat-workbench [class*='scroll-list'],
  body .ai-chat-workbench [class*='message-list'] {
    max-height: none !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    overscroll-behavior: contain !important;
    padding-bottom: 178px !important;
    scroll-padding-bottom: 178px !important;
  }

  body .ai-chat-workbench .ai-chat-input-shell,
  body .ai-chat-workbench .semi-chat-footer,
  body .ai-chat-workbench [class*='inputArea'],
  body .ai-chat-workbench [class*='InputArea'] {
    flex: 0 0 auto !important;
  }
}

@media (max-width: 900px) {
  body .ai-chat-workbench .ai-chat-console-body,
  body .ai-chat-workbench .ai-chat-semi-shell,
  body .ai-chat-workbench .semi-chat-content,
  body .ai-chat-workbench .semi-chat-list,
  body .ai-chat-workbench [class*='chatBoxList'] {
    min-height: 0 !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    padding-bottom: 160px !important;
  }
}

/* v20260710c: Semi Chat uses .semi-chat-container as the real scroll viewport. */
@media (min-width: 901px) {
  body .ai-chat-workbench .ai-chat-semi-shell .semi-chat-content {
    height: auto !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }

  body .ai-chat-workbench .ai-chat-semi-shell .semi-chat-container {
    height: 100% !important;
    max-height: 100% !important;
    min-height: 0 !important;
    overflow-y: scroll !important;
    overflow-x: hidden !important;
    padding: 28px 34px 190px !important;
    scroll-padding-bottom: 190px !important;
    overscroll-behavior: contain !important;
    scrollbar-gutter: stable !important;
  }

  body .ai-chat-workbench .ai-chat-semi-shell .semi-chat-container-scroll-hidden::-webkit-scrollbar {
    display: block !important;
    width: 10px !important;
    height: 10px !important;
  }

  body .ai-chat-workbench .ai-chat-semi-shell .semi-chat-container::-webkit-scrollbar-thumb {
    border-radius: 999px !important;
    background: rgba(85, 132, 190, .38) !important;
    border: 2px solid rgba(255,255,255,.75) !important;
  }

  body .ai-chat-workbench .ai-chat-semi-shell .semi-chat-container::-webkit-scrollbar-track {
    background: rgba(222, 239, 255, .55) !important;
    border-radius: 999px !important;
  }
}

@media (max-width: 900px) {
  body .ai-chat-workbench .ai-chat-semi-shell .semi-chat-container {
    height: 100% !important;
    min-height: 0 !important;
    overflow-y: scroll !important;
    overflow-x: hidden !important;
    padding-bottom: 180px !important;
    -webkit-overflow-scrolling: touch !important;
  }

  body .ai-chat-workbench .ai-chat-semi-shell .semi-chat-container-scroll-hidden::-webkit-scrollbar {
    display: block !important;
    width: 8px !important;
  }
}
