/* Load after portal.css. The transcript, not the composer, owns vertical scrolling. */
#ask .chat-shell {
  display: grid;
  grid-template-columns: 184px minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  border-radius: 8px;
  background: #fff;
  padding: 0;
}
#ask .chat-sidebar {
  min-height: 0;
  padding: 12px 8px;
  gap: 8px;
  background: #f6f7f5;
}
#ask .chat-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 2px;
}
#ask .chat-history-head strong { font-size: 13px; }
#ask #chathistorytoggle { display: none; }
#ask #newchat, #ask #chathistorytoggle {
  width: auto;
  padding: 6px 9px;
  background: #fff;
  color: #26312e;
  border: 1px solid #cad2ce;
  border-radius: 5px;
  font-size: 12px;
}
#ask .chat-thread-list { gap: 2px; min-height: 0; overscroll-behavior: contain; }
#ask .chat-thread {
  flex: none;
  width: 100%;
  max-width: none;
  border: 0;
  border-radius: 4px;
  padding: 8px;
  color: #424b47;
}
#ask .chat-thread:hover, #ask .chat-thread[aria-current='true'] {
  color: #203d32;
  background: #e5ece8;
}
#ask .chat-main {
  container-type: size;
  max-width: 880px;
  gap: 0;
  padding: 0 18px 12px;
}
#ask .chat-stream {
  padding: 16px 2px;
  overflow-x: hidden;
  overflow-anchor: none;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  gap: 8px;
}
#chatmessages {
  display: flex;
  flex: 1 0 auto;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}
#ask .chat-message { box-shadow: none; flex: none; border-radius: 8px; }
#ask .chat-assistant { border: 0; padding: 6px 4px; }
#ask .chat-user { background: #edf1ef; color: #1e2924; }
#ask .chat-message strong { color: #4e6057; letter-spacing: 0; }
#ask .chat-welcome p { font-size: 28px; }
#chatprogress { flex: none; padding: 4px; color: #506257; font-size: 12px; }
#ask .chat-dock { position: relative; flex: none; min-width: 0; }
#ask .chat-composer {
  position: relative;
  inset: auto;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 36px 36px;
  align-items: center;
  gap: 4px;
  padding: 4px;
  margin: 0;
  border: 1px solid #a6b4ac;
  border-radius: 8px;
  box-shadow: none;
}
#ask .chat-composer textarea {
  display: block;
  margin: 0;
  height: 36px;
  min-height: 0;
  border: 0;
  padding: 7px 4px;
  font-size: 15px;
  line-height: 22px;
  overflow-y: auto;
}
#ask .chat-composer button {
  display: grid;
  place-items: center;
  padding: 0;
  width: 36px;
  height: 36px;
  border-radius: 6px;
  line-height: 1;
}
#ask :is(.attach-button,.chat-options) { background: transparent; border: 0; color: #314039; font-size: 22px; }
#ask :is(.attach-button,.chat-options):hover, #ask #chatoptions[aria-expanded='true'] { background: #edf1ef; }
#ask .send-button { background: #243d31; color: #fff; }
#ask #attachedfilebar { border: 0; padding: 5px 2px; gap: 6px; justify-content: flex-start; }
#ask #attachmenttray {
  position: absolute;
  bottom: calc(100% + 6px);
  right: 0;
  width: min(310px, 100%);
  max-height: min(320px, 40dvh);
  max-height: min(320px, calc(100cqh - 90px));
  z-index: 4;
  padding: 12px;
  background: #fff;
  border: 1px solid #c4cec7;
  border-radius: 7px;
  overflow: auto;
  overscroll-behavior: contain;
}
#ask .attachment-label { display: block; margin: 3px 0 6px; letter-spacing: 0; }
#ask .chat-language-toggle { justify-content: flex-start; margin-bottom: 10px; }
#ask #choosevision, #ask .ask-document-choice {
  text-align: left;
  font-size: 12px;
  padding: 8px;
  width: 100%;
  overflow-wrap: anywhere;
}
#ask .ask-document-choice { align-items: center; margin: 2px 0; }
#ask .ask-document-choice span { white-space: nowrap; }
#ask #chatdocuments:not(:empty) { border-top: 1px solid #e1e6e3; margin-top: 10px; padding-top: 6px; }
@media (max-width: 650px) {
  #ask .chat-shell { grid-template-columns: minmax(0,1fr); grid-template-rows: auto minmax(0,1fr); }
  #ask .chat-sidebar { position: relative; display: block; padding: 3px 8px; z-index: 5; }
  #ask .chat-history-head strong { display: none; }
  #ask #chathistorytoggle { display: inline-flex; align-items: center; gap: 8px; background: transparent; border-color: transparent; }
  #ask #chathistorytoggle[aria-expanded='true'] span { transform: rotate(180deg); }
  #ask #newchat, #ask #chathistorytoggle { min-height: 36px; }
  #ask .chat-thread-list {
    display: none;
    position: absolute;
    top: 100%;
    left: 5px;
    width: min(280px, calc(100% - 10px));
    max-height: min(240px, 35dvh);
    padding: 4px;
    flex-direction: column;
    overflow: auto;
    border: 1px solid #c4cec7;
    border-radius: 6px;
    background: #fff;
  }
  #ask .chat-sidebar:has(#chathistorytoggle[aria-expanded='true']) .chat-thread-list { display: flex; }
  #ask .chat-main { width: 100%; height: 100%; padding: 0 6px 6px; }
  #ask .chat-stream { padding: 8px 2px; }
  #ask .chat-composer { grid-template-columns: 44px minmax(0,1fr) 44px 44px; gap: 0; padding: 2px; }
  #ask .chat-composer button { width: 44px; height: 44px; }
  #ask .chat-composer textarea { height: 44px; padding: 11px 2px; font-size: 16px; }
}
