.container {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.splitButton {
  display: inline-flex;
  align-items: stretch;
  height: 30px;
  border: 1px solid var(--divider);
  border-radius: var(--radius-lg);
  background: var(--chat-input-bg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.primaryButton,
.menuButton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  color: var(--text-muted);
  background: transparent;
  cursor: pointer;
  transition:
    background var(--transition-fast),
    color var(--transition-fast);
}

.primaryButton {
  width: 38px;
}

.menuButton {
  width: 28px;
  border-left: 1px solid var(--divider);
}

.primaryButton:hover:not(:disabled),
.menuButton:hover:not(:disabled) {
  background: var(--hover-bg);
  color: var(--text-primary);
}

.primaryButton:disabled,
.menuButton:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.menu {
  position: absolute;
  top: calc(100% + var(--space-2));
  right: 0;
  z-index: 1000;
  min-width: 224px;
  max-width: min(280px, calc(100vw - var(--space-4)));
  padding: var(--space-2);
  border: 1px solid var(--sidebar-border);
  border-radius: var(--radius-lg);
  background: var(--sidebar-bg);
  box-shadow: var(--shadow-lg);
  user-select: none;
  animation: menuIn var(--transition-fast);
}

@keyframes menuIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.utilityGroup {
  margin-top: var(--space-1);
  padding-top: var(--space-1);
  border-top: 1px solid var(--divider);
}

.menuItem {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 34px;
  gap: var(--space-2);
  border: 0;
  border-radius: var(--radius-md);
  padding: var(--space-1) var(--space-2);
  color: var(--text-primary);
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.menuItem:hover:not(:disabled) {
  background: var(--hover-bg);
}

.menuItem:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.menuItemLabel {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--fs-base);
}

.moreItemWrap {
  position: relative;
}

.menuItemMore {
  justify-content: space-between;
  gap: var(--space-2);
}

.menuItemMore > svg {
  flex: 0 0 auto;
  color: var(--text-muted);
}

.menuItemMoreLabel {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
}

.submenu {
  position: absolute;
  top: 0;
  right: calc(100% + var(--space-1));
  z-index: 1001;
  min-width: 224px;
  max-width: min(280px, calc(100vw - var(--space-4)));
  max-height: min(60vh, 480px);
  overflow-y: auto;
  padding: var(--space-2);
  border: 1px solid var(--sidebar-border);
  border-radius: var(--radius-lg);
  background: var(--sidebar-bg);
  box-shadow: var(--shadow-lg);
  user-select: none;
  animation: menuIn var(--transition-fast);
}

.appIconImage,
.appIconFallback,
.utilityIcon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border-radius: var(--radius-md);
  color: var(--text-primary);
  background: var(--hover-bg);
}

.appIconImage {
  overflow: hidden;
  background-color: transparent;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  isolation: isolate;
  transform: translateZ(0);
}

.appIconFallback {
  color: var(--text-primary);
}

.appIcon_editor {
  color: var(--tool-read);
  background: var(--selected-bg);
}

.appIcon_file_manager {
  color: var(--badge-done);
  background: var(--hover-bg-subtle);
}

.appIcon_terminal {
  color: var(--tool-bash);
  background: var(--terminal-tab-bg);
}

.appIcon_ide {
  color: var(--badge-plan);
  background: var(--toolbar-active);
}

.utilityIcon {
  color: var(--text-muted);
}
