.ms-agent-bubble {
  min-width: 0;
  border: 1px solid color-mix(in srgb, var(--ms-color-border) 78%, transparent);
  border-radius: var(--ms-radius-md);
  background: var(--ms-color-surface);
  color: var(--ms-color-foreground);
  box-shadow: var(--ms-shadow-sm);
}

.ms-agent-message-section {
  margin-top: 8px;
  border: 1px solid color-mix(in srgb, var(--ms-color-border) 78%, transparent);
  border-radius: var(--ms-radius-md);
  background: color-mix(in srgb, var(--ms-color-surface) 55%, transparent);
  padding: 8px;
}

.ms-agent-message-section--result {
  border-color: color-mix(in srgb, var(--ms-color-primary) 25%, transparent);
  background: color-mix(in srgb, var(--ms-color-primary) 5%, transparent);
}

.ms-agent-message-section--process,
.ms-agent-message-section--diagnostic {
  background: color-mix(in srgb, var(--ms-color-muted) 22%, transparent);
}

.ms-agent-message-section__summary {
  cursor: pointer;
  list-style: none;
  color: var(--ms-color-muted-foreground);
  font-size: var(--ms-text-caption);
  font-weight: 600;
  line-height: var(--ms-leading-caption);
}

.ms-agent-message-section__summary::marker,
.ms-agent-message-section__summary::-webkit-details-marker {
  display: none;
}

.ms-agent-message-section__body {
  margin-top: 6px;
}

.ms-agent-message-section__title {
  margin-bottom: 6px;
  color: var(--ms-color-muted-foreground);
  font-size: var(--ms-text-caption);
  font-weight: 600;
  line-height: var(--ms-leading-caption);
}

.ms-agent-chat-bubble-stack > * + * {
  margin-top: 4px;
}

.ms-agent-chat-content-stack > * + * {
  margin-top: 6px;
}

.ms-agent-chat-thread-fill {
  padding: var(--ms-space-5) var(--ms-space-4);
}

.ms-agent-chat-thread-error {
  margin-bottom: var(--ms-space-3);
  border: 1px solid color-mix(in srgb, var(--ms-color-destructive) 30%, transparent);
  border-radius: var(--ms-radius-sm);
  background: color-mix(in srgb, var(--ms-color-destructive) 10%, transparent);
  padding: var(--ms-space-2) var(--ms-space-3);
  color: var(--ms-color-destructive);
  font-size: var(--ms-text-caption);
  line-height: var(--ms-leading-caption);
}

.ms-agent-chat-capability-events {
  display: grid;
  gap: var(--ms-space-2);
  margin-bottom: var(--ms-space-3);
}

.ms-agent-chat-thread-items {
  display: flex;
  width: 100%;
  flex-direction: column;
  gap: var(--ms-space-3);
}

.ms-agent-chat-footer-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.ms-agent-chat-footer-badges[data-align="end"] {
  justify-content: flex-end;
}

.ms-agent-chat-footer-badges[data-align="start"] {
  justify-content: flex-start;
}

.ms-agent-chat-section-title {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--ms-space-1) var(--ms-space-2);
}

.ms-agent-chat-section-title__text {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--ms-color-foreground);
}

.ms-agent-chat-meta-list {
  display: inline-flex;
  min-width: 0;
  flex-wrap: wrap;
  gap: var(--ms-space-1);
}

.ms-agent-chat-tiny-badge {
  padding: 0 6px;
  font-size: var(--ms-text-tiny);
  line-height: 16px;
}

.ms-agent-chat-inline-list {
  display: grid;
  gap: 4px;
  color: var(--ms-color-muted-foreground);
  font-size: var(--ms-text-caption);
  line-height: var(--ms-leading-caption);
}

.ms-agent-chat-inline-list__item {
  min-width: 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.ms-agent-chat-message-text {
  min-width: 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.ms-agent-chat-empty-text {
  color: var(--ms-color-muted-foreground);
  font-size: var(--ms-text-caption);
  line-height: var(--ms-leading-caption);
}

.ms-agent-chat-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ms-space-1);
  color: var(--ms-color-muted-foreground);
  font-size: var(--ms-text-tiny);
  line-height: var(--ms-leading-tiny);
}

