.segmented {
  display: inline-flex;
  gap: 2px;
  min-width: 0;
  padding: 3px;
  border: var(--border-width) solid var(--color-border-control);
  border-radius: var(--radius-md);
  background: var(--color-surface-1);
}

.segmented__option {
  position: relative;
  display: flex;
}

.segmented__input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  cursor: pointer;
}

.segmented__label {
  display: inline-flex;
  align-items: center;
  height: 2rem;
  padding: 0 var(--space-3);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-text-muted);
  white-space: nowrap;
  transition:
    background-color var(--duration-fast) var(--ease-standard),
    color var(--duration-fast) var(--ease-standard);
}

.segmented__option:hover .segmented__label {
  color: var(--color-text);
}

.segmented__input:checked + .segmented__label {
  background: var(--color-surface-3);
  color: var(--color-text);
}

.segmented__input:focus-visible + .segmented__label {
  box-shadow: 0 0 0 2px var(--color-accent);
}
