.chat-view-widget {
  display: flex;
  flex-direction: column;
  /* Background of the area the chat is docked in, for elements that must be opaque. */
  --chat-ambient-background: var(--theia-editor-background);
}

.theia-side-panel .chat-view-widget {
  --chat-ambient-background: var(--theia-sideBar-background);
}

#theia-bottom-content-panel .chat-view-widget {
  --chat-ambient-background: var(--theia-panel-background);
}

.chat-tree-view-widget {
  flex: 1;
}

.chat-input-widget>.ps__rail-x,
.chat-input-widget>.ps__rail-y {
  display: none !important;
}

.theia-ChatNode {
  cursor: default;
  display: flex;
  flex-direction: column;
  padding: 10px 20px 6px 20px;
  user-select: text;
  -webkit-user-select: text;
  border-bottom: 1px solid var(--theia-sideBarSectionHeader-border);
  overflow-wrap: break-word;
}

div:last-child>.theia-ChatNode {
  border: none;
}

/* Pinned while its node is on screen; opaque to cover the content scrolling underneath. */
.theia-ChatNodeHeader {
  align-items: center;
  display: flex;
  justify-content: space-between;
  height: 24px;
  gap: 8px;
  position: sticky;
  top: 0;
  z-index: 2;
  /* Full-bleed: cancel the node's horizontal padding, then re-apply it. */
  margin: 0 -20px;
  padding: var(--theia-ui-padding) 20px;
  width: auto;
  background-color: var(--chat-ambient-background);
  container-type: scroll-state;
}

/* Shadow only while pinned; without scroll-state query support the header stays flat. */
@container scroll-state(stuck: top) {
  .theia-ChatNodeHeader::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: calc(var(--theia-ui-padding) * 2 / 3);
    pointer-events: none;
    background: linear-gradient(var(--theia-widget-shadow), transparent);
  }
}

.theia-ChatNodeHeader .theia-AgentAvatar {
  pointer-events: none;
  user-select: none;
  font-size: 20px;
}

.theia-ChatNodeHeader .theia-AgentLabel {
  font-size: 13px;
  font-weight: 600;
  margin: 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  /* Keep the agent name for as long as possible: badges shrink first, the name only truncates as a
     last resort (after the badges), and the status never shrinks. */
  flex-shrink: 1;
}

.theia-ChatNodeHeader .theia-ChatContentInProgress {
  display: inline-flex;
  align-items: center;
  gap: calc(var(--theia-ui-padding) / 2);
  /* Always keep the live status visible and anchored to the right, whatever the name/badge length. */
  margin-left: auto;
  flex-shrink: 0;
  white-space: nowrap;
  color: var(--theia-progressBar-background);
}

.theia-ChatNode .codicon {
  text-align: left;
}

.theia-AgentLabel {
  font-weight: 600;
}

/* Prompt variant and model badges share a subtle look; only an edited variant is emphasized. */
.theia-PromptVariantBadge,
.theia-ModelBadge {
  padding: 0 calc(var(--theia-ui-padding) * 2 / 3);
  font-size: var(--theia-ui-font-size0);
  color: var(--theia-descriptionForeground);
  background-color: var(--theia-editor-inactiveSelectionBackground);
  border-radius: calc(var(--theia-ui-padding) * 2 / 3);
  white-space: nowrap;
  user-select: none;
}

.theia-PromptVariantBadge.edited {
  color: var(--theia-editorWarning-foreground);
  background-color: var(--theia-inputValidation-warningBackground);
  border: 1px solid var(--theia-editorWarning-foreground);
}

/* In the crowded header the badges may be long; let both ellipsize together (with equal priority),
   before the agent name and without pushing the live status out. The full text stays available via
   each badge's hover tooltip. */
.theia-ChatNodeHeader .theia-PromptVariantBadge,
.theia-ChatNodeHeader .theia-ModelBadge {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 100;
}

.theia-ChatNode .theia-ChatNodeToolbar {
  margin-left: auto;
  line-height: 18px;
}

.theia-ChatNodeToolbar .theia-ChatNodeToolbarAction {
  display: none;
  align-items: center;
  padding: 4px;
  border-radius: 5px;
}

.theia-ChatNode:hover .theia-ChatNodeToolbar .theia-ChatNodeToolbarAction {
  display: inline-block;
}

.theia-ChatNodeToolbar .theia-ChatNodeToolbarAction:hover {
  cursor: pointer;
  background-color: var(--theia-toolbar-hoverBackground);
}

.theia-ChatNode {
  line-height: 1.3rem;
}

.theia-ChatNode ul,
.theia-ChatNode ol {
  padding-inline-start: 1rem;
}

.theia-ChatNode li>p {
  margin-top: 0;
  margin-bottom: 0;
}

.theia-ChatNode .theia-CodeWrapper {
  padding: 0.5em;
  padding-bottom: 0;
  background-color: var(--theia-editor-background);
  border-radius: 6px;
  border: var(--theia-border-width) solid var(--theia-checkbox-border);
  font-size: var(--theia-code-font-size);
}

.theia-RequestNode>p div {
  display: inline;
}

.theia-RequestNode .theia-RequestNode-AgentLabel,
.theia-RequestNode .theia-RequestNode-VariableLabel,
.theia-RequestNode .theia-RequestNode-FunctionLabel {
  padding: calc(var(--theia-ui-padding) * 2 / 3);
  padding-top: 0px;
  padding-bottom: 0px;
  border-radius: calc(var(--theia-ui-padding) * 2 / 3);
  background: var(--theia-badge-background);
  color: var(--theia-badge-foreground);
}

.theia-RequestNode-ImagePreview {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.theia-RequestNode-ImagePreview-Item {
  border: var(--theia-border-width) solid var(--theia-dropdown-border);
  border-radius: 4px;
  overflow: hidden;
  height: 100px;
  width: 120px;
}

.theia-RequestNode-ImagePreview-Item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.theia-RequestNode-ImagePreview-Inline {
  display: inline-block;
  margin: 4px 0;
}

.theia-RequestNode-Footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
}

.theia-RequestNode-Footer .item {
  opacity: var(--theia-mod-disabled-opacity);
  cursor: default;
  display: flex;
  flex-direction: row;
  column-gap: 0px;
  align-items: center;
}

.theia-RequestNode-Footer .item.enabled {
  cursor: pointer;
  opacity: 1;
}

.theia-RequestNode-Footer :not(.item.enabled) .action-label {
  background: transparent;
  cursor: default;
}

.theia-RequestNode .theia-ChatInput-Editor-Box {
  margin-left: 0px;
  margin-right: 0px;
}

.chat-input-widget {
  align-items: flex-end;
  display: flex;
  flex-direction: column;
}

.theia-ChatInput {
  margin-top: calc(var(--theia-ui-padding) * 8 / 3);
  position: relative;
  width: 100%;
  box-sizing: border-box;
  gap: calc(var(--theia-ui-padding) * 2 / 3);
}

.theia-ChatInput[data-ai-disabled="true"] {
  opacity: var(--theia-mod-disabled-opacity);
  pointer-events: none;
}

.theia-ChatInput[data-ai-disabled="true"] .theia-ChatInput-Editor-Placeholder {
  color: var(--theia-input-disabledForeground);
  font-family: var(--theia-ui-font-family);
}

