.st-ai-buttons {
  margin: 0;
}

.st-ai-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin: 0 0 0.5rem;
}

.st-ai-title-row > h1 {
  margin: 0;
}

.st-ai-split {
  display: inline-flex;
  position: relative;
  border-radius: 6px;
  overflow: visible;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.st-ai-button {
  appearance: none;
  border: 0;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  line-height: 1;
  cursor: pointer;
  background: var(--st-ai-button-bg, var(--md-primary-fg-color, #2a5adf));
  color: var(--st-ai-button-text, #ffffff);
}

.st-ai-button:hover,
.st-ai-button:focus-visible {
  background: var(--st-ai-button-hover, var(--md-accent-fg-color, #1e88e5));
}

.st-ai-button:focus-visible {
  outline: 2px solid rgba(0, 0, 0, 0.2);
  outline-offset: 2px;
}

.st-ai-main {
  border-top-left-radius: 6px;
  border-bottom-left-radius: 6px;
}

.st-ai-toggle {
  width: 2.25rem;
  padding: 0.5rem 0;
  border-left: 1px solid rgba(255, 255, 255, 0.25);
  border-top-right-radius: 6px;
  border-bottom-right-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.st-ai-caret {
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid currentColor;
}

.st-ai-menu {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 200px;
  background: var(--md-default-bg-color, #ffffff);
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 6px;
  padding: 0.25rem;
  z-index: 20;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.st-ai-menu.show {
  display: block;
}

.st-ai-menu-item {
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  cursor: pointer;
  color: var(--md-default-fg-color, #1f2933);
}

.st-ai-menu-item:hover,
.st-ai-menu-item:focus-visible {
  background: rgba(0, 0, 0, 0.06);
}

.st-ai-toast {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  background: var(--st-ai-toast-bg, #1b5e20);
  color: var(--st-ai-toast-text, #ffffff);
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  font-size: 0.875rem;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 1000;
}

.st-ai-toast.st-ai-toast-error {
  background: var(--st-ai-toast-error-bg, #c62828);
}

.st-ai-toast.show {
  opacity: 1;
  transform: translateY(0);
}
