.character-palette {
  position: fixed;
  right: 0;
  top: 0;
  width: 300px;
  height: 100vh;
  background: white;
  border-left: 1px solid #ccc;
  box-shadow: -2px 0 8px rgba(0, 0, 0, 0.1);
  overflow-y: auto;
  z-index: 1000;
  display: flex;
  flex-direction: column;
}

.palette-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px;
  border-bottom: 1px solid #e0e0e0;
  background: #f9f9f9;
  position: sticky;
  top: 0;
  z-index: 10;
}

.palette-header h3 {
  margin: 0;
  font-size: 16px;
  color: #333;
}

.close-button {
  background: transparent;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: #666;
  padding: 5px 10px;
  line-height: 1;
}

.close-button:hover {
  color: #333;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 3px;
}

.palette-content {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
}

.palette-category {
  margin-bottom: 10px;
}

.category-header {
  display: flex;
  align-items: center;
  padding: 10px;
  background: #f5f5f5;
  cursor: pointer;
  border-radius: 4px;
  user-select: none;
  transition: background 0.2s;
}

.category-header:hover {
  background: #e8e8e8;
}

.category-header.expanded {
  background: #667eea;
  color: white;
}

.category-icon {
  margin-right: 8px;
  font-size: 12px;
  width: 12px;
  display: inline-block;
}

.category-name {
  font-weight: 500;
  font-size: 14px;
}

.character-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
  gap: 5px;
  padding: 10px;
  background: #fafafa;
  border-radius: 0 0 4px 4px;
}

.char-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid #ddd;
  background: white;
  cursor: pointer;
  font-size: 24px;
  font-family: 'Courier New', 'Consolas', monospace;
  transition: all 0.2s;
  border-radius: 3px;
  user-select: none;
}

.char-button:hover {
  border-color: #667eea;
  background: #f0f0ff;
  transform: scale(1.1);
}

.char-button.active {
  background: #667eea;
  color: white;
  border-color: #667eea;
  box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
}

/* Scrollbar styling */
.character-palette::-webkit-scrollbar,
.palette-content::-webkit-scrollbar {
  width: 8px;
}

.character-palette::-webkit-scrollbar-track,
.palette-content::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.character-palette::-webkit-scrollbar-thumb,
.palette-content::-webkit-scrollbar-thumb {
  background: #c0c0c0;
  border-radius: 4px;
}

.character-palette::-webkit-scrollbar-thumb:hover,
.palette-content::-webkit-scrollbar-thumb:hover {
  background: #a0a0a0;
}