.theia-ChatInput-ChatContext ul {
  list-style-type: none;
  padding: 0px 4px 8px 8px;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.theia-ChatInput-ChatContext-Element {
  display: flex;
  flex-direction: column;
  border-radius: calc(var(--theia-ui-padding) * 2 / 3);
  border: var(--theia-border-width) solid var(--theia-dropdown-border);
  padding: 2px 4px 2px 6px;
  line-height: 16px;
  min-width: 0;
  user-select: none;
  cursor: pointer;
}

.theia-ChatInput-ChatContext-Element.invalid-file {
  border-color: var(--theia-inputValidation-errorBorder, var(--theia-errorForeground));
  background-color: var(--theia-inputValidation-errorBackground, rgba(255, 0, 0, 0.1));
}

.theia-ChatInput-ChatContext-Element.invalid-file .theia-ChatInput-ChatContext-title {
  text-decoration: line-through;
  color: var(--theia-errorForeground);
}

.invalid-file-icon {
  color: var(--theia-errorForeground);
  margin-right: 4px;
  flex-shrink: 0;
}

.theia-ChatInput-ChatContext-Element.warning-file {
  border-color: var(--theia-inputValidation-warningBorder, var(--theia-editorWarning-foreground));
  background-color: var(--theia-inputValidation-warningBackground, rgba(255, 165, 0, 0.1));
}

.theia-ChatInput-ChatContext-Element.warning-file .theia-ChatInput-ChatContext-title {
  color: var(--theia-editorWarning-foreground);
}

.warning-file-icon {
  color: var(--theia-editorWarning-foreground);
  margin-right: 4px;
  flex-shrink: 0;
}

.theia-ChatInput-ChatContext-Row {
  display: flex;
  align-items: center;
  width: 100%;
  color: var(--theia-foreground);
  font-family: var(--theia-ui-font-family);
}

.theia-ChatInput-ChatContext-labelParts {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.theia-ChatInput-ChatContext-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.theia-ChatInput-ChatContext-additionalInfo {
  color: var(--theia-disabledForeground);
  font-size: calc(var(--theia-content-font-size) * 0.8);
  margin-left: 4px;
  line-height: 18px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.theia-ChatInput-ChatContext-Element .action {
  cursor: pointer;
  margin-left: 4px;
  border-radius: 4px;
  flex-shrink: 0;
}

.theia-ChatInput-ChatContext-Element .action:hover {
  background-color: var(--theia-toolbar-hoverBackground);
}

.theia-ChatInput-ChatContext-Icon {
  display: inline;
  line-height: 18px;
  flex-shrink: 0;
}

.theia-ChatInput-ChatContext-Icon.codicon {
  margin-right: 6px;
}

.theia-ChatInput-ChangeSet-Box {
  margin: 0 16px -5px 16px;
  padding: 2px;
  padding-bottom: 12px;
  height: auto;
  border: var(--theia-border-width) solid var(--theia-dropdown-border);
  border-radius: 4px 4px 0 0;
  background-color: var(--theia-activityBar-background);
  display: flex;
  flex-direction: column;
}

.theia-ChatInput-ChangeSet-Header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 4px;
}

.theia-ChatInput-ChangeSet-Header-Title {
  display: flex;
  align-items: center;
  gap: 4px;
}

.theia-ChatInput-ChangeSet-Toggle {
  cursor: pointer;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.theia-ChatInput-ChangeSet-Toggle:hover {
  background-color: var(--theia-toolbar-hoverBackground);
}

.theia-ChatInput-ChangeSet-Toggle:focus {
  outline: 1px solid var(--theia-focusBorder);
  outline-offset: -1px;
}

.theia-ChatInput-ChangeSet-Box h3 {
  font-size: 12px;
  color: var(--theia-disabledForeground);
  padding-top: 0;
  margin: 0;
}

.theia-ChatInput-ChangeSet-Header-Actions .theia-button {
  height: 100%;
  box-sizing: border-box;
  font-size: 12px;
  padding: 2px 4px;
  min-width: 40px;
  margin: 0;
}

.theia-ChatInput-ChangeSet-List {
  overflow: hidden;
  transition: max-height 0.1s ease-in-out, opacity 0.1s ease-in-out;
}

.theia-ChatInput-ChangeSet-List.expanded {
  max-height: 150px;
  opacity: 1;
  overflow-y: auto;
}

.theia-ChatInput-ChangeSet-List.collapsed {
  max-height: 0;
  opacity: 0;
}

.theia-ChatInput-ChangeSet-List ul {
  list-style-type: none;
  padding: 0;
  margin: 4px;
}

.theia-ChatInput-ChangeSet-List ul li {
  display: flex;
  flex-direction: row;
  line-height: 18px;
  padding: 0;
  padding-top: 2px;
  margin: 0 2px 2px 0px;
  border-radius: 4px;
  position: relative;
}

.theia-ChatInput-ChangeSet-List ul li:hover {
  background-color: var(--theia-toolbar-hoverBackground);
}

.theia-ChatInput-ChangeSet-Actions {
  display: none;
}

.theia-ChatInput-ChangeSet-List ul li {
  cursor: pointer;
}

.theia-ChatInput-ChangeSet-List ul li:hover .theia-ChatInput-ChangeSet-Actions {
  display: flex;
  justify-content: flex-end;
  flex: auto;
  gap: 4px;
}

.theia-ChatInput-ChangeSet-List .theia-ChatInput-ChangeSet-Icon {
  position: relative;
  padding-left: 2px;
  padding-right: 4px;
  min-width: var(--theia-icon-size);
  display: flex;
  justify-content: center;
  align-items: center;
}

.theia-ChatInput-ChangeSet-List .theia-ChatInput-ChangeSet-Icon::before {
  text-align: center;
}

.theia-ChatInput-ChangeSet-List .theia-ChatInput-ChangeSet-Icon.codicon::before {
  font-size: var(--theia-ui-font-size1);
}

.theia-ChatInput-ChangeSet-Actions .action {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.theia-ChatInput-ChangeSet-additionalInfo {
  align-items: center;
  gap: 4px;
  margin-left: 8px;
  color: var(--theia-disabledForeground);
}

.theia-ChatInput-ChangeSet-List .theia-ChatInput-ChangeSet-AdditionalInfo-SuffixIcon {
  font-size: var(--theia-ui-font-size0) px;
  margin-left: 4px;
}

.theia-ChatInput-ChangeSet-labelParts {
  display: flex;
  overflow: hidden;
  text-overflow: ellipsis;
}

.theia-ChatInput-ChangeSet-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.theia-ChatInput-ChangeSet-Header-Actions {
  display: flex;
  flex: none;
  flex-flow: row nowrap;
  gap: var(--theia-ui-padding);
}

.theia-changeSet-Action {
  flex: none;
}

.theia-ChatInput-ChangeSet-Header-Actions,
.theia-ChatInput-ChangeSet-Box h3,
.theia-ChatInput-ChangeSet-additionalInfo {
  display: flex;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.theia-ChatInput-ChangeSet-Header-Actions .codicon.action {
  font-size: 18px;
  height: 20px;
  vertical-align: middle;
  margin-left: 4px;
  border-radius: 4px;
  cursor: pointer;
}

.theia-ChatInput-ChangeSet-Header-Actions .codicon.action:hover {
  background-color: var(--theia-toolbar-hoverBackground);
}

.theia-ChatInput-ChangeSet-title.rejected {
  text-decoration: line-through;
}

.theia-ChatInput-ChangeSet-title.add.pending {
  color: var(--theia-charts-green);
}

.theia-ChatInput-ChangeSet-title.modify.pending {
  color: var(--theia-charts-orange);
}

.theia-ChatInput-ChangeSet-title.delete.pending {
  color: var(--theia-charts-red);
}

.theia-ChatInput-Editor-Box {
  margin: 0 var(--theia-ui-padding) var(--theia-ui-padding) var(--theia-ui-padding);
  padding: calc(var(--theia-ui-padding) / 3);
  height: auto;
  border: var(--theia-border-width) solid var(--theia-dropdown-border);
  border-radius: calc(var(--theia-ui-padding) * 2 / 3);
  background-color: var(--theia-editor-background);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
}

.theia-ChatInput-Editor-Box:has(.monaco-editor.focused) {
  border-color: var(--theia-focusBorder);
}

.theia-ChatInput-Editor-Box .monaco-editor {
  outline-color: var(--theia-editor-background);
}

.theia-ChatInput-Editor {
  width: 100%;
  height: auto;
  display: flex;
  flex-direction: column-reverse;
  overflow: hidden;
  transition: height 0.05s ease-in-out;
  position: relative;
}

.theia-ChatInput-Editor-Placeholder {
  position: absolute;
  top: var(--theia-ui-padding);
  left: calc(var(--theia-ui-padding) * 4 / 3);
  right: 0;
  display: flex;
  align-items: center;
  color: var(--theia-descriptionForeground);
  pointer-events: none;
  z-index: 10;
  text-align: left;
  font-family: var(--theia-ui-font-family);
  line-height: var(--theia-content-line-height);
}

.theia-ChatInput-Editor-Placeholder.hidden {
  display: none;
}

.theia-ChatInput-Editor .monaco-editor {
  display: flex;
  width: 100%;
  height: 100%;
  position: relative;
}

.theia-ChatInput-Editor .monaco-editor .margin,
.theia-ChatInput-Editor .monaco-editor .monaco-editor-background,
.theia-ChatInput-Editor .monaco-editor .inputarea.ime-input {
  padding-left: calc(var(--theia-ui-padding) * 4 / 3) !important;
}

.theia-ChatInput-ImagePreview-Item {
  position: relative;
  border: var(--theia-border-width) solid var(--theia-dropdown-border);
  border-radius: 4px;
  overflow: hidden;
  height: 100px;
  width: 120px;
}

.theia-ChatInput-ChatContext-ImageRow {
  margin-top: 4px;
  width: 100%;
  display: flex;
  justify-content: center;
}

.theia-ChatInput-ImageContext-Element {
  min-width: 150px;
}

.theia-ChatInput-ImagePreview-Item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.theia-ChatInputOptions {
  width: 100%;
  height: 25px;
  padding-left: calc(var(--theia-ui-padding) / 2);
  padding-right: var(--theia-ui-padding);
  display: flex;
  justify-content: space-between;
  color: var(--theia-foreground);
}

.theia-ChatInputOptions .theia-ChatInputOptions-left,
.theia-ChatInputOptions .theia-ChatInputOptions-right {
  display: flex;
  align-items: center;
}

.theia-ChatInputOptions .theia-ChatInputOptions-left {
  order: -1;
  gap: calc(var(--theia-ui-padding) / 3);
  /* Let the group shrink so the model selector can give way to the right group. */
  min-width: 0;
}

.theia-ChatInputOptions .theia-ChatInputOptions-right {
  margin-right: calc(var(--theia-ui-padding) * 4 / 3);
  /* Keep the token usage and send/stop button fully visible. */
  flex-shrink: 0;
}

.theia-ChatInputOptions .option {
  min-width: calc(var(--theia-icon-size) + var(--theia-ui-padding) - 1px);
  height: calc(var(--theia-icon-size) + var(--theia-ui-padding) - 1px);
  padding: calc(var(--theia-ui-padding) / 3);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: calc(var(--theia-ui-padding) / 3);
  /* Keep icon buttons at their natural size so icon and label never overlap. */
  flex-shrink: 0;
  box-sizing: border-box;
  user-select: none;
  background-repeat: no-repeat;
  background-position: center;
  border-radius: calc(var(--theia-ui-padding) * 5 / 6);
  border: var(--theia-border-width) solid transparent;
  cursor: pointer;
  outline: none;
}

.theia-ChatInputOptions .option:focus-visible {
  outline: var(--theia-border-width) solid var(--theia-focusBorder);
  outline-offset: calc(-1 * var(--theia-border-width));
}

.theia-ChatInputOptions .option.disabled {
  cursor: default;
  opacity: var(--theia-mod-disabled-opacity);
  pointer-events: none;
}

.theia-ChatInputOptions .option:hover {
  opacity: 1;
  background-color: var(--theia-toolbar-hoverBackground);
}

.theia-ChatInputOptions .reverse {
  flex-direction: row-reverse;
}

/* Mode and reasoning selectors - compact SelectComponents inside toolbar */
.theia-ChatInput-ModeSelector.theia-select-component,
.theia-ChatInput-ReasoningSelector.theia-select-component {
  min-width: unset;
  min-height: unset;
  height: calc(var(--theia-icon-size) + var(--theia-ui-padding) - 1px);
  padding: 0 calc(var(--theia-ui-padding) * 2 / 3);
  border: var(--theia-border-width) solid transparent;
  box-sizing: border-box;
  background: var(--theia-editor-background);
  font-family: var(--theia-ui-font-family);
  font-size: var(--theia-content-font-size);
  border-radius: calc(var(--theia-ui-padding) * 5 / 6);
  max-width: 150px;
  outline: none;
}

/* Anchor for the off-level slash overlay drawn via ::after. */
.theia-ReasoningLevelSelector.theia-select-component {
  position: relative;
}

.theia-ChatInput-ModeSelector .theia-select-component-chevron,
.theia-ChatInput-ReasoningSelector .theia-select-component-chevron {
  font-size: var(--theia-ui-font-size1);
  margin-left: calc(var(--theia-ui-padding) / 3);
}

.theia-ChatInput-ModeSelector.theia-select-component:hover,
.theia-ChatInput-ReasoningSelector.theia-select-component:hover {
  background-color: var(--theia-toolbar-hoverBackground);
}

.theia-ChatInput-ModeSelector.theia-select-component:focus-visible,
.theia-ChatInput-ReasoningSelector.theia-select-component:focus-visible {
  outline: 1px solid var(--theia-focusBorder);
  outline-offset: -1px;
}

.theia-ChatInput-ModeSelector.disabled,
.theia-ChatInput-ReasoningSelector.disabled {
  opacity: var(--theia-mod-disabled-opacity);
  cursor: default;
  pointer-events: none;
}

/* Wrapper span is the flex item in the options row, so it (not the inner select) carries the shrink
   behaviour; otherwise the inner nowrap label keeps it at full width. Sizes to content (so "Default"
   sits snug to the chevron) up to max-width, then shrinks and ellipsizes the label for long names. */
.theia-ChatInput-ModelSelector-container {
  display: flex;
  flex-shrink: 1;
  min-width: 0;
  max-width: 200px;
}

/* Per-session model selector: shares the compact selector styling. */
.theia-ChatInput-ModelSelector.theia-select-component {
  min-width: 0;
  width: 100%;
  min-height: unset;
  overflow: hidden;
  height: calc(var(--theia-icon-size) + var(--theia-ui-padding) - 1px);
  padding: 0 calc(var(--theia-ui-padding) * 2 / 3);
  border: var(--theia-border-width) solid transparent;
  box-sizing: border-box;
  background: var(--theia-editor-background);
  font-family: var(--theia-ui-font-family);
  font-size: var(--theia-content-font-size);
  border-radius: calc(var(--theia-ui-padding) * 5 / 6);
  outline: none;
}

.theia-ChatInput-ModelSelector .theia-select-component-chevron {
  font-size: var(--theia-ui-font-size1);
  margin-left: calc(var(--theia-ui-padding) / 3);
  /* Keep the arrow visible even when the label is fully ellipsized. */
  flex-shrink: 0;
}

.theia-ChatInput-ModelSelector.theia-select-component:hover {
  background-color: var(--theia-toolbar-hoverBackground);
}

.theia-ChatInput-ModelSelector.theia-select-component:focus-visible {
  outline: 1px solid var(--theia-focusBorder);
  outline-offset: -1px;
}

/* Indicate an active per-session model override with accent-colored text rather than a focus-like border. */
.theia-ChatInput-ModelSelector.session-override .theia-select-component-label {
  color: var(--theia-textLink-foreground);
}

/* The shown model is unavailable (a disabled selection): flag it at a glance without opening the
   dropdown. Keyed off the displayed option, so navigating to a valid model clears it. */
.theia-ChatInput-ModelSelector.theia-select-component-selection-disabled .theia-select-component-label {
  color: var(--theia-errorForeground);
  text-decoration: line-through;
}

.theia-ChatInput-ModelSelector.disabled {
  opacity: var(--theia-mod-disabled-opacity);
  cursor: default;
  pointer-events: none;
}

/* Reasoning level glyphs, shared by the chat input's selector and the AI Configuration view's agent
   detail so a level looks the same wherever it is set. Keyed off `.theia-ReasoningLevelSelector` plus
   `reasoning-level-<level>`; the chat toolbar's own sizing stays on `.theia-ChatInput-ReasoningSelector`.

   Injected inside the select so the icon shares the dropdown's click area, hover/focus styles, and
   visual bounds (no DOM gap, single control). Sized to match the toolbar's other codicons.
   The base glyph is the filled lightbulb (\ea61); per-level overrides below swap glyph, opacity
   or color to give a visual cue that scales with the chosen reasoning intensity. */
.theia-ReasoningLevelSelector.theia-select-component {
  /* Left inset of the glyph, i.e. the control's own left padding. The off-level slash is centered over the
     glyph and has no way to read that padding, so each consumer states it here; the default matches the chat
     toolbar's compact padding. Without this the slash drifts off the bulb in any differently padded host. */
  --theia-reasoning-glyph-inset: calc(var(--theia-ui-padding) * 2 / 3);
}

.theia-ReasoningLevelSelector.theia-select-component::before {
  font-family: codicon;
  content: '\ea61';
  /* codicon-lightbulb (filled) — default for low/medium/high */
  font-size: var(--theia-icon-size);
  line-height: 1;
  margin-right: calc(var(--theia-ui-padding) / 3);
  display: inline-flex;
  align-items: center;
}

/* Off: empty bulb glyph + CSS-drawn diagonal slash overlay (mimics MDI's lightbulb-off). */
.theia-ReasoningLevelSelector.reasoning-level-off::before {
  content: '\ec40';
  /* codicon-lightbulb-empty */
  opacity: 0.85;
}

.theia-ReasoningLevelSelector.reasoning-level-off::after {
  content: '';
  position: absolute;
  /* Center over the ::before icon area: the control's left padding + half the icon width. */
  left: calc(var(--theia-reasoning-glyph-inset) + var(--theia-icon-size) / 2);
  top: 50%;
  width: calc(var(--theia-icon-size) * 0.95);
  height: 1.5px;
  background-color: currentColor;
  border-radius: 1px;
  transform: translate(-50%, -50%) rotate(-45deg);
  pointer-events: none;
  opacity: 0.85;
}

/* None: empty bulb for an explicit request without reasoning. */
.theia-ReasoningLevelSelector.reasoning-level-none::before {
  content: '\ec40';
  opacity: 0.35;
}

/* Minimal: empty (outline only) bulb at low opacity — "on, but barely".
   Lower opacity than `low` so the brightness order matches the level order:
   the crisper outline at full opacity would otherwise read brighter than a filled bulb at 0.55. */
.theia-ReasoningLevelSelector.reasoning-level-minimal::before {
  content: '\ec40';
  /* codicon-lightbulb-empty */
  opacity: 0.5;
}

/* Low: filled bulb, perceptibly more present than minimal. */
.theia-ReasoningLevelSelector.reasoning-level-low::before {
  opacity: 0.7;
}

/* Medium: filled bulb, moderately bright. */
.theia-ReasoningLevelSelector.reasoning-level-medium::before {
  opacity: 0.9;
}

/* High: filled bulb at full opacity, tinted with the warning foreground (warm/yellow). */
.theia-ReasoningLevelSelector.reasoning-level-high::before {
  color: var(--theia-editorWarning-foreground);
}

/* Extra high and maximum: sparkle bulb with increasingly prominent highlighting. */
.theia-ReasoningLevelSelector.reasoning-level-xhigh::before,
.theia-ReasoningLevelSelector.reasoning-level-max::before {
  content: '\ec1f';
  color: var(--theia-editorWarning-foreground);
}

.theia-ReasoningLevelSelector.reasoning-level-max::before {
  text-shadow: 0 0 3px currentColor;
}

/* Auto: lightbulb-sparkle — "the model decides automatically". */
.theia-ReasoningLevelSelector.reasoning-level-auto::before {
  content: '\ec1f';
  /* codicon-lightbulb-sparkle */
}

.theia-CodePartRenderer-root {
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-radius: 4px;
}

.theia-CodePartRenderer-root .monaco-editor {
  outline-color: var(--theia-editor-background);
}

.theia-CodePartRenderer-left {
  flex-grow: 1;
}

.theia-CodePartRenderer-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-left: 2px;
  padding-right: 2px;
}

.theia-CodePartRenderer-right .button {
  margin-left: 2px;
  width: 18px;
  height: 18px;
  padding: 2px;
  border-radius: 5px;
  cursor: pointer;
}

.theia-CodePartRenderer-right .button:hover {
  background-color: var(--theia-toolbar-hoverBackground);
}

.theia-QuestionPartRenderer-root {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--theia-ui-padding);
  border: var(--theia-border-width) solid var(--theia-sideBarSectionHeader-border);
  padding: calc(var(--theia-ui-padding) * 2);
  border-radius: var(--theia-ui-padding);
  margin: 0 0 var(--theia-ui-padding) 0;
}

.theia-QuestionPartRenderer-dismiss {
  position: absolute;
  top: var(--theia-ui-padding);
  right: var(--theia-ui-padding);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--theia-descriptionForeground);
  font-size: var(--theia-ui-font-size1);
  padding: 2px;
  line-height: 1;
  border-radius: calc(var(--theia-ui-padding) * 2 / 3);
}

.theia-QuestionPartRenderer-dismiss:hover {
  color: var(--theia-foreground);
  background-color: var(--theia-toolbar-hoverBackground);
}

.theia-QuestionPartRenderer-header {
  font-weight: 700;
  font-size: var(--theia-ui-font-size0);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--theia-descriptionForeground);
}

.theia-QuestionPartRenderer-question {
  margin-bottom: calc(var(--theia-ui-padding) / 2);
}

.theia-QuestionPartRenderer-options {
  display: flex;
  flex-wrap: wrap;
  gap: var(--theia-ui-padding);
}

.theia-QuestionPartRenderer-options.has-descriptions {
  flex-direction: column;
}

.theia-QuestionPartRenderer-option {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  min-width: 100px;
  flex: 1 1 auto;
  margin: 0;
  padding: var(--theia-ui-padding) calc(var(--theia-ui-padding) * 2);
  border-radius: var(--theia-ui-padding);
  border: var(--theia-border-width) solid var(--theia-sideBarSectionHeader-border);
  background-color: var(--theia-editor-background);
  color: var(--theia-foreground);
  cursor: pointer;
  line-height: 1.4;
}

.theia-QuestionPartRenderer-option:hover:not(:disabled) {
  background-color: var(--theia-list-hoverBackground);
}

.theia-QuestionPartRenderer-option.selected {
  background-color: var(--theia-button-background);
  color: var(--theia-button-foreground);
  border-color: var(--theia-button-background);
}

.theia-QuestionPartRenderer-option.selected:disabled:hover {
  background-color: var(--theia-button-background);
}

.theia-QuestionPartRenderer-option:disabled:not(.selected) {
  opacity: var(--theia-mod-disabled-opacity);
  cursor: default;
}

.theia-QuestionPartRenderer-option-label {
  font-weight: 600;
}

.theia-QuestionPartRenderer-option-description {
  font-size: var(--theia-ui-font-size0);
  opacity: 0.8;
  margin-top: 2px;
}

.theia-QuestionPartRenderer-confirm {
  align-self: flex-end;
  margin-top: calc(var(--theia-ui-padding) / 2);
}

.theia-toolCall,
.theia-thinking {
  font-weight: normal;
  color: var(--theia-descriptionForeground);
  line-height: 20px;
  margin-top: 13px;
  margin-bottom: 13px;
  cursor: pointer;
}

/* Tool confirmation styles */
.theia-tool-confirmation {
  margin: 10px 0;
  padding: 12px;
  border: 1px solid var(--theia-dropdown-border);
  border-radius: 4px;
  background-color: var(--theia-editorWidget-background);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.14);
  cursor: default;
}

