.toolbar {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px 0;
  position: relative;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  white-space: nowrap;
  position: relative;
  transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
}

/* Chip content fades out as the badge fades in */
.chip > :not(:global(.shortcut-badge)) {
  transition: opacity 0.5s ease;
}
.chip:has(:global(.shortcut-badge-visible)) > :not(:global(.shortcut-badge)) {
  opacity: 0;
  transition: opacity 0.3s ease;
}

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

.chip:disabled {
  opacity: 0.4;
  cursor: default;
}

.chipActive {
  background: var(--toolbar-active);
  color: var(--toolbar-active-text);
  border-color: rgba(var(--accent-primary-rgb), 0.15);
}

.chipActive:hover:not(:disabled) {
  background: var(--toolbar-active);
  color: var(--toolbar-active-text);
  filter: brightness(1.15);
}

.chipLabel {
  line-height: 1;
}

.extraUsage {
  color: var(--text-dim);
}

/* Inside chips, the badge floats centered over the content at its natural size */
.chip :global(.shortcut-badge) {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  z-index: 1;
}