.ms-agent-chat-chip {
  border: 1px solid color-mix(in srgb, var(--ms-color-border) 78%, transparent);
  border-radius: var(--ms-radius-sm);
  padding: 2px 6px;
  background: color-mix(in srgb, var(--ms-color-muted) 18%, transparent);
}

.ms-agent-chat-request-actions {
  display: flex;
  flex-shrink: 0;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: var(--ms-space-2);
}

.ms-agent-chat-request-menu {
  position: relative;
}

.ms-agent-chat-request-menu__summary {
  display: inline-flex;
  height: 32px;
  cursor: pointer;
  list-style: none;
  align-items: center;
  border-radius: var(--ms-radius-sm);
  padding-inline: var(--ms-space-2);
  color: var(--ms-color-muted-foreground);
  font-size: var(--ms-text-caption);
  line-height: var(--ms-leading-caption);
  transition: background-color var(--ms-duration-fast) var(--ms-easing-standard), color var(--ms-duration-fast) var(--ms-easing-standard);
}

.ms-agent-chat-request-menu__summary:hover {
  background: var(--ms-color-accent);
  color: var(--ms-color-foreground);
}

.ms-agent-chat-request-menu__summary::-webkit-details-marker {
  display: none;
}

.ms-agent-chat-request-menu__content {
  position: absolute;
  top: 100%;
  right: 0;
  z-index: 50;
  display: grid;
  min-width: 192px;
  gap: var(--ms-space-1);
  margin-top: var(--ms-space-1);
  border: 1px solid var(--ms-color-border);
  border-radius: var(--ms-radius-sm);
  background: var(--ms-color-popover);
  padding: var(--ms-space-1);
  color: var(--ms-color-popover-foreground);
  box-shadow: var(--ms-shadow-md);
}

.ms-agent-chat-request-menu__item {
  border: 0;
  border-radius: var(--ms-radius-xs);
  background: transparent;
  padding: 6px var(--ms-space-2);
  color: inherit;
  text-align: left;
  font: inherit;
  font-size: var(--ms-text-caption);
}

.ms-agent-chat-request-menu__item:hover {
  background: var(--ms-color-accent);
}

.ms-agent-chat-request-link {
  display: inline-flex;
  width: fit-content;
  height: 32px;
  align-items: center;
  border: 1px solid var(--ms-color-border);
  border-radius: var(--ms-radius-sm);
  background: var(--ms-color-background);
  padding-inline: var(--ms-space-3);
  color: var(--ms-color-foreground);
  font-size: var(--ms-text-caption);
  line-height: var(--ms-leading-caption);
  text-decoration: none;
  transition: border-color var(--ms-duration-fast) var(--ms-easing-standard), background-color var(--ms-duration-fast) var(--ms-easing-standard);
}

.ms-agent-chat-request-link:hover {
  border-color: var(--ms-color-ring);
  background: var(--ms-color-accent);
}

.ms-agent-chat-request-form {
  display: grid;
  gap: var(--ms-space-3);
  border: 1px solid color-mix(in srgb, var(--ms-color-border) 70%, transparent);
  border-radius: var(--ms-radius-sm);
  background: color-mix(in srgb, var(--ms-color-background) 70%, transparent);
  padding: var(--ms-space-3);
}

.ms-agent-chat-request-field {
  display: grid;
  gap: var(--ms-space-2);
}

.ms-agent-chat-request-label {
  color: var(--ms-color-foreground);
  font-size: var(--ms-text-caption);
  font-weight: 600;
  line-height: var(--ms-leading-caption);
}

.ms-agent-chat-request-help,
.ms-agent-chat-request-description,
.ms-agent-chat-request-option-description {
  color: var(--ms-color-muted-foreground);
  font-size: var(--ms-text-caption);
  line-height: var(--ms-leading-caption);
}

.ms-agent-chat-request-description,
.ms-agent-chat-request-option-description {
  font-size: var(--ms-text-tiny);
  line-height: var(--ms-leading-tiny);
}

.ms-agent-chat-request-required {
  margin-left: var(--ms-space-1);
  color: var(--ms-color-destructive);
}

.ms-agent-chat-request-check,
.ms-agent-chat-request-option {
  display: flex;
  align-items: flex-start;
  gap: var(--ms-space-2);
  color: var(--ms-color-foreground);
  font-size: var(--ms-text-caption);
  line-height: var(--ms-leading-caption);
}