.theia-tool-confirmation-intro {
  margin: calc(var(--theia-ui-padding) * 2) 0;
  line-height: var(--theia-content-line-height);
}

.theia-tool-confirmation-intro p {
  margin: 0;
}

.theia-tool-confirmation-header {
  font-weight: bold;
  margin-bottom: 8px;
  color: var(--theia-foreground);
  display: flex;
  align-items: center;
  gap: 6px;
}

.theia-tool-confirmation-info {
  margin-bottom: 12px;
}

.theia-tool-confirmation-name,
.theia-tool-confirmation-args {
  margin-bottom: 4px;
}

.theia-tool-confirmation-name .label,
.theia-tool-confirmation-args .label {
  font-weight: bold;
  margin-right: 6px;
}

.theia-tool-confirmation-description {
  margin: 6px 0 8px 0;
  color: var(--theia-descriptionForeground);
  font-weight: normal;
  max-height: 200px;
  overflow: auto;
}

details.theia-tool-confirmation-name>summary,
details.theia-tool-confirmation-args>summary {
  cursor: pointer;
  user-select: none;
}

details.theia-tool-confirmation-name>summary::marker,
details.theia-tool-confirmation-args>summary::marker {
  color: var(--theia-button-background);
}

.theia-tool-confirmation-args-summary {
  color: var(--theia-descriptionForeground);
}

