.Root {
  color: var(--demo-neutral-fg);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: flex-start;
  max-width: 40rem;
}

.Controls {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.Item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  height: 2.25rem;
  padding-inline: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  font-family: inherit;
  border-radius: 0.375rem;

  user-select: none;
  background: transparent;
  border: 1px solid var(--demo-border-emphasized);
  color: var(--demo-neutral-fg);

  &:hover:not(:disabled, [data-disabled], [data-selected]) {
    background: var(--demo-neutral-subtle);
  }

  &:focus-visible {
    outline: 2px solid var(--demo-coral-focus-ring);
    outline-offset: -1px;
  }

  &[data-selected] {
    background: var(--demo-coral-solid);
    border-color: var(--demo-coral-solid);
    color: var(--demo-coral-contrast);

    &:hover {
      background: var(--demo-coral-emphasized);
      border-color: var(--demo-coral-emphasized);
    }
  }

  &:is(:disabled, [data-disabled]) {
    opacity: 0.5;
  }
}

.Trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  height: 2.25rem;
  padding-inline: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  font-family: inherit;
  border-radius: 0.375rem;

  user-select: none;
  background: transparent;
  border: 1px solid var(--demo-border-emphasized);
  color: var(--demo-neutral-fg);
  transition:
    background 150ms,
    border-color 150ms,
    color 150ms;

  & svg {
    width: 1rem;
    height: 1rem;
  }

  &:hover:not(:disabled, [data-disabled]) {
    background: var(--demo-neutral-subtle);
  }

  &:focus-visible {
    outline: 2px solid var(--demo-coral-focus-ring);
    outline-offset: -1px;
  }

  &:is(:disabled, [data-disabled]) {
    opacity: 0.5;
  }
}

.Ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  height: 2.25rem;
  font-size: 0.875rem;
  color: var(--demo-neutral-emphasized);
  user-select: none;
}

.Text {
  font-size: 0.875rem;
  color: var(--demo-neutral-fg);
}

.PageSizeSelect {
  height: 2.25rem;
  padding-inline: 0.5rem;
  font-size: 0.875rem;
  font-family: inherit;
  border-radius: 0.375rem;
  border: 1px solid var(--demo-border-emphasized);
  background: transparent;
  color: var(--demo-neutral-fg);

  &:focus-visible {
    outline: 2px solid var(--demo-coral-focus-ring);
    outline-offset: -1px;
  }
}

.Grid {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
}

.GridItem {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  color: var(--demo-neutral-fg);
  background: var(--demo-neutral-subtle);
  border: 1px solid var(--demo-border-emphasized);
  border-radius: 0.375rem;
  width: 100%;
}

.GridItemTitle {
  font-weight: 500;
  color: var(--demo-neutral-fg);
}

.GridItemText {
  font-size: 0.8125rem;
  color: var(--demo-neutral-emphasized);
}