.ms-agent-chat-request-check {
  align-items: center;
}

.ms-agent-chat-request-options {
  display: grid;
  gap: var(--ms-space-2);
}

.ms-agent-chat-request-option-label,
.ms-agent-chat-request-option-description {
  display: block;
}

.ms-agent-chat-request-input,
.ms-agent-chat-request-textarea {
  width: 100%;
  border: 1px solid var(--ms-color-input);
  border-radius: var(--ms-radius-sm);
  background: var(--ms-color-background);
  color: var(--ms-color-foreground);
  font-size: var(--ms-text-caption);
  line-height: var(--ms-leading-caption);
  outline: none;
  transition: border-color var(--ms-duration-fast) var(--ms-easing-standard), box-shadow var(--ms-duration-fast) var(--ms-easing-standard);
}

.ms-agent-chat-request-input {
  height: 36px;
  padding-inline: var(--ms-space-3);
}

.ms-agent-chat-request-textarea {
  min-height: 80px;
  padding: var(--ms-space-2) var(--ms-space-3);
}

.ms-agent-chat-request-input:focus,
.ms-agent-chat-request-textarea:focus {
  border-color: var(--ms-color-ring);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--ms-color-ring) 18%, transparent);
}

.ms-agent-chat-request-footer {
  display: flex;
  justify-content: flex-end;
}

.ms-agent-chat-action-layer {
  position: absolute;
  right: 0;
  bottom: 100%;
  left: 0;
  z-index: 40;
  max-height: min(56vh, 520px);
  margin-bottom: var(--ms-space-2);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-inline: var(--ms-space-2);
}

.ms-agent-chat-action-layer__surface {
  border: 1px solid var(--ms-color-border);
  border-radius: var(--ms-radius-md);
  background: color-mix(in srgb, var(--ms-color-background) 95%, transparent);
  padding: var(--ms-space-2);
  box-shadow: var(--ms-shadow-lg);
  backdrop-filter: blur(12px);
}

.ms-agent-chat-action-layer__pager {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--ms-space-1);
  margin-bottom: var(--ms-space-2);
  padding-inline: var(--ms-space-1);
}

.ms-agent-chat-status-line {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ms-color-muted-foreground);
  font-size: var(--ms-text-caption);
}

.ms-agent-chat-result-stack {
  contain: layout paint style;
  content-visibility: auto;
  contain-intrinsic-size: auto 360px;
  margin-top: 8px;
}

.ms-agent-chat-result-stack > * + * {
  margin-top: 8px;
}

.ms-agent-chat-pre {
  margin: 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  color: color-mix(in srgb, var(--ms-color-muted-foreground) 88%, var(--ms-color-foreground));
  font-size: var(--ms-text-caption);
  line-height: var(--ms-leading-caption);
}

.ms-agent-chat-media-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: var(--ms-space-2);
}

.ms-agent-chat-media-grid[data-kind="image"] {
  align-items: flex-start;
}

.ms-agent-chat-media-grid[data-kind="media"] {
  align-items: flex-start;
}

.ms-agent-chat-media-tile {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--ms-color-border) 72%, transparent);
  border-radius: var(--ms-radius-sm);
  background: color-mix(in srgb, var(--ms-color-muted) 24%, transparent);
  padding: var(--ms-space-2);
}

.ms-agent-chat-media-tile__image {
  display: block;
  width: auto;
  height: auto;
  max-width: min(100%, 520px);
  max-height: min(56vh, 420px);
  object-fit: contain;
}

.ms-agent-chat-media-tile__video {
  display: block;
  width: auto;
  height: auto;
  max-width: min(100%, 560px);
  max-height: min(56vh, 420px);
  background: var(--ms-color-background);
  object-fit: contain;
}

.ms-agent-chat-media-tile__audio {
  display: block;
  width: min(100%, 360px);
}

.ms-agent-chat-media-tile__caption {
  min-width: 0;
  margin-top: var(--ms-space-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ms-color-muted-foreground);
  font-size: var(--ms-text-tiny);
  line-height: var(--ms-leading-tiny);
}

.ms-agent-chat-inspect {
  display: grid;
  gap: 6px;
}