.theia-tool-confirmation-args-content {
  margin: var(--theia-ui-padding) 0;
  padding: var(--theia-ui-padding) calc(var(--theia-ui-padding) * 2);
  max-height: 200px;
  overflow: auto;
}

.theia-tool-confirmation-args-content p {
  margin: var(--theia-ui-padding) 0;
}

.theia-tool-confirmation-args-content pre {
  margin: var(--theia-ui-padding) 0;
  padding: var(--theia-ui-padding) calc(var(--theia-ui-padding) * 2);
  background-color: var(--theia-textCodeBlock-background);
  border-radius: 3px;
  white-space: pre-wrap;
  word-break: break-word;
  font-weight: normal;
}

.theia-tool-confirmation-args-content code {
  word-break: break-word;
  font-weight: normal;
}

.theia-tool-confirmation-args-content hr {
  border-top: 1px solid var(--theia-editorHoverWidgetInternalBorder);
  border-bottom: 0;
  margin: var(--theia-ui-padding) 0;
}

.theia-tool-confirmation-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.theia-tool-confirmation-split-button {
  display: inline-flex;
  position: relative;
}

.theia-tool-confirmation-main-btn {
  border-top-right-radius: 0 !important;
  border-bottom-right-radius: 0 !important;
  margin-right: 0 !important;
}

