.sidebar {
  position: fixed;
  bottom: 86px;
   right: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px; /* smaller gap */
  z-index: 99;
  align-items: center;
  background: transparent;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  width: 90px;
  max-height: none;      /* allow natural height */
  overflow-y: visible;  /* no vertical scrollbar */
  overflow-x: hidden;   /* hide horizontal scrollbar */
  box-sizing: border-box;
}


.sidebar.active {
  opacity: 1;
  pointer-events: auto;
}

.tool-item {
  background: linear-gradient(145deg, #ffffff, #f3f3f3);
  border-radius: 20px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  width: 75px;
  padding: 6px 4px;
  margin: 2px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease;
  user-select: none;
    border: 2px solid transparent;   

}

.tool-item:hover {
  background-color: #e7f0fe;
  transform: translateY(-2px);
}
.tool-item.selected {
  background-color: #e1e9ff !important;
  transform: translateY(-2px);
  border: 2px solid #2e86de;
  border-radius: 20px;
  box-shadow: 0 2px 8px rgba(46, 134, 222, 0.4);
}


.tool-icon {
  font-size: 24px;
  margin-bottom: 6px;
  color: #4a4a4a;
  transition: color 0.3s ease;
}

.sidebar .tool-label {
  font-size: 12px;
  font-weight: 600;
  color: #000000;
}

.tool-item.components .tool-icon { color: #ff6f61; }


@media (max-width: 768px) {
  .sidebar {
    width: 60px;
    bottom: 76px;
    right: 16px;
  }
  .tool-item {
    width: 40px;
    
    padding: 8px 6px;
  }
  .tool-icon {
    font-size: 20px;
  }
 .sidebar .tool-label {
     font-size: 7px;
  font-weight: 800;

  color: #000000;
  }
}