.ms-agent-chat-inspect__toolbar {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--ms-color-muted-foreground);
  font-size: var(--ms-text-tiny);
  line-height: var(--ms-leading-tiny);
}

.ms-agent-chat-inspect__entry {
  display: grid;
  gap: 4px;
  border-radius: var(--ms-radius-sm);
  background: color-mix(in srgb, var(--ms-color-muted) 18%, transparent);
  padding: 6px 8px;
}

.ms-agent-chat-inspect__label {
  color: color-mix(in srgb, var(--ms-color-foreground) 82%, var(--ms-color-muted-foreground));
  font-size: var(--ms-text-tiny);
  font-weight: 650;
  line-height: var(--ms-leading-tiny);
}

.ai-agent-panel-shell .ms-agent-message--assistant .ms-agent-message-section,
.ai-agent-panel-shell .ms-agent-message--system .ms-agent-message-section {
  position: relative;
  margin-top: 6px;
  border: 0;
  border-left: 2px solid color-mix(in srgb, var(--ms-color-border) 72%, transparent);
  border-radius: 0;
  background: transparent;
  padding: 3px 0 3px 10px;
  box-shadow: none;
}

.ai-agent-panel-shell .ms-agent-message--assistant .ms-agent-message-section--result,
.ai-agent-panel-shell .ms-agent-message--system .ms-agent-message-section--result {
  border-left-color: color-mix(in srgb, var(--ms-color-primary) 48%, var(--ms-color-border));
}

.ai-agent-panel-shell .ms-agent-message--assistant .ms-agent-message-section--process,
.ai-agent-panel-shell .ms-agent-message--system .ms-agent-message-section--process {
  border-left-color: color-mix(in srgb, var(--ms-color-muted-foreground) 48%, var(--ms-color-border));
}

.ai-agent-panel-shell .ms-agent-message--assistant .ms-agent-message-section--diagnostic,
.ai-agent-panel-shell .ms-agent-message--system .ms-agent-message-section--diagnostic {
  border-left-color: color-mix(in srgb, var(--ms-color-destructive) 56%, var(--ms-color-border));
}

.ai-agent-panel-shell .ms-agent-message--assistant .ms-agent-message-section__title,
.ai-agent-panel-shell .ms-agent-message--assistant .ms-agent-message-section__summary,
.ai-agent-panel-shell .ms-agent-message--system .ms-agent-message-section__title,
.ai-agent-panel-shell .ms-agent-message--system .ms-agent-message-section__summary {
  min-height: 20px;
  margin-bottom: 4px;
  color: color-mix(in srgb, var(--ms-color-foreground) 82%, var(--ms-color-muted-foreground));
  font-size: var(--ms-text-caption);
  font-weight: 650;
  line-height: 20px;
}

.ai-agent-panel-shell .ms-agent-message--assistant .ms-agent-message-section__body,
.ai-agent-panel-shell .ms-agent-message--system .ms-agent-message-section__body {
  margin-top: 4px;
}

.ai-agent-panel-shell .ms-agent-message--assistant .ms-agent-message-section pre,
.ai-agent-panel-shell .ms-agent-message--system .ms-agent-message-section pre {
  margin: 0;
  line-height: 18px;
}

.ms-agent-chat-attachment-grid {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.ms-agent-chat-result-stack .ms-agent-chat-attachment-grid {
  margin-top: 0;
}

.ms-agent-chat-attachment-grid[data-columns="2"] {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ms-agent-model-setup-callout {
  margin-top: 8px;
  font-size: var(--ms-text-caption);
}

.ms-agent-model-setup-callout__body {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.ms-agent-model-setup-callout__icon {
  margin-top: 2px;
  flex: 0 0 auto;
  color: var(--ms-tone-color);
}

.ms-agent-model-setup-callout__content {
  min-width: 0;
  flex: 1 1 auto;
}

.ms-agent-model-setup-callout__title {
  color: var(--ms-color-foreground);
  font-weight: 600;
}

.ms-agent-model-setup-callout__description {
  margin-top: 2px;
  color: var(--ms-color-muted-foreground);
  line-height: var(--ms-leading-body);
}

.ms-agent-model-setup-callout__action {
  margin-top: 8px;
}