.theia-tool-confirmation-chevron-btn {
  border-top-left-radius: 0 !important;
  border-bottom-left-radius: 0 !important;
  width: 24px !important;
  min-width: 24px !important;
  max-width: 24px !important;
  padding: 0 !important;
  margin-left: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

/* Split buttons have no margin between them, so the default outline-offset: 1px
   causes focus outlines to overlap with the adjacent button. Use inset outline instead. */
.theia-tool-confirmation-main-btn:focus,
.theia-tool-confirmation-chevron-btn:focus {
  outline-offset: -2px;
}

.theia-tool-confirmation-deny-reason {
  display: flex;
  flex-direction: column;
  gap: var(--theia-ui-padding);
}

.theia-tool-confirmation-deny-reason-input {
  width: 100%;
  box-sizing: border-box;
}

.theia-tool-confirmation-deny-reason-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--theia-ui-padding);
}

.theia-tool-confirmation-countdown {
  font-size: var(--theia-ui-font-size0);
  opacity: 0.8;
}

.theia-tool-confirmation-status {
  margin: 10px 0;
  padding: 8px;
  border: 1px solid var(--theia-dropdown-border);
  border-radius: 4px;
  background-color: var(--theia-editorWidget-background);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.14);
  display: flex;
  align-items: center;
  gap: 6px;
}

.theia-tool-confirmation-status.allowed {
  border-color: var(--theia-successBackground);
  color: var(--theia-successBackground);
}

.theia-tool-confirmation-status.denied {
  border-color: var(--theia-errorBackground);
  color: var(--theia-errorBackground);
}

.theia-toolCall-denied,
.theia-toolCall-rejected,
.theia-toolCall-unavailable,
.theia-toolCall-finished summary,
.theia-toolCall-allowed,
.theia-toolCall-waiting {
  font-weight: bold;
}

.theia-toolCall-allowed .codicon-loading,
.theia-toolCall-pending .codicon-loading {
  font-size: 1em;
}

/* Small badge marking provider-executed server tools; explained via tooltip on hover. Mirrors the prompt-variant badge style. */
.theia-serverToolCall-badge {
  padding: 0 calc(var(--theia-ui-padding) * 2 / 3);
  font-size: var(--theia-ui-font-size0);
  font-weight: normal;
  color: var(--theia-badge-foreground);
  background-color: var(--theia-badge-background);
  border-radius: calc(var(--theia-ui-padding) * 2 / 3);
  white-space: nowrap;
  user-select: none;
}

.theia-toolCall-pending {
  color: var(--theia-descriptionForeground);
}

.theia-toolCall-denied,
.theia-toolCall-rejected {
  color: var(--theia-errorForeground);
  cursor: default;
}

.theia-toolCall-unavailable {
  color: var(--theia-editorWarning-foreground);
  cursor: default;
}

.theia-toolCall-response-result {
  font-weight: normal;
}

.theia-toolCall .fa,
.theia-toolCall details summary::marker,
.theia-thinking .fa,
.theia-thinking details summary::marker {
  color: var(--theia-button-background);
}

.theia-toolCall details pre,
.theia-thinking details pre {
  cursor: text;
  line-height: 1rem;
  margin-top: 0;
  margin-bottom: 0;
  padding: 6px;
  background-color: var(--theia-editor-background);
  overflow: auto;
  text-wrap: auto;
}

.theia-thinking.active {
  cursor: default;
}

.theia-thinking-status {
  display: flex;
  align-items: center;
  gap: calc(var(--theia-ui-padding) / 2);
}

/* Registered so that the fade can be transitioned. */
@property --theia-thinking-preview-fade {
  syntax: '<length>';
  inherits: false;
  initial-value: 0px;
}

/* Last lines of the reasoning, anchored to the bottom and clipped at the top. */
.theia-thinking-preview {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  max-height: 3lh;
  margin-left: calc(var(--theia-icon-size) + var(--theia-ui-padding) / 2);
  overflow: hidden;
  user-select: none;
  mask-image: linear-gradient(to bottom, transparent, black var(--theia-thinking-preview-fade));
  transition: --theia-thinking-preview-fade 600ms ease-out;
}

.theia-thinking-preview-text {
  flex-shrink: 0;
  overflow-wrap: anywhere;
}

.theia-thinking-preview.overflowing {
  --theia-thinking-preview-fade: 1lh;
}

.theia-toolCall-args-label {
  font-weight: normal;
  color: var(--theia-descriptionForeground);
}

.theia-ResponseNode-ProgressMessage {
  font-weight: normal;
  color: var(--theia-descriptionForeground);
  line-height: 20px;
  margin-bottom: 6px;
}

.theia-ResponseNode-ProgressMessage .inProgress {
  color: var(--theia-progressBar-background);
}

.theia-ResponseNode-ProgressMessage .completed {
  color: var(--theia-successBackground);
}

.theia-ResponseNode-ProgressMessage .failed {
  color: var(--theia-errorForeground);
}

