/* ==========================================================================
   composer.css: the single chat composer, context chips, routing indicator,
   autocomplete popover and the reply peek card.
   ========================================================================== */

.ms-composer-dock {
  position: relative;
  flex: 0 0 auto;
  z-index: 5;
  background: var(--vscode-panel-background);
  border-top: 1px solid var(--vscode-panel-border);
}

.ms-composer {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 5px 10px 6px;
  min-height: var(--ms-h-composer-min);
}
.ms-composer > .ms-progress { top: -1px; }

.ms-composer-chips {
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 20px;
  min-width: 0;
  overflow: hidden;
  flex-wrap: nowrap;
}
.ms-ctx-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 20px;
  max-width: 260px;
  padding: 0 2px 0 6px;
  border: 1px solid var(--vscode-widget-border);
  border-radius: 10px;
  background: var(--vscode-editorWidget-background);
  color: var(--vscode-foreground);
  font-size: var(--ms-fs-small);
  white-space: nowrap;
  flex: 0 0 auto;
}
.ms-ctx-chip .codicon { font-size: 12px; opacity: .85; }
.ms-ctx-chip .ms-chip-label { overflow: hidden; text-overflow: ellipsis; }
.ms-ctx-chip .ms-chip-kind { color: var(--vscode-descriptionForeground); }
.ms-ctx-chip .ms-chip-x {
  border: 0; background: transparent; color: var(--vscode-descriptionForeground);
  width: 16px; height: 16px; border-radius: 8px; padding: 0;
  display: inline-grid; place-items: center;
}
.ms-ctx-chip .ms-chip-x:hover { background: var(--vscode-toolbar-hoverBackground); color: var(--vscode-foreground); }
.ms-ctx-chip.is-scope { border-color: var(--vscode-inputOption-activeBorder); }
.ms-ctx-chip.is-muted { opacity: .7; }
.ms-chips-hint { color: var(--vscode-descriptionForeground); font-size: var(--ms-fs-tiny); margin-left: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ms-composer.is-drop-target { outline: 1px dashed var(--vscode-focusBorder); outline-offset: -3px; }

.ms-composer-row {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  min-width: 0;
}

.ms-composer-input-wrap {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: stretch;
  border: 1px solid var(--vscode-input-border, transparent);
  border-radius: 6px;
  background: var(--vscode-input-background);
}
.ms-composer-input-wrap:focus-within {
  border-color: var(--vscode-focusBorder);
  outline: 1px solid var(--vscode-focusBorder);
  outline-offset: -1px;
}
.ms-composer-prompt {
  flex: 0 0 auto;
  padding: 6px 0 0 8px;
  color: var(--vscode-descriptionForeground);
  font-size: 12px;
  line-height: 18px;
}

.ms-composer-field {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
}
.ms-composer-hl,
.ms-composer-input {
  margin: 0;
  padding: 6px 8px;
  border: 0;
  font-family: var(--ms-font-ui);
  font-size: var(--ms-fs);
  line-height: 18px;
  letter-spacing: normal;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: normal;
  tab-size: 4;
}
.ms-composer-input {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  min-height: 30px;
  max-height: 40vh;
  resize: none;
  overflow-y: auto;
  background: transparent;
  color: transparent;
  caret-color: var(--vscode-input-foreground);
}
.ms-composer-input::placeholder { color: var(--vscode-input-placeholderForeground); }
.ms-composer-input:focus { outline: none; }
.ms-composer-input::selection { color: transparent; background: var(--vscode-editor-selectionBackground); }
.ms-composer-hl {
  position: absolute;
  inset: 0;
  overflow: hidden;
  color: var(--vscode-input-foreground);
  pointer-events: none;
}
.ms-composer-hl mark {
  color: inherit;
  background: none;
  border-radius: 3px;
}
.ms-composer-hl mark.ms-slash {
  background: var(--vscode-chat-slashCommandBackground);
  color: var(--vscode-chat-slashCommandForeground);
  box-shadow: 0 0 0 1px var(--vscode-chat-slashCommandBackground);
}
.ms-composer-hl mark.ms-mention {
  color: var(--vscode-textLink-foreground);
  background: var(--vscode-inputOption-activeBackground);
  box-shadow: 0 0 0 1px var(--vscode-inputOption-activeBackground);
}
.ms-composer-hl mark.ms-number { color: var(--ms-prov-input); }

.ms-route {
  flex: 0 0 auto;
  align-self: flex-end;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 20px;
  margin: 0 6px 5px 0;
  padding: 0 7px;
  border-radius: 10px;
  border: 1px solid var(--vscode-widget-border);
  font-size: var(--ms-fs-tiny);
  white-space: nowrap;
  color: var(--vscode-descriptionForeground);
  background: var(--vscode-editorWidget-background);
  font-variant-numeric: tabular-nums;
}
.ms-route .codicon { font-size: 12px; }
.ms-route[data-kind="numeric"] {
  color: var(--vscode-statusBarItem-remoteForeground);
  background: var(--vscode-statusBarItem-remoteBackground);
  border-color: transparent;
}
.ms-route[data-kind="structural"],
.ms-route[data-kind="question"] { color: var(--ms-prov-estimated); }
.ms-route[data-kind="command"] {
  color: var(--vscode-chat-slashCommandForeground);
  background: var(--vscode-chat-slashCommandBackground);
  border-color: transparent;
}
.ms-route[data-kind="invalid"] { color: var(--vscode-errorForeground); }
.ms-route[data-kind="empty"] { opacity: .65; }

.ms-composer-actions { display: flex; align-items: center; gap: 4px; flex: 0 0 auto; padding-bottom: 3px; }
.ms-mode-btn {
  display: inline-flex; align-items: center; gap: 4px;
  height: 24px; padding: 0 6px;
  border: 1px solid var(--vscode-dropdown-border);
  border-radius: var(--ms-radius);
  background: var(--vscode-dropdown-background);
  color: var(--vscode-dropdown-foreground);
  font-size: var(--ms-fs-small);
}
.ms-mode-btn:hover { background: var(--vscode-toolbar-hoverBackground); }
.ms-send-btn { width: 30px; padding: 0; }
.ms-send-btn .codicon { font-size: 16px; }
.ms-send-btn.is-stop { background: var(--vscode-button-secondaryBackground); color: var(--vscode-button-secondaryForeground); border-color: var(--vscode-widget-border); }

/* ---------- autocomplete popover (opens upward) ---------- */
.ms-ac {
  position: absolute;
  bottom: calc(100% + 4px);
  left: 10px;
  z-index: 30;
  width: min(560px, calc(100vw - 40px));
  max-height: 280px;
  overflow-y: auto;
  padding: 4px 0;
  border: 1px solid var(--vscode-widget-border);
  border-radius: 6px;
  background: var(--vscode-quickInput-background);
  color: var(--vscode-quickInput-foreground);
  box-shadow: 0 4px 16px var(--vscode-widget-shadow);
}
.ms-ac[hidden] { display: none; }
.ms-ac-head {
  padding: 2px 10px 4px;
  font-size: var(--ms-fs-tiny);
  color: var(--vscode-pickerGroup-foreground);
  border-bottom: 1px solid var(--vscode-pickerGroup-border);
  margin-bottom: 2px;
}
.ms-ac-item {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 24px;
  padding: 0 10px;
  cursor: pointer;
  white-space: nowrap;
}
.ms-ac-item[aria-selected="true"] {
  background: var(--vscode-quickInputList-focusBackground, var(--vscode-list-activeSelectionBackground));
  color: var(--vscode-quickInputList-focusForeground, var(--vscode-list-activeSelectionForeground));
}
.ms-ac-item:hover:not([aria-selected="true"]) { background: var(--vscode-list-hoverBackground); }
.ms-ac-item .ms-ac-name { font-weight: 600; }
.ms-ac-item .ms-ac-path { color: var(--vscode-descriptionForeground); overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 1 1 auto; font-size: var(--ms-fs-small); }
.ms-ac-item .ms-ac-value { font-variant-numeric: tabular-nums; color: var(--vscode-descriptionForeground); font-size: var(--ms-fs-small); }
.ms-ac-item .ms-ac-cmd {
  font-family: var(--ms-font-mono);
  color: var(--vscode-chat-slashCommandForeground);
  background: var(--vscode-chat-slashCommandBackground);
  border-radius: 3px;
  padding: 0 4px;
}
.ms-ac-item mark { background: none; color: var(--vscode-list-highlightForeground, var(--vscode-textLink-foreground)); font-weight: 700; }

/* ---------- peek card (reply when no Chat area is visible) ---------- */
.ms-peek {
  position: absolute;
  right: 12px;
  bottom: calc(100% + 8px);
  z-index: 25;
  width: min(520px, calc(100vw - 32px));
  max-height: 46vh;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--vscode-notifications-border);
  border-radius: 6px;
  background: var(--vscode-notifications-background);
  color: var(--vscode-notifications-foreground);
  box-shadow: 0 6px 24px var(--vscode-widget-shadow);
  overflow: hidden;
}
.ms-peek[hidden] { display: none; }
.ms-peek-head {
  display: flex; align-items: center; gap: 6px;
  height: 28px; padding: 0 6px 0 10px;
  border-bottom: 1px solid var(--vscode-notifications-border);
  font-size: var(--ms-fs-small);
  font-weight: 600;
}
.ms-peek-body { padding: 8px 12px; overflow-y: auto; line-height: 1.5; }
.ms-peek-foot { display: flex; gap: 6px; padding: 6px 10px 8px; justify-content: flex-end; }