.spinner {
  display: inline-block;
  animation: spin 2s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

.theia-ChatPart-Error {
  margin-block: 1em;
}

.theia-ChatPart-Error-headline {
  color: var(--theia-errorForeground);
  display: flex;
  flex-direction: column;
  row-gap: var(--theia-ui-padding);
}

.theia-ChatPart-Error-prefix {
  font-weight: bold;
  display: flex;
  align-items: center;
  gap: var(--theia-ui-padding);
}

.theia-ChatPart-Error details {
  margin-top: var(--theia-ui-padding);
  color: var(--theia-descriptionForeground);
}

.theia-ChatPart-Error details summary::marker {
  color: var(--theia-button-background);
}

.theia-ChatPart-Error details pre {
  cursor: text;
  line-height: 1rem;
  margin: 0;
  padding: 6px;
  background-color: var(--theia-editor-background);
  overflow: auto;
  text-wrap: auto;
}

.section-header {
  font-weight: bold;
  font-size: 16px;
  margin-bottom: 10px;
}

.section-title {
  font-weight: bold;
  font-size: 14px;
  margin: 20px 0px;
}

.section-content p {
  margin: 10px 0;
}

.section-content a {
  cursor: pointer;
}

.section-content strong {
  font-weight: bold;
}

.session-settings-container {
  display: flex;
  flex-direction: column;
}

.monaco-session-settings-dialog {
  min-width: 400px;
}

.session-settings-error {
  color: var(--theia-errorForeground);
  min-height: 1em;
  display: block;
}

.session-settings-container .monaco-editor {
  outline-color: var(--theia-editor-background);
}

.session-settings-section-header {
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 4px;
  color: var(--theia-foreground);
}

.session-settings-section-note {
  font-size: 12px;
  color: var(--theia-descriptionForeground);
  margin-bottom: 8px;
}

.session-settings-checkbox-container {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.session-settings-checkbox-container input[type="checkbox"] {
  cursor: pointer;
}

.session-settings-checkbox-container label {
  cursor: pointer;
  user-select: none;
}

.session-settings-confirmation-timeout {
  padding: 8px 0;
  border-bottom: 1px solid var(--theia-sideBarSectionHeader-border);
  margin-bottom: 8px;
}

.session-settings-timeout-container {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 22px;
}

.session-settings-timeout-container label {
  white-space: nowrap;
}

.session-settings-timeout-container label.disabled {
  color: var(--theia-disabledForeground);
}

.session-settings-timeout-container input[type="number"],
.session-settings-compaction-threshold-container input[type="number"] {
  width: 100px;
  padding: 4px 8px;
  border: 1px solid var(--theia-input-border);
  border-radius: 4px;
  background-color: var(--theia-input-background);
  color: var(--theia-input-foreground);
}

.session-settings-compaction-threshold-container {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.session-settings-timeout-container input[type="number"]:disabled {
  opacity: var(--theia-mod-disabled-opacity);
  cursor: not-allowed;
}

.session-settings-advanced {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.session-settings-editor-container {
  height: 150px;
}

.chat-agent-suggestions {
  padding-inline: 16px;
  padding-block-end: 8px;
  user-select: none;
}

/* Delegation response styles */
.theia-delegation-container {
  border: var(--theia-border-width) solid var(--theia-sideBarSectionHeader-border);
  border-radius: var(--theia-ui-padding);
  margin: var(--theia-ui-padding) 0;
  background-color: var(--theia-sideBar-background);
}

.delegation-response-details {
  width: 100%;
}

.delegation-summary {
  cursor: pointer;
  padding: var(--theia-ui-padding);
  background-color: var(--theia-editorGroupHeader-tabsBackground);
  border-radius: var(--theia-ui-padding) var(--theia-ui-padding) 0 0;
  border-bottom: var(--theia-border-width) solid var(--theia-sideBarSectionHeader-border);
  list-style: none;
  position: relative;
}

.delegation-summary:focus {
  outline-offset: 0;
}

.delegation-summary:hover {
  background-color: var(--theia-toolbar-hoverBackground);
}

.delegation-toggle-arrow::before {
  content: "\25BC";
  transition: transform 0.2s ease;
  display: inline-block;
  transform: rotate(-90deg);
}

.delegation-toggle-arrow.open::before {
  transform: rotate(0deg);
}

.delegation-toggle-arrow {
  color: var(--theia-descriptionForeground);
  font-size: var(--theia-ui-font-size1);
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.delegation-response-details:not([open]) .delegation-summary {
  border-bottom: none;
  border-radius: var(--theia-ui-padding);
}

.delegation-summary::-webkit-details-marker {
  display: none;
}

.delegation-summary::marker {
  content: "";
}

.delegation-header {
  display: flex;
  align-items: center;
  width: 100%;
  gap: var(--theia-ui-padding);
}

.delegation-agent {
  flex: 1;
  /* Takes up available space */
  font-size: var(--theia-ui-font-size1);
  color: var(--theia-foreground);
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: var(--theia-ui-padding);
}

.delegation-status {
  display: flex;
  align-items: center;
  gap: var(--theia-ui-padding);
  font-size: var(--theia-ui-font-size1);
}

.delegation-status-icon {
  font-size: var(--theia-icon-size);
}

.delegation-status-icon.codicon-loading {
  animation: spin 2s linear infinite;
  color: var(--theia-progressBar-background);
}

.delegation-status-icon.codicon-check {
  color: var(--theia-charts-green);
}

.delegation-status-icon.codicon-error {
  color: var(--theia-errorForeground);
}

.delegation-status-icon.codicon-close {
  color: var(--theia-descriptionForeground);
}

.delegation-status-text {
  color: var(--theia-descriptionForeground);
  font-weight: normal;
}

.delegation-cancel-button {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--theia-descriptionForeground);
  padding: 2px 4px;
  display: inline-flex;
  align-items: center;
}

.delegation-cancel-button:hover {
  color: var(--theia-errorForeground);
}

.delegation-cancel-button .codicon {
  font-size: var(--theia-icon-size);
}

.delegation-content {
  padding: var(--theia-ui-padding);
}

.delegation-prompt-section {
  margin-bottom: var(--theia-ui-padding);
  padding-bottom: var(--theia-ui-padding);
  border-bottom: var(--theia-border-width) solid var(--theia-sideBarSectionHeader-border);
}

.delegation-prompt {
  margin-top: var(--theia-ui-padding);
  padding: var(--theia-ui-padding);
  background-color: var(--theia-editor-background);
  border-radius: var(--theia-ui-padding);
  border: var(--theia-border-width) solid var(--theia-dropdown-border);
  font-style: italic;
  color: var(--theia-descriptionForeground);
}

.delegation-response-section {
  margin-top: var(--theia-ui-padding);
}

.delegation-response-section>strong {
  display: block;
  margin-bottom: var(--theia-ui-padding);
  color: var(--theia-foreground);
}

.delegation-interaction-badge {
  color: var(--theia-editorWarning-foreground);
  display: flex;
  align-items: center;
}

.delegation-pending-confirmations {
  margin-top: var(--theia-ui-padding);
  padding-top: var(--theia-ui-padding);
  border-top: var(--theia-border-width) solid var(--theia-sideBarSectionHeader-border);
}

.delegation-pending-confirmations .theia-tool-confirmation {
  margin: 0;
  margin-bottom: var(--theia-ui-padding);
}

.delegation-pending-confirmations .theia-tool-confirmation:last-child {
  margin-bottom: 0;
}

.delegation-response-placeholder {
  margin-top: var(--theia-ui-padding);
  min-height: calc(var(--theia-ui-padding) * 6);
}

/* ChatTree scroll-to-bottom floating button */
.theia-ChatTree-ScrollToBottom {
  position: absolute;
  right: 16px;
  bottom: 16px;
  z-index: 10;
  width: 32px;
  height: 32px;
  border-radius: 16px;
  border: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  background: var(--theia-layoutColor3, #ececec);
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 20px;
  opacity: 0.7;
  color: var(--theia-button-background, #007acc);
  transition: opacity 0.18s, background 0.2s, color 0.2s;
}

.theia-ChatTree-ScrollToBottom:hover {
  opacity: 1;
  background: var(--theia-button-background, #007acc);
  color: var(--theia-button-foreground, #fff);
}

.theia-blocked-resource-wrapper {
  display: inline-flex;
  flex-direction: column;
  gap: calc(var(--theia-ui-padding) / 2);
  max-width: 100%;
}

.theia-blocked-resource {
  display: inline-flex;
  align-items: center;
  gap: var(--theia-ui-padding);
  max-width: 100%;
  box-sizing: border-box;
  padding: calc(var(--theia-ui-padding) * 2 / 3) var(--theia-ui-padding);
  border: var(--theia-border-width) solid var(--theia-input-border, var(--theia-sideBarSectionHeader-border));
  border-radius: 4px;
  background-color: var(--theia-editorWidget-background);
  color: var(--theia-foreground);
  vertical-align: middle;
}

.theia-blocked-resource-icon {
  flex: 0 0 auto;
  color: var(--theia-editorWarning-foreground);
}

.theia-blocked-resource-label {
  min-width: 0;
}

.theia-blocked-resource-details {
  min-width: 0;
  color: var(--theia-descriptionForeground);
}

.theia-blocked-resource-details summary {
  cursor: pointer;
}

.theia-blocked-resource-details ul {
  margin: 2px 0 0 0;
  padding-left: 16px;
}

.theia-blocked-resource-details li {
  word-break: break-all;
}

.theia-blocked-resource-url {

  color: var(--theia-descriptionForeground);
  word-break: break-all;
}

.theia-blocked-resource-allow {
  flex: 0 0 auto;
  padding: 2px calc(var(--theia-ui-padding) * 2);
  border: none;
  border-radius: 3px;
  background-color: var(--theia-button-secondaryBackground);
  color: var(--theia-button-secondaryForeground);
  cursor: pointer;
  font-family: var(--theia-ui-font-family);
  font-size: var(--theia-ui-font-size1);
}

.theia-blocked-resource-allow:hover {
  background-color: var(--theia-button-secondaryHoverBackground);
}

/* Unknown content styles */
.theia-chat-unknown-content {
  margin: 4px 0;
}

.theia-chat-unknown-content-warning {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: var(--theia-ui-padding);
  background-color: var(--theia-warningBackground);
  border: 1px solid var(--theia-warningBorder);
  border-radius: 3px;
  color: var(--theia-warningForeground);
  font-size: 0.9em;
  margin-bottom: 8px;
}

.theia-chat-unknown-content-warning i {
  flex-shrink: 0;
}

.theia-chat-unknown-content-fallback {
  color: var(--theia-foreground);
  font-family: var(--theia-code-font-family);
  white-space: pre-wrap;
}

/* Scrollable hover for large tool call arguments */
.theia-hover.toolcall-args-hover>div {
  max-height: 400px;
  max-width: 600px;
  overflow-y: auto;
  overflow-x: hidden;
}

/* Code blocks inside tool call hovers: constrain and scroll. */
.theia-hover.toolcall-args-hover pre {
  max-height: 200px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  margin: var(--theia-ui-padding) 0;
  padding: var(--theia-ui-padding) calc(var(--theia-ui-padding) * 2);
  border-radius: 3px;
  background-color: var(--theia-textCodeBlock-background);
}

/* Reset code background inside pre to avoid double semi-transparent layers
   (.theia-hover code in hover-service.css sets the same background) */
.theia-hover.toolcall-args-hover pre code {
  background-color: transparent;
}

/* Inline code styling */
.theia-hover.toolcall-args-hover code:not(pre code) {
  padding: 1px var(--theia-ui-padding);
  border-radius: 3px;
  background-color: var(--theia-textCodeBlock-background);
  word-break: break-all;
  font-family: var(--theia-code-font-family);
}

/* Spacing between arg sections - uses internal border like hover-service.css */
.theia-hover.toolcall-args-hover hr {
  border-top: 1px solid var(--theia-editorHoverWidgetInternalBorder);
  border-bottom: 0;
  margin: var(--theia-ui-padding) 0;
}

/* Collapsible Section — subtle separator-label for config area sections */
.theia-ChatInput-CapabilitiesSection {
  border-top: var(--theia-border-width) solid color-mix(in srgb, var(--theia-panel-border) 50%, transparent);
  margin-top: var(--theia-ui-padding);
  padding-top: calc(var(--theia-ui-padding) / 3);
}

.theia-ChatInput-CapabilitiesSection-heading {
  padding: calc(var(--theia-ui-padding) / 2) calc(var(--theia-ui-padding) / 3);
  padding-bottom: var(--theia-ui-padding);
  color: var(--theia-descriptionForeground);
  font-size: var(--theia-ui-font-size1);
  font-family: var(--theia-ui-font-family);
  user-select: none;
}


/* Capability Chips — inline toggles inside editor box, styled like search option buttons */
.theia-ChatInput-CapabilityChips {
  display: flex;
  flex-wrap: wrap;
  gap: calc(var(--theia-ui-padding) * 2 / 3);
  padding: calc(var(--theia-ui-padding) * 2 / 3) calc(var(--theia-ui-padding) * 4 / 3);
  max-height: 84px;
  overflow-y: auto;
}

.theia-ChatInput-CapabilityChip {
  display: inline-flex;
  align-items: center;
  border-radius: calc(var(--theia-ui-padding) * 2 / 3);
  border: var(--theia-border-width) solid var(--theia-dropdown-border);
  padding: calc(var(--theia-ui-padding) / 3) var(--theia-ui-padding);
  line-height: var(--theia-icon-size);
  font-size: var(--theia-ui-font-size1);
  color: var(--theia-foreground);
  cursor: pointer;
  user-select: none;
  outline: none;
  white-space: nowrap;
  margin: 1px 0px;
}

.theia-ChatInput-CapabilityChip.checked {
  border-color: var(--theia-inputOption-activeBorder);
  background-color: var(--theia-inputOption-activeBackground);
}

.theia-ChatInput-CapabilityChip-icon {
  font-size: var(--theia-statusBar-font-size);
  margin-right: calc(var(--theia-ui-padding) / 2);
}

.theia-ChatInput-CapabilityChip:hover:not(.chip-disabled):not(.checked) {
  background-color: var(--theia-toolbar-hoverBackground);
}

.theia-ChatInput-CapabilityChip:focus-visible {
  outline: 1px solid var(--theia-focusBorder);
  outline-offset: -1px;
}

.theia-ChatInput-CapabilityChip.checked:focus-visible {
  outline-width: 2px;
}

.theia-ChatInput-CapabilityChip.chip-disabled {
  opacity: var(--theia-mod-disabled-opacity);
  cursor: default;
  pointer-events: none;
}

.theia-ChatInputOptions .option.toggled {
  border: var(--theia-border-width) var(--theia-inputOption-activeBorder) solid;
  background-color: var(--theia-inputOption-activeBackground);
}

.theia-ChatInputOptions .option {
  position: relative;
}

.theia-capabilities-badge-dot {
  position: absolute;
  top: var(--theia-border-width);
  right: var(--theia-border-width);
  width: var(--theia-ui-padding);
  height: var(--theia-ui-padding);
  border-radius: 50%;
  background-color: var(--theia-activityBarBadge-background);
  pointer-events: none;
}

/* Unsaved changes indicator - small dot on tools icon when panel is collapsed */
.theia-capabilities-unsaved-indicator {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--theia-activityBarBadge-background);
  pointer-events: none;
}

/* Generic Capabilities Section */
.theia-ChatInput-GenericCapabilitiesSection {
  border-top: var(--theia-border-width) solid color-mix(in srgb, var(--theia-panel-border) 50%, transparent);
  margin-top: var(--theia-ui-padding);
  padding-top: calc(var(--theia-ui-padding) / 3);
}

.theia-ChatInput-GenericCapabilitiesSection-heading {
  padding: calc(var(--theia-ui-padding) / 2) calc(var(--theia-ui-padding) / 3);
  padding-bottom: var(--theia-ui-padding);
  color: var(--theia-descriptionForeground);
  font-size: var(--theia-ui-font-size1);
  font-family: var(--theia-ui-font-family);
  user-select: none;
}

/* Generic Capabilities Tree — fixed height so filtering doesn't grow the panel */
.theia-GenericCapabilities-Tree {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 250px;
}

.theia-GenericCapabilities-Tree.disabled {
  opacity: var(--theia-mod-disabled-opacity);
  pointer-events: none;
}

/* Search/filter bar — replicates settings search input (preferences-searchbar-widget) */
.theia-GenericCapabilities-Tree-SearchContainer {
  display: flex;
  align-items: center;
  position: relative;
  margin-bottom: calc(var(--theia-ui-padding) / 2);
  flex-shrink: 0;
}

.theia-GenericCapabilities-Tree-SearchInput {
  flex: 1;
  text-indent: calc(var(--theia-ui-padding) + 2px);
  padding: 2px 0;
  min-height: 22px;
  box-sizing: border-box;
  border: var(--theia-border-width) solid var(--theia-dropdown-border);
}

/* Hide native clear button */
.theia-GenericCapabilities-Tree-SearchInput::-webkit-search-decoration,
.theia-GenericCapabilities-Tree-SearchInput::-webkit-search-cancel-button {
  display: none;
}

.theia-GenericCapabilities-Tree-SearchActions {
  height: 20px;
  align-items: center;
  position: absolute;
  z-index: 1;
  right: calc(var(--theia-ui-padding) + 3px);
  display: flex;
}

.theia-GenericCapabilities-Tree-SearchAction {
  width: 18px;
  height: 18px;
  margin: 0 1px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  user-select: none;
  border: var(--theia-border-width) solid transparent;
  opacity: 0.7;
  cursor: pointer;
  appearance: none;
  background-color: transparent;
  padding: 0;
  font: inherit;
  color: inherit;
}

.theia-GenericCapabilities-Tree-SearchAction:hover {
  background-color: var(--theia-toolbar-hoverBackground);
  opacity: 1;
}

/* Tree content */
.theia-GenericCapabilities-Tree-Content {
  flex: 1;
  overflow-y: auto;
  outline: none;
}

.theia-GenericCapabilities-Tree-Content:focus-visible {
  outline: 1px solid var(--theia-focusBorder);
  outline-offset: -1px;
}

.theia-GenericCapabilities-Tree-Empty {
  padding: var(--theia-ui-padding);
  color: var(--theia-descriptionForeground);
  font-style: italic;
  text-align: center;
}

/* Tree node (root or group) */
.theia-GenericCapabilities-TreeNode {
  user-select: none;
}

.theia-GenericCapabilities-TreeNode.root {
  border-bottom: var(--theia-border-width) solid var(--theia-dropdown-border);
}

.theia-GenericCapabilities-TreeNode.root:last-child {
  border-bottom: none;
}

.theia-GenericCapabilities-TreeNodeHeader {
  display: flex;
  align-items: center;
  gap: calc(var(--theia-ui-padding) / 2);
  padding: calc(var(--theia-ui-padding) / 2) var(--theia-ui-padding);
  padding-left: var(--tree-indent, var(--theia-ui-padding));
  cursor: pointer;
  outline: none;
}

.theia-GenericCapabilities-TreeNode.root>.theia-GenericCapabilities-TreeNodeHeader {
  background-color: var(--theia-sideBarSectionHeader-background);
}

.theia-GenericCapabilities-TreeNode.group>.theia-GenericCapabilities-TreeNodeHeader {
  background-color: color-mix(in srgb, var(--theia-sideBarSectionHeader-background) 50%, transparent);
  font-size: var(--theia-ui-font-size1);
}

.theia-GenericCapabilities-TreeNodeHeader:hover {
  background: var(--theia-list-hoverBackground);
  color: var(--theia-list-hoverForeground);
}

/* Selected (focused) header — active when tree has focus */
.theia-GenericCapabilities-Tree-Content:focus-within .theia-GenericCapabilities-TreeNodeHeader.theia-mod-selected {
  background: var(--theia-list-activeSelectionBackground);
  color: var(--theia-list-activeSelectionForeground);
  outline: 1px solid var(--theia-focusBorder);
  outline-offset: -1px;
}

/* Selected header — inactive when tree lacks focus */
.theia-GenericCapabilities-TreeNodeHeader.theia-mod-selected {
  background: var(--theia-list-inactiveSelectionBackground);
  color: var(--theia-list-inactiveSelectionForeground);
}

.theia-GenericCapabilities-TreeNode-Chevron {
  flex-shrink: 0;
  font-size: var(--theia-ui-font-size1);
}

.theia-GenericCapabilities-TreeNode-Name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--theia-ui-font-size1);
}

/* Tree item (leaf) */
.theia-GenericCapabilities-TreeItem {
  display: flex;
  align-items: center;
  gap: var(--theia-ui-padding);
  padding: calc(var(--theia-ui-padding) / 2) var(--theia-ui-padding);
  padding-left: var(--tree-indent, var(--theia-ui-padding));
  cursor: pointer;
  user-select: none;
  outline: none;
}

.theia-GenericCapabilities-TreeItem:hover:not(.theia-mod-disabled) {
  background: var(--theia-list-hoverBackground);
  color: var(--theia-list-hoverForeground);
}

/* Selected (focused) item — active when tree has focus */
.theia-GenericCapabilities-Tree-Content:focus-within .theia-GenericCapabilities-TreeItem.theia-mod-selected {
  background: var(--theia-list-activeSelectionBackground);
  color: var(--theia-list-activeSelectionForeground);
  outline: 1px solid var(--theia-focusBorder);
  outline-offset: -1px;
}

/* Selected item — inactive when tree lacks focus */
.theia-GenericCapabilities-TreeItem.theia-mod-selected {
  background: var(--theia-list-inactiveSelectionBackground);
  color: var(--theia-list-inactiveSelectionForeground);
}

.theia-GenericCapabilities-TreeItem.theia-mod-disabled {
  opacity: var(--theia-mod-disabled-opacity);
  cursor: default;
}

.theia-GenericCapabilities-TreeItem-Checkbox {
  flex-shrink: 0;
}

.theia-GenericCapabilities-TreeItem-Name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--theia-ui-font-size1);
  padding-bottom: 1px;
  margin-bottom: -1px;
}

/* Warning icon shown before each provider server tool entry. */
.theia-GenericCapabilities-ServerTool-Warning {
  color: var(--theia-editorWarning-foreground);
  margin-right: 4px;
  flex-shrink: 0;
}

/* Two-column capabilities panel layout */
.theia-ChatInput-CapabilitiesPanel {
  display: flex;
  flex-direction: row;
  gap: var(--theia-ui-padding);
  border-bottom: 1px solid color-mix(in srgb, var(--theia-panel-border) 50%, transparent);
  padding: var(--theia-ui-padding);
  position: relative;
}

/* Save button container in capabilities panel - always rendered inline with Generic Capabilities heading */
.theia-ChatInput-CapabilitiesPanel-SaveButton {
  position: absolute;
  top: var(--theia-ui-padding);
  right: var(--theia-ui-padding);
  display: flex;
  align-items: center;
}

.theia-ChatInput-CapabilitiesPanel-SaveButton .theia-button {
  height: 100%;
  box-sizing: border-box;
  font-size: var(--theia-ui-font-size1);
  padding: calc(var(--theia-ui-padding) / 3) calc(var(--theia-ui-padding) * 2 / 3);
  min-width: 40px;
  margin: 0;
}

.theia-ChatInput-CapabilitiesPanel-SaveButton .theia-button:disabled:hover {
  background-color: var(--theia-button-disabledBackground);
  cursor: default;
}

.theia-ChatInput-CapabilitiesPanel-Left {
  flex: 0 0 auto;
  min-width: 120px;
  max-width: 200px;
}

.theia-ChatInput-CapabilitiesPanel-Divider {
  width: 1px;
  background-color: var(--theia-panel-border);
  margin: 0 calc(var(--theia-ui-padding) / 2);
}

.theia-ChatInput-CapabilitiesPanel-Right {
  flex: 1;
  min-width: 0;
}

/* Override chip layout to be vertical in left panel */
.theia-ChatInput-CapabilitiesPanel-Left .theia-ChatInput-CapabilitiesSection {
  border-top: none;
  margin-top: 0;
  padding-top: 0;
}

.theia-ChatInput-CapabilitiesPanel-Left .theia-ChatInput-CapabilityChips {
  flex-direction: column;
  max-height: 280px;
  padding: 0;
}

/* Override generic capabilities section in right panel */
.theia-ChatInput-CapabilitiesPanel-Right .theia-ChatInput-GenericCapabilitiesSection {
  border-top: none;
  margin-top: 0;
  padding-top: 0;
}

.theia-ChatInput-CapabilitiesPanel-Right .theia-GenericCapabilities-Tree {
  height: 280px;
}

/* Tree checkbox styling - use native inputs aligned with settings checkboxes */
.theia-GenericCapabilities-TreeNode-Checkbox,
.theia-GenericCapabilities-TreeItem-Checkbox {
  flex-shrink: 0;
  margin: 0;
  cursor: pointer;
}

.theia-GenericCapabilities-Tree-SearchAction:focus-visible {
  border-color: var(--theia-focusBorder);
  opacity: 1;
}

/* Capabilities Collapsed Bar - horizontal scrollable chip row */
.theia-capabilities-collapsed-bar {
  display: flex;
  flex-direction: row;
  align-items: center;
  padding: calc(var(--theia-ui-padding) / 2) calc(var(--theia-ui-padding) * 4 / 3);
  min-width: 0;
}

/* Capabilities quick bar - horizontal scrollable chip container */
.theia-capabilities-collapsed-scrollbar {
  flex: 1;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: calc(var(--theia-ui-padding) * 2 / 3);
  min-width: 0;
  overflow-x: scroll;
  overflow-y: hidden;
  min-height: calc(var(--theia-content-line-height) + var(--theia-ui-padding) / 3);
}

/* Thin overlay scrollbar, always reserves space but thumb only visible on hover */
.theia-capabilities-collapsed-scrollbar::-webkit-scrollbar {
  height: calc(var(--theia-ui-padding) / 2);
}

.theia-capabilities-collapsed-scrollbar::-webkit-scrollbar-thumb {
  background-color: transparent;
  border-radius: calc(var(--theia-ui-padding) / 2);
}

.theia-capabilities-collapsed-scrollbar:hover::-webkit-scrollbar-thumb {
  background-color: var(--theia-scrollbarSlider-background);
}

.theia-capabilities-collapsed-scrollbar::-webkit-scrollbar-thumb:hover {
  background-color: var(--theia-scrollbarSlider-hoverBackground);
}

/* Token usage: border tinting on warning/error (repeated with :has for focus specificity) */
.theia-ChatInput-Editor-Box.token-usage-border-token-usage-yellow,
.theia-ChatInput-Editor-Box.token-usage-border-token-usage-yellow:has(.monaco-editor.focused) {
  border-color: var(--theia-warningBackground);
}

.theia-ChatInput-Editor-Box.token-usage-border-token-usage-red,
.theia-ChatInput-Editor-Box.token-usage-border-token-usage-red:has(.monaco-editor.focused) {
  border-color: var(--theia-errorBackground);
}

/* Token usage badge next to send button */
.token-usage-badge {
  cursor: default;
  display: flex;
  align-items: center;
  margin-right: calc(var(--theia-ui-padding) / 2);
  --token-usage-fill: var(--theia-descriptionForeground);
  --token-usage-track: color-mix(in srgb, var(--theia-foreground) 12%, transparent);
}

.token-usage-badge.token-usage-yellow {
  --token-usage-fill: var(--theia-warningBackground);
}

.token-usage-badge.token-usage-red {
  --token-usage-fill: var(--theia-errorBackground);
}

/* Circular progress ring */
.token-usage-ring {
  width: var(--theia-icon-size);
  height: var(--theia-icon-size);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.token-usage-ring-inner {
  width: 75%;
  height: 75%;
  border-radius: 50%;
  background: var(--theia-editor-background);
}

.theia-ChatCompactionMarker {
  width: 100%;
  margin: 6px 0;
  padding: 4px 8px;
  border-top: 1px solid var(--theia-editorWidget-border);
  border-bottom: 1px solid var(--theia-editorWidget-border);
  color: var(--theia-descriptionForeground);
  font-size: var(--theia-ui-font-size0);
}

.theia-ChatCompactionMarker summary {
  cursor: pointer;
}

.theia-ChatCompactionMarker-summary {
  margin-top: 4px;
  white-space: pre-wrap;
}
